/* ============================================================
   好学社团 · 皮肤「戏神 · 赤幕」
   Phase 1：页头 / 卡片 / 按钮 / 正文文字 / 首页组件
   ------------------------------------------------------------
   硬约束：除 .xi-seal（切换按钮本身）外，本文件禁止出现
   width/height/padding/margin/font-size/line-height/border-radius/
   top/left/right/bottom/display/flex/grid/position 等布局属性。
   只允许颜色类：color / background / border-color / box-shadow /
   opacity / background-image / outline-color 等。
   这样保证换肤前后「按钮布局完全不变」，切换无位移。
   ============================================================ */

/* ---------- 1. 切换印章（两套皮肤下都存在，故不加主题前缀） ---------- */
.xi-seal {
    flex: 0 0 auto;
    margin: 0 auto 0 10px;           /* ← 右侧 auto 吃掉剩余空间：钉在品牌右侧，导航零位移 */
    width: 28px;
    height: 28px;
    border-radius: 50%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, .9);
    background: #fff;
    color: #b01a10;
    font-size: 12px;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    transition: background .18s, color .18s, box-shadow .18s, transform .18s;
}
.xi-seal:hover { background: #fff1f0; transform: translateY(-1px); }
.xi-seal:active { transform: scale(.94); }
.xi-seal:focus-visible { outline: 2px solid #f0382c; outline-offset: 2px; }

/* 悬停气泡：未点击时显示「点了会切到的皮肤名」
   注意：必须横向排在按钮右侧——.site-header 的 backdrop-filter 会裁切后代，
   气泡若向下弹出会被页头下边界切掉。 */
.xi-seal::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-3px);
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    background: #1c1414;
    color: #f0e9e6;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s, transform .15s;
    z-index: 60;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.xi-seal:hover::after,
.xi-seal:focus-visible::after { opacity: 1; transform: translateY(-50%); }

/* 登录页没有页头，印章固定在右上角 */
.xi-seal-floating {
    position: fixed;
    top: 18px;
    right: 18px;
    margin: 0;
    z-index: 60;
}

/* ============================================================
   2. 「戏神 · 赤幕」深色皮肤 —— 仅覆盖颜色
   ============================================================ */
html[data-theme="xiqu"] {
    /* 复用原站变量名 → 自动吃掉 70 处 var(--orange*) 与全部玻璃组件 */
    --orange: #f0382c;
    --orange-dark: #ff6b5e;
    --orange-deep: #ff9b93;
    --orange-50: #1c1414;
    --orange-100: #2a1a18;
    --orange-200: #3a2420;
    --orange-300: #6b2a22;

    --text: #f0e9e6;
    --muted: #a89c98;

    --glass: rgba(28, 20, 20, .72);
    --glass-strong: rgba(38, 27, 26, .82);
    --glass-border: rgba(240, 56, 44, .20);
    --glass-shadow: 0 10px 34px rgba(0, 0, 0, .55);
    --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .06);

    /* 皮肤自有 token */
    --xq-bg-0: #16100f;
    --xq-bg-1: #0c0909;
    --xq-line: rgba(240, 56, 44, .18);
    --xq-line-strong: rgba(240, 56, 44, .38);
    --xq-gold: #d4a03c;
    --xq-crimson: #c8102e;
    --xq-panel: rgba(28, 20, 20, .55);

    /* 内页控件（表单/表格/卡片） */
    --xq-field: #2a1a18;
    --xq-field-2: #33201d;
    --xq-head: #3a2420;
    --xq-hair: rgba(240, 56, 44, .14);

    color-scheme: dark;
}

