/*!
 * ROMA Lab – styles.css
 * -----------------------------------------------------------------------------
 * Purpose: Main site stylesheet for ROMA-AI-Lab.github.io
 * Author: (kept as original project authors)
 *
 * Maintainability Notes (non-functional changes only):
 * 1) We do NOT change selectors, property values, or cascade order.
 * 2) We keep existing visual effects 100% intact.
 * 3) We add clear section banners and an index for quick navigation.
 * 4) We normalize minor whitespace and ensure consistent indentation.
 * 5) We avoid @layer / @import or any splitting that could affect cascade.
 *
 * Quick Index (search with your editor):
 * [RESET].............. Base reset & typography
 * [THEME].............. Theme tokens (dark/light) & smooth switching
 * [LAYOUT]............. Container, sections, grids
 * [GLASS].............. Glass–matte tokens & placeholders
 * [MEDIA].............. Avatar / project cover
 * [HEADER]............. Sticky header / nav / drawer
 * [HERO]............... Hero section
 * [BUTTON]............. Buttons / chips / controls
 * [CARDS].............. Cards & metrics
 * [PUB]................ Publications list
 * [SCROLL]............. Vertical scroll containers (news, etc.)
 * [FOOTER]............. Footer
 * [RESPONSIVE]......... Media queries
 *
 * Z-Index reference:
 *   60  - mobile drawer
 *   59  - drawer overlay
 *   50  - sticky header
 *
 * Breakpoints reference:
 *   ≤1100px, ≤900px, ≤780px, ≤720px, ≤520px
 * -----------------------------------------------------------------------------
 */

/* ----- Reset / Base ----- */
*, *::before, *::after {
    box-sizing: border-box
}

html:focus-within {
    scroll-behavior: smooth
}

body {
    margin: 0;
    line-height: 1.6;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, -apple-system, "Apple Color Emoji", "Segoe UI Emoji";
    -webkit-font-smoothing: antialiased
}

img, svg, video {
    max-width: 100%;
    display: block
}

a {
    color: inherit;
    text-decoration: none
}

/* ----- Theme tokens ----- */
:root {
    --bg: #0b1020;
    --panel: #0f172a;
    --panel-2: #121a31;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --brand: #a3e635;
    --brand-2: #22d3ee;
    --ring: #a3e63544;
    --card: #0e1530;
    --shadow: 0 8px 24px rgba(2, 6, 23, .35);
    --border: #1f2a44;
    --code: #0a0f1e;
    --bg-card: color-mix(in oklab, var(--panel) 72%, white 0%); /* 玻璃感基底 */
    --border-color: color-mix(in oklab, var(--border) 90%, transparent);
    --shadow-card: 0 4px 16px rgba(2, 6, 23, 0.28);
    --shadow-hover: 0 8px 28px rgba(20, 40, 120, 0.40);
}

.light {
    --bg: #ffffff;
    --panel: #f8fafc;
    --panel-2: #eef2f7;
    --text: #0f172a;
    --muted: #475569;
    --brand: #3b82f6;
    --brand-2: #22c55e;
    --ring: #3b82f655;
    --card: #ffffff;
    --shadow: 0 8px 24px rgba(15, 23, 42, .12);
    --border: #e5e7eb;
    --code: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.72);
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-card: 0 4px 16px rgba(15, 23, 42, 0.15);
    --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.22);
}

/* Smooth theme switching */
html, body, .card, .video-card, #people-grid .card.people-card, .media-fx {
    transition: background-color .35s ease,
    color .35s ease,
    box-shadow .35s ease,
    border-color .35s ease;
}

body {
    background: var(--bg);
    color: var(--text)
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px
}

/* ===== Glass–matte tokens ===== */
:root {
    --glass-bg: color-mix(in oklab, var(--panel) 55%, transparent);
    --glass-border: #ffffff22;
    --glass-highlight: #ffffff26;
    --glass-shadow: 0 8px 24px rgba(2, 6, 23, .25);
}

.light {
    --glass-border: #0f172a22;
    --glass-highlight: #ffffff3a;
}

/* ===== Avatars ===== */
.avatar img,
img.avatar {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 4/3;
    border-bottom: 1px solid var(--border);
    display: block;
}

/* glass–matte avatar placeholder */
.avatar.placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    position: relative;
    background: linear-gradient(180deg, var(--glass-bg), color-mix(in oklab, var(--panel-2) 85%, transparent));
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow) inset 0 1px 0 var(--glass-highlight);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.avatar.placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 40%);
    pointer-events: none;
}

/* ===== Project cover (NEW, for project cards & gallery) ===== */
.project-cover {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
    display: block;
}

.project-cover.placeholder {
    position: relative;
    background: linear-gradient(180deg, var(--glass-bg), color-mix(in oklab, var(--panel-2) 85%, transparent));
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow) inset 0 1px 0 var(--glass-highlight);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
}

/* ----- Header / Nav ----- */
header.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: color-mix(in oklab, var(--panel) 90%, transparent);
    border-bottom: 1px solid var(--border)
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    padding: 14px 0
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700
}

.brand svg {
    width: 28px;
    height: 28px
}

.nav-links-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

/* FIX: 给桌面端导航加类名 */
.nav-links-inline a {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--muted)
}

.nav-links-inline a.active, .nav-links-inline a:hover {
    color: var(--text);
    border-color: var(--border);
    background: var(--panel-2)
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-right: max(10px, env(safe-area-inset-right));
}

/* FIX: 右侧安全留白 */
.btn, button, .chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 10px 14px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer
}

.btn.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #0b1020;
    border: 0
}

.btn.ghost {
    background: transparent
}

.btn:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px
}

/* 移动端 menu 按钮更靠左一点，避免被滚动条挡住 */
#menu {
    display: none;
    margin-right: 12px;
}

/* FIX */
@media (max-width: 720px) {
    #menu {
        display: inline-flex;
    }
}

/* ----- Mobile drawer (NEW) ----- */
/*.nav-drawer {*/
/*    position: fixed;*/
/*    top: 0;*/
/*    right: 0;*/
/*    bottom: 0;*/
/*    width: min(86vw, 360px);*/
/*    background: var(--panel);*/
/*    border-left: 1px solid var(--border);*/
/*    transform: translateX(100%);*/
/*    transition: transform .25s ease;*/
/*    z-index: 60;*/
/*    display: flex;*/
/*    flex-direction: column;*/
/*    padding: 16px*/
/*}*/

.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    width: 56%;
    max-width: 380px; /* 保持桌面端不太宽 */
    /*width: min(86vw, 360px);*/
    box-shadow: var(--shadow-lg);
    background: var(--panel);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    /*transition: transform .25s ease;*/
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 12px 0 0 12px; /* 小圆角更像原生抽屉 */
}

.nav-drawer .title {
    font-weight: 700;
    margin-bottom: 10px
}

.nav-drawer a {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    margin-bottom: 8px
}

.nav-drawer a.active {
    font-weight: 600;
    border-color: var(--border);
    background: var(--panel-3);
}


.nav-drawer .spacer {
    flex: 1
}

.nav-drawer .footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.nav-drawer.show {
    transform: none
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
    z-index: 59;
    backdrop-filter: none;
}

/* FIX: 去掉强模糊，只做半透明遮罩 */
.nav-overlay.show {
    opacity: 1;
    visibility: visible
}

