/* 页眉 — Vue3 统一版（PC / 移动端，风格对齐「我的交易」） */
.headerContainer {
    display: block;
    width: 100%;
}

#header-app {
    display: block;
    width: 100%;
}

.hd-root {
    width: 100%;
    background: #fff;
    position: relative;
    z-index: 1000;
}

/* ---- 顶部提示条 ---- */
.hd-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    padding: 6px 48px 6px 16px;
    background: #86c5fa;
    position: relative;
}

.hd-prompt-text {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #db4f16;
    font-size: 14px;
    text-decoration: none;
}

.hd-prompt-text:hover {
    color: #db4f16;
}

.hd-prompt-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.hd-prompt-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hd-prompt-close img {
    width: 12px;
    height: 12px;
}

/* ---- 主栏 ---- */
.hd-bar {
    max-width: 1440px;
    margin: 0 auto;
    min-height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.hd-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.hd-logo-img--pc {
    display: block;
    width: 42px;
    height: 25px;
}

.hd-logo-img--mob {
    display: none;
    width: 135px;
    height: 50px;
}

/* ---- 桌面导航 ---- */
.hd-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.hd-nav--desktop {
    display: flex;
}

.hd-nav-link {
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hd-nav-link:hover,
.hd-nav-link.is-active {
    color: #02cab9;
    background: rgba(2, 202, 185, 0.06);
}

.hd-nav-link img {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.hd-nav-link.is-open img {
    transform: rotate(180deg);
}

/* ---- Mega 菜单：寻找教师 ---- */
.hd-mega-wrap {
    position: relative;
    flex: 0 0 auto;
}

.hd-mega {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    display: flex;
    width: 420px;
    min-height: 260px;
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    z-index: 30;
}

.hd-mega-side {
    width: 196px;
    border-right: 1px solid #f0f0f0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.hd-mega-tab {
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.hd-mega-tab:hover,
.hd-mega-tab.is-active {
    background: #02cab9;
    color: #fff;
}

.hd-mega-panel {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    max-height: 280px;
}

.hd-mega-item {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.hd-mega-item:hover {
    background: rgba(2, 202, 185, 0.08);
    color: #02cab9;
}

/* ---- 右侧操作区 ---- */
.hd-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.hd-actions--desktop {
    display: flex;
}

.hd-icon-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.hd-icon-link:hover {
    background: rgba(2, 202, 185, 0.06);
}

.hd-icon-link img {
    width: 16px;
    height: 16px;
}

.hd-badge {
    position: absolute;
    right: -2px;
    top: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ffc107;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}

.hd-auth-link {
    color: #666;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
}

.hd-auth-link:hover {
    color: #02cab9;
    background: rgba(2, 202, 185, 0.06);
}

.hd-auth-link--primary {
    color: #02cab9;
}

/* ---- 语言 / 货币 ---- */
.hd-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hd-select-wrap {
    position: relative;
    flex: 0 0 auto;
}

.hd-select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 120px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid #02cab9;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.hd-select-btn:hover,
.hd-select-btn.is-open {
    background: rgba(2, 202, 185, 0.04);
    box-shadow: 0 2px 8px rgba(2, 202, 185, 0.08);
}

.hd-select-btn img {
    width: 10px;
    height: 10px;
    transition: transform 0.2s;
}

.hd-select-btn.is-open img {
    transform: rotate(180deg);
}

.hd-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    max-height: 240px;
    overflow-y: auto;
}

.hd-select-option {
    padding: 9px 12px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.hd-select-option:hover,
.hd-select-option.is-active {
    color: #02cab9;
    background: rgba(2, 202, 185, 0.08);
}

.hd-select-option.is-active {
    font-weight: 600;
}

/* ---- 用户菜单 ---- */
.hd-user-wrap {
    position: relative;
    flex: 0 0 auto;
}

.hd-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #02cab9;
    background: #fff;
    color: #333;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    min-height: 40px;
    max-width: 200px;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.hd-user-btn-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e8eef5;
}

.hd-user-btn-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.hd-user-btn-chevron {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    opacity: 0.75;
    transition: transform 0.2s, opacity 0.2s;
}

.hd-user-btn:hover,
.hd-user-btn.is-open {
    color: #02cab9;
    background: rgba(2, 202, 185, 0.04);
    box-shadow: 0 2px 8px rgba(2, 202, 185, 0.12);
    border-color: #02cab9;
}

.hd-user-btn:hover .hd-user-btn-chevron,
.hd-user-btn.is-open .hd-user-btn-chevron {
    opacity: 1;
}

.hd-user-btn.is-open .hd-user-btn-chevron {
    transform: rotate(180deg);
}

.hd-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
    z-index: 40;
}

.hd-user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 8px;
}

.hd-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hd-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hd-user-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.hd-user-item-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 54px;
    padding: 8px 4px;
    border-radius: 8px;
    color: #4b5563;
    font-size: 12px;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}

.hd-user-item-link:hover {
    background: #f5f7fb;
    color: #02cab9;
}

.hd-user-item-link img {
    width: 18px;
    height: 18px;
    opacity: 0.85;
}

.hd-user-item-link--logout {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 8px;
    min-height: 38px;
    color: #8b93a7;
}

.hd-user-item-link--logout:hover {
    background: #fff5f5;
    color: #c0392b;
}

.hd-user-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: #e6e9f0;
    margin: 6px 4px;
}

