/* ============================================================
   零维E界官网 · 3.0 布局
   - 给 /index.php 用（2026-12-06 上线），旧 index_2.4.2.css 只服务 index_old.php
   - 令牌沿用旧站的 --accent / --text-* / --danger 命名，
     这样正文里残留的行内 var(--xxx) 还能生效
   ============================================================ */

/* ---------- 令牌：浅色 ---------- */
:root {
    --accent: #00AAFF;
    --accent-hover: #33BBFF;
    --accent-pressed: #0099E6;
    --accent-soft: rgba(0, 170, 255, 0.10);
    --accent-2: #7C5CFF;
    --text-on-accent: #FFFFFF;

    --bg: #F2F5FA;
    --bg-layer: rgba(250, 252, 255, 0.72);
    --card-bg: #FFFFFF;
    --card-surface: rgba(255, 255, 255, 0.8);
    --card-hover: #F8FAFD;

    --text-primary: #101828;
    --text-secondary: #475467;
    --text-tertiary: #8A94A6;
    --text-invert: #FFFFFF;

    --stroke: rgba(16, 24, 40, 0.08);
    --stroke-strong: rgba(16, 24, 40, 0.14);

    --danger: #D92D20;
    --status-active: #12B76A;
    --status-active-pre: #00AAFF;
    --status-ended: #D92D20;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 10px 30px -18px rgba(16, 24, 40, 0.35);
    --shadow-lg: 0 24px 60px -32px rgba(16, 24, 40, 0.45);

    --radius: 18px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    --header-h: 64px;
    /* 顶栏顶部要让出的高度：系统安全区 + 启动器工具条 */
    --safe-top: env(safe-area-inset-top, 0px);
    --app-top: 0px;
    --wrap: 1440px;

    --ease: cubic-bezier(0.2, 0, 0, 1);
    --dur: 160ms;

    color-scheme: light;
}

/* ---------- 令牌：深色 ---------- */
body.dark {
    --accent: #38B6FF;
    --accent-hover: #66C7FF;
    --accent-pressed: #1FA6F0;
    --accent-soft: rgba(56, 182, 255, 0.14);
    --accent-2: #9B84FF;
    --text-on-accent: #04121E;

    --bg: #0C1016;
    --bg-layer: rgba(12, 16, 22, 0.76);
    --card-bg: #141A22;
    --card-surface: rgba(20, 26, 34, 0.8);
    --card-hover: #18202A;

    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.66);
    --text-tertiary: rgba(255, 255, 255, 0.42);
    --text-invert: #0C1016;

    --stroke: rgba(255, 255, 255, 0.09);
    --stroke-strong: rgba(255, 255, 255, 0.18);

    --danger: #FF7A70;
    --status-active: #4ADE80;
    --status-active-pre: #38B6FF;
    --status-ended: #F87171;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 24px 60px -32px rgba(0, 0, 0, 0.9);

    color-scheme: dark;
}

/* ---------- 基础 ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 18px);
    /* 移动端点击不再闪一层蓝灰色高亮，悬停/按下反馈由 :hover / :active 自己给 */
    -webkit-tap-highlight-color: transparent;
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI",
        "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg);
    background-image:
        radial-gradient(1200px 620px at 12% -8%, rgba(0, 170, 255, 0.14), transparent 62%),
        radial-gradient(900px 520px at 92% 4%, rgba(124, 92, 255, 0.10), transparent 60%),
        radial-gradient(900px 620px at 50% 110%, rgba(0, 170, 255, 0.07), transparent 65%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    border: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

p {
    margin: 8px 0;
    text-indent: 2em;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    line-height: 1.25;
}

::selection {
    background: rgba(0, 170, 255, 0.28);
}

/* 位图字体只用在序号/装饰上 */
@font-face {
    font-family: "fusion-pixel";
    src: url("/assets/FusionPixelMonoPatched.woff2") format("woff2");
    font-display: swap;
}

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    /* 刘海屏 / 挖孔屏：给状态栏留出空间，避免吸顶后被盖住半截 */
    height: calc(var(--header-h) + var(--safe-top) + var(--app-top));
    padding-top: calc(var(--safe-top) + var(--app-top));
    background: var(--bg-layer);
    border-bottom: 1px solid transparent;
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    transform: translateZ(0);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.topbar.scrolled {
    border-bottom-color: var(--stroke);
    box-shadow: 0 8px 24px -20px rgba(16, 24, 40, 0.6);
}

.topbar-in {
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: var(--wrap);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.02em;
}

.brand img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.5);
    /* 旧站彩蛋：logo 一直慢慢转，悬停时加速 */
    animation: logo-spin 60s linear infinite;
}