/* ----- Hero ----- */
.hero {
    position: relative;
    overflow: hidden;
    background: radial-gradient(1200px 600px at 50% -10%, color-mix(in oklab, var(--brand) 18%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, var(--panel), var(--bg));
    border-bottom: 1px solid var(--border)
}

.hero-wrap {
    padding: 72px 0 48px;
    display: grid;
    grid-template-columns:1.2fr .8fr;
    gap: 24px
}

@media (max-width: 900px) {
    .hero-wrap {
        grid-template-columns:1fr
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--muted);
    background: var(--panel-2)
}

.title {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.2;
    margin: 12px 0 8px
}

.subtitle {
    color: var(--muted);
    max-width: 60ch
}

.hero-card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow)
}

.hero-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.hero-grid {
    display: grid;
    grid-template-columns:repeat(3, 1fr);
    gap: 12px
}

@media (max-width: 700px) {
    .hero-grid {
        grid-template-columns:1fr 1fr
    }
}

.metric {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px
}

.metric .k {
    font-size: 24px;
    font-weight: 800
}

.metric .k sub {
    font-size: 12px;
    color: var(--muted);
    margin-left: 4px
}

/* ----- Sections ----- */
section {
    padding: 64px 0;
    border-bottom: 1px solid var(--border)
}

section:last-of-type {
    border-bottom: 0
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap
}

.section-head h2 {
    font-size: clamp(22px, 3vw, 32px);
    margin: 0
}

.section-desc {
    color: var(--muted);
    max-width: 75ch
}

/* ----- Cards & Grids (default) ----- */
.grid {
    display: grid;
    gap: 16px
}

.grid.people {
    grid-template-columns:repeat(4, 1fr)
}

.grid.research {
    grid-template-columns:repeat(3, 1fr)
}

.grid.pub {
    grid-template-columns:1fr
}

@media (max-width: 1100px) {
    .grid.people {
        grid-template-columns:repeat(3, 1fr)
    }

    .grid.research {
        grid-template-columns:repeat(2, 1fr)
    }
}

@media (max-width: 780px) {
    .grid.people {
        grid-template-columns:repeat(2, 1fr)
    }
}

@media (max-width: 520px) {
    .grid.people {
        grid-template-columns:1fr
    }

    .grid.research {
        grid-template-columns:1fr
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow)
}

.card .body {
    padding: 16px
}

.card .meta {
    color: var(--muted);
    font-size: 14px
}

/* 统一按钮行高度，确保 Email / Profile 对齐（FIX） */
.actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    align-items: center;
    min-height: 42px
}

/* ----- Publication (no thumbnails on home) ----- */
.pub-item {
    display: grid;
    grid-template-columns:1fr auto;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel)
}

.pub-item .title {
    font-weight: 700
}

.pub-item .authors, .pub-item .venue {
    color: var(--muted);
    font-size: 14px
}

.pub-actions {
    display: flex;
    gap: 8px;
    align-items: center
}

.pub-actions .btn {
    padding: 8px 10px;
    border-radius: 10px
}

.bibtex {
    display: none;
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    background: #020617;
    color: #e5e7eb;
    overflow: auto
}

.light .bibtex {
    background: #0f172a;
    color: #e5e7eb
}

/* ----- Scroll containers ----- */
.v-scroll {
    max-height: 520px;
    overflow: auto;
    padding-right: 4px
}

#news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px
}

.news-card .body {
    display: flex;
    gap: 10px;
    align-items: flex-start
}

.news-date {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 8px;
    background: var(--panel-2)
}

.news-text {
    flex: 1
}

.news-text a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.news-text a:hover,
.news-text a:focus-visible {
    text-decoration-thickness: 2px;
}



/* ----- Footer ----- */
footer {
    padding: 36px 0;
    color: var(--muted)
}

.foot {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap
}

.foot-left {
    display: flex;
    gap: 10px;
    align-items: center
}

.foot-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

/* Footer 备案图标：缩成“表情包”大小并与文字对齐 */
footer .foot-left small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

footer .foot-left small img {
    width: 1.1em;     /* 和文字高度接近 */
    height: 1.1em;
    object-fit: contain;
    vertical-align: middle;
}


/* ----- Utilities ----- */
:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
    border-radius: 8px
}

.hidden {
    display: none !important
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

/* ---------- Markdown prose (for custom .md sections) ---------- */
.prose {
    margin-top: 16px;
    line-height: 1.7;
}

/* ---------- Person detail markdown enhancement ---------- */

/* 整体宽度 & 居中：正文更像一篇优雅的个人页面 */
#person-detail-body .person-prose {
    max-width: 720px;
    margin: 0 auto;
}

/* 顶部大标题（👤 Dr. ...）稍微拉开一点气口 */
#person-detail-body .person-prose h1 {
    margin-top: 0;
    margin-bottom: 0.4em;
}

/* H2 标题（带 emoji），做一条很轻的底线，方便扫读各 section */
#person-detail-body .person-prose h2 {
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
}

/* H3 稍微紧凑一点，用于 “Influence Highlights” 这类副标题 */
#person-detail-body .person-prose h3 {
    margin-top: 1.2em;
    margin-bottom: 0.4em;
}

/* 顶部第一段简介稍微收一点颜色和字号，看起来像 intro */
#person-detail-body .person-prose > p:first-of-type {
    color: var(--muted);
    font-size: 0.95rem;
}

/* 列表更紧凑，但保持良好可读性 */
#person-detail-body .person-prose ul,
#person-detail-body .person-prose ol {
    margin: 0.4em 0 0.8em;
    padding-left: 1.2em;
}

/* 小圆点列表清晰一点 */
#person-detail-body .person-prose ul {
    list-style: disc;
}

/* Awards 那首小诗的区块样式 */
#person-detail-body .person-prose blockquote {
    margin: 1.2em 0;
    padding: 12px 14px;
    border-radius: 12px;
    border-left: 3px solid var(--brand);
    background: color-mix(in oklab, var(--panel-2) 85%, transparent);
    color: var(--muted);
}

/* 亮色主题下稍微抬一点亮度，保持轻盈 */
.light #person-detail-body .person-prose blockquote {
    background: color-mix(in oklab, var(--panel-2) 70%, white 15%);
}

/* 引用里的多行文本（带 <br/>）更紧凑一点 */
#person-detail-body .person-prose blockquote p {
    margin: 0;
    line-height: 1.6;
}

/* 引用里第一行（🍇 Awards and Honors）稍微加一点权重 */
#person-detail-body .person-prose blockquote p br + text {
    font-weight: 600;
}

/* 分隔线（---）在个人页收窄一点 */
#person-detail-body .person-prose hr {
    margin: 1.2em 0;
    border-top-style: dashed;
}

/* 链接下划线稍微柔一点 */
#person-detail-body .person-prose a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

#person-detail-body .person-prose blockquote {
    position: relative;
}

#person-detail-body .person-prose blockquote::after {

    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.8;
    font-style: italic;
}



.prose h1, .prose h2, .prose h3, .prose h4 {
    margin: 1.2em 0 .5em;
    line-height: 1.3
}

.prose h1 {
    font-size: clamp(22px, 3vw, 28px)
}

.prose h2 {
    font-size: clamp(20px, 2.6vw, 24px)
}

.prose h3 {
    font-size: clamp(18px, 2.2vw, 20px)
}

.prose p {
    margin: .6em 0;
    color: var(--text)
}

.prose a {
    color: inherit;
    text-decoration: underline
}

.prose ul, .prose ol {
    padding-left: 1.2em;
    margin: .6em 0
}

.prose li {
    margin: .25em 0
}

.prose img {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: .6em 0
}

.prose code {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    background: var(--panel-2);
    padding: .15em .4em;
    border-radius: 6px;
    border: 1px solid var(--border)
}

.prose pre.code {
    background: var(--panel-2);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    overflow: auto
}

.prose hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1em 0
}

/* 标签容器与胶囊样式 */
.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px
}

