/* =============================================
   Site Header — 政务门户导航（继承 index.css 变量）
   此文件为全站 header/nav 的覆盖补丁，
   首页由 index.css 中的 .gw-* 体系主导，
   非首页模板仍通过本文件的 .site-* 确保兜底。
   ============================================= */

/* 非首页时沿用的紧凑导航（site-header），
   政务风：深蓝背景，去除过度圆角，字重规范化 */
:root {
    --hdr-bg:         #2d4f6b;
    --hdr-height:     52px;
    --hdr-text:       rgba(255,255,255,.88);
    --hdr-text-hover: #fff;
    --hdr-accent:     #45647e;
    --hdr-sub-bg:     #ffffff;
    --hdr-sub-border: #d7e4ef;
    --hdr-sub-shadow: 0 8px 22px rgba(39,75,107,.12);
    --hdr-gold:       #d9b35b;
}

.site-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--hdr-height);
    background: var(--hdr-bg);
    box-shadow: 0 3px 10px rgba(47,95,134,.24);
    /* 顶部金色线 */
    border-top: 3px solid var(--hdr-gold);
}

.site-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Logo / 站名 */
.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 28px;
}

.site-logo__text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .04em;
    font-family: "PingFang SC","Microsoft YaHei",sans-serif;
    white-space: nowrap;
}

/* Mobile toggle */
.site-header__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.site-header__toggle span {
    display: block;
    width: 22px; height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform .3s, opacity .3s;
}

.site-header__toggle--active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header__toggle--active span:nth-child(2) { opacity: 0; }
.site-header__toggle--active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav */
.site-nav {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.site-nav__list {
    list-style: none;
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
    height: var(--hdr-height);
}

.site-nav__item { position: relative; }

.site-nav__item > a {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 100%;
    color: var(--hdr-text);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color .2s, background .2s, border-color .2s;
    white-space: nowrap;
}

.site-nav__item > a:hover {
    color: var(--hdr-text-hover);
    background: rgba(255,255,255,.1);
}

.site-nav__item--active > a {
    color: #fff;
    background: linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(30,58,82,.18) 100%);
    border-bottom-color: var(--hdr-gold);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

/* Dropdown */
.site-nav__sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: var(--hdr-sub-bg);
    border: 1px solid var(--hdr-sub-border);
    border-top: 3px solid var(--hdr-gold);
    box-shadow: var(--hdr-sub-shadow);
    padding: 6px 0;
    list-style: none;
    margin: 0;
    z-index: 100;
}

.site-nav__item:hover .site-nav__sub { display: block; }

.site-nav__sub li a {
    display: block;
    padding: 9px 18px;
    color: #3c302c;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s, background .2s;
}

.site-nav__sub li a:hover {
    color: var(--hdr-bg);
    background: #faf2eb;
}

/* Right side */
.site-nav__right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 16px;
}

/* Search */
.site-search {
    display: flex;
    align-items: stretch;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 3px;
    overflow: hidden;
    height: 34px;
    transition: border-color .2s, background .2s;
}

.site-search:focus-within {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.4);
}

.site-search__input {
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    padding: 0 10px;
    width: 130px;
    font-family: inherit;
}

.site-search__input::placeholder { color: rgba(255,255,255,.5); }

.site-search__btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.75);
    cursor: pointer;
    padding: 0 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    transition: color .2s;
}

.site-search__btn:hover { color: #fff; }

/* User area */
.site-user { display: flex; align-items: center; gap: 8px; }

.site-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    font-size: 13px;
    border-radius: 3px;
    text-decoration: none;
    transition: all .2s;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1.5;
    white-space: nowrap;
    font-family: inherit;
    font-weight: 600;
}

.site-btn--ghost {
    color: rgba(255,255,255,.85);
    border-color: rgba(255,255,255,.3);
    background: transparent;
}

.site-btn--ghost:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255,255,255,.08);
}

.site-btn--primary {
    color: #fff;
    background: var(--hdr-accent);
    border-color: var(--hdr-accent);
}

.site-btn--primary:hover { background: #8f0c18; border-color: #8f0c18; }

/* User dropdown */
.site-user__avatar-wrap { position: relative; }

.site-user__avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--hdr-text);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background .2s;
}

.site-user__avatar:hover { background: rgba(255,255,255,.1); }
.site-user__avatar img { width: 28px; height: 28px; border-radius: 50%; }
.site-user__avatar span { font-size: 13px; }

.site-user__menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 150px;
    background: #fff;
    border: 1px solid var(--hdr-sub-border);
    border-radius: 3px;
    box-shadow: var(--hdr-sub-shadow);
    padding: 6px 0;
    list-style: none;
    margin: 4px 0 0;
    z-index: 100;
}

.site-user__avatar-wrap:hover .site-user__menu { display: block; }

.site-user__menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: #2b2f36;
    font-size: 13px;
    text-decoration: none;
    transition: color .2s, background .2s;
}

.site-user__menu li a:hover { color: var(--hdr-bg); background: #f4f7fc; }

.site-user__menu-divider { height: 1px; background: #eef0f3; margin: 4px 10px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .site-header__toggle { display: flex; }

    .site-nav {
        display: none;
        position: absolute;
        top: var(--hdr-height);
        left: 0; right: 0;
        background: var(--hdr-bg);
        flex-direction: column;
        padding: 10px 0 16px;
        border-top: 1px solid rgba(255,255,255,.1);
        box-shadow: 0 8px 16px rgba(0,0,0,.2);
        z-index: 999;
    }

    .site-nav--open { display: flex; }

    .site-nav__list {
        flex-direction: column;
        width: 100%;
        height: auto;
        gap: 0;
    }

    .site-nav__item > a {
        height: auto;
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255,255,255,.06);
        border-left: none;
        border-right: none;
        width: 100%;
    }

    .site-nav__item--active > a {
        border-bottom-color: rgba(255,255,255,.06);
        border-left: 3px solid var(--hdr-gold);
        padding-left: 17px;
    }

    .site-nav__sub {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid rgba(255,255,255,.06);
        background: rgba(0,0,0,.12);
        display: none;
    }

    .site-nav__item:hover .site-nav__sub { display: block; }

    .site-nav__sub li a {
        color: rgba(255,255,255,.75);
        padding: 10px 32px;
        font-size: 14px;
    }

    .site-nav__sub li a:hover { color: #fff; background: rgba(255,255,255,.06); }

    .site-nav__right {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
        margin-left: 0;
        padding: 0 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .site-search {
        width: 100%;
        flex: 1;
    }

    .site-search__input { width: 100%; flex: 1; }
}