.brand:hover img {
    animation-duration: 0.3s;
}

@keyframes logo-spin {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.brand em {
    display: block;
    font-style: normal;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--text-tertiary);
    font-weight: 500;
    line-height: 1;
    margin-top: 2px;
}

.brand-txt {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.nav-main,
.nav-social {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-main a,
.nav-social a {
    padding: 7px 11px;
    border-radius: 9px;
    font-size: 13.5px;
    color: var(--text-secondary);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.nav-main a:hover,
.nav-social a:hover {
    color: var(--text-primary);
    background: var(--accent-soft);
}

.nav-main a.cur {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}

.nav-social {
    margin-left: auto;
}

.nav-social a {
    font-size: 12.5px;
    color: var(--text-tertiary);
}

.nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--stroke-strong);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 17px;
    cursor: pointer;
}

/* ---------- 首屏 ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 12px;
}

.eyebrow {
    margin: 0 0 10px;
    text-indent: 0;
    font-family: "fusion-pixel", Consolas, monospace;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--accent);
}

.hero h1 {
    font-size: clamp(40px, 6vw, 68px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    background: linear-gradient(120deg, var(--text-primary) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    margin: 16px 0 0;
    text-indent: 0;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--text-secondary);
}

/* 版本/规模这类信息用「文字 + 点分隔」，和下面的按钮区分开 */
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    margin-top: 20px;
    text-indent: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.hero-meta .dot {
    width: 7px;
    height: 7px;
    margin-right: 2px;
    border-radius: 50%;
    background: var(--status-active);
    box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.16);
}

.hero-meta .dot_pre {
    width: 7px;
    height: 7px;
    margin-right: 2px;
    border-radius: 50%;
    background: var(--status-active-pre);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.16);
}

.hero-meta i {
    font-style: normal;
    color: var(--text-tertiary);
    opacity: 0.55;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1px solid var(--stroke-strong);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
        border-color var(--dur) var(--ease), color var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease);
}

.btn:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0) scale(0.99);
}

.btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, #00AAFF, #2E7CF6 70%, #7C5CFF 130%);
    color: #fff;
    box-shadow: 0 14px 28px -16px rgba(0, 140, 255, 0.9);
}

.btn-primary:hover {
    color: #fff;
    filter: brightness(1.06);
    box-shadow: 0 18px 34px -16px rgba(0, 140, 255, 0.95);
}

.btn-lg {
    height: 48px;
    min-width: 184px;
    padding: 0 40px;
    border-radius: 14px;
    font-size: 16.5px;
}

.btn-lg span {
    font-family: Consolas, monospace;
    transition: transform var(--dur) var(--ease);
}

.btn-lg:hover span {
    transform: translateX(3px);
}

.btn-danger {
    color: var(--danger);
    border-color: var(--stroke-strong);
    border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.btn-danger:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(217, 45, 32, 0.08);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.hero-subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

/* 三个入口均分一行，各占三分之一；再用 max-width 兜住，大屏不会拉成长条 */
.hero-subnav > a,
.hero-subnav > .act-wrap {
    flex: 0 0 auto;
    width: calc((100% - 16px) / 3);
    min-width: 0;
    max-width: 190px;
    white-space: nowrap;
}

.hero-subnav > .act-wrap > button {
    width: 100%;
}

/* 次要入口：和主按钮同一套高度与圆角，只靠描边/底色区分层级 */
.hero-subnav > a,
.hero-subnav .act-wrap > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 48px;
    padding: 0 22px;
    border: 1px solid var(--stroke-strong);
    border-radius: 14px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font: inherit;
    font-size: 13.8px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
        background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.hero-subnav > a:hover,
.hero-subnav .act-wrap > button:hover,
.hero-subnav .act-wrap.open > button {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.hero-subnav .act-wrap > button::after {
    content: "";
    width: 0;
    height: 0;
    margin-left: 2px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.65;
}

.hero-dl {
    margin-top: 18px;
    text-indent: 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-tertiary);
}

.hero-dl b {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    font-size: 14px;
}

/* 活动下拉 */
.act-wrap {
    position: relative;
    display: inline-flex;
}

.act-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 40;
    display: none;
    min-width: 168px;
    padding: 8px;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
}