.tag {
    font-size: 12px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    background: var(--panel)
}

.pub-actions a[href=""] {
    opacity: .5;
    pointer-events: none;
}

/* 首页 publication 区块（例如 #pub-list 在首页） */
#pub-list .pub-item .title {
    font-size: 0.95rem;
}

/* 独立页（pages/publications.html） */
#pub-all-list .pub-item .title {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .pub-item .title {
        font-size: 0.9rem;
    }
}

/* --- Mobile-first header defaults (prevent FOUC) --- */
@media (max-width: 720px) {
    /* 隐藏桌面内联导航，首屏就不出现 */
    .nav-links-inline {
        display: none !important;
    }

    /* 显示汉堡按钮（如果上面已有同名规则可保留，这里是兜底） */
    #menu {
        display: inline-flex !important;
    }

    /* 品牌名不换行，避免被挤成两行 */
    .brand span {
        white-space: nowrap;
    }

    /* 头部间距在移动端稍微紧凑一点，避免挤压 */
    .nav {
        gap: 10px;
    }
}

/* iOS 安全区增强：仅在有刘海设备上起作用，其他设备值为 0 */
header.site-header {
    padding-top: max(0px, env(safe-area-inset-top));
}

header.site-header .nav {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

/* 你的 .controls 里已经处理了右侧；这里补齐左侧兜底（可选） */
.controls {
    padding-left: max(10px, env(safe-area-inset-left));
}

/* 移动端抽屉的内边距也跟随安全区（可选，手感更好） */
.nav-drawer {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

/* 防滚动链路穿透：背景层不把滚动冒泡到页面 */
html, body {
    overscroll-behavior: contain;
}

/* 抽屉 & 遮罩避免误触背景 */
.nav-overlay {
    touch-action: none;
}

.nav-drawer {
    overscroll-behavior: contain;
}

/* --- Publications: mobile layout fix --- */
@media (max-width: 720px) {
    /* 1) 卡片改为上下布局，按钮放到文字下面 */
    .pub-item {
        grid-template-columns: 1fr !important;
        align-items: start;
        gap: 10px;
    }

    .pub-actions {
        justify-content: flex-start;
    }

    /* 2) 标题小一号且避免奇怪断字 */
    #pub-list .pub-item .title,
    #pub-all-list .pub-item .title {
        font-size: 0.95rem !important;
        line-height: 1.35;
        word-break: keep-all; /* 优先整词换行 */
        overflow-wrap: anywhere; /* 实在太长再强制换 */
    }

    /* 3) 按钮触控尺寸适配 */
    .pub-actions .btn {
        padding: 8px 10px;
        border-radius: 10px;
    }
}

/* --- Form controls: dark theme styling --- */
input[type="search"],
select {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    outline: none;
}

input[type="search"]::placeholder {
    color: var(--muted);
}

input[type="search"]:focus,
select:focus {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
}

@media (max-width: 720px) {
    .filters-mobile summary {
        padding: 8px 10px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--panel-2)
    }

    .filters-mobile[open] {
        padding: 8px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--panel)
    }

    .filters-mobile > *:not(summary) {
        margin-top: 8px;
        display: block
    }

    .filters-mobile input, .filters-mobile select {
        width: 100%
    }
}

@media (max-width: 720px) {
    .hero-wrap {
        padding: 56px 0 36px
    }

    .subtitle {
        max-width: 100%
    }
}

/* ========= Auto Hero Top Gap (自适应导航高度) ========= */

/* 默认变量值 */
:root {
    --hero-top-gap: 48px; /* 桌面端舒适留白 */
}

/* hero 使用这个变量控制上边距 */
.hero-wrap {
    padding-top: var(--hero-top-gap);
}

/* 手机默认更紧凑，JS 会再动态覆盖 */
@media (max-width: 720px) {
    :root {
        --hero-top-gap: 24px;
    }
}

/* ========= Header Safe-Area Enhancement（iOS 刘海/圆角） ========= */
/* 说明：
   - 在有安全区的设备（iPhone 刘海/动态岛）上，env(safe-area-inset-*) 会返回 >0 的值；
   - 其它设备值为 0，不会改变原有布局。 */

header.site-header {
    /* 顶部让出安全区，避免被遮挡 */
    padding-top: max(0px, env(safe-area-inset-top));
}

/* 头部左右也让出安全区，保证 GitHub/菜单不贴边 */
header.site-header .nav {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

/* 你的 .controls 原本只做了右侧安全留白，这里补齐左侧兜底（不与原有规则冲突） */
.controls {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
}

/* 移动端抽屉同样尊重安全区（触控更舒服） */
.nav-drawer {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

/* ========= Auto Hero Top Gap（自适应导航高度） ========= */
:root {
    --hero-top-gap: 48px; /* 桌面端默认的舒适留白 */
}

/* 让 hero 真正使用变量作为顶部内边距 */
.hero-wrap {
    padding-top: var(--hero-top-gap);
}

/* 手机初始更紧凑（JS 会覆盖为 headerHeight+8px） */
@media (max-width: 720px) {
    :root {
        --hero-top-gap: 24px;
    }
}

.btn, button, .chip {
    min-height: 44px;
}

/* ---- Back-to-top (mobile + desktop) ---- */
#to-top {
    position: fixed;
    right: clamp(16px, 2vw, 28px);
    bottom: clamp(18px, 3vh, 32px);
    z-index: 1000; /* 略高一点，避免被内容覆盖 */
    box-shadow: var(--shadow);
    min-width: 44px; /* 更好的命中面积 */
    min-height: 44px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    opacity: .95;
    transition: transform .15s ease, opacity .15s ease;
}

#to-top:hover {
    transform: translateY(-1px);
}

/* 手机端保持更靠内的边距（避免和手势冲突） */
@media (max-width: 720px) {
    #to-top {
        right: 16px;
        bottom: 18px;
    }
}

/*!* ---- Back-to-top (mobile only) ---- *!*/
/*#to-top {*/
/*    position: fixed;*/
/*    right: 16px;*/
/*    bottom: 18px;*/
/*    z-index: 70; !* 高于内容，低于抽屉(60)没关系；若需浮在抽屉上可调到 80+ *!*/
/*    box-shadow: var(--shadow);*/
/*}*/

/*@media (min-width: 721px) {*/
/*    #to-top {*/
/*        display: none;*/
/*    }*/

/*    !* 仅手机显示 *!*/
/*}*/

/* ===== Lightbox (dialog) ===== */
dialog.lightbox {
    padding: 0;
    border: 0;
    /* 让 dialog 自身全屏，只做容器；用 flex 居中承载图片 */
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 背景蒙层 */
dialog.lightbox::backdrop {
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(2px);
}

/* 预览大图：桌面不再真正“满屏”，给出边距方便点击关闭 */
dialog.lightbox img {
    max-width: min(96vw, 1600px);
    max-height: 92vh;
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .45);
    cursor: zoom-out; /* 告诉用户“再点一下就缩回” */
}

/* 缩略图可选：提示可放大 */
#life-grid img.project-cover {
    cursor: zoom-in;
}

