
.navbar .nav-links,
.navbar .nav-links .nav-links {
  align-items: center;
}


.dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 12px;      
  margin-bottom: -12px;      
}


.dropbtn {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: #333333;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  line-height: inherit;
}


.dropbtn::after {
  content: " ▾";
  font-size: 0.8em;
  margin-left: 0.3em;
  opacity: 0.7;
  transition: transform 0.3s ease;
}

.dropdown:hover .dropbtn::after {
  transform: rotate(180deg);
}


.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0;                        
  border-top: 4px solid transparent;    
  background-clip: padding-box;
  background-color: #ffffff;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  z-index: 9999;
  border: 1px solid #eeeeee;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: #333333;
  padding: 0.75rem 1rem;
  text-decoration: none;
  display: block;
  font-size: 1.1rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-content a:hover {
  background-color: #f5f5f5;
  color: #000000;
}


.accessibility-mode .dropbtn {
  font-size: 1.3rem !important;
  padding: 0.75rem 1rem !important;
  border: 2px solid transparent !important;
  border-radius: 4px !important;
  margin: 0.125rem !important;
  min-height: 50px !important;
  min-width: 50px !important;
}

.accessibility-mode .dropdown-content {
  border: 3px solid var(--text-color) !important;
  background-color: var(--bg-color) !important;
}

.accessibility-mode .dropdown-content a {
  font-size: 1.2rem !important;
  padding: 1rem !important;
  color: var(--text-color) !important;
}

.accessibility-mode .dropdown-content a:hover,
.accessibility-mode .dropdown-content a:focus {
  background-color: rgba(0, 71, 171, 0.1) !important;
  text-decoration: underline !important;
}

.accessibility-mode .dropbtn:focus,
.accessibility-mode .dropdown-content a:focus {
  outline: 4px solid var(--focus-color) !important;
  outline-offset: 2px !important;
}

@media screen and (max-width: 768px) {
  .dropbtn {
    padding: 0.375rem 0.625rem;
    font-size: 1.2rem;
  }
  .dropdown-content {
    min-width: 140px;
  }
  .dropdown-content a {
    padding: 0.6rem 0.8rem;
    font-size: 1.05rem;
  }
}


@media screen and (max-width: 480px) {
  .dropbtn {
    padding: 0.5rem;
    font-size: 1.0rem;
  }
  .dropdown-content {
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
  }
  .dropdown-content a {
    text-align: center;
    padding: 0.7rem 1rem;
  }
}




.console-link-locked,
a[href="test.html"]:not(.console-link-unlocked),
a[href="collect.html"]:not(.console-link-unlocked),
a[data-console-link]:not(.console-link-unlocked) {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    position: relative !important;
}

.console-link-locked::after,
a[href="test.html"]:not(.console-link-unlocked)::after,
a[href="collect.html"]:not(.console-link-unlocked)::after,
a[data-console-link]:not(.console-link-unlocked)::after {
    content: "请先登录" !important;
    position: absolute !important;
    top: -8px !important;
    right: -40px !important;
    background: #e74c3c !important;
    color: white !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    white-space: nowrap !important;
    z-index: 1000 !important;
}

.console-link-unlocked {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

.console-link-unlocked::after {
    display: none !important;
    content: none !important;
}

body.auth-loading > *:not(#auth-loading-overlay) {
    visibility: hidden !important;
}

#auth-loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(255,255,255,0.95) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 999999 !important;
}

.auth-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-popup-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    min-width: 250px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-popup-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.auth-popup-content {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.5;
}

