.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--theme-border);
    height: 72px;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 12px;
}

.logo-text {
    font-family: 'Georgia', 'Noto Serif SC', 'STSong', 'Songti SC', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--theme-primary);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--theme-text-secondary);
    letter-spacing: 0.3px;
    display: block;
    line-height: 1;
    font-weight: 400;
}

/* 导航区域自动撑满剩余空间 */
nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    flex-wrap: nowrap;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    display: block;
    padding: 8px 13px;
    text-decoration: none;
    color: var(--theme-text);
    font-weight: 500;
    font-size: 0.88rem;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    letter-spacing: 0;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--theme-primary);
    background: rgba(0, 0, 0, 0.05);
}

.main-nav a.active {
    font-weight: 600;
}

.nav-cta {
    background: var(--theme-primary) !important;
    color: #fff !important;
    padding: 7px 14px !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-cta:hover {
    background: var(--theme-primary-dark) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--theme-shadow);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.lang-btn {
    padding: 5px 9px;
    border: 1px solid var(--theme-border);
    background: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--theme-text);
}
.lang-btn:first-child {
    border-radius: 12px 0 0 12px;
    border-right: none;
}
.lang-btn:last-child {
    border-radius: 0 12px 12px 0;
}

.lang-btn.active-lang {
    background: var(--theme-primary);
    color: #fff;
    border-color: var(--theme-primary);
    font-weight: 600;
}

.lang-btn:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.lang-btn.active-lang:hover {
    background: var(--theme-primary-dark);
    color: #fff;
}

/* 紧凑登录链接 */
.header-login-link {
    flex-shrink: 0;
    text-decoration: none;
    font-size: 0.78rem;
    color: var(--theme-text-secondary);
    padding: 5px 8px;
    border-radius: 14px;
    border: 1px solid var(--theme-border);
    white-space: nowrap;
    transition: all 0.3s;
}
.header-login-link:hover {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}
.hl-text {
    display: inline;
}

@media (max-width: 1024px) {
    .hl-text { display: none; }
}

/* 右侧功能区：主题+语言+登录，紧凑排列 */
.header-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 12px;
}

.theme-switcher {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
    height: 28px;
}

/* 当前选中的主题按钮 —— 始终可见 */
.theme-switcher > .theme-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--theme-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 2px var(--theme-primary);
    flex-shrink: 0;
}

/* 下拉容器 —— 绝对定位，脱离文档流，只向下展开 */
.theme-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--theme-border);
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* hover 时向下展开下拉 */
.theme-switcher:hover .theme-dropdown {
    opacity: 1;
    pointer-events: auto;
}

/* 下拉中的其他主题按钮 */
.theme-dropdown .theme-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--theme-border);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.theme-dropdown .theme-btn:hover {
    transform: scale(1.15);
    border-color: var(--theme-primary);
}

/* 各主题颜色 */
.theme-btn[data-theme="theme-ice"] {
    background: linear-gradient(135deg, #1e90ff, #0066cc);
}

.theme-btn[data-theme="theme-mint"] {
    background: linear-gradient(135deg, #00b894, #008577);
}

.theme-btn[data-theme="theme-violet"] {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.theme-btn[data-theme="theme-rose"] {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.theme-btn[data-theme="theme-amber"] {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* 下拉箭头指示器 */
/* .theme-switcher::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--theme-text-secondary);
    margin-top: 2px;
    transition: transform 0.3s ease;
    opacity: 0.5;
} */

.theme-switcher:hover::after {
    transform: rotate(180deg);
    opacity: 1;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--theme-text);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--theme-surface);
        flex-direction: column;
        padding: 16px;
        box-shadow: 0 12px 40px var(--theme-shadow);
        border-radius: 0 0 10px 10px;
        z-index: 999;
    }
    .main-nav.open {
        display: flex;
    }
    .main-nav a {
        padding: 12px 16px;
        width: 100%;
    }
    .header-inner {
        padding: 0 14px;
    }
}

@media (max-width: 480px) {
    .lang-btn {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
}

/* 顶部圆形搜索按钮：主题色背景 + 白色放大镜图标，点击跳转 /search */
.header-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--theme-primary);
    text-decoration: none;
    cursor: pointer;
    margin-right: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}
.header-search-btn img {
    width: 18px;
    height: 18px;
    display: block;
}
.header-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--theme-shadow);
}

@media (max-width: 768px) {
    .header-search-btn {
        width: 32px;
        height: 32px;
        margin-right: 4px;
    }
    .header-search-btn img {
        width: 16px;
        height: 16px;
    }
}