/* ---- 下拉菜单（英语测试等） ---- */
.hd-dropdown-wrap {
    position: relative;
    flex: 0 0 auto;
}

.hd-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 160px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 30;
}

.hd-dropdown-item {
    display: block;
    padding: 10px 14px;
    color: #666;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.hd-dropdown-item:hover {
    background: rgba(2, 202, 185, 0.08);
    color: #02cab9;
}

/* ---- 汉堡按钮 & 抽屉 ---- */
.hd-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid #e8eef5;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.hd-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #666;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

.hd-menu-btn.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hd-menu-btn.is-open span:nth-child(2) {
    opacity: 0;
}

.hd-menu-btn.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hd-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1001;
}

.hd-drawer {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    height: 100vh;
    background: #fff;
    z-index: 1002;
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    padding: 16px 16px 32px;
}

.hd-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.hd-drawer-title {
    font-size: 16px;
    font-weight: 700;
    color: #444;
}

.hd-drawer-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
}

.hd-drawer-section {
    margin-top: 12px;
}

.hd-drawer-link {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    color: #666;
    font-size: 15px;
    text-align: left;
    text-decoration: none;
    padding: 12px 4px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.hd-drawer-link:hover {
    color: #02cab9;
}

.hd-drawer-sub {
    padding-left: 12px;
}

.hd-drawer-sub .hd-drawer-link {
    font-size: 14px;
    padding: 10px 4px;
}

.hd-drawer-select-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.hd-drawer-select-group .hd-select-wrap {
    width: 100%;
}

.hd-drawer-select-group .hd-select-btn {
    width: 100%;
}

.hd-drawer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px 12px;
}

/* ---- 响应式 ---- */
@media (max-width: 992px) {
    .hd-bar {
        padding: 0 16px;
    }

    .hd-nav--desktop,
    .hd-actions--desktop {
        display: none !important;
    }

    .hd-menu-btn {
        display: inline-flex;
    }

    .hd-logo-img--pc {
        display: none;
    }

    .hd-logo-img--mob {
        display: block;
    }

    .hd-overlay.is-visible,
    .hd-drawer.is-visible {
        display: block;
    }

    .hd-prompt {
        padding-right: 40px;
    }
}

@media (min-width: 993px) {
    .hd-bar {
        min-height: 80px;
        padding: 0 60px;
    }

    .hd-prompt-close {
        right: 35px;
    }
}

@media (max-width: 480px) {
    .hd-bar {
        min-height: 56px;
        padding: 0 12px;
        gap: 8px;
    }

    .hd-logo-img--mob {
        width: 110px;
        height: auto;
    }
}