/* ======== Video Wall ======== */
.grid.videos {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1100px) {
    .grid.videos {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid.videos {
        grid-template-columns: 1fr;
    }
}

.video-card .body {
    padding: 12px 14px;
}

.video-title {
    font-weight: 700;
    line-height: 1.35;
}

.video-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.video-ctas {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 16:9 封面占位 + 玻璃磨砂背景 */
.video-embed {
    background: var(--panel-2);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.video-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    position: relative;
}

/* Play 按钮（圆形，居中） */
.video-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 60px;
    height: 60px;
    border-radius: 9999px;
    border: 0;
    background: color-mix(in oklab, var(--panel) 70%, black 10%);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.video-play svg {
    fill: white;
}

.video-play:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.video-card:hover .video-play {
    transform: scale(1.05);
    transition: transform .15s ease;
}

/* 真正的 iframe：保持 16:9 */
.video-iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
    border: 0;
}

/* 降级提示 */
.video-fallback {
    padding: 16px;
    text-align: center;
}

.video-fallback p {
    margin: 0 0 8px;
}

/* 悬浮反馈 */
.video-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    transition: transform .15s ease, box-shadow .15s ease;
}

/* sentinel（增量渲染用，占位很小） */
.video-sentinel {
    height: 1px;
    visibility: hidden;
}

.video-cover:hover {
    transform: scale(1.03) translateY(-2px);
    filter: brightness(1.1);
    transition: transform 0.35s ease, filter 0.35s ease;
}

.video-play svg {
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Video card – theme-adaptive */
.video-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(115%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    transition: box-shadow .3s ease, transform .3s ease, background-color .3s ease, border-color .3s ease;
}

.video-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.video-title::after {
    content: '';
    display: block;
    height: 2px;
    width: 40%;
    margin-top: 6px;
    background: linear-gradient(90deg, #00e0ff, transparent);
}

/* === Cinematic View === */
#cinematic-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.7);
    transition: opacity 0.4s ease;
    opacity: 0;
}

#cinematic-overlay.active {
    display: flex;
    opacity: 1;
}

.cinematic-player {
    position: relative;
    width: 90%;
    max-width: 500px;
    aspect-ratio: 16/9;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    animation: zoomIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


/* iframe 本身 */
#cinematic-iframe {
    position: relative;
    z-index: 1;           /* 在 loading 下面 */
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    transition: opacity 0.2s ease;
}

/* 覆盖在 iframe 上的提示层 */
.cinematic-loading {
    position: absolute;
    inset: 0;
    z-index: 2;           /* 明确压在 iframe 上 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e5e7eb;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 55%);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* overlay 处于 loading 状态时：显示提示，略压低 iframe 亮度 */
#cinematic-overlay.loading .cinematic-loading {
    opacity: 1;
}

#cinematic-overlay.loading #cinematic-iframe {
    opacity: 0.25;
}

.cinematic-close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 2rem;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.2s ease;
}

.cinematic-close:hover {
    transform: scale(1.2);
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== Global media effect (People first) ===== */
/* Theme-adaptive media frame */
.media-fx {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(115%);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transform: translateZ(0);
}

.media-fx:hover {
    box-shadow: var(--shadow-hover);
}

.media-fx > img { /* 包裹后的 img 保留原裁切 */
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s cubic-bezier(.2, .8, .2, 1), filter .45s ease;
}

.media-fx:hover > img {
    transform: scale(1.035);
    filter: contrast(1.04) saturate(1.02) brightness(1.02);
}

/* 柔光随鼠标移动（由 JS 设置 --mx/--my） */
.media-fx::after {
    content: "";
    position: absolute;
    inset: -20%;
    pointer-events: none;
    background: radial-gradient(120px 120px at var(--mx, 50%) var(--my, 50%),
    color-mix(in oklab, var(--brand) 22%, transparent) 0%,
    transparent 60%);
    opacity: 0;
    transition: opacity .35s ease;
}

.media-fx:hover::after {
    opacity: .55;
}

/* ===== People text polish ===== */
/* 姓名：更强层级 + 霓虹分割线（与 video-title 呼应） */
.person-name {
    font-weight: 800;
    font-size: clamp(16px, 1.1rem, 18px);
    letter-spacing: .2px;
    line-height: 1.35;
    position: relative;
    display: inline-block; /* 让下划线只占标题宽度 */
    max-width: 100%;
}

.person-name::after {
    content: "";
    display: block;
    height: 2px;
    margin-top: 6px;
    width: 46%;
    background: linear-gradient(90deg, #00e0ff, transparent 70%);
    opacity: .85;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(0, 224, 255, .35);
    transition: width .35s ease, opacity .35s ease;
}

.card:hover .person-name::after {
    width: 64%;
    opacity: 1;
}

/* 角色/单位：更精致的次级层级 */
.person-meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13.5px;
    letter-spacing: .1px;
    display: block; /* name 换行后更稳定 */
    opacity: .88;
}

.person-role {
    text-transform: none;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: color-mix(in oklab, var(--muted) 80%, white 20%);
}

.person-sep {
    margin: 0 .4em;
    opacity: .5;
}

/* 卡片底部按钮/链接行与上方文字的节奏 */
.card .body .actions {
    margin-top: 10px;
}

/* 防止“柔光圈”遮挡文字点击（来自你之前的 image 效果容器） */
.media-fx + .person-name,
.media-fx + .person-name + .person-meta {
    position: relative;
    z-index: 1;
}

.card:hover .person-name {
    text-shadow: 0 0 16px rgba(0, 224, 255, .18);
}

/* People card – same depth language as video */
#people-grid .card.people-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(12px) saturate(115%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1),
    box-shadow .28s ease,
    border-color .28s ease,
    background-color .28s ease;
    overflow: hidden;
}

#people-grid .card.people-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: radial-gradient(240px 160px at 20% -10%, color-mix(in oklab, var(--brand) 18%, transparent) 0%, transparent 60%),
    radial-gradient(200px 160px at 110% 10%, color-mix(in oklab, var(--brand-2) 14%, transparent) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .35s ease;
    pointer-events: none;
}

#people-grid .card.people-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: color-mix(in oklab, var(--border-color) 50%, var(--text) 10%);
}

#people-grid .card.people-card:hover::before {
    opacity: 1;
}

#people-grid .card.people-card:focus-within {
    outline: none;
    box-shadow: var(--shadow-hover), 0 0 0 2px color-mix(in oklab, var(--brand) 45%, transparent);
    transform: translateY(-3px);
}

@media (hover: hover) {
    #people-grid .card.people-card:active {
        transform: translateY(-1px) scale(.995);
    }
}

#people-grid .card.people-card .body {
    position: relative;
    z-index: 1;
}

/* Neon underline adapt for light theme */
.light .video-title::after,
.light .person-name::after {
    background: linear-gradient(90deg, #0078a6, transparent 70%);
    box-shadow: 0 0 8px rgba(0, 120, 166, .25);
    opacity: .95;
}

/* Text colors follow theme tokens */
.video-title, .person-name {
    color: var(--text);
}

.video-meta, .person-meta {
    color: var(--muted);
}

/* ===========================
   Projects & Life — Card Effects
   统一“玻璃 + 层次光影 + 悬浮上抬”
   （与 video-card / people-card 视觉一致）
   =========================== */

/* 让 life 的 <a class="card"> 作为完整块级卡片展示 */
#life-home-grid .card {
    display: block;
}

/* 玻璃卡片语言（与 video/people 保持一致） */
#research-grid .card.project-card,
#life-home-grid .card.life-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px) saturate(115%);
    -webkit-backdrop-filter: blur(16px) saturate(115%);
    overflow: hidden;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1),
    box-shadow .28s ease,
    border-color .28s ease,
    background-color .28s ease;
}

/* 悬浮上抬 + 更强阴影 */
#research-grid .card.project-card:hover,
#life-home-grid .card.life-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: color-mix(in oklab, var(--border-color) 60%, var(--text) 12%);
}

/* Project 顶部柔光（贴近 people 的层次感，但更克制） */
#research-grid .card.project-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(220px 140px at 10% -10%, color-mix(in oklab, var(--brand) 12%, transparent) 0%, transparent 60%),
    radial-gradient(180px 140px at 110% 10%, color-mix(in oklab, var(--brand-2) 10%, transparent) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .35s ease;
}