.act-menu.show {
    display: block;
    animation: pop-in 140ms var(--ease);
}

.act-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 9px;
    color: var(--text-secondary);
    font-size: 13.5px;
}

.act-menu a:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}

@keyframes pop-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* 首屏右侧视频 */
.hero-media {
    position: relative;
    justify-self: stretch;
}

.cover-frame {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-lg);
    background: #000;
    aspect-ratio: 16 / 9;
}

.cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.cover-hint {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(8, 12, 18, 0.55);
    color: #fff;
    font-size: 11.5px;
    letter-spacing: 0.02em;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.hero-media::after {
    content: "";
    position: absolute;
    /* 只贴在卡片下沿内侧，别再往外顶，否则窄屏会多出十几像素横向滚动 */
    inset: auto 0 0 24%;
    height: 40%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 170, 255, 0.34), transparent);
    filter: blur(24px);
    pointer-events: none;
}

/* ---------- 主体三栏 ---------- */
.page {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr) 318px;
    gap: 26px;
    align-items: start;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 12px;
}

.toc {
    position: sticky;
    top: calc(var(--header-h) + 22px);
    padding: 6px 0;
    font-size: 13px;
}

.toc-title {
    margin: 0 0 10px;
    padding-left: 12px;
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--text-tertiary);
    font-family: "fusion-pixel", Consolas, monospace;
}

.toc a {
    position: relative;
    display: block;
    padding: 7px 12px;
    border-radius: 9px;
    color: var(--text-secondary);
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.toc a::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 50%;
    width: 3px;
    height: 0;
    border-radius: 3px;
    background: var(--accent);
    transform: translateY(-50%);
    transition: height var(--dur) var(--ease);
}

.toc a:hover {
    color: var(--text-primary);
    background: var(--accent-soft);
}

.toc a.cur {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}

.toc a.cur::before {
    height: 16px;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.rail {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* ---------- 卡片 ---------- */
.card {
    padding: 26px 28px;
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    background: var(--card-surface);
    box-shadow: var(--shadow-sm);
}

.card + .card {
    margin-top: 0;
}

.sec-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
}

.sec-no {
    font-family: "fusion-pixel", Consolas, monospace;
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--accent);
    opacity: 0.85;
}

.sec-head h2 {
    font-size: 20px;
    letter-spacing: -0.01em;
}

.sec-head .sec-note {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.subhead {
    display: block;
    margin: 20px 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.subhead:first-child {
    margin-top: 0;
}

/* 正文排版 */
.prose {
    font-size: 14.5px;
    line-height: 1.95;
    color: var(--text-secondary);
}

.prose b {
    color: var(--accent);
    font-weight: 700;
}

.prose strong {
    color: var(--text-primary);
}

.prose a {
    padding: 0 2px;
    border-radius: 4px;
}

.prose a:hover {
    background: var(--accent-soft);
}

.prose img {
    display: block;
    width: 100%;
    height: auto;
    margin: 12px 0;
    border: 1px solid var(--stroke);
    border-radius: 12px;
}

.prose ol,
.prose ul {
    margin: 8px 0 8px 1.4em;
    padding-left: 1.1em;
}

.prose li {
    margin: 4px 0;
}

.prose li::marker {
    color: var(--accent);
}

.note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-tertiary);
}

.note-warn {
    color: var(--danger);
}

/* 配置表 */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--stroke);
    border-radius: 12px;
}

table.spec {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: center;
    white-space: nowrap;
}

table.spec th,
table.spec td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--stroke);
    color: var(--text-secondary);
}

table.spec thead th {
    font-size: 13px;
    color: var(--text-primary);
    background: rgba(0, 170, 255, 0.07);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}

table.spec tbody th {
    text-align: left;
    font-weight: 500;
    color: var(--text-tertiary);
}

table.spec tr:last-child th,
table.spec tr:last-child td {
    border-bottom: 0;
}

table.spec tbody tr:hover td,
table.spec tbody tr:hover th {
    background: rgba(0, 170, 255, 0.04);
    background: color-mix(in srgb, var(--accent) 4%, transparent);
}

