/* ====== 统一导航栏 + 页脚 + 汉堡菜单样式 ====== */
/* 这个文件被所有页面模板引用，确保移动端导航栏一致性 */
:root {
    --mobile-navbar-height: 78px;
    --mobile-top-action-width: 64px;
    --mobile-top-action-height: 24px;
    --mobile-icon-button-size: 40px;
    --mobile-bottom-nav-height: 65px;
    --button-on-gradient-text: var(--text-muted, #94a3b8);
}
[data-theme="moonlight"] { --button-on-gradient-text: #ffffff; }

/* 导航栏玻璃拟物化 */
.navbar {
    background: var(--nav-bg, rgba(30,41,59,0.88));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    height: 72px;
    display: flex; align-items: center;
    position: sticky; top: 0; z-index: 1000;
    width: 100%; box-sizing: border-box;
    border-bottom: 1px solid var(--border-color, #334155);
    padding: 0 20px; transition: all 0.4s ease;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1440px; margin: 0 auto; }

/* Logo */
.logo-box { font-size: 1.5rem; color: var(--text-main, #e2e8f0); font-weight: 900; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.3s; position: relative; }
.logo-box:hover { color: var(--primary, #0ea5e9); }
.logo-main { display: inline-flex; align-items: center; gap: 8px; }
.mobile-site-tagline { display: none; }

/* 导航链接 */
.nav-links { display: flex; gap: 3px; align-items: center; }
.nav-link { color: var(--text-muted, #94a3b8); text-decoration: none; font-weight: 600; padding: 6px 10px; border-radius: 10px; transition: all 0.3s; font-size: 0.85rem; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.nav-link:hover { color: var(--primary, #0ea5e9); background: var(--glow, rgba(14,165,233,0.15)); transform: translateY(-2px); }
.nav-ad-link {
    border: none;
    color: var(--button-on-gradient-text) !important;
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    box-shadow: 0 2px 8px rgba(37,99,235,0.28);
}
.nav-ad-link:hover {
    color: var(--button-on-gradient-text) !important;
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* 导航下拉 */
.nav-dropdown { position: relative; }
.nav-dropdown::after { content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 10px; z-index: 99; }
.dropdown-menu { display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(8px); background: var(--card-bg, #1e293b); border: 1px solid var(--border-color, #334155); border-radius: 14px; padding: 8px; min-width: 210px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); z-index: 100; opacity: 0; transition: all 0.35s cubic-bezier(0.4,0,0.2,1); }
.dropdown-menu::before { content: ''; position: absolute; top: -7px; left: 50%; transform: translateX(-50%) rotate(45deg); width: 14px; height: 14px; background: var(--card-bg, #1e293b); border-left: 1px solid var(--border-color, #334155); border-top: 1px solid var(--border-color, #334155); }
.nav-dropdown:hover .dropdown-menu { display: block; opacity: 1; transform: translateX(-50%) translateY(0); }
.dropdown-menu a { display: flex; align-items: center; gap: 8px; padding: 11px 16px; color: var(--text-muted, #94a3b8); text-decoration: none; border-radius: 10px; transition: all 0.25s ease; font-size: 0.88rem; font-weight: 600; }
.dropdown-menu a:hover { background: linear-gradient(135deg, rgba(14,165,233,0.15), rgba(14,165,233,0.08)); color: var(--primary, #0ea5e9); padding-left: 22px; }

/* 右侧操作区 */
.nav-right { display: flex; gap: 6px; align-items: center; }
.nav-scroll-group, .nav-fixed-group { display: contents; }
.nav-right i { color: var(--text-muted, #94a3b8); transition: all 0.3s; font-size: 1.05rem; cursor: pointer; padding: 6px; border-radius: 10px; }
.nav-right i:hover { color: var(--primary, #0ea5e9); transform: scale(1.15); background: var(--glow, rgba(14,165,233,0.15)); }
.nav-icon-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}
.nav-icon-btn i { padding: 0; font-size: 1.05rem; color: inherit; }
.nav-icon-btn:hover { color: var(--primary, #0ea5e9); transform: scale(1.15); background: var(--glow, rgba(14,165,233,0.15)); }
.nav-deploy-btn {
    width: auto;
    min-width: 64px;
    padding: 0 10px;
    color: #fff;
    background: linear-gradient(135deg,#06b6d4 0%,#2563eb 50%,#8b5cf6 100%);
    box-shadow: 0 2px 10px rgba(37,99,235,0.34);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    animation: nav-deploy-breathe 3.6s ease-in-out infinite;
}
.nav-deploy-btn:hover { color:#fff; background: linear-gradient(135deg,#0891b2 0%,#1d4ed8 48%,#7c3aed 100%); transform: translateY(-1px) scale(1.02); }
#navSearch { color: var(--text-muted, #94a3b8) !important; }
[data-theme="moonlight"] #navSearch { color: var(--text-muted, #64748b) !important; }
.deploy-same-popup {
    position: fixed;
    inset: 0;
    z-index: 10070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15,23,42,0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.deploy-same-popup[hidden] { display: none !important; }
.deploy-same-dialog {
    position: relative;
    width: min(340px, 92vw);
    padding: 20px 18px 18px;
    border: 1px solid var(--border-color, #334155);
    border-radius: 14px;
    background: var(--card-bg, #1e293b);
    color: var(--text-main, #e2e8f0);
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.34);
}
.deploy-same-dialog h3 { margin: 0 34px 14px; font-size: 1rem; font-weight: 900; }
.deploy-same-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: var(--input-bg, rgba(15,23,42,0.6));
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
}
.deploy-same-qr-wrap {
    width: min(260px, 78vw);
    margin: 0 auto;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
}
.deploy-same-qr-wrap img { display: block; width: 100%; height: auto; border-radius: 8px; }
.nav-mobile-ad-slot,
.nav-search-btn-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: var(--nav-action-width, auto);
    min-width: 0;
    max-width: 72px;
    height: var(--mobile-top-action-height);
    min-height: var(--mobile-top-action-height);
    max-height: var(--mobile-top-action-height);
    padding: 0 5px;
    border-radius: 7px;
    box-sizing: border-box;
    color: var(--button-on-gradient-text);
    background: var(--nav-ad-bg, linear-gradient(135deg,#2563eb,#1d4ed8));
    text-decoration: none;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 auto;
}
.nav-search-btn-mobile { background: linear-gradient(135deg,#2563eb,#1d4ed8); gap: 5px; box-shadow: 0 2px 8px rgba(37,99,235,0.28); }
.nav-search-icon { display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:0;background:transparent;box-shadow:none; }
.nav-mobile-ad-slot i,
.nav-search-btn-mobile i {
    color: var(--button-on-gradient-text) !important;
    flex-shrink: 0;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1;
}
.nav-mobile-ad-slot span,
.nav-search-btn-mobile span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 汉堡菜单 */
.hamburger-btn { display: none; background: none; border: none; color: var(--text-muted, #94a3b8); font-size: 1.4rem; cursor: pointer; padding: 8px; border-radius: 10px; transition: 0.3s; }
.hamburger-btn:hover { color: var(--primary, #0ea5e9); background: var(--glow, rgba(14,165,233,0.15)); }
.mobile-menu-overlay { display: none; position: fixed; inset: 0; background: var(--modal-overlay, rgba(15,23,42,0.7)); z-index: 1001; }
.mobile-menu-panel { display: none; position: fixed; top: 0; right: 0; width: min(300px, 80vw); height: 100vh; background: var(--card-bg, #1e293b); z-index: 1002; padding: 24px 20px; overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,0.3); flex-direction: column; gap: 4px; }
.mobile-menu-panel a { color: var(--text-main, #e2e8f0); text-decoration: none; font-weight: 600; padding: 8px 6px; border-radius: 8px; display: flex; align-items: center; gap: 6px; font-size: 0.62rem; transition: 0.2s; }
.mobile-menu-panel a:hover, .mobile-menu-panel a:active { background: var(--glow, rgba(14,165,233,0.15)); color: var(--primary, #0ea5e9); }
.mobile-menu-close { align-self: flex-end; background: none; border: none; color: var(--text-muted, #94a3b8); font-size: 1.3rem; cursor: pointer; padding: 8px; margin-bottom: 12px; }
.mobile-menu-open .mobile-menu-overlay, .mobile-menu-open .mobile-menu-panel { display: flex; }
.mobile-menu-overlay.is-open, .mobile-menu-panel.is-open { display: flex !important; }
.mobile-menu-open { overflow: hidden; }
.mobile-menu-ad-button {
    color: var(--button-on-gradient-text) !important;
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    font-weight: 900 !important;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(37,99,235,0.26);
}
.mobile-menu-qr-list { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu-qr-link i { color: var(--primary, #0ea5e9) !important; }
.mobile-qr-popup[hidden] { display: none !important; }
.mobile-qr-popup {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15,23,42,0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.mobile-qr-dialog {
    width: min(330px, 92vw);
    background: var(--card-bg, #1e293b);
    color: var(--text-main, #e2e8f0);
    border: 1px solid var(--border-color, #334155);
    border-radius: 16px;
    padding: 22px 18px 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    text-align: center;
    position: relative;
}
.mobile-qr-dialog h3 { margin: 0 34px 14px; font-size: 1rem; font-weight: 900; }
.mobile-qr-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--input-bg, rgba(148,163,184,0.14));
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
}
.mobile-qr-img-wrap {
    width: 210px;
    height: 210px;
    max-width: 100%;
    margin: 0 auto 12px;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
}
.mobile-qr-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.mobile-qr-dialog p { margin: 0 0 10px; color: var(--text-muted, #94a3b8); font-size: 0.78rem; line-height: 1.5; }
.mobile-qr-dialog a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    color: var(--button-on-gradient-text);
    background: linear-gradient(135deg,#2563eb,#1d4ed8);
    font-weight: 800;
}

/* 移动端底部导航 */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--nav-bg, rgba(30,41,59,0.88)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-color, #334155); z-index: 999; justify-content: space-around; align-items: center; padding-bottom: env(safe-area-inset-bottom, 0px); }
.mobile-nav a { color: var(--text-muted, #94a3b8); font-size: 0.62rem; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 600; transition: color 0.3s; }
.mobile-nav a i { font-size: 1rem; }
.mobile-nav a:hover, .mobile-nav a.active { color: var(--primary, #0ea5e9); }
.mobile-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--nav-bg, rgba(30,41,59,0.88)); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border-color, #334155); z-index: 999; justify-content: space-around; align-items: center; padding-bottom: env(safe-area-inset-bottom, 0px); }
.mobile-bottom-nav a { color: var(--text-muted, #94a3b8); font-size: 0.62rem; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 600; transition: color 0.3s; }
.mobile-bottom-nav a i { font-size: 1rem; }
.mobile-bottom-nav a:hover, .mobile-bottom-nav a.active { color: var(--primary, #0ea5e9); }

/* 页脚 */
.footer-common { padding: 24px 40px; color: var(--text-muted, #94a3b8); font-size: 0.9rem; background: var(--card-bg, #1e293b); border-top: 1px solid var(--border-color, #334155); transition: all 0.4s; text-align: center; line-height: 1.8; }

/* quark 脉冲动画 */
@keyframes quark-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    50% { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
}

/* 响应式 */
@media (max-width: 992px) {
    .navbar { height: auto; min-height: var(--mobile-navbar-height); max-height: none; padding: 7px 10px 8px; flex-wrap: wrap; overflow: visible; }
    .nav-container { flex-wrap: wrap; justify-content:flex-start; align-items:flex-start; gap: 4px; height: auto; min-width: 0; }
    .nav-container > .nav-right { margin-left: 0 !important; }
    .logo-box { width: 100%; max-width: 100%; min-width: 0; flex: 0 0 100%; flex-direction: row; align-items: center; justify-content: flex-start; gap: 6px; padding: 0; overflow: hidden; white-space: nowrap; line-height: 1.05; }
    .logo-main { gap: 5px; min-width: 0; }
    .logo-box img { width:24px !important; height:24px !important; flex-shrink: 0; }
    .logo-box .site-name { display:inline-block; max-width:160px; overflow:hidden; text-overflow:ellipsis; color:var(--text-main,#e2e8f0); font-size:0.88rem; font-weight:900; }
    .mobile-site-tagline { display:block; width:auto; max-width:calc(100vw - 112px); text-align:left; overflow:hidden; text-overflow:ellipsis; color:var(--text-muted,#94a3b8); font-size:0.52rem; font-weight:700; line-height:1.05; }
    .navbar .nav-links { display: none; }
    .nav-right { width: 100%; min-width: 0; flex: 0 0 100%; height: 24px; display: flex; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 1px; overflow: visible; scrollbar-width: none; }
    .nav-right::-webkit-scrollbar { display: none; }
    .nav-right > * { flex-shrink: 0; }
    .nav-scroll-group { display:flex; flex:1 1 auto; min-width:0; align-items:center; justify-content:flex-start; gap:1px; height:100%; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
    .nav-scroll-group::-webkit-scrollbar { display:none; }
    .nav-scroll-group > * { flex-shrink:0; }
    .nav-fixed-group { display:flex; flex:0 0 auto; align-items:center; gap:1px; height:100%; margin-left:auto; }
    .nav-fixed-group > * { flex-shrink:0; }
    .nav-fixed-group > i {
        width: var(--mobile-icon-button-size);
        min-width: var(--mobile-icon-button-size);
        height: var(--mobile-icon-button-size);
        min-height: var(--mobile-icon-button-size);
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .hamburger-btn { display: inline-flex; align-items: center; justify-content: center; width: 21px; min-width: 21px; height: 21px; min-height: 21px; flex-shrink: 0; margin-left: 0; padding: 0; border-radius: 6px; font-size: 0.78rem; }
    .mobile-nav { display: none; }
    .mobile-bottom-nav { display: flex; }
    body { padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px)); }
    .nav-mobile-ad-slot {
        display: inline-flex !important;
        width: var(--nav-action-width, auto);
        min-width: 0;
        max-width: 60px;
        height: 21px;
        min-height: 21px;
        max-height: 21px;
        flex: 0 0 auto;
        padding: 0 2px;
        border-radius: 5px;
        font-size: 7px;
        font-weight: 800;
        animation: nav-action-breathe 4.8s ease-in-out infinite;
    }
    .nav-search-btn-mobile { display: inline-flex !important; width:21px; min-width:21px; max-width:21px; height:21px; min-height:21px; max-height:21px; flex:0 0 21px; padding:0; gap:0; border-radius:5px; animation: nav-search-breathe 4.2s ease-in-out infinite; }
    .nav-search-icon { width:10px; height:10px; align-items:center; justify-content:center; overflow:visible; }
    .nav-search-icon i { display:inline-flex; align-items:center; justify-content:center; font-size:0.56rem !important; line-height:1 !important; }
    .nav-fixed-group > i {
        display: none !important;
    }
    .nav-theme-btn {
        display: inline-flex !important;
        width: 21px !important;
        min-width: 21px !important;
        height: 21px !important;
        min-height: 21px !important;
        border-radius: 6px !important;
    }
    .nav-theme-btn i { font-size:0.72rem !important; }
    .nav-deploy-btn { width:auto !important; min-width:0 !important; height:21px !important; min-height:21px !important; padding:0 2px !important; border-radius:5px !important; font-size:7px !important; font-weight:800 !important; line-height:1 !important; white-space:nowrap; color:#fff !important; background:linear-gradient(135deg,#06b6d4 0%,#2563eb 50%,#8b5cf6 100%) !important; box-shadow:0 2px 8px rgba(37,99,235,0.32) !important; animation:nav-deploy-breathe 3.8s ease-in-out infinite !important; }
    #navSearch { display: none !important; }
    .footer-common { padding: 20px 16px; font-size: 0.82rem; }
}

@keyframes nav-search-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(37,99,235,0.28); }
    50% { transform: scale(1.02); box-shadow: 0 3px 12px rgba(37,99,235,0.4); }
}
@keyframes nav-action-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(37,99,235,0.26); }
    50% { transform: scale(1.018); box-shadow: 0 3px 12px rgba(37,99,235,0.38); }
}
@keyframes nav-deploy-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 10px rgba(37,99,235,0.34); }
    50% { transform: scale(1.025); box-shadow: 0 4px 16px rgba(139,92,246,0.46); }
}
@media (max-width: 768px) {
    .mobile-bottom-nav { display: flex; }
    body { padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 480px) {
    .footer-common { padding: 16px 12px; font-size: 0.78rem; }
}
@media (hover: none) and (pointer: coarse) {
    .mobile-nav a { min-height: 44px; padding: 6px 0; }
    .mobile-menu-panel a { min-height: 44px; min-width: 44px; }
}