.auth-popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.auth-popup-button {
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.auth-popup-button.logout {
    background: #f44336;
    color: white;
}

.auth-popup-button.logout:hover {
    background: #d32f2f;
}

.auth-popup-button.close {
    background: #666;
    color: white;
}

.auth-popup-button.close:hover {
    background: #555;
}
.console-link-unlocked {
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.console-link-locked {
    opacity: 0.3 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}
.admin-link-logged-in {
    color: #4CAF50 !important;
    font-weight: bold !important;
}
.auth-element-hidden {
    display: none !important;
}
.console-link-locked {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.console-link-locked:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.console-link-unlocked {
    opacity: 1;
    cursor: pointer;
}

.auth-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.auth-popup-container {
    background: white;
    border-radius: 8px;
    padding: 24px;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-popup-title {
    margin-top: 0;
    margin-bottom: 16px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.auth-popup-content {
    margin-bottom: 20px;
}

.auth-popup-content p {
    margin: 8px 0;
    color: #555;
}

.auth-popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.auth-popup-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.auth-popup-button.logout {
    background-color: #dc3545;
    color: white;
}

.auth-popup-button.logout:hover {
    background-color: #c82333;
}

.auth-popup-button.close {
    background-color: #6c757d;
    color: white;
}

.auth-popup-button.close:hover {
    background-color: #5a6268;
}

.logged-in {
    font-weight: bold;
    color: #28a745 !important;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    max-width: 300px;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.info {
    background-color: #17a2b8;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.warning {
    background-color: #ffc107;
    color: #333;
}
.console-link-locked {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.console-link-locked:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.console-link-unlocked {
    opacity: 1;
    cursor: pointer;
}

.auth-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.auth-popup-container {
    background: white;
    border-radius: 8px;
    padding: 24px;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: auth-popup-fade-in 0.3s ease;
}

@keyframes auth-popup-fade-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-popup-title {
    margin-top: 0;
    margin-bottom: 16px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.auth-popup-content {
    margin-bottom: 20px;
}

.auth-popup-content p {
    margin: 8px 0;
    color: #555;
}

.auth-popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.auth-popup-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.auth-popup-button.logout {
    background-color: #dc3545;
    color: white;
}

.auth-popup-button.logout:hover {
    background-color: #c82333;
}

.auth-popup-button.close {
    background-color: #6c757d;
    color: white;
}

.auth-popup-button.close:hover {
    background-color: #5a6268;
}

.auth-popup-header {
    margin-bottom: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

.auth-popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.auth-popup-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.auth-info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.auth-info-item:last-child {
    border-bottom: none;
}

.auth-info-label {
    color: #666;
    font-weight: 500;
}

.auth-info-value {
    color: #333;
}

.logged-in {
    font-weight: bold;
    color: #28a745 !important;
}

#auth-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.auth-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: auth-spin 1s linear infinite;
    margin-bottom: 20px;
}

.auth-loading-text {
    font-size: 16px;
    color: #666;
    font-family: Arial, sans-serif;
}

@keyframes auth-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body.auth-protected > *:not(#auth-loading-overlay) {
    visibility: hidden !important;
    opacity: 0 !important;
}
#loader-wrapper {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    opacity: 1;
    visibility: visible;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, opacity;
    contain: layout style paint;
}
#loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-icon {
    position: relative;
    width: clamp(60px, 12vw, 90px);
    height: clamp(60px, 12vw, 90px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #006994;
    border-right-color: #4fc3f7;
    animation: spin 1.6s linear infinite;
}
.ring.outer {
    width: 100%;
    height: 100%;
}
.ring.inner {
    width: 65%;
    height: 65%;
    animation-duration: 2.2s;
    animation-direction: reverse;
    border-top-color: #1a237e;
    border-left-color: #5c6bc0;
}
.core {
    width: 10px;
    height: 10px;
    background: #006994;
    border-radius: 50%;
    box-shadow: 0 0 12px #4fc3f7, 0 0 24px rgba(0, 105, 148, 0.6);
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50%      { transform: scale(1.4); opacity: 1; }
}
.loader-text {
    margin-top: clamp(24px, 5vw, 36px);
    text-align: center;
    position: relative;
    height: 2.4em;
}
.line {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", "Helvetica Neue", sans-serif;
    font-size: clamp(14px, 2.5vw, 18px);
    letter-spacing: 0.2em;
    color: #2c3e50;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    animation: textCycle 6s ease-in-out infinite;
}
.line:first-child { animation-delay: 0s; }
.line:last-child  { animation-delay: 3s; }
@keyframes textCycle {
    0%   { opacity: 0; }
    15%  { opacity: 1; }
    40%  { opacity: 1; }
    55%  { opacity: 0; }
    100% { opacity: 0; }
}

html.auth-hidden {
    visibility: hidden !important;
}

.auth-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    visibility: visible;
}

@keyframes auth-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auth-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: auth-spin 1s linear infinite;
    margin-bottom: 15px;
}

.auth-loading-text {
    font-size: 14px;
    color: #666;
    font-family: Arial, sans-serif;
}

a.console-link-locked {
    pointer-events: auto !important;
    cursor: not-allowed !important;
}

a.console-link-unlocked {
    pointer-events: auto !important;
    cursor: pointer !important;
}

body.auth-no-scroll {
    overflow: hidden !important;
}

.qrcode-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none; 
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    cursor: zoom-out;
}
.qrcode-modal.is-open {
    display: flex;
}
.qrcode-modal-img {
    width: min(360px, 80vw);
    height: auto;
    background-color: #ffffff;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    animation: qrcodeZoomIn 0.3s ease;
}
.qrcode-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background-color: #ffffff;
    color: #111111;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-modal-close:hover {
    background-color: #f0f0f0;
}

@keyframes qrcodeZoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}