/* 制作团队 */
.credit-line {
    margin: 2px 0;
    line-height: 2;
    font-size: 14px;
    color: var(--text-secondary);
}

.donate_vip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 12px 2px 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(252, 204, 0, 0.16), rgba(255, 136, 0, 0.16));
    color: #B45309;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.1;
    vertical-align: middle;
}

/* .prose b 会把颜色抢走，这里显式压回来 */
.prose b.donate_vip {
    color: #B45309;
}

.dark .donate_vip,
.dark .prose b.donate_vip {
    color: #FBBF24;
}

.donate_vip img {
    width: 15px;
    height: 15px;
    margin: 6px 0;
    display: block;
}

details#credits {
    margin-top: 10px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: rgba(0, 170, 255, 0.03);
    background: color-mix(in srgb, var(--accent) 3%, transparent);
}

details#credits summary {
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
}

details#credits summary::-webkit-details-marker {
    display: none;
}

details#credits summary::before {
    content: "▸";
    margin-right: 8px;
    color: var(--accent);
    display: inline-block;
    transition: transform var(--dur) var(--ease);
}

details#credits[open] summary::before {
    transform: rotate(90deg);
}

details#credits > div {
    padding: 0 14px 14px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-secondary);
    word-break: break-word;
}

/* 侧栏卡片 */
.rail-card {
    padding: 20px;
}

.rail-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 15px;
}

.rail-card h3::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 3px;
    background: linear-gradient(var(--accent), var(--accent-2));
}

/* 活动 BOSS */
#online_boss {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

.boss-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 0;
    color: var(--text-tertiary);
    font-size: 12.5px;
}

.boss-loading img {
    width: 120px;
    image-rendering: pixelated;
    opacity: 0.85;
}

.boss-item {
    padding: 14px;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 88%, var(--accent) 2%);
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.boss-item .boss-title {
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 700;
}

.boss-item ul {
    margin: 4px 0 8px;
    padding-left: 1.15em;
}

.boss-item li {
    margin: 3px 0;
}

.boss-item .k {
    color: var(--text-primary);
    font-weight: 600;
}

.boss-item .st {
    font-weight: 600;
}

.boss-item .st.on {
    color: var(--status-active);
}

.boss-item .st.off {
    color: var(--status-ended);
}

.boss-item .st.wait {
    color: var(--text-tertiary);
}

/* 视频列表 */
.vid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vid a {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 6px;
    border-radius: 12px;
    color: var(--text-primary);
    transition: background var(--dur) var(--ease);
}

.vid a:hover {
    background: var(--accent-soft);
}

.vid .thumb {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 16 / 9;
    background: #000;
}

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

.vid .t {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vid a:hover .t {
    color: var(--accent);
}

/* 快捷链接 */
.quick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.quick a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--stroke);
    border-radius: 11px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
        background var(--dur) var(--ease);
}

.quick a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.quick a.wide {
    grid-column: 1 / -1;
}

/* ---------- 页脚 ---------- */
.footer {
    margin-top: 10px;
    padding: 34px 24px 40px;
    background: #10141C;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12.5px;
    line-height: 1.9;
    text-align: center;
}

.footer a {
    color: rgba(255, 255, 255, 0.86);
}

.footer b {
    color: #fff;
}

/* ---------- 悬浮按钮 ---------- */
.corner_button {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 80;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--stroke-strong);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
        background var(--dur) var(--ease), visibility var(--dur);
}

.corner_button.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.corner_button:hover {
    background: var(--card-hover);
    color: var(--accent);
}

#theme {
    bottom: 70px;
    opacity: 1;
    visibility: visible;
    transform: none;
}

#theme img {
    width: 18px;
    height: 18px;
}

body.dark #theme img {
    filter: invert(1);
}

/* ---------- 移动端下载条 ---------- */
#downloadbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    /* 底部手势条 / 安全区，别让按钮被系统条压掉 */
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-layer);
    border-top: 1px solid var(--stroke);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    transform: translateZ(0);
}

/* 下载条出现时，给页面底部留出空间，别挡住页脚 */
body.has-dlbar {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
}

body.has-dlbar #gotop {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
}

body.has-dlbar #theme {
    bottom: calc(122px + env(safe-area-inset-bottom, 0px));
}

#downloadbar img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.down_title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.down_btn {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 16px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.down_close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 0;
    background: none;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
}