#research-grid .card.project-card:hover::before {
    opacity: .95;
}

/* ===== 标题霓虹分割线（扩展到 Project / Life 标题） ===== */
.project-title,
.life-title {
    position: relative;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

.project-title::after,
.life-title::after {
    content: "";
    display: block;
    height: 2px;
    margin-top: 6px;
    width: 40%;
    border-radius: 2px;
    background: linear-gradient(90deg, #00e0ff, transparent 70%);
    box-shadow: 0 0 12px rgba(0, 224, 255, .35);
    transition: width .35s ease, opacity .35s ease, background .3s ease, box-shadow .3s ease;
}

/* 悬浮时加长分割线（与 people 的交互保持一致） */
#research-grid .card.project-card:hover .project-title::after,
#life-home-grid .card.life-card:hover .life-title::after {
    width: 64%;
    opacity: 1;
}

/* 亮色主题下的可读性优化（沿用你现有 video/people 的逻辑） */
.light .project-title::after,
.light .life-title::after {
    background: linear-gradient(90deg, #0078a6, transparent 70%);
    box-shadow: 0 0 8px rgba(0, 120, 166, .25);
    opacity: .95;
}

/* 次级文字（副标题/元信息）色板统一 */
.project-meta,
.life-meta {
    color: var(--muted);
    font-size: 13.5px;
    letter-spacing: .1px;
    margin-top: 6px;
}

/* ===========================
   Subpages — Card Effects (Projects / Life / People)
   让子页卡片获得与首页一致的“玻璃 + 层次光影”
   =========================== */

/* 某些子页使用 <a class="card">，确保表现为块级卡片 */
#proj-all-grid .card,
#life-grid .card,
#people-all-grid .card {
    display: block;
}

/* 统一玻璃卡片语言 */
#proj-all-grid .card.project-card,
#life-grid .card.life-card,
#people-all-grid .card.people-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(16px) saturate(115%);
    -webkit-backdrop-filter: blur(16px) saturate(115%);
    overflow: hidden;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1),
    box-shadow .28s ease,
    border-color .28s ease,
    background-color .28s ease;
}

/* 悬浮上抬 + 强阴影 */
#proj-all-grid .card.project-card:hover,
#life-grid .card.life-card:hover,
#people-all-grid .card.people-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: color-mix(in oklab, var(--border-color) 60%, var(--text) 12%);
}

/* Projects 顶部柔光（子页版，略弱） */
#proj-all-grid .card.project-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(220px 140px at 10% -10%, color-mix(in oklab, var(--brand) 12%, transparent) 0%, transparent 60%),
    radial-gradient(180px 140px at 110% 10%, color-mix(in oklab, var(--brand-2) 10%, transparent) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .35s ease;
}

#proj-all-grid .card.project-card:hover::before {
    opacity: .95;
}

/* People 顶部柔光（与首页一致） */
#people-all-grid .card.people-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(240px 160px at 20% -10%, color-mix(in oklab, var(--brand) 18%, transparent) 0%, transparent 60%),
    radial-gradient(200px 160px at 110% 10%, color-mix(in oklab, var(--brand-2) 14%, transparent) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .35s ease;
}

#people-all-grid .card.people-card:hover::before {
    opacity: 1;
}

/* 霓虹标题线：扩展到子页 */
:is(.project-title, .life-title, .person-name) {
    position: relative;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

:is(.project-title, .life-title, .person-name)::after {
    content: "";
    display: block;
    height: 2px;
    margin-top: 6px;
    width: 40%;
    border-radius: 2px;
    background: linear-gradient(90deg, #00e0ff, transparent 70%);
    box-shadow: 0 0 12px rgba(0, 224, 255, .35);
    transition: width .35s ease, opacity .35s ease, background .3s ease, box-shadow .3s ease;
}

#proj-all-grid .card.project-card:hover .project-title::after,
#people-all-grid .card.people-card:hover .person-name::after {
    width: 64%;
    opacity: 1;
}

.light :is(.project-title, .life-title, .person-name)::after {
    background: linear-gradient(90deg, #0078a6, transparent 70%);
    box-shadow: 0 0 8px rgba(0, 120, 166, .25);
    opacity: .95;
}

/* 次级文字（统一色板） */
:is(.project-meta, .life-meta, .person-meta) {
    color: var(--muted);
    font-size: 13.5px;
    letter-spacing: .1px;
    margin-top: 6px;
}

/* ===== Person page: avatar cinematic image effect (no card) ===== */
#person-detail .media-fx {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px) saturate(115%);
    -webkit-backdrop-filter: blur(12px) saturate(115%);
    transform: translateZ(0);
    transition: box-shadow .35s ease, border-color .35s ease, background-color .35s ease;
}

/* 顶部柔光（更克制，避免喧宾夺主） */
#person-detail .media-fx::before {
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(220px 140px at 10% -10%, color-mix(in oklab, var(--brand) 12%, transparent) 0%, transparent 60%),
    radial-gradient(180px 140px at 110% 10%, color-mix(in oklab, var(--brand-2) 10%, transparent) 0%, transparent 60%);
    opacity: .0;
    transition: opacity .35s ease;
}

#person-detail .media-fx:hover::before {
    opacity: .95;
}

/* 视差高光：跟随鼠标位置的轻微光斑 */
#person-detail .media-fx::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(220px 160px at var(--mx, 50%) var(--my, 40%),
    rgba(255, 255, 255, .08), transparent 60%);
    transition: opacity .25s ease;
}

/* 图片本体：轻微缩放+提亮，保留你原本的头像比例设置 */
#person-detail .media-fx > img {
    display: block;
    width: 50%;
    height: auto;
    object-fit: cover;
    transition: transform .35s ease, filter .35s ease;
}

#person-detail .media-fx:hover > img {
    transform: scale(1.03) translateY(-2px);
    filter: brightness(1.06);
}

/* ===== Person page avatar: make wrapper + img a perfect fit ===== */

/* 头像原先可能自带边框/圆角，这里交给外层统一管理 */
#person-detail img.avatar {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* 外层包裹：与图片成为“一体”——不再被父容器拉伸 */
#person-detail .media-fx.avatar-frame {
    display: inline-block; /* 让外层按内容收缩 */
    width: min(50%, 500px); /* 继承你个人页头像的 max-width 语义 */
    border-radius: 12px; /* 与你页面设计一致 */
    overflow: hidden;

    /* 玻璃质感沿用之前的变量 */
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px) saturate(115%);
    -webkit-backdrop-filter: blur(12px) saturate(115%);
}

/* 图片占满包裹（用包裹来控制最终尺寸） */
#person-detail .media-fx.avatar-frame > img {
    display: block;
    width: 100%;
    height: auto; /* 不拉伸纵横比 */
    border-radius: inherit;
}

/* 悬浮柔光与视差仍然保留（如果你之前已加过，可保留或省略这段） */
#person-detail .media-fx.avatar-frame::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(220px 140px at 10% -10%, color-mix(in oklab, var(--brand) 12%, transparent) 0%, transparent 60%),
    radial-gradient(180px 140px at 110% 10%, color-mix(in oklab, var(--brand-2) 10%, transparent) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .35s ease;
}

#person-detail .media-fx.avatar-frame:hover::before {
    opacity: .95;
}

#person-detail .media-fx.avatar-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(220px 160px at var(--mx, 50%) var(--my, 40%), rgba(255, 255, 255, .08), transparent 60%);
}