/* ---- 2.1 页面底色：灰界 + 赤色流星 + 两点赤色光斑 ---- */
html[data-theme="xiqu"] body {
    background-image:
        /* 赤色流星：自右上斜切而下的一束赤光 */
        linear-gradient(198deg,
            rgba(240, 56, 44, .13) 0%,
            rgba(240, 56, 44, .045) 17%,
            rgba(240, 56, 44, 0) 33%),
        linear-gradient(135deg, #16100f 0%, #100c0c 45%, #0c0909 100%);
    background-attachment: fixed;
}
html[data-theme="xiqu"] body::before {
    background: radial-gradient(circle, rgba(240, 56, 44, .34), transparent 70%);
    opacity: .55;
}
html[data-theme="xiqu"] body::after {
    background: radial-gradient(circle, rgba(200, 16, 46, .30), transparent 70%);
    opacity: .5;
}
html[data-theme="xiqu"] ::selection { background: rgba(240, 56, 44, .32); color: #fff; }

/* ---- 2.2 顶栏：暗玻璃 + 顶部 2px 幕布线（用 inset 阴影，不占布局高度） ---- */
html[data-theme="xiqu"] .site-header {
    background: rgba(20, 16, 15, .82);
    border-bottom-color: var(--xq-line-strong);
    color: #f0e9e6;
    box-shadow: inset 0 2px 0 0 var(--xq-crimson), 0 4px 20px rgba(0, 0, 0, .5);
}
html[data-theme="xiqu"] .site-header a { color: #f0e9e6; }
html[data-theme="xiqu"] .site-header a:hover { background: rgba(240, 56, 44, .16); }
html[data-theme="xiqu"] .site-header .nav a.is-active {
    background: rgba(240, 56, 44, .20);
    color: #f0e9e6 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
html[data-theme="xiqu"] .site-header .nav a.is-active:hover { background: rgba(240, 56, 44, .30); }

/* 当前页气泡统一朱红（原站每个路由一个彩虹色，深色下会脏） */
html[data-theme="xiqu"] .site-header .nav a.is-active .nav-bubble,
html[data-theme="xiqu"] .site-header a[data-route="home"].is-active .nav-bubble,
html[data-theme="xiqu"] .site-header a[data-route="news"].is-active .nav-bubble,
html[data-theme="xiqu"] .site-header a[data-route="knowledge"].is-active .nav-bubble,
html[data-theme="xiqu"] .site-header a[data-route="exercise_list"].is-active .nav-bubble,
html[data-theme="xiqu"] .site-header a[data-route="exercise_import"].is-active .nav-bubble,
html[data-theme="xiqu"] .site-header a[data-route="member_list"].is-active .nav-bubble,
html[data-theme="xiqu"] .site-header a[data-route="profile"].is-active .nav-bubble,
html[data-theme="xiqu"] .site-header a[data-route="contact"].is-active .nav-bubble,
html[data-theme="xiqu"] .site-header a[data-route="logout"].is-active .nav-bubble {
    --bc: #f0382c;
}

/* 印章在戏神态：实心（表示当前已启用） */
html[data-theme="xiqu"] .xi-seal {
    background: #b01a10;
    color: #fff1f0;
    border-color: #f0382c;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, .18);
}
html[data-theme="xiqu"] .xi-seal:hover { background: #c8102e; }

/* ---- 2.3 文字与链接 ---- */
html[data-theme="xiqu"] body { color: var(--text); }
html[data-theme="xiqu"] h1,
html[data-theme="xiqu"] h2,
html[data-theme="xiqu"] h3 { color: #f0e9e6; }
html[data-theme="xiqu"] h1 { color: #f3ece9; }
html[data-theme="xiqu"] a { color: #ff6b5e; }
html[data-theme="xiqu"] a:hover { color: #ff9b93; }
html[data-theme="xiqu"] .guide { color: var(--muted); }
html[data-theme="xiqu"] .guide code {
    background: rgba(240, 56, 44, .14);
    color: #ffc2bd;
}
html[data-theme="xiqu"] .empty-state { color: var(--muted); }
html[data-theme="xiqu"] .meta { color: var(--muted); }

/* ---- 2.4 玻璃卡片 ---- */
html[data-theme="xiqu"] .card {
    background: rgba(32, 23, 22, .78);
    border-color: var(--xq-line);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
}
html[data-theme="xiqu"] .alert {
    background: rgba(240, 56, 44, .12);
    color: #ffc2bd;
    border-color: rgba(240, 56, 44, .30);
}
html[data-theme="xiqu"] .error {
    background: rgba(240, 56, 44, .14);
    color: #ff9b93;
}

/* ---- 2.5 按钮：布局完全沿用原站，只换色 ---- */
html[data-theme="xiqu"] .btn {
    background: linear-gradient(135deg, #f0382c, #b01a10);
    border-color: rgba(255, 255, 255, .18);
    box-shadow: 0 4px 14px rgba(200, 16, 46, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
}
html[data-theme="xiqu"] .btn:hover { filter: brightness(1.08); }
html[data-theme="xiqu"] .btn-ghost {
    background: rgba(28, 20, 20, .55);
    color: #ff9b93;
    border-color: rgba(240, 56, 44, .45);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}
html[data-theme="xiqu"] .btn-ghost:hover {
    background: rgba(240, 56, 44, .16);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
}
html[data-theme="xiqu"] .btn-danger {
    background: linear-gradient(135deg, #c8102e, #8a1710);
    border-color: #8a1710;
    box-shadow: 0 4px 14px rgba(200, 16, 46, .35);
}
html[data-theme="xiqu"] .btn-danger:hover { background: #a30d24; }
html[data-theme="xiqu"] .btn-ghost.btn:disabled,
html[data-theme="xiqu"] .btn-ghost.btn[disabled] {
    background: rgba(28, 20, 20, .45);
    color: var(--muted);
    border-color: rgba(240, 56, 44, .20);
}

/* ---- 2.6 首页：标签页 / 学科 chip / 计数徽标 ---- */
html[data-theme="xiqu"] .news-tab:hover {
    color: #ff9b93;
    background: rgba(240, 56, 44, .12);
}
html[data-theme="xiqu"] .news-tab.active {
    color: #ffc2bd;
    background: rgba(240, 56, 44, .20);
}
html[data-theme="xiqu"] .subject-tabs {
    background: rgba(28, 20, 20, .55);
    border-bottom-color: var(--xq-line);
}
html[data-theme="xiqu"] .subject-tab:hover {
    color: #ff9b93;
    background: rgba(240, 56, 44, .12);
}
html[data-theme="xiqu"] .subject-tab.active {
    background: rgba(240, 56, 44, .20);
    color: #ffc2bd;
    border-color: rgba(240, 56, 44, .28);
    border-bottom-color: rgba(240, 56, 44, .20);
}
html[data-theme="xiqu"] .subject-chip {
    background: rgba(36, 24, 22, .72);
    border-color: rgba(240, 56, 44, .24);
    color: #ff9b93;
}
html[data-theme="xiqu"] .subject-chip:hover {
    background: rgba(240, 56, 44, .18);
    border-color: var(--xq-line-strong);
}
html[data-theme="xiqu"] .subject-count {
    background: rgba(240, 56, 44, .30);
    color: #ffd0cb;
}
/* 激活标签本身已是赤色底，徽标改成浅章（避免红压红看不出数字） */
html[data-theme="xiqu"] .subject-tab.active .subject-count {
    background: #fff1f0;
    color: #8a1710;
}
html[data-theme="xiqu"] .count-badge {
    background: rgba(240, 56, 44, .22);
    color: #ffc2bd;
}
html[data-theme="xiqu"] .exercise-item { border-bottom-color: rgba(240, 56, 44, .16); }
html[data-theme="xiqu"] .stat {
    background: rgba(36, 24, 22, .70);
    border-color: rgba(240, 56, 44, .22);
}
html[data-theme="xiqu"] .stat .v { color: #ff9b93; }
html[data-theme="xiqu"] .stat.ok .v { color: #3fb950; }
html[data-theme="xiqu"] .stat.bad .v { color: #f0382c; }
html[data-theme="xiqu"] .rate-bar { background: rgba(240, 56, 44, .16); }
html[data-theme="xiqu"] .rate-fill { background: linear-gradient(90deg, #f0382c, #6b2a22); }

/* ---- 2.7 页脚：戏台帷幕（顶部竖向褶纹，纯背景层不占位） ---- */
html[data-theme="xiqu"] .site-footer {
    background-image:
        repeating-linear-gradient(90deg,
            rgba(200, 16, 46, .30) 0 1px,
            rgba(200, 16, 46, 0) 1px 12px),
        linear-gradient(180deg, rgba(240, 56, 44, .12), rgba(16, 12, 11, 0) 46%);
    background-repeat: no-repeat;
    background-size: 100% 8px, 100% 100%;
    background-position: top, top;
    background-color: rgba(16, 12, 11, .78);
    border-top-color: rgba(200, 16, 46, .55);
    color: var(--muted);
}
html[data-theme="xiqu"] .site-footer .beian-links a {
    color: var(--muted);
    border-bottom-color: rgba(240, 56, 44, .30);
}
html[data-theme="xiqu"] .site-footer .beian-links a:hover {
    color: #ff6b5e;
    border-bottom-color: #ff6b5e;
}

/* ============================================================
   3. 内页组件（Phase 2）：表单 / 表格 / 日志卡 / 标签 / 练习 / 答卷 / 登录页
   ------------------------------------------------------------
   本节同样只写颜色，不含布局属性。
   ============================================================ */

/* ---- 3.1 表单控件：全站 input/select/textarea 转暗底 ---- */
html[data-theme="xiqu"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]),
html[data-theme="xiqu"] select,
html[data-theme="xiqu"] textarea {
    background: var(--xq-field) !important;
    color: #f0e9e6 !important;
    border-color: rgba(240, 56, 44, .30) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04) !important;
}
html[data-theme="xiqu"] input:not([type="checkbox"]):not([type="radio"]):focus,
html[data-theme="xiqu"] select:focus,
html[data-theme="xiqu"] textarea:focus {
    border-color: #f0382c !important;
    box-shadow: 0 0 0 3px rgba(240, 56, 44, .18) !important;
}
html[data-theme="xiqu"] ::placeholder { color: rgba(240, 233, 230, .34); }
html[data-theme="xiqu"] select option { background: var(--xq-field); color: #f0e9e6; }
html[data-theme="xiqu"] input[type="checkbox"],
html[data-theme="xiqu"] input[type="radio"] { accent-color: #f0382c; }
/* Chrome 自动填充会把深色输入框刷成亮黄白底，必须压掉 */
html[data-theme="xiqu"] input:-webkit-autofill,
html[data-theme="xiqu"] input:-webkit-autofill:hover,
html[data-theme="xiqu"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f0e9e6;
    -webkit-box-shadow: 0 0 0 1000px var(--xq-field) inset !important;
    caret-color: #f0e9e6;
}
html[data-theme="xiqu"] .field-label,
html[data-theme="xiqu"] .setup-label,
html[data-theme="xiqu"] .filter-label,
html[data-theme="xiqu"] .sort-label,
html[data-theme="xiqu"] .profile-section-label,
html[data-theme="xiqu"] .group-title { color: #ffc2bd; }
html[data-theme="xiqu"] .field-help,
html[data-theme="xiqu"] .field-body { color: var(--muted); }
html[data-theme="xiqu"] .field-error { color: #ff6b5e; }
html[data-theme="xiqu"] .msec-divider { border-top-color: rgba(240, 56, 44, .22); }
html[data-theme="xiqu"] .msec-divider span { background: #16100f; color: var(--muted); }
html[data-theme="xiqu"] .form-error-banner { background: rgba(240, 56, 44, .14); color: #ff9b93; }

/* ---- 3.2 表格：mtable / dtable / ltable / rank-table / log-table ---- */
html[data-theme="xiqu"] .mtable,
html[data-theme="xiqu"] .dtable,
html[data-theme="xiqu"] .ltable,
html[data-theme="xiqu"] .rank-table {
    background: rgba(30, 21, 20, .92) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35) !important;
}
html[data-theme="xiqu"] .mtable th,
html[data-theme="xiqu"] .dtable th,
html[data-theme="xiqu"] .ltable th,
html[data-theme="xiqu"] .rank-table th {
    background: var(--xq-head) !important;
    color: #ffc2bd !important;
    border-bottom-color: var(--xq-hair) !important;
}
html[data-theme="xiqu"] .mtable td,
html[data-theme="xiqu"] .dtable td,
html[data-theme="xiqu"] .ltable td,
html[data-theme="xiqu"] .rank-table td {
    color: var(--text) !important;
    border-bottom-color: var(--xq-hair) !important;
}
html[data-theme="xiqu"] .mtable tr:hover td,
html[data-theme="xiqu"] .dtable tr:hover td,
html[data-theme="xiqu"] .ltable tr:hover td,
html[data-theme="xiqu"] .rank-table tr:hover td { background: rgba(240, 56, 44, .08); }
html[data-theme="xiqu"] .rank-table th.col-rank,
html[data-theme="xiqu"] .rank-table th.col-num { color: #ffc2bd; }

/* ---- 3.3 会员管理的日志卡（首页 profile 一排三块）---- */
html[data-theme="xiqu"] .log-card {
    background: rgba(30, 21, 20, .92) !important;
    border-color: var(--xq-hair) !important;
}
html[data-theme="xiqu"] .log-head {
    background: var(--xq-head) !important;
    color: #ffc2bd !important;
    border-bottom-color: var(--xq-hair) !important;
}
html[data-theme="xiqu"] .log-table th {
    background: #32201d !important;
    color: #ffc2bd !important;
    border-bottom-color: var(--xq-hair) !important;
}
html[data-theme="xiqu"] .log-table td {
    color: var(--text) !important;
    border-bottom-color: var(--xq-hair) !important;
}
html[data-theme="xiqu"] .log-scroll::-webkit-scrollbar-thumb { background: rgba(240, 56, 44, .35); }
html[data-theme="xiqu"] .log-empty { color: var(--muted); }

/* ---- 3.4 标签徽标 ---- */
html[data-theme="xiqu"] .grade-tag {
    background: rgba(240, 56, 44, .14) !important;
    color: #ffc2bd !important;
    border-color: rgba(240, 56, 44, .26) !important;
}
html[data-theme="xiqu"] .tag-single,
html[data-theme="xiqu"] .tag-multiple,
html[data-theme="xiqu"] .tag-fill {
    background: rgba(240, 56, 44, .16) !important;
    color: #ffc2bd !important;
}
html[data-theme="xiqu"] .tag-subjective,
html[data-theme="xiqu"] .tag-orange {
    background: rgba(212, 160, 60, .16) !important;
    color: #e8bd6a !important;
}
html[data-theme="xiqu"] .reason-chip {
    background: rgba(240, 56, 44, .16) !important;
    color: #ff9b93 !important;
}
html[data-theme="xiqu"] .reason-tag { background: rgba(240, 56, 44, .14); color: #ffc2bd; }
html[data-theme="xiqu"] .reason-stats { color: var(--muted); }
html[data-theme="xiqu"] .validity-tag {
    background: rgba(240, 56, 44, .16) !important;
    color: #ff9b93 !important;
}
html[data-theme="xiqu"] .validity-tag.expired {
    background: rgba(200, 16, 46, .22) !important;
    color: #ff8b80 !important;
}
html[data-theme="xiqu"] .pill.ok { background: rgba(63, 185, 80, .18); color: #56d364; }
html[data-theme="xiqu"] .pill.fail { background: rgba(240, 56, 44, .20); color: #ff8b80; }
html[data-theme="xiqu"] .blank-tag { background: rgba(240, 56, 44, .14); color: #ffc2bd; }
html[data-theme="xiqu"] .blank-cell { border-color: rgba(240, 56, 44, .28); }
html[data-theme="xiqu"] .blank-correct-list { color: #56d364; }
html[data-theme="xiqu"] .grade-tags { color: var(--muted); }

/* ---- 3.5 选择卡：练习设置里的学科/模式 ---- */
html[data-theme="xiqu"] .subject-radio,
html[data-theme="xiqu"] .mode-radio {
    background: rgba(38, 26, 24, .72) !important;
    border-color: rgba(240, 56, 44, .26) !important;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .subject-radio:hover,
html[data-theme="xiqu"] .mode-radio:hover {
    background: rgba(240, 56, 44, .14) !important;
    border-color: rgba(240, 56, 44, .45) !important;
}
html[data-theme="xiqu"] .subject-radio:has(input:checked),
html[data-theme="xiqu"] .mode-radio:has(input:checked) {
    background: rgba(240, 56, 44, .20) !important;
    border-color: #f0382c !important;
}
html[data-theme="xiqu"] .setup-group .meta,
html[data-theme="xiqu"] .practice-setup .meta { color: var(--muted); }

/* ---- 3.6 题目与练习 ---- */
html[data-theme="xiqu"] .exercise-body,
html[data-theme="xiqu"] .exercise-answer {
    background: rgba(38, 26, 24, .72) !important;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .answer-box,
html[data-theme="xiqu"] .answer-box-inline {
    background: rgba(240, 56, 44, .10) !important;
    border-color: rgba(240, 56, 44, .24) !important;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .quiz-options li label {
    background: rgba(38, 26, 24, .72) !important;
    border-color: rgba(240, 56, 44, .20) !important;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .quiz-options li label:hover { background: rgba(240, 56, 44, .14); }
html[data-theme="xiqu"] .quiz-options li label.is-correct { background: rgba(63, 185, 80, .16); }
html[data-theme="xiqu"] .quiz-options li label.is-wrong { background: rgba(240, 56, 44, .18); }
html[data-theme="xiqu"] .wrong-ans { color: #ff8b80; }
html[data-theme="xiqu"] .wrong-q,
html[data-theme="xiqu"] .wrong-q-body { color: var(--text); }
html[data-theme="xiqu"] .wrong-meta { color: var(--muted); }
html[data-theme="xiqu"] .result-card,
html[data-theme="xiqu"] .feedback-card { color: var(--text); }
/* 黑板（答题页）改「灰界戏台」：深丹底 + 木框 */
html[data-theme="xiqu"] .chalkboard {
    background: linear-gradient(160deg, #2a1512, #1a0f0e 70%) !important;
    border-color: #6b2a22 !important;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, .6), 0 10px 30px rgba(0, 0, 0, .5) !important;
}
html[data-theme="xiqu"] .chalkboard h1 { color: #ffd8d2; }
html[data-theme="xiqu"] .chalkboard .quiz-options li label { background: rgba(255, 255, 255, .05); }
html[data-theme="xiqu"] .chalkboard .quiz-options li label b { color: #e8bd6a; }

/* ---- 3.7 试卷答卷：错题卡 / 试卷卡 / 上传区 ---- */
html[data-theme="xiqu"] .exam-wrong-card {
    background: rgba(30, 21, 20, .92) !important;
    border-color: rgba(240, 56, 44, .24) !important;
}
html[data-theme="xiqu"] .exam-wrong-head {
    background: var(--xq-head) !important;
    color: #ffc2bd !important;
    border-color: rgba(240, 56, 44, .24) !important;
}
html[data-theme="xiqu"] .exam-wrong-count { color: #ff9b93; }
html[data-theme="xiqu"] .sheet-card,
html[data-theme="xiqu"] .sheet-thumb,
html[data-theme="xiqu"] .sheet-card-wrap { background: rgba(30, 21, 20, .92); }
html[data-theme="xiqu"] .sheet-card-title { color: var(--text); }
html[data-theme="xiqu"] .sheet-card-meta { color: var(--muted); }
html[data-theme="xiqu"] .sheet-norender { color: var(--muted); }
html[data-theme="xiqu"] .sheet-grade-panel { background: rgba(30, 21, 20, .85); }
html[data-theme="xiqu"] .sheet-grade-head { color: #ffc2bd; }
html[data-theme="xiqu"] .sheet-annotation { color: var(--text); }
html[data-theme="xiqu"] .upload-grid .meta { color: var(--muted); }
html[data-theme="xiqu"] .dropzone {
    background: rgba(38, 26, 24, .6) !important;
    border-color: rgba(240, 56, 44, .35) !important;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .dropzone-icon { color: #ff9b93; }
html[data-theme="xiqu"] .dropzone-title { color: #ffc2bd; }
html[data-theme="xiqu"] .dropzone-hint { color: var(--muted); }
/* PDF / Excel 预览保持白纸黑字（反色会毁掉可读性），只改外框 */
html[data-theme="xiqu"] .pdf-canvas,
html[data-theme="xiqu"] .xlsx-sheet { background: #fff; color: #111; }
html[data-theme="xiqu"] .preview-bar,
html[data-theme="xiqu"] .preview-head { background: rgba(30, 21, 20, .95); color: var(--text); }
html[data-theme="xiqu"] .preview-dialog { background: rgba(24, 17, 16, .98); }
html[data-theme="xiqu"] .preview-pager button { background: rgba(240, 56, 44, .14); color: #ffc2bd; }
html[data-theme="xiqu"] .xlsx-tabs,
html[data-theme="xiqu"] .xlsx-tab { background: rgba(30, 21, 20, .95); color: var(--text); }

/* ---- 3.8 导入页（模板内联样式，需 !important 抢优先级）---- */
html[data-theme="xiqu"] .upload-card {
    background: linear-gradient(180deg, #231615 0%, #1c1211 100%) !important;
    border-color: rgba(240, 56, 44, .28) !important;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .45) !important;
}
html[data-theme="xiqu"] .upload-card h1 { color: #ffc2bd !important; }
html[data-theme="xiqu"] .upload-hint {
    background: rgba(240, 56, 44, .12) !important;
    border-left-color: #f0382c !important;
    color: #ffd0cb !important;
}
html[data-theme="xiqu"] .upload-hint b { color: #ff9b93 !important; }
html[data-theme="xiqu"] .meta-fields {
    background: rgba(38, 26, 24, .82) !important;
    border-color: rgba(240, 56, 44, .26) !important;
}
html[data-theme="xiqu"] .meta-fields label { color: #ffc2bd !important; }
html[data-theme="xiqu"] .meta-fields select {
    background: var(--xq-field) !important;
    color: #f0e9e6 !important;
    border-color: rgba(240, 56, 44, .32) !important;
}
html[data-theme="xiqu"] .upload-area {
    background: rgba(240, 56, 44, .06) !important;
    border-color: rgba(240, 56, 44, .38) !important;
}
html[data-theme="xiqu"] .upload-area-label { color: #ffc2bd !important; }
html[data-theme="xiqu"] .upload-area-tip { color: var(--muted) !important; }
html[data-theme="xiqu"] .file-native {
    background: var(--xq-field) !important;
    border-color: #f0382c !important;
    color: #ff9b93 !important;
}
html[data-theme="xiqu"] .file-native:hover { background: rgba(240, 56, 44, .14) !important; }
html[data-theme="xiqu"] .upload-card .file-list {
    background: rgba(38, 26, 24, .82) !important;
    border-color: rgba(240, 56, 44, .24) !important;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .upload-card .file-list h4 { color: #ffc2bd !important; }
html[data-theme="xiqu"] .upload-card .file-list .meta { color: var(--muted) !important; }
html[data-theme="xiqu"] .upload-card a,
html[data-theme="xiqu"] .format-note a { color: #ff9b93 !important; }
html[data-theme="xiqu"] .format-note {
    background: rgba(38, 26, 24, .6) !important;
    color: #b8aaa6 !important;
}
html[data-theme="xiqu"] .format-note b { color: #ff9b93 !important; }
html[data-theme="xiqu"] .upload-actions button {
    background: linear-gradient(135deg, #f0382c, #b01a10) !important;
    box-shadow: 0 4px 14px rgba(200, 16, 46, .38) !important;
}
html[data-theme="xiqu"] .error {
    color: #ff9b93 !important;
    background: rgba(240, 56, 44, .14) !important;
}

/* ---- 3.9 列表容器 ---- */
html[data-theme="xiqu"] .file-list,
html[data-theme="xiqu"] .problem-item,
html[data-theme="xiqu"] .knowledge-card,
html[data-theme="xiqu"] .sheet-card {
    background: rgba(30, 21, 20, .9) !important;
    border-color: var(--xq-hair) !important;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .file-title a { color: #ff9b93; }
html[data-theme="xiqu"] .file-meta { color: var(--muted); }
html[data-theme="xiqu"] .file-item { border-bottom-color: var(--xq-hair); }
html[data-theme="xiqu"] .problem-title { color: var(--text); }
html[data-theme="xiqu"] .problem-meta,
html[data-theme="xiqu"] .problem-note { color: var(--muted); }
html[data-theme="xiqu"] .home-knowledge li { border-bottom-color: var(--xq-hair); }
html[data-theme="xiqu"] .news-item { border-bottom-color: var(--xq-hair); }
html[data-theme="xiqu"] .batch-bar {
    background: rgba(30, 21, 20, .95) !important;
    border-color: rgba(240, 56, 44, .28) !important;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .batch-hint { color: var(--muted); }
html[data-theme="xiqu"] .filter-card { background: transparent; }

/* ---- 3.10 排序 / 分页 / 榜单切换 ---- */
html[data-theme="xiqu"] .sort-group {
    background: rgba(38, 26, 24, .78) !important;
    border-color: rgba(240, 56, 44, .22) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3) !important;
}
html[data-theme="xiqu"] .sort-btn { color: var(--muted); }
html[data-theme="xiqu"] .sort-btn.active { background: rgba(240, 56, 44, .22); color: #ffc2bd; }
html[data-theme="xiqu"] .rank-tab {
    background: rgba(38, 26, 24, .78) !important;
    color: #c9b8b4 !important;
    border-color: rgba(240, 56, 44, .22) !important;
}
html[data-theme="xiqu"] .rank-tab.active {
    background: linear-gradient(135deg, #f0382c, #b01a10) !important;
    color: #fff1f0 !important;
    border-color: transparent !important;
}
html[data-theme="xiqu"] .rank-switch { background: rgba(38, 26, 24, .7); }
html[data-theme="xiqu"] .rank-mini { color: var(--muted); }
html[data-theme="xiqu"] .pager a,
html[data-theme="xiqu"] .pager span {
    background: rgba(38, 26, 24, .78) !important;
    border-color: rgba(240, 56, 44, .22) !important;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .pager .current { background: #b01a10 !important; color: #fff1f0 !important; }

/* 榜单前三名：原站是白/米色渐变，深色主题下会变成「白底浅字」，必须整行改暗 */
html[data-theme="xiqu"] .rank-table tbody tr.top3 {
    background: linear-gradient(90deg, rgba(212, 160, 60, .18), rgba(212, 160, 60, .03)) !important;
}
html[data-theme="xiqu"] .rank-table tbody tr.top3 td { color: #e8bd6a !important; }
html[data-theme="xiqu"] .rank-mini li.top3 {
    background: linear-gradient(90deg, rgba(212, 160, 60, .16), rgba(212, 160, 60, .02)) !important;
}
html[data-theme="xiqu"] .rank-mini .nm { color: #e8d6d2 !important; }
html[data-theme="xiqu"] .rank-mini li.top3 .nm { color: #e8bd6a !important; }
html[data-theme="xiqu"] .rank-mini .vl { color: var(--muted) !important; }
html[data-theme="xiqu"] .rank-mini li { border-bottom-color: var(--xq-hair) !important; }
html[data-theme="xiqu"] .rank-panel h3 { color: #ffc2bd !important; }
html[data-theme="xiqu"] .rank-more { color: #ff9b93 !important; }

/* 新闻分类胶囊：原站 #fff 底 + 深橘字 */
html[data-theme="xiqu"] .kind-tabs a {
    background: rgba(38, 26, 24, .78) !important;
    color: #ffc2bd !important;
    border-color: rgba(240, 56, 44, .24) !important;
}
html[data-theme="xiqu"] .kind-tabs a.active {
    background: linear-gradient(135deg, #f0382c, #b01a10) !important;
    color: #fff1f0 !important;
    border-color: transparent !important;
}
html[data-theme="xiqu"] .btn-add {
    background: linear-gradient(135deg, #f0382c, #b01a10) !important;
    color: #fff1f0 !important;
}

/* 代码片段（说明里的 1. / A. / 答案： 之类） */
html[data-theme="xiqu"] code {
    background: rgba(240, 56, 44, .14) !important;
    color: #ffc2bd !important;
}

/* ---- 3.11 登录 / 注册页（独立模板，不继承 base）---- */
html[data-theme="xiqu"] .auth-body {
    background-image:
        linear-gradient(198deg, rgba(240, 56, 44, .13) 0%, rgba(240, 56, 44, .045) 17%, rgba(240, 56, 44, 0) 33%),
        linear-gradient(135deg, #16100f 0%, #100c0c 45%, #0c0909 100%);
    background-attachment: fixed;
    color: var(--text) !important;
}
html[data-theme="xiqu"] .auth-login {
    background: rgba(32, 23, 22, .92) !important;
    border-color: rgba(240, 56, 44, .24) !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .6) !important;
}
html[data-theme="xiqu"] .auth-login .brand-center { color: #ff9b93; }
html[data-theme="xiqu"] .auth-login h1 { color: #f3ece9; }
html[data-theme="xiqu"] .auth-body .card { border-color: rgba(240, 56, 44, .22); }
html[data-theme="xiqu"] .auth-body .meta { color: var(--muted); }
html[data-theme="xiqu"] .auth-body .lock-banner,
html[data-theme="xiqu"] .auth-body .locked-hint { color: var(--muted); }
html[data-theme="xiqu"] .back-link { color: #ff9b93; }

/* ---- 3.12 移动端抽屉（PC 下 display:none，不影响桌面）---- */
html.is-mobile[data-theme="xiqu"] .nav-drawer {
    background: #16100f !important;
    border-top-color: rgba(240, 56, 44, .28) !important;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .55) !important;
}
html.is-mobile[data-theme="xiqu"] .nav-drawer a {
    color: #f0e9e6 !important;
    border-bottom-color: rgba(240, 56, 44, .16) !important;
}
html.is-mobile[data-theme="xiqu"] .nav-burger { color: #f0e9e6; }
html.is-mobile[data-theme="xiqu"] .nav-drawer a:hover { background: rgba(240, 56, 44, .14); }

/* ============================================================
   4. 标志性视觉符号（装饰层）
   ------------------------------------------------------------
   本节只作用于「新增的装饰元素」与纯背景层，不参与任何既有
   元素的位置计算。校验「换肤零位移」时应先剥离本节：

     sed '/标志性视觉符号/,$d' static/css/skin-xiqu.css \
       | grep -nE '^\s*(width|height|padding|margin|font-size|line-height|border-radius|top|left|right|bottom|display|flex|grid|position)\s*:'

   本节内所有偏移量都属于新元素自身，改它不会推动任何既有内容。
   ============================================================ */

/* 3.1 页头「戏神徽记」：脸谱暗纹压在暗玻璃里（绝对定位伪元素，不参与布局） */
html[data-theme="xiqu"] .site-header::after {
    content: "";
    position: absolute;
    left: calc(50% - 300px);
    top: 50%;
    width: 52px;
    height: 52px;
    transform: translateY(-50%);
    background: url("/static/img/xiqu-mask.svg") center / contain no-repeat;
    opacity: .30;
    pointer-events: none;
}
/* 窄屏时品牌与导航之间的空白消失，暗纹会压字，直接不显示 */
@media (max-width: 960px) {
    html[data-theme="xiqu"] .site-header::after { display: none; }
}

/* 3.2 页面水印：右下角出血的大脸谱，位于内容之下 */
.xq-mark {
    position: fixed;
    right: -70px;
    bottom: -58px;
    width: 420px;
    height: 420px;
    background: url("/static/img/xiqu-mask.svg") center / contain no-repeat;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transition: opacity .35s ease;
}
html[data-theme="xiqu"] .xq-mark { opacity: .09; }

@media (max-width: 768px) {
    .xq-mark {
        width: 260px;
        height: 260px;
        right: -84px;
        bottom: -48px;
    }
    html[data-theme="xiqu"] .xq-mark { opacity: .07; }
}

/* 3.3 打印时不要水印 */
@media print {
    .xq-mark { display: none !important; }
}

/* 3.4 页脚皮肤署名：只切到戏神态才出现，默认皮肤完全不占位 */
.xq-sign {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 0;
    font-size: 12px;
    letter-spacing: .16em;
}
html[data-theme="xiqu"] .xq-sign { display: flex; }
.xq-sign-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(240, 56, 44, .55);
    background: rgba(200, 16, 46, .18);
    color: #ff9b93;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0;
}
.xq-sign-text {
    color: rgba(255, 155, 147, .78);
    font-size: 12px;
}

/* 3.5 移动端抽屉里的皮肤切换项（PC 隐藏，只在 is-mobile 抽屉里出现） */
.nav-skin {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 10px 0 2px;
    padding: 12px 10px;
    border: 1px dashed rgba(234, 88, 12, .35);
    border-radius: 8px;
    background: rgba(255, 247, 237, .9);
    color: #c2410c;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
html.is-mobile .nav-skin { display: flex; }
html[data-theme="xiqu"] .nav-skin {
    border-color: rgba(240, 56, 44, .40);
    background: rgba(240, 56, 44, .10);
    color: #ff9b93;
}
html[data-theme="xiqu"] .nav-skin:hover { background: rgba(240, 56, 44, .18); }
.nav-skin-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ea580c;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    flex: 0 0 auto;
}
html[data-theme="xiqu"] .nav-skin-ico { background: #b01a10; color: #fff1f0; }

/* 4.6 原生「选择文件」按钮：input[type=file] 内部按钮只能用伪元素改色 */
html[data-theme="xiqu"] input[type="file"]::file-selector-button {
    background: var(--xq-field);
    color: #ff9b93;
    border: 1px solid rgba(240, 56, 44, .42);
    border-radius: 6px;
    padding: 7px 14px;
    margin-right: 10px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

/* ---- 2.8 打印：试卷打印必须仍是浅底黑字 ---- */
@media print {
    html[data-theme="xiqu"] body { background: #fff !important; color: #000 !important; }
    html[data-theme="xiqu"] .site-header,
    html[data-theme="xiqu"] .site-footer { display: none !important; }
    html[data-theme="xiqu"] .card {
        background: #fff !important;
        border-color: #ccc !important;
        box-shadow: none !important;
    }
    html[data-theme="xiqu"] h1,
    html[data-theme="xiqu"] h2,
    html[data-theme="xiqu"] h3,
    html[data-theme="xiqu"] .meta,
    html[data-theme="xiqu"] .empty-state { color: #000 !important; }
}
