/* ============================================================
   顶栏「更多」下拉面板 —— 全站唯一定义（唯一真源）
   ------------------------------------------------------------
   模板（唯一）：app/components/header.html
   引用           ：由 app/components/header.html 顶部 <link> 引入本文件
   覆盖子域       ：www / hk / us / news / video / download / tool / vas
                    （凡 <include file="Public:header" /> 的页面自动生效）
   ------------------------------------------------------------
   面板规格：340 x 186，内边距 8px，2 列 5+4
              grid-auto-flow: column / 行高 repeat(5, 32px) / gap 2px 6px
   单项规格：高 32px / 左右 12px / 字号 13px / 圆角 6px
   面板圆角：6px
   边框    ：1px solid rgba(15, 23, 42, .055)
   底色    ：#fff
   阴影    ：0 8px 24px rgba(15, 23, 42, .06)
   hover   ：rgba(15, 23, 42, .035)
   ------------------------------------------------------------
   注意：critical-base.css / theme.css / base-bundle.min.css 已移除全部
        .header-more* 规则，改本文件即全站同步生效，不要再在别处复制。
   ============================================================ */
.header-more {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-left: 12px;
}
.header-more-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--c-text-2);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--ease), color var(--ease), transform var(--ease);
}
.header-more-toggle:hover {
    background: var(--c-bg-soft);
    color: var(--c-text);
}
.header-more-toggle:focus-visible {
    outline: 2px solid var(--c-action);
    outline-offset: 2px;
}
.header-more-toggle-bar {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform var(--ease), opacity var(--ease);
}
.header-more.is-open .header-more-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.header-more.is-open .header-more-toggle-bar:nth-child(2) {
    opacity: 0;
}
.header-more.is-open .header-more-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
.header-more-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 24px);
    padding: 8px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.055);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    z-index: 1003;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(5, 32px);
    grid-auto-flow: column;
    gap: 2px 6px;
}
.header-more.is-open .header-more-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.header-more-panel a {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: var(--fw-medium);
    line-height: 1;
    color: var(--c-text-2);
    text-decoration: none;
    border-radius: 6px;
    transition: background var(--ease), color var(--ease);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-more-panel a:hover {
    background: rgba(15, 23, 42, 0.035);
    color: var(--c-text);
}
.header-more-panel a:focus-visible {
    outline: 2px solid var(--c-action);
    outline-offset: -2px;
}
.header-more-panel a + a {
    margin-top: 0;
}
/* 暗色模式 */
html.io-dark-mode .header-more-toggle {
    color: #dbe8fb;
}
html.io-dark-mode .header-more-toggle:hover {
    background: rgba(219, 232, 255, 0.1);
    color: #fff;
}
html.io-dark-mode .header-more-panel {
    background: var(--c-bg-elevated);
    border-color: rgba(219, 232, 255, 0.12);
}
html.io-dark-mode .header-more-panel a {
    color: var(--c-text-2);
}
html.io-dark-mode .header-more-panel a:hover {
    background: rgba(219, 232, 255, 0.08);
    color: #fff;
}
/* 移动端：与主导航汉堡重复，隐藏「更多」菜单（保持原行为） */
@media (max-width: 767px), (orientation: landscape) and (max-height: 500px) {
    .header-more {
        display: none;
    }
    .header-more-toggle {
        width: 34px;
        height: 34px;
    }
    .header-more-toggle-bar {
        width: 18px;
    }
    .header-more-panel {
        position: fixed;
        top: var(--header-h);
        right: var(--layout-main-pad-x-sm);
        left: var(--layout-main-pad-x-sm);
        width: auto;
        max-width: none;
        max-height: calc(100vh - var(--header-h) - 20px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}