/* ==== Accent CTA buttons (breathing glow + subtle shimmer) ==== */
:root {
    /* 统一参数，便于全站调节 */
    --cta-radius: 12px;
    --cta-glow1: color-mix(in oklab, var(--brand) 92%, white 0%);
    --cta-glow2: color-mix(in oklab, var(--brand-2) 92%, white 0%);
    --cta-bg: color-mix(in oklab, var(--panel) 88%, black 0%);
    --cta-border: color-mix(in oklab, var(--border) 70%, transparent);
    --cta-text: var(--text);
}

/* 基础态：在 ghost/solid 的基础上叠一层高亮，但不过分刺眼 */
.btn.cta {
    position: relative;
    border-radius: var(--cta-radius);
    border-color: var(--cta-border);
    background: linear-gradient(180deg, color-mix(in oklab, var(--panel-2) 70%, transparent), var(--panel));
    color: var(--cta-text);
    isolation: isolate; /* 让伪元素的混合不影响外部 */
    will-change: box-shadow, transform;
    transition: transform .18s ease,
    box-shadow .25s ease,
    border-color .25s ease,
    background-color .25s ease;
}

/* 呼吸光（常态轻微、hover 加强） */
.btn.cta {
    animation: cta-breathe 2.6s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0),
    0 0 0 0 rgba(0, 0, 0, 0),
    0 0 0 0 rgba(0, 0, 0, 0);
}

@keyframes cta-breathe {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0),
        0 0 0 0 rgba(0, 0, 0, 0),
        0 0 0 0 rgba(0, 0, 0, 0.0);
    }
    50% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0),
        0 0 22px 6px color-mix(in oklab, var(--cta-glow1) 30%, transparent),
        0 0 30px 10px color-mix(in oklab, var(--cta-glow2) 22%, transparent);
    }
}

/* 轻微流光：仅在 hover 时沿按钮横向扫过一条柔光 */
.btn.cta::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: calc(var(--cta-radius) - 1px);
    background: linear-gradient(120deg,
    transparent 0%,
    color-mix(in oklab, white 30%, var(--cta-glow2)) 15%,
    color-mix(in oklab, white 18%, var(--cta-glow1)) 25%,
    transparent 40%);
    background-size: 220% 100%;
    mix-blend-mode: screen;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, background-position .6s ease;
}

.btn.cta:hover::after {
    opacity: .55;
    background-position: -120% 0;
}

/* 悬停/聚焦的反馈（略微上抬 + 边界更清晰） */
.btn.cta:hover {
    transform: translateY(-1px);
    border-color: color-mix(in oklab, var(--cta-glow1) 30%, var(--cta-border));
}

.btn.cta:focus-visible {
    outline: 2px solid color-mix(in oklab, var(--cta-glow1) 55%, transparent);
    outline-offset: 2px;
}

/* 亮色主题下做对比度保护，避免过曝 */
.light .btn.cta {
    --cta-bg: color-mix(in oklab, #ffffff 85%, var(--panel) 15%);
    --cta-border: rgba(0, 0, 0, .08);
}

.light .btn.cta::after {
    opacity: .45;
}

/* 动效可访问性：用户选择“减少动效”时，禁用动画但保留静态高亮 */
@media (prefers-reduced-motion: reduce) {
    .btn.cta {
        animation: none;
    }

    .btn.cta::after {
        transition: none;
    }
}

/* 让箭头/↗更有动感（可选） */
.btn.cta:hover {
    letter-spacing: .1px;
}

.btn.cta:hover svg, .btn.cta:hover .arrow {
    transform: translateX(1px);
}


/* === Fix: Light theme CTA text contrast === */
.light .btn.cta {
    --cta-text: var(--text); /* 或直接用 var(--text) 以保持主题一致 */
    color: var(--cta-text);
}

/* 若与 ghost 一起使用（如 .btn.ghost.cta），可加更强对比的边框与背景 */
.light .btn.ghost.cta {
    --cta-text: #0f172a;
    color: var(--cta-text);
    border-color: rgba(0, 0, 0, 0.1);
    background: color-mix(in oklab, #ffffff 92%, var(--panel) 8%);
}


/* 保持你现有的尺寸一致性（文件里已有 min-height 规则会继承） */

/*.cinematic-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: none; align-items: center; justify-content: center; z-index: 70; }*/
/*.cinematic-overlay.active { display: flex; }*/
/*.cinematic-player { width: min(1200px, 92vw); aspect-ratio: 16/9; position: relative; background: #000; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); overflow: hidden; }*/
/*.cinematic-close { position: absolute; top: 8px; right: 8px; z-index: 1; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.4); color: #fff; border-radius: 10px; padding: 6px 10px; cursor: pointer; }*/
/*.cinematic-iframe { width: 100%; height: 100%; border: 0; }*/

/*.cinematic-overlay{position:fixed;inset:0;background:rgba(0,0,0,.75);display:none;align-items:center;justify-content:center;z-index:70}*/
/*.cinematic-overlay.active{display:flex}*/
/*.cinematic-player{width:min(1200px,92vw);aspect-ratio:16/9;position:relative;background:#000;border-radius:14px;overflow:hidden}*/
#cinematic-host {
    width: 100%;
    height: 100%
}

/*.cinematic-close{position:absolute;top:8px;right:8px;z-index:1;border:1px solid rgba(255,255,255,.25);background:rgba(0,0,0,.4);color:#fff;border-radius:10px;padding:6px 10px;cursor:pointer}*/
/*.cinematic-iframe{width:100%;height:100%;border:0}*/

/* ===== Peer Recognition micro-tweaks ===== */
#repute-list .prose {
    margin: 0;
}

#repute-list .prose sup a {
    text-decoration: none;
    opacity: .9;
}

#repute-list .prose mark {
    padding: 0 .2em;
    border-radius: 4px;
    background: color-mix(in oklab, var(--brand) 22%, transparent);
}

/* BEGIN PATCH: styles.css (Peer Recognition) */
/* 宽卡：左侧小头像（固定）、右侧大段评价（自适应） */
.repute-card {
    --repute-avatar: 76px;
    --repute-gap: 14px;
    display: grid;
    grid-template-columns: var(--repute-avatar) 1fr;
    gap: var(--repute-gap);
    align-items: flex-start;
    width: min(720px, 100%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 14px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

/* 整卡抛光：与 video/people/life 同感受（轻浮、提亮） */
.repute-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, .12));
    border-color: color-mix(in oklab, var(--brand) 24%, var(--border));
}

/* 左侧头像区（小而精） */
.repute-media {
    width: var(--repute-avatar);
    min-width: var(--repute-avatar);
    height: var(--repute-avatar);
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.repute-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 右侧主体 */
.repute-body {
    min-width: 0;
}

.repute-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
    margin-bottom: 6px;
}

.repute-name {
    font-weight: 800;
    line-height: 1.15;
}

.repute-meta {
    color: var(--muted);
    font-size: 13px;
}

/* 评价正文（富文本） */
.repute-quote.prose {
    margin: 0;
}

.repute-quote.prose p {
    margin: .45em 0;
}

.repute-quote.prose sup a {
    text-decoration: none;
    opacity: .9;
}

.repute-quote.prose mark {
    padding: 0 .22em;
    border-radius: 4px;
    background: color-mix(in oklab, var(--brand) 22%, transparent);
}

/* 小屏策略：头像更小，仍保持左右布局；特别窄时改为上下堆叠 */
@media (max-width: 720px) {
    .repute-card {
        --repute-avatar: 64px;
    }
}