/* ---------- 启动器内嵌 ---------- */
body.in-launcher .footer,
body.in-launcher #theme,
body.in-launcher .hero-dl {
    display: none;
}

/* 启动器自己已经给状态栏留过位置了：关掉 safe-area，避免高度叠两次。
   顶部工具条的 40px 由 --app-top 控制，见 :root */
body.in-launcher {
    background-color: transparent;
    --safe-top: 0px;
}

/* ES家（eshome_pager）顶部有 40px 工具条盖在页面上：
   整块顶栏往下让 40px，背景一起盖住这条缝，展开菜单时高度仍能自动撑开 */
body.pager-shift {
    --app-top: 40px;
    /* 页面背景让出来，否则会盖住 App 的底 */
    background-image: none;
}

/* ---------- 断点 ---------- */
.sec-intro {
    margin: 0 0 16px;
    text-indent: 0;
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-secondary);
}
@media (max-width: 1280px) {
    .page {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .toc {
        display: none;
    }
}

@media (max-width: 960px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-media {
        order: -1;
        width: 100%;
        max-width: 820px;
        margin: 0 auto;
    }

    .hero h1 {
        font-size: clamp(36px, 9vw, 56px);
    }
}

@media (max-width: 960px) {
    .page {
        grid-template-columns: minmax(0, 1fr);
    }

    .rail {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    .rail .quick {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .nav-main,
    .nav-social {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* 展开时顶栏整体变高，两组链接依次排在品牌下面，不互相压盖 */
    .topbar.nav-open {
        height: auto;
        background: var(--card-bg);
        border-bottom-color: var(--stroke);
        box-shadow: var(--shadow-lg);
    }

    .topbar.nav-open .topbar-in {
        flex-wrap: wrap;
        height: auto;
        padding-bottom: 12px;
    }

    /* 展开后只把品牌这一行撑住原有高度；☰ 保持 38×38，别跟着变高 */
    .topbar.nav-open .brand {
        height: var(--header-h);
    }

    .topbar.nav-open .nav-main,
    .topbar.nav-open .nav-social {
        display: flex;
        flex: 1 1 100%;
        flex-wrap: wrap;
        gap: 4px;
        margin: 0;
        padding: 0;
        border: 0;
        background: none;
        box-shadow: none;
    }

    .topbar.nav-open .nav-main a,
    .topbar.nav-open .nav-social a {
        flex: 1 1 30%;
        padding: 9px 6px;
        text-align: center;
        background: var(--card-hover);
    }

    .topbar.nav-open .nav-social {
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid var(--stroke);
    }

    .card {
        padding: 20px;
    }

    .sec-head {
        flex-wrap: wrap;
    }

    .sec-head .sec-note {
        margin-left: 0;
        flex-basis: 100%;
    }
}

@media (max-width: 640px) {
    .topbar-in {
        padding-left: 14px;
        padding-right: 14px;
    }

    .hero-sub {
        font-size: 14.5px;
    }

    .hero-subnav > a,
    .hero-subnav .act-wrap > button {
        height: 48px;
        padding: 0 16px;
        font-size: 13px;
    }

    .rail {
        grid-template-columns: minmax(0, 1fr);
    }

    .card {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .prose {
        font-size: 14px;
        line-height: 1.9;
    }

    .vid a {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .corner_button {
        right: 12px;
        bottom: 16px;
    }

    #theme {
        bottom: 64px;
    }
}

/* 手机窄屏时按钮才铺满一行 */
@media (max-width: 560px) {
    .btn-lg {
        width: 100%;
    }

    .hero-cta .btn:not(.btn-primary) {
        flex: 1 1 44%;
    }
}

/* 减少动效 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}


/* ---------- 全屏预览 ---------- */
.fullview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    height: 100%;
    width: 100%;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.fullview .tip {
    position: fixed;
    top: 30px;
    left: 0;
    width: 100%;
    text-align: center;
    text-shadow: 0 0 8px #666;
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.fullview_img {
    width: 100%;
    height: 100%;
    display: flex;
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.fullview_img.dragging {
    cursor: grabbing;
}

.fullview_img img {
    width: 100%;
    height: auto;
    max-width: none;
    margin: auto;
    -webkit-user-drag: none;
    user-select: none;
}
.fullview_img img.zoom_added {
    width: 200%;
    height: auto;
}