@media (max-width: 520px) {
    .repute-card {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .repute-media {
        width: 56px;
        height: 56px;
        margin-bottom: 8px;
    }
}

/* END PATCH */

/* BEGIN PATCH: Wider Peer Recognition card */
.repute-card {
    /* 新增一个可控的最大宽度变量 */
    --repute-maxw: 840px; /* 之前是 720px，扩大到 840px */
    --repute-avatar: 80px; /* 头像微增 76 → 80，更协调 */
    width: min(var(--repute-maxw), 100%);
    margin-inline: auto; /* 居中 */
}

/* 超大屏再放大一点，让文字更舒展 */
@media (min-width: 1440px) {
    .repute-card {
        --repute-maxw: 900px;
    }
}

/* 极窄时仍按之前策略堆叠（已在你现有 media query 中处理，这里不重复） */
/* END PATCH */

/* BEGIN PATCH: Dark theme mark highlight stronger */
.repute-quote.prose mark {
    /* 明暗通用的基础：增加内边距和圆角，你已有可保留 */
    padding: 0 .26em;
    border-radius: 5px;
}

/* 1) 系统暗色偏好 */
@media (prefers-color-scheme: dark) {
    .repute-quote.prose mark {
        /* 更高的对比度：使用较亮的底色 + 轻微发光边 */
        background: color-mix(in oklab, #ffffff 24%, var(--brand));
        color: inherit; /* 不改文字色，避免反差过度 */
        box-shadow: inset 0 0 0 1px color-mix(in oklab, #ffffff 30%, transparent),
        0 0 0 2px rgba(255, 255, 255, .04); /* 微弱描边与外晕，提升边界感 */
    }
}

/* 2) 站点自有的暗色 data-attr（若你有切换按钮） */
:root[data-theme="dark"] .repute-quote.prose mark {
    background: color-mix(in oklab, #ffffff 24%, var(--brand));
    color: inherit;
    box-shadow: inset 0 0 0 1px color-mix(in oklab, #ffffff 30%, transparent),
    0 0 0 2px rgba(255, 255, 255, .04);
}

/* 加强脚注上标可点性：略提升可见度 */
.repute-quote.prose sup a {
    opacity: .95;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
}

/* END PATCH */

/* === PATCH 1: Dark 模式下 <mark> 高亮更显眼（提升优先级+兜底） === */
/* 先统一基础：让 reputation 两个容器里的 mark 都走这一套 */
#repute-list .repute-quote.prose mark,
#repute-all-grid .repute-quote.prose mark {
    padding: 0 .28em;
    border-radius: 5px;
}

/* A) 系统暗色偏好 */
@media (prefers-color-scheme: dark) {
    #repute-list .repute-quote.prose mark,
    #repute-all-grid .repute-quote.prose mark {
        /* 使用更亮的底色 + 轻描边，提高对比度 */
        background-color: color-mix(in oklab, #fff 28%, var(--brand)) !important;
        box-shadow: inset 0 0 0 1px color-mix(in oklab, #fff 32%, transparent),
        0 0 0 2px rgba(255, 255, 255, .05);
    }
}

/* B) 如果你用 data-theme 切换暗色，覆盖到位（提高选择器优先级） */
:root[data-theme="dark"] #repute-list .repute-quote.prose mark,
:root[data-theme="dark"] #repute-all-grid .repute-quote.prose mark,
html.dark #repute-list .repute-quote.prose mark,
html.dark #repute-all-grid .repute-quote.prose mark,
body.dark #repute-list .repute-quote.prose mark,
body.dark #repute-all-grid .repute-quote.prose mark {
    background-color: color-mix(in oklab, #fff 28%, var(--brand)) !important;
    box-shadow: inset 0 0 0 1px color-mix(in oklab, #fff 32%, transparent),
    0 0 0 2px rgba(255, 255, 255, .05);
}

/* 如需更醒目，把 28% 再调高到 32% 即可 */

/* === PATCH 2: 手机端头像被拉伸→强制正圆 & 不被栅格撑开 === */
.repute-media {
    /* 防止被 grid 拉伸 */
    align-self: start;
    justify-self: start;
    /* 双保险：固定正方形比例 */
    aspect-ratio: 1 / 1;
}

.repute-media img {
    /* 覆盖全局 img { height:auto } 等规则，避免椭圆 */
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* 窄屏下我们以前设置了 56x56，如果有别的样式覆盖，也用强制等宽高兜底 */
@media (max-width: 520px) {
    .repute-media {
        width: 56px !important;
        height: 56px !important;
    }
}

/* === Peer Recognition：强力兜底（放在 styles.css 末尾） === */

/* 1) 卡片更宽：桌面端更舒展 */
.repute-card {
    --repute-maxw: 900px; /* 你之前是 720/840，这里再加一档 */
    --repute-avatar: 80px;
    width: min(var(--repute-maxw), 100%);
    margin-inline: auto;
}

/* 2) 手机端头像绝不变形：容器与图片都强制 1:1 */
.repute-media {
    align-self: start;
    justify-self: start;
    width: var(--repute-avatar);
    height: var(--repute-avatar);
    aspect-ratio: 1 / 1; /* 关键：锁定正方形 */
    border-radius: 50%;
    overflow: hidden;
}

.repute-media img {
    width: 100% !important; /* 覆盖全局 img 高度/宽度规则 */
    height: 100% !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

@media (max-width: 520px) {
    .repute-media {
        width: 56px !important;
        height: 56px !important;
    }
}

/* 3) 暗色（站内）高亮更显眼：
   你站内的深色= body没有.light 类；不要只依赖 prefers-color-scheme */
#repute-list .repute-quote.prose mark,
#repute-all-grid .repute-quote.prose mark {
    padding: 0 .28em;
    border-radius: 5px;
}

/* 站内暗色模式（默认态）：用 body:not(.light) 覆盖，且加 !important 兜底 */
body:not(.light) #repute-list .repute-quote.prose mark,
body:not(.light) #repute-all-grid .repute-quote.prose mark {
    background-color: color-mix(in oklab, #fff 30%, var(--brand)) !important;
    box-shadow: inset 0 0 0 1px color-mix(in oklab, #fff 32%, transparent),
    0 0 0 2px rgba(255, 255, 255, .05);
}

/* 如果你也希望系统暗色偏好生效，可以保留这组（可选） */
@media (prefers-color-scheme: dark) {
    #repute-list .repute-quote.prose mark,
    #repute-all-grid .repute-quote.prose mark {
        background-color: color-mix(in oklab, #fff 28%, var(--brand)) !important;
        box-shadow: inset 0 0 0 1px color-mix(in oklab, #fff 32%, transparent),
        0 0 0 2px rgba(255, 255, 255, .05);
    }
}

/* 脚注上标点击感（保留） */
.repute-quote.prose sup a {
    opacity: .95;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
}

/* === FIX: mobile 正圆头像（作用域只限 reputation 两个容器） === */

/* 1) 任何屏宽都把容器锁成正方形，禁止 Grid 拉伸 */
#repute-list .repute-card .repute-media,
#repute-all-grid .repute-card .repute-media {
    align-self: start !important; /* 别被 align-items: stretch 拉长 */
    justify-self: start !important;
    width: var(--repute-avatar) !important;
    height: var(--repute-avatar) !important;
    aspect-ratio: 1 / 1 !important; /* 容器强制正方 */
    border-radius: 50% !important;
    overflow: hidden !important;
    display: inline-flex !important; /* 防止块级元素在单列下被拉宽 */
}

/* 2) 头像图片 1:1 填充容器；覆盖 .media-fx / 全局 img 的宽高规则 */
#repute-list .repute-card .repute-media img,
#repute-all-grid .repute-card .repute-media img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

/* 3) 超小屏的尺寸（数值可按需调） */
@media (max-width: 520px) {
    #repute-list .repute-card .repute-media,
    #repute-all-grid .repute-card .repute-media {
        width: 56px !important;
        height: 56px !important;
    }
}

/* 4) 单列断点时，卡片自身也不要把子项撑开 */
@media (max-width: 520px) {
    #repute-list .repute-card,
    #repute-all-grid .repute-card {
        align-items: start !important; /* 禁止内部纵向拉伸 */
        justify-items: start !important; /* 禁止内部横向拉伸 */
    }
}

/* === Peer Recognition：头像正圆兜底（覆盖全局 4:3） === */
.repute-media {
    /* 防止被 grid 拉伸；锁定为正方形 */
    align-self: start;
    justify-self: start;
    width: var(--repute-avatar, 80px);
    height: var(--repute-avatar, 80px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
}

.repute-media img {
    /* 覆盖全局 img/avatar 的 height:auto 与 4:3 */
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* 窄屏更小的圆形尺寸（可按需调整） */
@media (max-width: 520px) {
    .repute-media {
        width: 56px !important;
        height: 56px !important;
    }
}

/* Fix: Peer Recognition avatar becomes oval on mobile */

/* 1) 禁止单列栅格把头像容器拉伸；容器与图片都锁定 1:1 */
#repute-list .repute-card .repute-media,
#repute-all-grid .repute-card .repute-media {
    align-self: start !important;
    justify-self: start !important; /* 关键：不随列宽拉伸 */
    width: var(--repute-avatar) !important;
    height: var(--repute-avatar) !important;
    aspect-ratio: 1 / 1 !important; /* 容器强制正方形 */
    border-radius: 50% !important;
    overflow: hidden !important;
    display: inline-flex !important; /* 进一步避免拉宽 */
}

/* 2) 图片填充容器，并覆盖全局 img 的宽高/比例规则 */
#repute-list .repute-card .repute-media img,
#repute-all-grid .repute-card .repute-media img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

/* 3) 单列断点下，整卡也不要把子项拉伸 */
@media (max-width: 520px) {
    #repute-list .repute-card,
    #repute-all-grid .repute-card {
        align-items: start !important;
        justify-items: start !important;
    }

    /* 若你想统一手机尺寸： */
    #repute-list .repute-card .repute-media,
    #repute-all-grid .repute-card .repute-media {
        width: 56px !important;
        height: 56px !important;
    }
}

/* === Peer Recognition: 更宽的卡片 & 5行后滚动 === */

/* 1) Home 与子页的 Peer Recognition 容器：强制 2 列（>=1100px），中小屏降为 1 列 */
#repute-list.grid.people,
#repute-all-grid.grid.people {
    grid-template-columns: repeat(1, minmax(460px, 1fr)) !important; /* 两列、每列最小 460px，卡更宽 */
    gap: 18px;
}

/* <= 1100px：一列展示，更易读 */
@media (max-width: 1100px) {
    #repute-list.grid.people,
    #repute-all-grid.grid.people {
        grid-template-columns: 1fr !important;
    }
}

/* 2) 卡片内正文区域：超过约 5 行后出现滚动条，保证同一行卡片等高 */
.repute-quote.prose {
    line-height: 1.55;
    max-height: 7.75em; /* 约5行（5 × 1.55em） */
    overflow: auto;
    padding-right: 4px; /* 给滚动条留点空间，避免遮字 */
    scrollbar-gutter: stable both-edges;
}

/* 让小段落之间紧凑些，减少“稀疏感” */
.repute-quote.prose p {
    margin: .4em 0;
}

/* 可选：滚动条美化（支持的浏览器会生效） */
.repute-quote.prose::-webkit-scrollbar {
    width: 8px;
}

.repute-quote.prose::-webkit-scrollbar-thumb {
    background: color-mix(in oklab, var(--text) 15%, transparent);
    border-radius: 8px;
}

/* Peer Recognition：修正手机端头像被拉伸变椭圆的问题 */

/* 1) 关闭整卡的默认拉伸，子项不再被横向撑宽 */
.repute-card {
    justify-items: start !important;
    align-items: start !important;
}

/* 2) 头像容器强制正方形，并禁止被 Grid 拉宽 */
.repute-card .repute-media {
    width: var(--repute-avatar) !important;
    height: var(--repute-avatar) !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    justify-self: start !important; /* 关键：不要 stretch */
    align-self: start !important;
}

/* 3) 覆盖 .media-fx > img 的通用拉伸，锁定 1:1 填充 */
.repute-card .repute-media > img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

/* 4) 极窄断点下的头像尺寸（你已有 56px，这里沿用并兜底） */
@media (max-width: 520px) {
    .repute-card .repute-media {
        width: 56px !important;
        height: 56px !important;
    }
}

/* ----- Peer Recognition: honors chips (new) ----- */
.repute-honors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 6px;
    padding: 0;
    list-style: none;
}

.repute-honors .chip--honor {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.loading-hint {
    font-size: 13px;
    color: var(--muted);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    background: color-mix(in oklab, var(--panel) 80%, transparent);
}


/* ===== 访问线路切换按钮 ===== */

.btn.route-switch {
    font-size: 0.9rem;
    padding-inline: 10px;
    border-radius: 999px;
    opacity: 0.85;
}


.btn.route-switch:hover {
    opacity: 1;
}

/* ===== 访问线路弹出菜单 ===== */
.route-popup {
    position: absolute;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 0;
    width: 190px;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
    z-index: 10000;
}

.route-popup.show {
    display: block;
}

.route-item {
    display: block;
    padding: 6px 14px;
    font-size: 0.88rem;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}

.route-item:hover {
    background: var(--panel-2);
}

/* ===== 访问线路切换按钮（Header） ===== */
.btn.route-switch {
    font-size: 0.9rem;
    padding-inline: 10px;
    border-radius: 999px;
    opacity: 0.85;
}

.btn.route-switch:hover {
    opacity: 1;
}

.route-label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.route-part {
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
}

/* 高亮当前线路：更醒目 */
.route-part.active {
    opacity: 1;
    font-weight: 600;
    transform: translateY(-0.5px);
    text-shadow: 0 0 6px color-mix(in oklab, var(--brand) 70%, transparent);
}

.route-slash {
    opacity: 0.7;
}

/* ===== 访问线路弹出菜单 ===== */
.route-popup {
    position: absolute;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 0;
    width: 210px;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    z-index: 10000;
}

.route-popup.show {
    display: block;
}

.route-item {
    display: block;
    padding: 6px 14px;
    font-size: 0.88rem;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}

.route-item:hover {
    background: var(--panel-2);
}

/* ===== Routes 按钮（Header） ===== */
.btn.route-switch {
    font-size: 0.9rem;
    padding-inline: 10px;
    border-radius: 999px;
    opacity: 0.85;
}

.btn.route-switch:hover {
    opacity: 1;
}

.route-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.route-icon {
    font-size: 0.95em;
    opacity: 0.85;
    transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}

.route-text {
    font-size: 0.9rem;
}

.route-caret {
    font-size: 0.8em;
    opacity: 0.7;
}

/* 在 .site 上：图标轻微偏红 / 更醒目 */
.route-switch.cn-active .route-icon {
    transform: translateY(-0.5px);
    text-shadow: 0 0 6px color-mix(in oklab, #ff4d4f 60%, transparent);
    color: color-mix(in oklab, #ff4d4f 60%, var(--text));
}

/* ===== 弹出菜单 ===== */
.route-popup {
    position: absolute;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 0;
    width: 230px;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    z-index: 10000;
}

.route-popup.show {
    display: block;
}

.route-item {
    display: block;
    padding: 6px 14px;
    font-size: 0.88rem;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}

.route-item:hover {
    background: var(--panel-2);
}
