@import url("../../assets/remixicon/remixicon.css");

/* ============================================
   班级量化考核管理系统 - 管理员端公共样式
   东方雅韵 · 水墨书香（语文学科专版）
   ============================================ */

/* 1. 【墨韵书香 · 徽墨天青】（正统文人书斋 · 徽墨冷白） */
:root,
html[data-theme="ink_blue"] {
    --c-primary: #1e3a5f;        /* 墨韵黛蓝 */
    --c-primary-light: #284b7a;  /* 霁蓝天青 */
    --c-primary-dark: #122238;   /* 沉香深墨 */
    --c-primary-soft: rgba(30, 58, 95, 0.08);
    --c-sidebar-bg: linear-gradient(180deg, #142233 0%, #1c324c 55%, #122030 100%);
    --c-sidebar-active: linear-gradient(90deg, rgba(30, 58, 95, 0.9), rgba(40, 75, 122, 0.7));
    --c-sidebar-accent: #68a0dc;
    --c-bg: #f4f6fa;             /* 生宣冷白 */
    --c-bg-pattern: 
        radial-gradient(circle at 12% 18%, rgba(30, 58, 95, 0.038) 0%, transparent 45%),
        radial-gradient(circle at 88% 82%, rgba(20, 40, 68, 0.042) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(184, 59, 50, 0.015) 0%, transparent 65%);
    --c-bg-pattern-size: auto;
    --c-bg-card: #ffffff;        /* 素笺净白卡片 */
    --c-card-border: 1px solid #d5dfec;
    --c-card-shadow: 0 4px 18px rgba(22, 42, 69, 0.05);
    --c-card-radius: 10px;
    --c-quote-bg: linear-gradient(135deg, #f8fafc 0%, #edf3f9 100%);
    --c-border: #d5dfec;         /* 典籍折痕浅边框 */
    --c-border-subtle: #edf2f7;  /* 水墨微晕线 */
    --c-ink: #1a2736;            /* 砚石徽墨 */
    --c-ink-sub: #475569;        /* 研墨淡灰 */
    --c-ink-muted: #8c97a8;      /* 宣纸水印灰 */
    --c-cinnabar: #b83b32;       /* 朱砂印泥红 */
    --c-cinnabar-light: #cf483e;
    --c-bamboo: #276f57;
    --c-bamboo-light: #348e70;
    --c-amber: #cf8325;
    --c-amber-light: #de9b35;

    --header-bg: var(--c-sidebar-bg);
    --font-serif: "Source Han Serif CN", "Noto Serif SC", "Songti SC", "SimSun", "STSong", "STKaiti", "KaiTi", "楷体", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* 2. 【松风竹韵 · 翠竹素卷】（自然清朗 · 竹简切角 · 翠绿侧标） */
html[data-theme="bamboo_green"] {
    --c-primary: #15803d;
    --c-primary-light: #16a34a;
    --c-primary-dark: #0f5127;
    --c-primary-soft: rgba(21, 128, 61, 0.09);
    --c-sidebar-bg: linear-gradient(180deg, #0d291b 0%, #15462c 55%, #0a2115 100%);
    --c-sidebar-active: linear-gradient(90deg, rgba(22, 163, 74, 0.88), rgba(21, 128, 61, 0.6));
    --c-sidebar-accent: #4ade80;
    --c-bg: #edf5f0;             /* 清朗淡竹青背景 */
    --c-bg-pattern: 
        repeating-linear-gradient(90deg, transparent, transparent 46px, rgba(21, 128, 61, 0.035) 47px, rgba(21, 128, 61, 0.035) 48px),
        radial-gradient(circle at 85% 15%, rgba(22, 163, 74, 0.05) 0%, transparent 50%);
    --c-bg-pattern-size: auto;
    --c-bg-card: #fdfffe;
    --c-card-border: 1px solid #cfe0d5;
    --c-card-shadow: 0 4px 16px rgba(21, 128, 61, 0.06);
    --c-card-radius: 6px;
    --c-quote-bg: linear-gradient(135deg, #f4faf6 0%, #eaf4ed 100%);
    --c-border: #cfe0d5;
    --c-border-subtle: #e2ede6;
    --c-ink: #11261a;
    --c-ink-sub: #33503f;
    --c-ink-muted: #7d9685;
    --c-cinnabar: #b83b32;
    --c-cinnabar-light: #cf483e;
    --c-bamboo: #15803d;
    --c-bamboo-light: #16a34a;
    --c-amber: #b45309;
    --c-amber-light: #d97706;
}

/* 3. 【紫气东来 · 盛唐金石】（盛世重彩 · 雍容华贵 · 鎏金双边） */
html[data-theme="imperial_purple"] {
    --c-primary: #5a1e36;
    --c-primary-light: #7c2d4d;
    --c-primary-dark: #3b1122;
    --c-primary-soft: rgba(90, 30, 54, 0.09);
    --c-sidebar-bg: linear-gradient(180deg, #2c0f1b 0%, #4a192d 55%, #220814 100%);
    --c-sidebar-active: linear-gradient(90deg, rgba(124, 45, 77, 0.9), rgba(90, 30, 54, 0.7));
    --c-sidebar-accent: #f59e0b;  /* 烫金高亮 */
    --c-bg: #fcf4f6;             /* 温润藕荷暖底 */
    --c-bg-pattern:
        radial-gradient(circle at 15% 15%, rgba(90, 30, 54, 0.04) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(217, 119, 6, 0.035) 0%, transparent 50%),
        linear-gradient(135deg, rgba(90, 30, 54, 0.015) 25%, transparent 25%, transparent 50%, rgba(90, 30, 54, 0.015) 50%, rgba(90, 30, 54, 0.015) 75%, transparent 75%, transparent);
    --c-bg-pattern-size: 36px 36px;
    --c-bg-card: #ffffff;
    --c-card-border: 1px solid #ebd0db;
    --c-card-shadow: 0 5px 20px rgba(90, 30, 54, 0.06), 0 0 0 1px rgba(217, 119, 6, 0.16);
    --c-card-radius: 14px;
    --c-quote-bg: linear-gradient(135deg, #fbf2f5 0%, #f6e4eb 100%);
    --c-border: #ebd0db;
    --c-border-subtle: #f5e3ec;
    --c-ink: #2b0f1b;
    --c-ink-sub: #522739;
    --c-ink-muted: #9c7687;
    --c-cinnabar: #b91c1c;
    --c-cinnabar-light: #dc2626;
    --c-bamboo: #276f57;
    --c-bamboo-light: #348e70;
    --c-amber: #d97706;
    --c-amber-light: #f59e0b;
}

/* 4. 【素笺古韵 · 宋版线装】（澄心暖纸 · 版心虚线 · 质朴刻本） */
html[data-theme="warm_paper"] {
    --c-primary: #4c3523;
    --c-primary-light: #6a4b33;
    --c-primary-dark: #312115;
    --c-primary-soft: rgba(76, 53, 35, 0.09);
    --c-sidebar-bg: linear-gradient(180deg, #271c14 0%, #3d2b20 55%, #1f1610 100%);
    --c-sidebar-active: linear-gradient(90deg, rgba(106, 75, 51, 0.9), rgba(76, 53, 35, 0.7));
    --c-sidebar-accent: #dfc39b;  /* 象牙牙雕色 */
    --c-bg: #f6efe2;             /* 纯正老宣纸暖黄 */
    --c-bg-pattern: 
        repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(120, 80, 40, 0.038) 29px, rgba(120, 80, 40, 0.038) 30px),
        radial-gradient(circle at 50% 10%, rgba(180, 83, 9, 0.03) 0%, transparent 60%);
    --c-bg-pattern-size: auto;
    --c-bg-card: #fdfaf3;
    --c-card-border: 1px solid #dfcebb;
    --c-card-shadow: 0 3px 14px rgba(76, 53, 35, 0.06);
    --c-card-radius: 4px;        /* 质朴直角线装书页 */
    --c-quote-bg: linear-gradient(135deg, #f9f3e7 0%, #f1e6d3 100%);
    --c-border: #dfcebb;
    --c-border-subtle: #eee3d3;
    --c-ink: #291a11;
    --c-ink-sub: #533e2e;
    --c-ink-muted: #9e8975;
    --c-cinnabar: #c2410c;
    --c-cinnabar-light: #ea580c;
    --c-bamboo: #276f57;
    --c-bamboo-light: #348e70;
    --c-amber: #c25e1a;
    --c-amber-light: #d97706;
}

/* 5. 【霁月清风 · 瓷影天青】（现代大圆角 · 半透明毛玻璃 · 汝窑轻灵） */
html[data-theme="misty_cyan"] {
    --c-primary: #0f766e;
    --c-primary-light: #14b8a6;
    --c-primary-dark: #0a4f4a;
    --c-primary-soft: rgba(15, 118, 110, 0.09);
    --c-sidebar-bg: linear-gradient(180deg, #132431 0%, #1c3a4f 55%, #0f1d27 100%);
    --c-sidebar-active: linear-gradient(90deg, rgba(15, 118, 110, 0.9), rgba(20, 184, 166, 0.6));
    --c-sidebar-accent: #2dd4bf;  /* 清澈天青瓷绿 */
    --c-bg: #eaf1f6;             /* 清冽烟雨天青底色 */
    --c-bg-pattern: 
        radial-gradient(ellipse at 20% 40%, rgba(15, 118, 110, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 60%, rgba(45, 100, 140, 0.045) 0%, transparent 55%),
        linear-gradient(180deg, rgba(255,255,255,0.75) 0%, transparent 100%);
    --c-bg-pattern-size: auto;
    --c-bg-card: rgba(255, 255, 255, 0.92);
    --c-card-border: 1px solid rgba(20, 184, 166, 0.25);
    --c-card-shadow: 0 10px 30px rgba(15, 118, 110, 0.08);
    --c-card-radius: 18px;       /* 现代大圆角 */
    --c-quote-bg: linear-gradient(135deg, #f0f8fb 0%, #e2eff5 100%);
    --c-border: #cde0ea;
    --c-border-subtle: #e1edf3;
    --c-ink: #13222e;
    --c-ink-sub: #3b5060;
    --c-ink-muted: #8298a8;
    --c-cinnabar: #b83b32;
    --c-cinnabar-light: #cf483e;
    --c-bamboo: #0f766e;
    --c-bamboo-light: #14b8a6;
    --c-amber: #d97706;
    --c-amber-light: #f59e0b;
}

/* ============================================================
   五套主题专属组件造型差异化系统 (Differentiated Archetypes)
   ============================================================ */

/* --- 1. 【墨韵书香】专属细节 --- */
html[data-theme="ink_blue"] .card,
html[data-theme="ink_blue"] .panel,
html[data-theme="ink_blue"] .work-card {
    border-radius: 10px;
    border: 1px solid #d5dfec;
    box-shadow: 0 4px 18px rgba(30, 58, 95, 0.05);
}
html[data-theme="ink_blue"] .panel-title::before {
    content: "🖋️";
    font-size: 13px;
    margin-right: 4px;
}
html[data-theme="ink_blue"] .sidebar .menu-item.active {
    border-left: 3.5px solid #68a0dc;
}

/* --- 2. 【松风竹韵】专属细节：竹简切角、修竹翠绿左侧饰条 --- */
html[data-theme="bamboo_green"] .card,
html[data-theme="bamboo_green"] .panel,
html[data-theme="bamboo_green"] .work-card,
html[data-theme="bamboo_green"] .stat-card,
html[data-theme="bamboo_green"] .quick-card,
html[data-theme="bamboo_green"] .workbench-card,
html[data-theme="bamboo_green"] .mobile-card {
    border-radius: 6px !important;
    border: 1px solid #cfe0d5 !important;
    border-left: 4.5px solid #16a34a !important;
    box-shadow: 0 3px 14px rgba(22, 101, 52, 0.06) !important;
    background: #fdfffe !important;
}
html[data-theme="bamboo_green"] .card:hover,
html[data-theme="bamboo_green"] .panel:hover {
    border-left-color: #22c55e !important;
    box-shadow: 0 6px 20px rgba(22, 101, 52, 0.12) !important;
}
html[data-theme="bamboo_green"] .panel-title::before {
    content: "🎋";
    font-size: 14px;
    margin-right: 4px;
}
html[data-theme="bamboo_green"] .card-num {
    color: var(--c-bamboo) !important;
}
html[data-theme="bamboo_green"] .sidebar .menu-item.active {
    border-left: 3.5px solid #4ade80 !important;
    background: linear-gradient(90deg, rgba(22, 163, 74, 0.85), rgba(21, 128, 61, 0.5)) !important;
    box-shadow: 0 4px 14px rgba(10, 40, 20, 0.3) !important;
}

/* --- 3. 【紫气东来】专属细节：盛唐重彩、金石双层边框与鎏金微光 --- */
html[data-theme="imperial_purple"] .card,
html[data-theme="imperial_purple"] .panel,
html[data-theme="imperial_purple"] .work-card,
html[data-theme="imperial_purple"] .stat-card,
html[data-theme="imperial_purple"] .quick-card,
html[data-theme="imperial_purple"] .workbench-card,
html[data-theme="imperial_purple"] .mobile-card {
    border-radius: 14px !important;
    border: 1px solid #ebd0db !important;
    box-shadow: 0 6px 22px rgba(90, 30, 54, 0.06), 0 0 0 1px rgba(217, 119, 6, 0.2) !important;
    background: #ffffff !important;
}
html[data-theme="imperial_purple"] .card:hover,
html[data-theme="imperial_purple"] .panel:hover {
    box-shadow: 0 8px 28px rgba(90, 30, 54, 0.1), 0 0 0 1.5px rgba(217, 119, 6, 0.45) !important;
    transform: translateY(-3px);
}
html[data-theme="imperial_purple"] .panel-title::before {
    content: "👑";
    font-size: 14px;
    margin-right: 4px;
}
html[data-theme="imperial_purple"] .card-num {
    color: #5a1e36 !important;
}
html[data-theme="imperial_purple"] .sidebar .menu-item.active {
    border-left: 3.5px solid #f59e0b !important;
    color: #fef08a !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(245, 158, 11, 0.25) !important;
}

/* --- 4. 【素笺古韵】专属细节：宋版线装书页、澄心暖纸、内缩版心虚线 --- */
html[data-theme="warm_paper"] body {
    background-color: #f6efe2 !important;
}
html[data-theme="warm_paper"] .card,
html[data-theme="warm_paper"] .panel,
html[data-theme="warm_paper"] .work-card,
html[data-theme="warm_paper"] .stat-card,
html[data-theme="warm_paper"] .quick-card,
html[data-theme="warm_paper"] .workbench-card,
html[data-theme="warm_paper"] .mobile-card {
    border-radius: 4px !important;
    background: #fdfaf3 !important;
    border: 1px solid #dfcebb !important;
    outline: 1px dashed rgba(160, 110, 60, 0.22) !important;
    outline-offset: -5px !important;
    box-shadow: 0 3px 12px rgba(76, 53, 35, 0.05) !important;
}
html[data-theme="warm_paper"] .card:hover,
html[data-theme="warm_paper"] .panel:hover {
    outline-color: rgba(160, 110, 60, 0.48) !important;
    box-shadow: 0 6px 18px rgba(76, 53, 35, 0.1) !important;
}
html[data-theme="warm_paper"] .panel-title::before {
    content: "📜";
    font-size: 14px;
    margin-right: 4px;
}
html[data-theme="warm_paper"] .card-num {
    color: #4c3523 !important;
    font-family: var(--font-serif) !important;
}
html[data-theme="warm_paper"] .sidebar .menu-item.active {
    border-left: 3.5px solid #dfc39b !important;
    color: #faeed9 !important;
}

/* --- 5. 【霁月清风】专属细节：现代18px大圆角、半透明毛玻璃微拟态、天青轻灵 --- */
html[data-theme="misty_cyan"] body {
    background-color: #eaf1f6 !important;
}
html[data-theme="misty_cyan"] .card,
html[data-theme="misty_cyan"] .panel,
html[data-theme="misty_cyan"] .work-card,
html[data-theme="misty_cyan"] .stat-card,
html[data-theme="misty_cyan"] .quick-card,
html[data-theme="misty_cyan"] .workbench-card,
html[data-theme="misty_cyan"] .mobile-card {
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.90) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(20, 184, 166, 0.26) !important;
    box-shadow: 0 8px 30px rgba(15, 118, 110, 0.08) !important;
}
html[data-theme="misty_cyan"] .card:hover,
html[data-theme="misty_cyan"] .panel:hover {
    border-color: rgba(20, 184, 166, 0.5) !important;
    box-shadow: 0 12px 36px rgba(15, 118, 110, 0.14) !important;
    transform: translateY(-3px);
}
html[data-theme="misty_cyan"] .panel-title::before {
    content: "💠";
    font-size: 14px;
    margin-right: 4px;
}
html[data-theme="misty_cyan"] .card-num {
    color: #0f766e !important;
}
html[data-theme="misty_cyan"] .sidebar .menu-item.active {
    border-left: 3.5px solid #2dd4bf !important;
    box-shadow: 0 4px 16px rgba(15, 118, 110, 0.35) !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--c-bg);
    background-image: var(--c-bg-pattern);
    background-size: var(--c-bg-pattern-size, auto);
    color: var(--c-ink);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 整体布局 */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* 侧边栏：沉静墨玉微青，如砚台温润，各主题自适应渐变 */
.sidebar {
    width: 232px;
    background: var(--c-sidebar-bg, linear-gradient(180deg, #162436 0%, #1e324b 55%, #18283a 100%));
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 4px 0 24px rgba(22, 36, 54, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 10;
    transition: none;
}

.logo {
    height: 64px;
    line-height: 64px;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: var(--font-serif);
    color: #f8fafc;
    background: rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.menu { flex: 1; overflow-y: auto; padding: 12px 0; }
.menu-group {
    padding: 16px 22px 6px;
    font-size: 11px;
    color: #8395ac;
    letter-spacing: 1.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.menu-group::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin-left: 6px;
}

.menu-item {
    padding: 11px 18px;
    cursor: pointer;
    font-size: 13.5px;
    transition: background-color 0.15s ease, color 0.15s ease;
    border-left: 3px solid transparent;
    color: rgba(240, 244, 250, 0.82);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin: 2px 10px;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}
.menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: none;
}
.menu-item:active {
    background: rgba(255, 255, 255, 0.16);
}
.menu-item:focus {
    outline: none;
}
.menu-item.active {
    background: var(--c-sidebar-active, linear-gradient(90deg, rgba(40, 75, 122, 0.75), rgba(30, 58, 95, 0.45)));
    border-left-color: var(--c-sidebar-accent, #68a0dc);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

/* 主内容区：如展卷阅读，宽厚舒适 */
.main { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    background-color: var(--c-bg); 
    background-image: var(--c-bg-pattern);
    background-size: var(--c-bg-pattern-size, auto);
}

.header {
    height: 64px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

.header-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--c-primary);
    font-family: var(--font-serif);
    letter-spacing: 0.5px;
}

/* 诗词微语小笺 */
.header-quote {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px;
    background: var(--c-quote-bg, var(--c-primary-soft));
    border: 1px solid var(--c-border);
    border-radius: 20px;
    font-size: 12.5px;
    color: var(--c-ink);
    font-family: var(--font-serif);
    max-width: 520px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}
.header-quote::before {
    content: "「晨课」";
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--c-cinnabar);
    color: #ffffff;
    font-size: 11px;
    font-family: var(--font-serif);
    font-weight: 600;
}

.header-right { display: flex; align-items: center; gap: 16px; font-size: 13.5px; color: var(--c-ink-sub); }
.header-right .admin-badge {
    background: var(--c-primary-soft);
    color: var(--c-primary);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12.5px;
}
.logout {
    color: #8c97a8;
    cursor: pointer;
    text-decoration: none;
    transition: color .2s, background-color .2s, opacity .2s, transform .2s;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
}
.logout:hover { color: var(--c-cinnabar); background: rgba(184, 59, 50, 0.08); }

.content { flex: 1; padding: 24px; overflow-y: auto; }

/* 工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.search-box {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.search-box .search-field {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 220px;
    min-width: 0;
}
.search-box input {
    width: 220px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    outline: none;
    font-size: 13px;
    background: #fff;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease;
    color: var(--c-ink);
}
.search-box input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}
.search-box .search-field input {
    width: 100%;
    padding-right: 40px;
}
.search-clear-btn {
    position: absolute;
    right: 3px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--c-ink-muted);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: color .15s ease, background-color .15s ease;
}
.search-clear-btn:hover {
    color: var(--c-ink);
    background: var(--c-primary-soft);
}
.search-clear-btn.is-visible {
    display: inline-flex;
}

/* 按钮规范：东方雅墨，沉静考究 */
.btn {
    padding: 7px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.btn:active { transform: translateY(0); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }

/* 黛青主按钮：随主题自适应渐变与雅致阴影 */
.btn-primary {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
    color: #fff;
    border-color: var(--c-primary-dark);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary));
    box-shadow: 0 4px 14px var(--c-primary-soft);
}

/* 松柏/修竹绿 */
.btn-success {
    background: linear-gradient(135deg, var(--c-bamboo), var(--c-bamboo-light));
    color: #fff;
    border-color: #1e5946;
}
.btn-success:hover {
    background: linear-gradient(135deg, #1e5845, #2b775e);
    box-shadow: 0 4px 14px rgba(39, 111, 87, 0.22);
}

/* 琥珀藤黄 */
.btn-warning {
    background: linear-gradient(135deg, var(--c-amber), var(--c-amber-light));
    color: #fff;
    border-color: #b8731e;
}
.btn-warning:hover {
    background: linear-gradient(135deg, #ba741e, #cf8d2b);
    box-shadow: 0 4px 14px rgba(207, 131, 37, 0.22);
}

/* 朱砂印泥红 */
.btn-danger {
    background: linear-gradient(135deg, var(--c-cinnabar), var(--c-cinnabar-light));
    color: #fff;
    border-color: #9f322a;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #a4332b, #b93e35);
    box-shadow: 0 4px 14px rgba(184, 59, 50, 0.22);
}

/* 宣纸素白灰 */
.btn-default {
    background: #fff;
    color: var(--c-ink-sub);
    border: 1px solid var(--c-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.btn-default:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--c-ink);
}

/* 标签页 */
.tab-group {
    display: inline-flex;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.tab-btn {
    padding: 7px 18px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    border-right: 1px solid var(--c-border);
    transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s;
    color: var(--c-ink-sub);
    font-family: var(--font-serif);
}
.tab-btn:last-child { border-right: none; }
.tab-btn:hover { background: #f8fafc; color: var(--c-ink); }
.tab-btn.active {
    background: var(--c-primary);
    color: #fff;
    font-weight: 600;
}

/* 面板：素笺如玉，典雅从容 */
.panel {
    background: var(--c-bg-card);
    border-radius: var(--c-card-radius, 14px);
    padding: 22px;
    box-shadow: var(--c-card-shadow, 0 4px 20px rgba(30, 58, 95, 0.04));
    margin-bottom: 22px;
    border: var(--c-card-border, 1px solid var(--c-border));
}
.panel-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--c-border-subtle);
    color: var(--c-primary);
    font-family: var(--font-serif);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 概览卡片：书卷微签质感 */
.overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.card {
    background: var(--c-bg-card);
    border-radius: var(--c-card-radius, 14px);
    padding: 20px 22px;
    box-shadow: var(--c-card-shadow, 0 4px 18px rgba(30, 58, 95, 0.03));
    border: var(--c-card-border, 1px solid var(--c-border));
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    position: relative;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.08);
    border-color: #cbd5e1;
}
.card-num {
    font-size: 30px;
    font-weight: 800;
    color: var(--c-primary);
    margin-bottom: 4px;
    line-height: 1.1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.card-label {
    font-size: 13px;
    color: var(--c-ink-sub);
    font-family: var(--font-serif);
    letter-spacing: 0.3px;
}

/* 表格：淡墨规矩，清秀井然 */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--c-border-subtle);
}
.table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--c-ink-sub);
    font-family: var(--font-serif);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--c-border);
}
.table tr { transition: background .15s ease; }
.table tr:hover { background: #f5f8fc; }

/* 排名状元、榜眼、探花雅致微光 */
.rank-top1 { background: rgba(254, 243, 199, 0.4) !important; }
.rank-top2 { background: rgba(241, 245, 249, 0.7) !important; }
.rank-top3 { background: rgba(254, 237, 230, 0.45) !important; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-size: 13px;
}
.page-btn {
    padding: 5px 12px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
    min-width: 30px;
    text-align: center;
    transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s;
    color: var(--c-ink-sub);
}
.page-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.page-btn.active {
    background: var(--c-primary);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}
.page-btn.disabled { color: #c0c4cc; cursor: not-allowed; border-color: var(--c-border-subtle); }

/* 弹窗：线装书雅箱质感 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(18, 32, 51, 0.48);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 3000;
}
.modal-box {
    background: #fff;
    border-radius: 16px;
    width: 500px;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(18, 32, 51, 0.22);
    border: 1px solid var(--c-border);
    animation: modalIn .25s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-large { width: 780px; }
.modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
    color: #fff;
    font-family: var(--font-serif);
    letter-spacing: 0.5px;
}
.modal-header .close {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-size: 22px;
    background: none;
    border: none;
    transition: transform .2s;
    line-height: 1;
}
.modal-header .close:hover { transform: rotate(90deg); color: #fff; }
.modal-body { padding: 22px; flex: 1; overflow-y: auto; }
.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--c-border-subtle);
    text-align: right;
    background: #f8fafc;
}
.modal-footer .btn { margin-left: 8px; }

/* 表单输入：柔和润墨，不刺眼 */
.form-row { margin-bottom: 18px; }
.form-row label {
    display: block;
    font-size: 13.5px;
    color: var(--c-ink-sub);
    margin-bottom: 7px;
    font-family: var(--font-serif);
    font-weight: 600;
}
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
    color: var(--c-ink);
    transition: border-color .2s, box-shadow .2s, background-color .2s, color .2s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}
.checkbox-inline { display: inline-flex; align-items: center; margin-right: 20px; }
.checkbox-inline input { width: auto; margin-right: 6px; }

/* 座位布局：讲堂列席风格 */
.seat-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 14px;
    min-height: 400px;
    border: 1px solid var(--c-border);
}
.seat-row { display: flex; gap: 10px; }
.seat-cell {
    width: 90px;
    height: 50px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .2s, background-color .2s, box-shadow .2s, transform .2s;
    text-align: center;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.seat-cell:hover {
    border-color: var(--c-primary);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.14);
}
.seat-cell.empty { background: #f8fafc; color: var(--c-ink-muted); }
.seat-cell.occupied {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
    color: #fff;
    border-color: transparent;
    font-weight: 500;
}

/* 空状态 */
.empty-tip {
    text-align: center;
    color: var(--c-ink-muted);
    padding: 40px 0;
    font-size: 14px;
    font-family: var(--font-serif);
}

.mobile-only-back {
    display: none;
}

/* ========== 手机端适配（后台专用移动界面） ========== */
@media (max-width: 768px) {
  body { font-size: 14px; }
  .layout {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding-bottom: 0;
  }
  /* 侧边栏改为底部导航 */
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 132px;
    z-index: 1000;
    display: block;
    box-shadow: 0 -2px 14px rgba(0,0,0,.14);
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    flex-shrink: 0;
  }
  .sidebar .logo { display: none; }
  .sidebar .menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 9px 8px;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .sidebar .menu::-webkit-scrollbar { display: none; }
  .sidebar .menu-group { display: none; }
  .sidebar .menu-item {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 14px;
    font-size: 12px;
    border-left: none;
    border-radius: 20px;
    white-space: nowrap;
  }
  .sidebar .menu-item:hover { transform: none; }
  .main {
    display: block;
    min-height: 100vh;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }
  .header {
    position: sticky;
    top: 0;
    z-index: 500;
    min-height: 52px;
    height: auto;
    padding: 0 14px;
  }
  .header-title { font-size: 16px; }
  .header-quote { display: none; }
  .header-right { display: none !important; }
  .switch-terminal-btn { display: none !important; }
  .content { padding: 14px; }
  .overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
  }
  .card { padding: 14px; border-radius: 12px; }
  .card-num { font-size: 22px; }
  .panel {
    padding: 14px;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .panel-title { font-size: 15px; }
  .table { min-width: 580px; width: 100%; font-size: 13px; }
  .table.table-fit { min-width: 100%; }
  .table th, .table td { padding: 10px 8px; }
  .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
  }
  .search-box { width: 100%; margin-left: 0; }
  .search-box .search-field { width: 100%; flex: 1 1 auto; }
  .search-box input { width: 100%; flex: 1; min-width: 0; }
  .search-clear-btn { width: 44px; height: 44px; right: 0; }
  .btn { padding: 6px 13px; }
  .tab-group { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { flex: 0 0 auto; padding: 8px 14px; }
  .modal { align-items: flex-end; }
  .modal-box {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
  }
  .modal-large { width: 100%; }
  .modal-body {
    padding: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }
  .modal-footer {
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 10;
    border-top: 1px solid var(--c-border, #e2e8f0);
  }
  .form-row input, .form-row select, .form-row textarea { font-size: 16px; }
  .seat-layout { padding: 12px; min-height: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seat-row { gap: 6px; }
  .seat-cell { min-width: 58px; width: auto; height: 42px; font-size: 12px; }
  .pagination { flex-wrap: wrap; justify-content: center; }
}

/* ========== 手机端视觉规范细化 ========== */
@media (max-width: 768px) {
  .btn { border-radius: 8px; min-height: 36px; }
  .btn-primary { background: var(--c-primary); background-image: none; color: #fff; }
  .btn-success { background: var(--c-bamboo); background-image: none; color: #fff; }
  .btn-warning { background: var(--c-amber); background-image: none; color: #fff; }
  .btn-danger  { background: var(--c-cinnabar); background-image: none; color: #fff; }
  .btn-default { background: #fff; border: 1px solid var(--c-border); color: var(--c-ink-sub); box-shadow: none; }

  .card, .panel {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.05);
  }
  .card-num { color: var(--c-primary); }
  .tab-btn.active { background: var(--c-primary); background-image: none; }
  .page-btn.active { background: var(--c-primary); background-image: none; }
  .modal-header { background: var(--c-primary); background-image: none; }

  .sidebar .menu { padding: 6px 8px; }
  .sidebar .menu-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
  }

  .fab {
    position: fixed;
    right: 16px;
    bottom: 96px;
    z-index: 2600;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    border: none;
    box-shadow: 0 8px 18px rgba(30, 58, 95, 0.3);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .toast {
    position: fixed;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%);
    background: rgba(30, 58, 95, 0.94);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    max-width: 78%;
    text-align: center;
    animation: toastIn .2s ease;
  }
  @keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

  .skeleton {
    border-radius: 6px;
    background: linear-gradient(90deg, #eef1f6 25%, #dfe4ec 37%, #eef1f6 63%);
    background-size: 400% 100%;
    animation: sk-load 1.4s ease infinite;
  }
  @keyframes sk-load { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
}

/* ============================================================
   终端架构规范：电脑端管理后台与手机专属工作台彻底解耦
   ============================================================ */

/* PC端顶栏切换终端按钮（高雅胶囊式） */
.switch-terminal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--c-primary-soft, #eef4fb);
  color: var(--c-primary, #1e3a5f);
  border: 1px solid var(--c-border, #dbe3ed);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
}
.switch-terminal-btn:hover {
  background: var(--c-primary, #1e3a5f);
  color: #ffffff;
  border-color: var(--c-primary, #1e3a5f);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(30, 58, 95, 0.18);
}
.switch-terminal-btn i {
  font-size: 14px;
}

/* 电脑端后台(.layout)全局坚守：固定桌面端经典双栏布局，严禁手机抽屉塌陷与底栏污染 */
.layout {
  display: flex !important;
  height: 100vh !important;
  overflow: hidden !important;
  min-width: 900px;
}
.layout .sidebar {
  position: relative !important;
  width: 232px !important;
  height: 100% !important;
  transform: none !important;
  display: flex !important;
  flex-shrink: 0 !important;
  z-index: 10 !important;
  box-shadow: 4px 0 24px rgba(22, 36, 54, 0.08) !important;
  transition: none !important;
}
.layout .main {
  flex: 1 !important;
  height: 100% !important;
  overflow: hidden !important;
  min-width: 0 !important;
}
.layout .header {
  display: flex !important;
  height: 64px !important;
  padding: 0 28px !important;
}
.layout .header-quote {
  display: inline-flex !important;
}
.layout .header-right .logout {
  display: inline-flex !important;
}
.layout .drawer-close-btn,
.layout .header-mobile-toggle,
.layout .sidebar-mask,
.layout ~ #sidebarMask,
.layout ~ #appBottom,
.layout #appBottom,
.layout .bottom {
  display: none !important;
}

/* 移动端视口解除 min-width: 900px 锁死，支持全宽单列自适应 */
@media (max-width: 768px) {
  .layout {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .layout .sidebar {
    display: none !important;
  }
  .layout .main {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    min-width: 0 !important;
  }
  .layout .header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: auto !important;
    min-height: 56px !important;
    padding: 8px 12px !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: var(--c-bg-card, #ffffff) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
  }
  .mobile-nav-back, .mobile-only-back {
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
    min-height: 44px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--c-primary, #1e3a8a) !important;
    text-decoration: none !important;
    padding: 0 12px !important;
    border-radius: 20px !important;
    background: var(--c-primary-soft, rgba(30,58,138,0.08)) !important;
    border: 1px solid var(--c-primary-soft, rgba(30,58,138,0.2)) !important;
    flex-shrink: 0 !important;
    transition: color 0.2s, background-color 0.2s, border-color 0.2s, opacity 0.2s !important;
  }
  .mobile-nav-back:active, .mobile-only-back:active {
    background: var(--c-primary, #1e3a8a) !important;
    color: #fff !important;
  }
  .layout .header-title-wrap {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 0 4px !important;
    min-width: 0 !important;
  }
  .layout .header-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  /* 右上方空白：彻底隐藏多余小字与按钮，保持手机端干净整洁 */
  .layout .header .header-right,
  .layout .header-right,
  .header-right,
  .switch-terminal-btn,
  .layout .header .switch-terminal-btn,
  .layout .header .header-quote {
    display: none !important;
  }
  /* 右侧对称空白占位，使标题完美居中 */
  .layout .header::after {
    content: "";
    width: 68px;
    height: 1px;
    display: block;
    flex-shrink: 0;
  }
  .layout .content {
    padding: 12px 12px calc(92px + env(safe-area-inset-bottom, 0px)) 12px !important;
    height: auto !important;
    overflow: visible !important;
  }
}

/* 表格容器自适应横向滚动，避免宽表挤压 */
.table-wrap, .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
}
.table-scroll-hint {
  display: none;
}
@media (max-width: 768px) {
  .table-scroll-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--c-ink-sub, #64748b);
    background: rgba(30, 58, 95, 0.05);
    border-radius: 4px;
    padding: 3px 8px;
    margin-bottom: 8px;
  }
}

/* ============================================================
   统一移动端 4 项常驻底栏 (工作台、作文批改、量化考核、设置)
   ============================================================ */
.mobile-tabbar {
  display: none;
}
@media (max-width: 768px) {
  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    box-sizing: border-box;
    border-top: 1px solid var(--c-border, #e2e8f0);
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  }
  .mobile-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--c-ink-muted);
    font-size: 11px;
    min-height: 58px;
    transition: color 0.15s;
    position: relative;
    background: transparent !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .mobile-tab-item:link,
  .mobile-tab-item:visited,
  .mobile-tab-item:hover,
  .mobile-tab-item:focus,
  .mobile-tab-item:active {
    background: transparent !important;
  }
  .mobile-tab-item i {
    font-size: 20px;
    line-height: 1;
  }
  .mobile-tab-item.active {
    color: var(--c-primary, #1e3a8a) !important;
    background: transparent !important;
    font-weight: 700;
  }
  .mobile-tab-item.accent {
    color: var(--c-bamboo);
  }
  .mobile-tab-item.accent.active {
    color: var(--c-bamboo) !important;
  }
  .tab-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--c-bamboo);
    position: absolute;
    top: 8px;
    right: calc(50% - 14px);
  }
}

/* ============================================================
   原创度与学术诚信检测指标卡片（AI率与抄袭率识别仪表）
   ============================================================ */
.integrity-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.integrity-item {
  background: #f8fafc;
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.integrity-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.integrity-label {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
.integrity-val-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.integrity-percent {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-serif, serif);
  line-height: 1;
}
.integrity-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}
.tag-safe { background: #dcfce7; color: var(--c-bamboo); border: 1px solid #bbf7d0; }
.tag-warn { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.tag-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.integrity-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  margin-top: 2px;
}

@media (max-width: 540px) {
  .integrity-banner {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ============================================================
   光荣榜 / 排行榜 东方雅韵五套主题专属造型与领奖台系统
   (Differentiated Leaderboard & Podium Archetypes)
   ============================================================ */

/* 领奖台整体面板通用规范 */
.rank-podium-panel {
  background: var(--c-bg-card);
  border-radius: var(--c-card-radius, 14px);
  padding: 24px 20px 0;
  margin-bottom: 22px;
  box-shadow: var(--c-card-shadow, 0 4px 18px rgba(0,0,0,0.05));
  border: var(--c-card-border, 1px solid var(--c-border));
  overflow: hidden;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.podium-header {
  text-align: center;
  margin-bottom: 20px;
}
.podium-title {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-serif, serif);
  letter-spacing: 0.8px;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.podium-subtitle {
  font-size: 12.5px;
  color: var(--c-ink-sub);
  margin-top: 4px;
  font-family: var(--font-serif, serif);
}

/* 领奖台 3 位选手并列错落结构 */
.top-three-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  max-width: 580px;
  margin: 0 auto;
}
.podium-slot {
  flex: 1;
  max-width: 170px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.podium-slot.rank-2 { order: 1; }
.podium-slot.rank-1 { order: 2; z-index: 2; }
.podium-slot.rank-3 { order: 3; }
/* 领奖台席位顶部荣誉勋章胶囊（图标与头衔像素级居中规整） */
.podium-crown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font-serif, serif);
  margin-bottom: 8px;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.08);
  background: #ffffff;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.podium-crown .crown-icon {
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1em;
  position: relative;
  top: -0.5px;
}
.podium-crown .crown-text {
  line-height: 1;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  height: 1em;
}

/* 状元 / 魁首（第 1 名）专属鎏金高定徽章 */
.podium-slot.rank-1 .podium-crown {
  height: 30px;
  padding: 0 14px;
  font-size: 13.5px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e;
  border: 1px solid #f59e0b;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.25);
}
.podium-slot.rank-1 .podium-crown .crown-icon {
  font-size: 17px;
}

/* 榜眼 / 亚席（第 2 名）银质雅韵勋章 */
.podium-slot.rank-2 .podium-crown {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.12);
}

/* 探花 / 鼎甲（第 3 名）铜韵沉雅勋章 */
.podium-slot.rank-3 .podium-crown {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #9a3412;
  border: 1px solid #fdba74;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.12);
}
.podium-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-serif, serif);
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
}
.podium-slot:hover .podium-avatar {
  transform: scale(1.06);
}
.podium-slot.rank-1 .podium-avatar {
  width: 76px;
  height: 76px;
  font-size: 28px;
  border-width: 3px;
}

.podium-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-ink);
  font-family: var(--font-serif, serif);
  margin-bottom: 3px;
  white-space: nowrap;
}
.podium-slot.rank-1 .podium-name {
  font-size: 17px;
  color: var(--c-primary);
}

.trend {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 4px;
  line-height: 1.3;
  vertical-align: middle;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}
.trend.up {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}
.trend.down {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}
.trend.flat {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
}

.podium-score {
  font-size: 13px;
  color: var(--c-ink-sub);
  margin-bottom: 2px;
}
.podium-score b {
  font-size: 17px;
  font-weight: 800;
  margin-right: 2px;
}
.podium-slot.rank-1 .podium-score b {
  font-size: 21px;
}

.podium-tier {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 8px;
  display: inline-block;
  white-space: nowrap;
}

/* 错落阶梯底座 */
.podium-pedestal {
  width: 100%;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-serif, serif);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.podium-slot.rank-1 .podium-pedestal { height: 68px; font-size: 24px; }
.podium-slot.rank-2 .podium-pedestal { height: 46px; }
.podium-slot.rank-3 .podium-pedestal { height: 34px; }

/* ------------------------------------------------------------
   1. 【墨韵书香 · 徽墨天青】榜单与领奖台专属特色
   ------------------------------------------------------------ */
html[data-theme="ink_blue"] .rank-podium-panel {
  border-radius: 10px;
  border: 1px solid #d5dfec;
  box-shadow: 0 6px 24px rgba(30, 58, 95, 0.06);
}
html[data-theme="ink_blue"] .podium-slot.rank-1 .podium-avatar {
  background: linear-gradient(135deg, #1e3a5f, #284b7a);
  border-color: #b83b32;
  box-shadow: 0 0 0 3px rgba(184, 59, 50, 0.25), 0 8px 24px rgba(30, 58, 95, 0.2);
}
html[data-theme="ink_blue"] .podium-slot.rank-2 .podium-avatar {
  background: linear-gradient(135deg, #475569, #64748b);
}
html[data-theme="ink_blue"] .podium-slot.rank-3 .podium-avatar {
  background: linear-gradient(135deg, #334155, #475569);
}
html[data-theme="ink_blue"] .podium-slot.rank-1 .podium-pedestal {
  background: linear-gradient(to top, #162436, #1e3a5f, #284b7a);
  border-top: 3px solid #b83b32;
}
html[data-theme="ink_blue"] .podium-slot.rank-2 .podium-pedestal {
  background: linear-gradient(to top, #334155, #475569);
}
html[data-theme="ink_blue"] .podium-slot.rank-3 .podium-pedestal {
  background: linear-gradient(to top, #1e293b, #334155);
}
html[data-theme="ink_blue"] .podium-slot.rank-1 .podium-tier {
  background: #fdf3f2; color: #b83b32; border: 1px solid #fca5a5;
}
html[data-theme="ink_blue"] .podium-slot.rank-2 .podium-tier,
html[data-theme="ink_blue"] .podium-slot.rank-3 .podium-tier {
  background: #f1f5f9; color: #475569;
}
html[data-theme="ink_blue"] tr.rank-top1 {
  background: #fdfaf9 !important;
}
html[data-theme="ink_blue"] tr.rank-top1 td:first-child span {
  background: #b83b32 !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 6px rgba(184, 59, 50, 0.35) !important;
}

/* ------------------------------------------------------------
   2. 【松风竹韵 · 翠竹素卷】榜单与领奖台专属特色：竹节台座、翠绿侧标
   ------------------------------------------------------------ */
html[data-theme="bamboo_green"] .rank-podium-panel {
  border-radius: 6px !important;
  border: 1px solid #cfe0d5 !important;
  border-left: 5px solid #16a34a !important;
  background: #fdfffe !important;
  box-shadow: 0 4px 18px rgba(22, 101, 52, 0.07) !important;
}
html[data-theme="bamboo_green"] .podium-slot.rank-1 .podium-avatar {
  background: linear-gradient(135deg, #15803d, #22c55e);
  border-color: #86efac;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3), 0 8px 24px rgba(21, 128, 61, 0.25);
}
html[data-theme="bamboo_green"] .podium-slot.rank-2 .podium-avatar {
  background: linear-gradient(135deg, #166534, #15803d);
}
html[data-theme="bamboo_green"] .podium-slot.rank-3 .podium-avatar {
  background: linear-gradient(135deg, #14532d, #166534);
}
/* 竹节错落台座 (带竹节横向刻痕) */
html[data-theme="bamboo_green"] .podium-pedestal {
  border-top: 3px solid #4ade80 !important;
  position: relative;
}
html[data-theme="bamboo_green"] .podium-slot.rank-1 .podium-pedestal {
  background: linear-gradient(to top, #14532d, #16a34a 60%, #22c55e) !important;
}
html[data-theme="bamboo_green"] .podium-slot.rank-2 .podium-pedestal {
  background: linear-gradient(to top, #0f3d21, #15803d) !important;
}
html[data-theme="bamboo_green"] .podium-slot.rank-3 .podium-pedestal {
  background: linear-gradient(to top, #0b2e19, #166534) !important;
}
html[data-theme="bamboo_green"] .podium-slot.rank-1 .podium-tier {
  background: #eaf7ee; color: var(--c-bamboo); border: 1px solid #86efac;
}
html[data-theme="bamboo_green"] .podium-slot.rank-2 .podium-tier,
html[data-theme="bamboo_green"] .podium-slot.rank-3 .podium-tier {
  background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
}
html[data-theme="bamboo_green"] tr.rank-top1,
html[data-theme="bamboo_green"] tr.rank-top2,
html[data-theme="bamboo_green"] tr.rank-top3 {
  border-left: 3.5px solid #16a34a !important;
}
html[data-theme="bamboo_green"] tr.rank-top1 {
  background: #f4faf6 !important;
}
html[data-theme="bamboo_green"] tr.rank-top1 td:first-child span {
  background: linear-gradient(135deg, #15803d, #22c55e) !important;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.4) !important;
}

/* ------------------------------------------------------------
   3. 【紫气东来 · 盛唐金石】榜单与领奖台专属特色：皇家鎏金阶梯、双层金边
   ------------------------------------------------------------ */
html[data-theme="imperial_purple"] .rank-podium-panel {
  border-radius: 14px !important;
  border: 1px solid #ebd0db !important;
  box-shadow: 0 6px 24px rgba(90, 30, 54, 0.08), 0 0 0 1.5px rgba(217, 119, 6, 0.25) !important;
  background: #ffffff !important;
}
html[data-theme="imperial_purple"] .podium-slot.rank-1 .podium-avatar {
  background: linear-gradient(135deg, #5a1e36, #7c2d4d);
  border-color: #fbbf24;
  box-shadow: 0 0 0 3.5px rgba(245, 158, 11, 0.4), 0 0 24px rgba(245, 158, 11, 0.5) !important;
}
html[data-theme="imperial_purple"] .podium-slot.rank-2 .podium-avatar {
  background: linear-gradient(135deg, #702d47, #5a1e36);
  border-color: #fcd34d;
}
html[data-theme="imperial_purple"] .podium-slot.rank-3 .podium-avatar {
  background: linear-gradient(135deg, #381422, #5a1e36);
  border-color: #f59e0b;
}
/* 璀璨皇家鎏金阶梯 */
html[data-theme="imperial_purple"] .podium-slot.rank-1 .podium-pedestal {
  background: linear-gradient(to top, #b45309, #d97706 40%, #f59e0b 80%, #fef08a) !important;
  color: #78350f !important;
  border-top: 3px solid #fef08a !important;
  text-shadow: 0 1px 1px rgba(255,255,255,0.6);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35) !important;
}
html[data-theme="imperial_purple"] .podium-slot.rank-2 .podium-pedestal {
  background: linear-gradient(to top, #3b1122, #5a1e36, #7c2d4d) !important;
  border-top: 2px solid #f59e0b !important;
}
html[data-theme="imperial_purple"] .podium-slot.rank-3 .podium-pedestal {
  background: linear-gradient(to top, #2b0f1b, #3b1122, #5a1e36) !important;
  border-top: 2px solid #d97706 !important;
}
html[data-theme="imperial_purple"] .podium-slot.rank-1 .podium-tier {
  background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; font-weight: 700;
}
html[data-theme="imperial_purple"] .podium-slot.rank-2 .podium-tier,
html[data-theme="imperial_purple"] .podium-slot.rank-3 .podium-tier {
  background: #fbf0f4; color: #9d174d; border: 1px solid #f472b6;
}
html[data-theme="imperial_purple"] tr.rank-top1 {
  background: #fefbf3 !important;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.2) !important;
}
html[data-theme="imperial_purple"] tr.rank-top1 td:first-child span {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5) !important;
}

/* ------------------------------------------------------------
   4. 【素笺古韵 · 宋版线装】榜单与领奖台专属特色：经折书函、澄心暖纸虚线框
   ------------------------------------------------------------ */
html[data-theme="warm_paper"] .rank-podium-panel {
  border-radius: 4px !important;
  background: #fdfaf3 !important;
  border: 1px solid #dfcebb !important;
  outline: 1px dashed rgba(160, 110, 60, 0.25) !important;
  outline-offset: -6px !important;
  box-shadow: 0 4px 16px rgba(76, 53, 35, 0.06) !important;
}
html[data-theme="warm_paper"] .podium-slot.rank-1 .podium-avatar {
  background: linear-gradient(135deg, #4c3523, #6a4b33);
  border-color: #dfc39b;
  box-shadow: 0 0 0 3px rgba(160, 110, 60, 0.25), 0 8px 20px rgba(76, 53, 35, 0.2);
}
html[data-theme="warm_paper"] .podium-slot.rank-2 .podium-avatar {
  background: linear-gradient(135deg, #5c4033, #7a5843);
  border-color: #dfcebb;
}
html[data-theme="warm_paper"] .podium-slot.rank-3 .podium-avatar {
  background: linear-gradient(135deg, #3d2b20, #5c4033);
  border-color: #dfcebb;
}
/* 宋代经折线装厚册书函台座 */
html[data-theme="warm_paper"] .podium-slot.rank-1 .podium-pedestal {
  background: linear-gradient(to top, #312115, #4c3523 50%, #6a4b33) !important;
  border-top: 3px solid #dfc39b !important;
}
html[data-theme="warm_paper"] .podium-slot.rank-2 .podium-pedestal {
  background: linear-gradient(to top, #271c14, #3d2b20 60%, #5c4033) !important;
  border-top: 2px solid #dfcebb !important;
}
html[data-theme="warm_paper"] .podium-slot.rank-3 .podium-pedestal {
  background: linear-gradient(to top, #1f1610, #312115) !important;
  border-top: 2px solid #cbb8a3 !important;
}
html[data-theme="warm_paper"] .podium-slot.rank-1 .podium-tier {
  background: #f7eee0; color: #854d0e; border: 1px solid #fde047;
}
html[data-theme="warm_paper"] .podium-slot.rank-2 .podium-tier,
html[data-theme="warm_paper"] .podium-slot.rank-3 .podium-tier {
  background: #fcf6ec; color: #6a4b33; border: 1px solid #dfcebb;
}
html[data-theme="warm_paper"] tr.rank-top1 {
  background: #fbf7ee !important;
}
html[data-theme="warm_paper"] tr.rank-top1 td:first-child span {
  background: #6a4b33 !important;
  border-radius: 2px !important;
  border: 1px solid #dfc39b !important;
}

/* ------------------------------------------------------------
   5. 【霁月清风 · 瓷影天青】榜单与领奖台专属特色：汝窑天青悬浮毛玻璃、大圆角
   ------------------------------------------------------------ */
html[data-theme="misty_cyan"] .rank-podium-panel {
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.90) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(20, 184, 166, 0.28) !important;
  box-shadow: 0 10px 32px rgba(15, 118, 110, 0.09) !important;
}
html[data-theme="misty_cyan"] .podium-slot.rank-1 .podium-avatar {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.35), 0 0 24px rgba(20, 184, 166, 0.45) !important;
}
html[data-theme="misty_cyan"] .podium-slot.rank-2 .podium-avatar {
  background: linear-gradient(135deg, #115e59, #0f766e);
  border-color: #99f6e4;
}
html[data-theme="misty_cyan"] .podium-slot.rank-3 .podium-avatar {
  background: linear-gradient(135deg, #134e4a, #115e59);
  border-color: #99f6e4;
}
/* 汝窑天青半透水晶光柱台座 */
html[data-theme="misty_cyan"] .podium-slot.rank-1 .podium-pedestal {
  background: linear-gradient(to top, rgba(15, 118, 110, 0.9), rgba(20, 184, 166, 0.45)) !important;
  border-top: 3px solid #2dd4bf !important;
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.35) !important;
}
html[data-theme="misty_cyan"] .podium-slot.rank-2 .podium-pedestal {
  background: linear-gradient(to top, rgba(17, 94, 89, 0.85), rgba(15, 118, 110, 0.35)) !important;
  border-top: 2px solid #5eead4 !important;
}
html[data-theme="misty_cyan"] .podium-slot.rank-3 .podium-pedestal {
  background: linear-gradient(to top, rgba(19, 78, 74, 0.8), rgba(17, 94, 89, 0.3)) !important;
  border-top: 2px solid #99f6e4 !important;
}
html[data-theme="misty_cyan"] .podium-slot.rank-1 .podium-tier {
  background: #e6f7f6; color: #0f766e; border: 1px solid #5eead4;
}
html[data-theme="misty_cyan"] .podium-slot.rank-2 .podium-tier,
html[data-theme="misty_cyan"] .podium-slot.rank-3 .podium-tier {
  background: #f0fdfa; color: #115e59; border: 1px solid #99f6e4;
}
html[data-theme="misty_cyan"] tr.rank-top1 {
  background: rgba(230, 247, 246, 0.65) !important;
}
html[data-theme="misty_cyan"] tr.rank-top1 td:first-child span {
  background: linear-gradient(135deg, #0f766e, #14b8a6) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.5) !important;
}

@media (max-width: 600px) {
  .top-three-podium {
    gap: 10px;
  }
  .podium-slot.rank-1 .podium-avatar {
    width: 62px;
    height: 62px;
    font-size: 22px;
  }
  .podium-avatar {
    width: 48px;
    height: 48px;
    font-size: 17px;
  }
  .podium-slot.rank-1 .podium-pedestal { height: 50px; }
  .podium-slot.rank-2 .podium-pedestal { height: 36px; }
  .podium-slot.rank-3 .podium-pedestal { height: 26px; }
}

/* ============================================================
   课文背诵通关看板与积分商城管理 五套主题专属雅韵色彩系统 (PC Admin)
   ============================================================ */

/* 背诵通关看板与商城通用控制 */
.board-header {
  background: var(--c-bg-card, #fff) !important;
  border: var(--c-card-border, 1px solid #ebeef5) !important;
  border-radius: var(--c-card-radius, 12px) !important;
}
.recite-summary-card {
  background: var(--c-bg-card, #fff) !important;
  border: var(--c-card-border, 1px solid #e2e8f0) !important;
  border-radius: var(--c-card-radius, 12px) !important;
  border-left: 5px solid var(--c-primary) !important;
  box-shadow: var(--c-card-shadow, 0 4px 14px rgba(0,0,0,0.05)) !important;
}
.board-card {
  background: var(--c-bg-card, #fff) !important;
  border-radius: var(--c-card-radius, 12px) !important;
}
.board-card:hover {
  border-color: var(--c-primary) !important;
  box-shadow: var(--c-primary-shadow, 0 6px 14px rgba(30,58,95,.12)) !important;
}
.board-card.selected {
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 2px var(--c-primary) !important;
}

/* 商城选项卡与卡片 */
.shop-tab-btn.active {
  background: var(--c-primary) !important;
  color: #fff !important;
  box-shadow: var(--c-primary-shadow, 0 4px 10px rgba(0,0,0,0.15)) !important;
}
.goods-card {
  background: var(--c-bg-card, #fff) !important;
  border-radius: var(--c-card-radius, 12px) !important;
  border: var(--c-card-border, 1px solid #e2e8f0) !important;
}

/* 1. 【墨韵书香 · 徽墨天青】 */
html[data-theme="ink_blue"] .recite-bar-fill {
  background: linear-gradient(90deg, #1e3a5f 0%, #3b82f6 100%) !important;
}
html[data-theme="ink_blue"] .board-card.passed {
  background: #f0f4f9 !important;
  border-color: #3b82f6 !important;
}
html[data-theme="ink_blue"] .board-card.passed .stu-name {
  color: #1e3a5f !important;
}
html[data-theme="ink_blue"] .tag-passed {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

/* 2. 【松风竹韵 · 翠竹素卷】 */
html[data-theme="bamboo_green"] .recite-bar-fill {
  background: linear-gradient(90deg, #15803d 0%, #22c55e 100%) !important;
}
html[data-theme="bamboo_green"] .board-card.passed {
  background: #f0fdf4 !important;
  border-color: var(--c-bamboo) !important;
}
html[data-theme="bamboo_green"] .board-card.passed .stu-name {
  color: var(--c-bamboo) !important;
}
html[data-theme="bamboo_green"] .tag-passed {
  background: #f0fdf4 !important;
  color: var(--c-bamboo) !important;
}
html[data-theme="bamboo_green"] .recite-summary-card {
  border-left: 5px solid #16a34a !important;
}

/* 3. 【紫气东来 · 盛唐金石】 */
html[data-theme="imperial_purple"] .recite-bar-fill {
  background: linear-gradient(90deg, #5a1e36 0%, #f59e0b 100%) !important;
}
html[data-theme="imperial_purple"] .board-card.passed {
  background: #fdf2f8 !important;
  border-color: #f59e0b !important;
}
html[data-theme="imperial_purple"] .board-card.passed .stu-name {
  color: #5a1e36 !important;
}
html[data-theme="imperial_purple"] .tag-passed {
  background: #fef3c7 !important;
  color: #b45309 !important;
}
html[data-theme="imperial_purple"] .recite-summary-card {
  border-left: 5px solid #5a1e36 !important;
  box-shadow: 0 4px 18px rgba(90, 30, 54, 0.08), 0 0 0 1px rgba(217, 119, 6, 0.2) !important;
}

/* 4. 【素笺古韵 · 宋版线装】 */
html[data-theme="warm_paper"] .recite-bar-fill {
  background: linear-gradient(90deg, #4c3523 0%, #d97706 100%) !important;
}
html[data-theme="warm_paper"] .board-card.passed {
  background: #faf5ec !important;
  border-color: #b45309 !important;
}
html[data-theme="warm_paper"] .board-card.passed .stu-name {
  color: #4c3523 !important;
}
html[data-theme="warm_paper"] .tag-passed {
  background: #fef3c7 !important;
  color: #92400e !important;
}
html[data-theme="warm_paper"] .recite-summary-card {
  border-left: 5px solid #4c3523 !important;
  outline: 1px dashed rgba(160, 110, 60, 0.25) !important;
  outline-offset: -4px !important;
}

/* 5. 【霁月清风 · 瓷影天青】 */
html[data-theme="misty_cyan"] .recite-bar-fill {
  background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%) !important;
}
html[data-theme="misty_cyan"] .board-card.passed {
  background: #f0fdfa !important;
  border-color: #0f766e !important;
}
html[data-theme="misty_cyan"] .board-card.passed .stu-name {
  color: #0f766e !important;
}
html[data-theme="misty_cyan"] .tag-passed {
  background: #ccfbf1 !important;
  color: #0f766e !important;
}
html[data-theme="misty_cyan"] .recite-summary-card {
  border-left: 5px solid #0f766e !important;
  backdrop-filter: blur(12px) !important;
}

/* 背诵看板入口键主题适配 */
.btn-recite-entry {
  background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%) !important;
  border: none !important;
  box-shadow: 0 3px 10px rgba(30, 58, 95, 0.25) !important;
  color: #ffffff !important;
}
html[data-theme="ink_blue"] .btn-recite-entry {
  background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%) !important;
  box-shadow: 0 3px 10px rgba(30, 58, 95, 0.25) !important;
}
html[data-theme="bamboo_green"] .btn-recite-entry {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%) !important;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.25) !important;
}
html[data-theme="imperial_purple"] .btn-recite-entry {
  background: linear-gradient(135deg, #5a1e36 0%, #f59e0b 100%) !important;
  box-shadow: 0 3px 10px rgba(90, 30, 54, 0.25) !important;
}
html[data-theme="warm_paper"] .btn-recite-entry {
  background: linear-gradient(135deg, #78350f 0%, #9a3412 100%) !important;
  box-shadow: 0 3px 10px rgba(120, 53, 15, 0.25) !important;
}
html[data-theme="misty_cyan"] .btn-recite-entry {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%) !important;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.25) !important;
}

/* ============================================================
   后台全页面移动端通用适配（兜底）
   ============================================================ */
@media (max-width: 768px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .layout .main .content,
  .main .content,
  .content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 12px 12px calc(92px + env(safe-area-inset-bottom, 0px)) 12px !important;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .layout .main {
    padding-bottom: 0 !important;
  }

  /* 顶栏避开手机状态栏/刘海 */
  .layout .header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
    padding-bottom: 8px !important;
    min-height: 56px !important;
  }

  /* 页签横向滚动，避免被截断 */
  .tab-nav,
  .essay-tabs,
  .history-subtabs {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    flex-wrap: nowrap !important;
  }
  .tab-nav .tab-btn,
  .essay-tabs .tab-btn,
  .history-subtabs .tab-btn {
    flex-shrink: 0 !important;
  }

  .panel,
  .card,
  .work-card,
  .workbench-card,
  .app-config-card,
  .hero-card,
  .overview,
  .quick-card,
  .mobile-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .toolbar,
  .class-bar,
  .btn-group,
  .filter-bar,
  .form-grid-2,
  .form-grid-3 {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .toolbar .btn,
  .toolbar button,
  .class-bar .btn,
  .class-bar select,
  .toolbar input,
  .toolbar select,
  .toolbar .search-box,
  .search-box input,
  .form-input,
  .form-select,
  input[type="text"],
  input[type="number"],
  select,
  textarea {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .search-box {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  .table-wrap,
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    align-items: center !important;
    padding: 12px;
  }

  .modal-box,
  .modal-content {
    max-width: 96vw !important;
    width: 96vw !important;
    box-sizing: border-box;
  }

  .more-sheet {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 14px 14px 0 0 !important;
  }

  body {
    padding-bottom: 0 !important;
  }
}

/* 手机端剩余页面工具栏输入框自适应（商城/学生账号/座位/值日等） */
@media (max-width: 768px) {
  .toolbar input[type="text"],
  .toolbar input[type="search"],
  .toolbar select {
    flex: 1 1 45% !important;
    min-width: 0 !important;
    width: auto !important;
  }
  .toolbar .search-box {
    flex: 1 1 100% !important;
  }
  .toolbar .btn {
    flex-shrink: 0;
  }
}

/* 系统设置页手机端分组优化 */
@media (max-width: 768px) {
  .feature-switch-card {
    padding: 12px 14px !important;
    gap: 8px !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
  }
  .switch-card-left {
    gap: 10px !important;
    flex: 1 1 100% !important;
  }
  .switch-card-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 19px !important;
    border-radius: 9px !important;
  }
  .switch-card-desc {
    font-size: 11.5px !important;
  }
  .switch-card-right {
    margin-left: 0 !important;
    width: 100% !important;
    justify-content: flex-end !important;
    padding-top: 4px;
  }
  .app-info-banner,
  .form-actions-bar {
    max-width: 100% !important;
    width: 100% !important;
  }
  .form-actions-bar .btn {
    flex: 1 1 45% !important;
    justify-content: center;
  }
  .tabs,
  .tab-nav,
  .settings-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    flex-wrap: nowrap !important;
  }
}

/* ============================================================
   全站可用性增强：键盘焦点、触控目标、弹窗滚动与低动态偏好
   ============================================================ */
:is(a, button, input, select, textarea, summary, [tabindex], [role="button"]):focus-visible {
  outline: 3px solid var(--c-primary) !important;
  outline-offset: 2px !important;
}

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

[data-a11y-clickable="true"] {
  cursor: pointer;
}

button,
[role="button"],
.btn,
.tab-btn,
.menu-item,
.mobile-tab-item,
.logout,
.close {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden !important;
}

.modal,
.modal-box,
.modal-content {
  overscroll-behavior: contain;
}

.modal-box,
.modal-content {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .btn,
  button:not(.close):not(.essay-dialog-close),
  select,
  .tab-btn,
  .menu-item,
  .mobile-tab-item,
  .logout {
    min-height: 44px;
  }

  .modal-header .close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: -12px -10px -12px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  .modal-box,
  .modal-content,
  .card,
  .btn,
  .tab-btn,
  .mobile-tab-item,
  .close {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   手机后台最终覆盖层
   这里只保留一份移动端结果规则，统一收敛底栏、表单、弹窗、
   浮动层和数据表，避免页面内旧规则互相覆盖。
   ============================================================ */
@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  body {
    padding-bottom: 0 !important;
  }

  .layout,
  .layout .main,
  .layout .content,
  .layout > .main > .content,
  .main,
  .content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .layout .header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 7px) !important;
    padding-bottom: 7px !important;
    min-height: calc(56px + env(safe-area-inset-top, 0px)) !important;
  }

  .layout .header-title {
    font-size: 17px !important;
    line-height: 1.25 !important;
  }

  .mobile-nav-back,
  .mobile-only-back {
    min-width: 76px !important;
    min-height: 44px !important;
    justify-content: center !important;
  }

  .layout .content,
  .layout > .main > .content,
  .main .content,
  .content {
    padding: 12px 12px calc(92px + env(safe-area-inset-bottom, 0px)) 12px !important;
    overflow-x: hidden !important;
  }

  .mobile-container {
    width: 100%;
    max-width: 100%;
    padding: 14px 14px calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden;
  }

  /* 底栏统一为 58px，仅用颜色表示当前页，不再出现背景块或位移。 */
  .mobile-tabbar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1300 !important;
    display: flex !important;
    height: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 0 0 env(safe-area-inset-bottom, 0px) !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.97) !important;
    border-top: 1px solid var(--c-border, #e2e8f0) !important;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  body.modal-open .mobile-tabbar {
    display: none !important;
  }

  .mobile-tab-item,
  .mobile-tab-item:link,
  .mobile-tab-item:visited,
  .mobile-tab-item:hover,
  .mobile-tab-item:focus,
  .mobile-tab-item:active,
  .mobile-tab-item.active,
  .mobile-tab-item.accent {
    min-width: 0 !important;
    min-height: 58px !important;
    padding: 5px 2px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline-offset: -3px !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .mobile-tab-item {
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    color: var(--c-ink-muted, #64748b) !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    text-decoration: none !important;
  }

  .mobile-tab-item i {
    display: block;
    font-size: 20px !important;
    line-height: 1 !important;
  }

  .mobile-tab-item.active,
  .mobile-tab-item.accent.active {
    color: var(--c-primary, #1e3a8a) !important;
    background: transparent !important;
    font-weight: 700 !important;
  }

  .mobile-tab-item.accent:not(.active) {
    color: var(--c-bamboo, #15803d) !important;
  }

  .mobile-tab-item::after {
    content: none !important;
    display: none !important;
  }

  /* 手机表单统一使用 16px，避免 iOS 聚焦时自动放大。 */
  .form-row input,
  .form-row select,
  .form-row textarea,
  .form-input,
  .form-select,
  .class-bar input,
  .class-bar select,
  .toolbar input:not([type="checkbox"]):not([type="radio"]),
  .toolbar select,
  .search-box input,
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  select,
  textarea {
    min-height: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    box-sizing: border-box !important;
  }

  textarea {
    height: auto !important;
    min-height: 108px !important;
    resize: vertical;
  }

  .search-box {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }

  .search-box .search-field {
    width: 100% !important;
    min-width: 0 !important;
  }

  .search-box .search-clear-btn {
    width: 44px !important;
    height: 44px !important;
  }

  .toolbar,
  .class-bar,
  .btn-group,
  .filter-bar,
  .form-grid-2,
  .form-grid-3 {
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
    box-sizing: border-box;
  }

  .class-bar {
    align-items: stretch !important;
    padding: 10px 12px !important;
  }

  .class-bar strong {
    flex: 0 0 100%;
    font-size: 13px;
  }

  .class-bar select {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
    width: auto !important;
  }

  .class-bar .btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }

  .toolbar > .btn,
  .toolbar > button:not(.search-clear-btn),
  .toolbar > select {
    flex: 1 1 calc(50% - 4px);
    min-width: 0 !important;
    justify-content: center;
  }

  .toolbar .tab-group,
  .toolbar .tab-nav {
    flex: 1 1 100%;
  }

  .tab-btn,
  .page-btn {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }

  .pagination {
    gap: 6px !important;
  }

  .page-btn {
    min-width: 44px !important;
    padding: 6px 10px !important;
  }

  .checkbox-inline,
  label:has(> input[type="checkbox"]),
  label:has(> input[type="radio"]) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    margin: 0 7px 0 0;
    accent-color: var(--c-primary, #1e3a8a);
  }

  /* 手机弹窗统一从底部升起，并让正文和页脚各自滚动。 */
  .modal {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .modal-box,
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 18px 18px 0 0 !important;
    max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px))) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .modal-box {
    display: flex !important;
    flex-direction: column !important;
  }

  .modal-box .modal-header,
  .modal-content .modal-header {
    flex: 0 0 auto;
    padding: 14px 16px !important;
  }

  .modal-box .modal-body,
  .modal-content .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal-box .modal-footer,
  .modal-content .modal-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--c-bg-card, #fff) !important;
  }

  .modal-content {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .modal-footer .btn {
    margin-left: 0 !important;
  }

  .modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .modal-footer .btn,
  .modal-footer button {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }

  /* 固定操作层始终与底栏、刘海和系统手势区保持安全距离。 */
  .fab {
    right: 14px !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1350 !important;
  }

  .toast,
  .toast-undo {
    z-index: 1400 !important;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: calc(100vw - 24px) !important;
  }

  .toast-undo {
    gap: 10px !important;
  }

  .toast-undo .msg {
    min-width: 0;
    white-space: normal !important;
  }

  .batch-top-dock {
    top: calc(66px + env(safe-area-inset-top, 0px)) !important;
    z-index: 1350 !important;
    max-width: calc(100vw - 24px) !important;
  }

  .batch-bar {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1350 !important;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-sizing: border-box;
  }

  .batch-bar.show {
    display: flex !important;
  }

  .batch-bar .count {
    min-width: 0;
    font-size: 13px;
    color: var(--c-ink-sub, #475569);
  }

  .batch-bar button {
    min-height: 44px !important;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  .batch-bar .reset {
    background: var(--c-primary-soft, #e8eef8);
    color: var(--c-primary, #1e3a8a);
  }

  .batch-bar .del {
    background: #fef2f2;
    color: #dc2626;
  }

  /* 座位图只在自身容器内横向滚动，不把整页撑宽。 */
  .seat-layout {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  /* 宽表卡片化。score.php / feedback.php 已有专用手机列表，不在此列。 */
  .mobile-card-panel {
    overflow: visible !important;
    padding: 12px !important;
  }

  .mobile-card-panel > .table-scroll-hint {
    display: none !important;
  }

  .mobile-card-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  table.mobile-card-table {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
    table-layout: auto !important;
  }

  table.mobile-card-table thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  table.mobile-card-table tbody {
    display: block !important;
    width: 100% !important;
  }

  table.mobile-card-table tbody tr.mobile-card-row {
    display: block !important;
    width: 100% !important;
    margin: 0 0 10px !important;
    padding: 10px 12px !important;
    border: 1px solid var(--c-border, #e2e8f0) !important;
    border-radius: 12px !important;
    background: var(--c-bg-card, #fff) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045) !important;
    box-sizing: border-box;
    overflow: hidden;
  }

  table.mobile-card-table tbody tr.mobile-card-row:last-child {
    margin-bottom: 0 !important;
  }

  table.mobile-card-table tbody tr:hover {
    background: var(--c-bg-card, #fff) !important;
  }

  table.mobile-card-table td {
    display: grid !important;
    grid-template-columns: minmax(78px, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 8px 0 !important;
    border: 0 !important;
    border-bottom: 1px dashed var(--c-border-subtle, #edf1f7) !important;
    color: var(--c-ink, #1f2937) !important;
    font-size: 13.5px !important;
    line-height: 1.5 !important;
    text-align: right !important;
    overflow-wrap: anywhere;
    box-sizing: border-box;
  }

  table.mobile-card-table td:last-child {
    border-bottom: 0 !important;
  }

  table.mobile-card-table td::before {
    content: attr(data-label);
    min-width: 0;
    color: var(--c-ink-muted, #64748b);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
  }

  table.mobile-card-table td.mobile-card-check-cell {
    grid-template-columns: minmax(78px, 34%) auto;
    justify-content: start;
  }

  table.mobile-card-table td.mobile-card-check-cell input {
    justify-self: end;
  }

  table.mobile-card-table td.mobile-card-action-cell {
    display: block !important;
    padding-top: 12px !important;
    text-align: left !important;
  }

  table.mobile-card-table td.mobile-card-action-cell::before {
    display: block;
    margin-bottom: 8px;
  }

  table.mobile-card-table td.mobile-card-action-cell > div,
  table.mobile-card-table td.mobile-card-action-cell .row-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center;
  }

  table.mobile-card-table td.mobile-card-action-cell .btn,
  table.mobile-card-table td.mobile-card-action-cell button,
  table.mobile-card-table td.mobile-card-action-cell a {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
  }

  table.mobile-card-table tr.mobile-card-empty-row {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  table.mobile-card-table tr.mobile-card-empty-row td {
    display: block !important;
    padding: 32px 12px !important;
    border: 1px dashed var(--c-border, #e2e8f0) !important;
    border-radius: 12px !important;
    text-align: center !important;
  }

  table.mobile-card-table tr.mobile-card-empty-row td::before {
    content: none !important;
    display: none !important;
  }

  /* 保留页面内横向滚动的表格，不做尺寸锁死。 */
  .table-wrap:not(.mobile-card-wrap),
  .table-responsive:not(.mobile-card-wrap) {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================================
   手机横屏覆盖层
   仅在后台 .layout 页面生效，登录页不会命中任何选择器。
   解决 844x390、932x430 等横屏手机仍套用桌面双栏的问题。
   ============================================================ */
@media (max-width: 932px) and (max-height: 500px) and (orientation: landscape) {
  html:has(.layout),
  body:has(.layout) {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  body:has(.layout) {
    padding-bottom: 0 !important;
  }

  .layout {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .layout .sidebar {
    display: none !important;
  }

  .layout .main {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  .layout .header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    width: 100% !important;
    min-height: 52px !important;
    height: auto !important;
    padding: 6px 10px !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    background: var(--c-bg-card, #fff) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
  }

  .layout .header .header-right,
  .layout .header .header-quote,
  .layout .header .switch-terminal-btn,
  .layout .switch-terminal-btn {
    display: none !important;
  }

  .layout .header::after {
    content: "" !important;
    display: block !important;
    width: 58px !important;
    height: 1px !important;
    flex: 0 0 58px !important;
  }

  .layout .header-title-wrap,
  .layout .header-title {
    min-width: 0 !important;
  }

  .layout .header-title-wrap {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }

  .layout .header-title {
    flex: 1 1 auto !important;
    overflow: hidden !important;
    color: var(--c-ink, #1f2937) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .layout .mobile-nav-back,
  .layout .mobile-only-back {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    min-width: 58px !important;
    min-height: 44px !important;
    padding: 0 8px !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
    color: var(--c-primary, #1e3a8a) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    background: var(--c-primary-soft, rgba(30, 58, 138, 0.08)) !important;
  }

  .layout .content,
  .layout > .main > .content,
  .layout .main .content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 10px 10px calc(78px + env(safe-area-inset-bottom, 0px)) 10px !important;
    overflow-x: hidden !important;
  }

  .layout .mobile-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 10px calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: hidden !important;
  }

  body:has(.layout) .mobile-tabbar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1300 !important;
    display: flex !important;
    height: calc(52px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 0 0 env(safe-area-inset-bottom, 0px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border-radius: 0 !important;
    border-top: 1px solid var(--c-border, #e2e8f0) !important;
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  body:has(.layout) .mobile-tab-item,
  body:has(.layout) .mobile-tab-item:link,
  body:has(.layout) .mobile-tab-item:visited,
  body:has(.layout) .mobile-tab-item:hover,
  body:has(.layout) .mobile-tab-item:focus,
  body:has(.layout) .mobile-tab-item:active,
  body:has(.layout) .mobile-tab-item.active {
    min-width: 0 !important;
    min-height: 52px !important;
    padding: 4px 2px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
  }

  body:has(.layout) .mobile-tab-item {
    display: flex !important;
    flex: 1 1 0 !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1px !important;
    color: var(--c-ink-muted, #64748b) !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    text-decoration: none !important;
  }

  body:has(.layout) .mobile-tab-item i {
    display: block !important;
    font-size: 19px !important;
    line-height: 1 !important;
  }

  body:has(.layout) .mobile-tab-item.active,
  body:has(.layout) .mobile-tab-item.accent.active {
    color: var(--c-primary, #1e3a8a) !important;
    font-weight: 700 !important;
  }

  body:has(.layout) .mobile-tab-item.accent:not(.active) {
    color: var(--c-bamboo, #15803d) !important;
  }

  .layout .panel,
  .layout .card,
  .layout .work-card,
  .layout .workbench-card,
  .layout .app-config-card,
  .layout .hero-card,
  .layout .overview,
  .layout .quick-card,
  .layout .mobile-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .layout .toolbar,
  .layout .class-bar,
  .layout .btn-group,
  .layout .filter-bar,
  .layout .form-grid-2,
  .layout .form-grid-3 {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  .layout .class-bar {
    align-items: stretch !important;
    padding: 9px 10px !important;
  }

  .layout .class-bar strong {
    flex: 0 0 100% !important;
    font-size: 13px !important;
  }

  .layout .class-bar select,
  .layout .toolbar > select,
  .layout .toolbar > .btn,
  .layout .toolbar > button:not(.search-clear-btn) {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
  }

  .layout .toolbar .search-box,
  .layout .search-box {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .layout input:not([type="checkbox"]):not([type="radio"]),
  .layout select,
  .layout textarea,
  .layout .form-input,
  .layout .form-select,
  .layout .search-box input {
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }

  .layout input:not([type="checkbox"]):not([type="radio"]),
  .layout select,
  .layout .form-input,
  .layout .form-select,
  .layout .search-box input {
    min-height: 44px !important;
    height: 44px !important;
  }

  .layout textarea {
    min-height: 108px !important;
    height: auto !important;
    resize: vertical !important;
  }

  .layout .tab-nav,
  .layout .essay-tabs,
  .layout .history-subtabs {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }

  .layout .tab-nav .tab-btn,
  .layout .essay-tabs .tab-btn,
  .layout .history-subtabs .tab-btn {
    flex: 0 0 auto !important;
    min-height: 44px !important;
  }

  .layout .page-btn,
  .layout .tab-btn,
  .layout .preset-chip,
  .layout .score-pill,
  .layout .hw-mini-btn,
  .layout .hw-preset-btn,
  .layout .row-actions .btn,
  .layout .row-actions button,
  .layout .row-actions a {
    min-height: 44px !important;
    align-items: center !important;
    touch-action: manipulation;
  }

  .layout .row-more {
    display: none !important;
  }

  .layout .batch-student-item {
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  .layout label:has(> input[type="checkbox"]),
  .layout label:has(> input[type="radio"]),
  .layout .checkbox-inline {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 44px !important;
  }

  .layout input[type="checkbox"],
  .layout input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    margin: 0 7px 0 0 !important;
    accent-color: var(--c-primary, #1e3a8a) !important;
  }

  .layout .seat-cell {
    min-width: 64px !important;
    height: 54px !important;
    line-height: 54px !important;
  }

  .layout .seat-clear {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    display: inline-flex !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    width: 44px !important;
    height: 44px !important;
    padding: 4px 5px !important;
    box-sizing: border-box !important;
    color: #fff !important;
    font-size: 0 !important;
    line-height: 1 !important;
    opacity: 0.95 !important;
  }

  .layout .seat-clear::before {
    content: "×";
    font-size: 14px;
    line-height: 1;
  }

  .layout #btnQuickEditTopic,
  .layout #btnQuickDeleteTopic,
  .layout a[onclick="openTopicModal()"],
  .layout a[onclick="toggleEssayRuleInfo()"],
  .layout a[onclick="resetDefaultPrompt()"] {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 44px !important;
    padding: 0 6px !important;
    box-sizing: border-box !important;
  }

  .layout .modal {
    align-items: flex-end !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .layout .modal-box,
  .layout .modal-content {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px))) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border-radius: 18px 18px 0 0 !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .layout .modal-box .modal-body,
  .layout .modal-content .modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .layout .modal-footer,
  .layout .modal-box .modal-footer,
  .layout .modal-content .modal-footer {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 3 !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--c-bg-card, #fff) !important;
  }

  .layout .modal-footer .btn,
  .layout .modal-footer button {
    flex: 1 1 calc(50% - 4px) !important;
    justify-content: center !important;
  }

  body:has(.layout) .batch-top-dock {
    top: calc(62px + env(safe-area-inset-top, 0px)) !important;
    max-width: calc(100vw - 20px) !important;
    z-index: 1350 !important;
  }

  body:has(.layout) .batch-bar {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1350 !important;
    display: none !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 9px 10px !important;
    border: 1px solid var(--c-border, #e2e8f0) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18) !important;
    box-sizing: border-box !important;
  }

  body:has(.layout) .batch-bar.show {
    display: flex !important;
  }

  body:has(.layout) .batch-bar button {
    min-height: 44px !important;
  }

  body:has(.layout) .fab {
    right: 12px !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1350 !important;
  }

  body:has(.layout) .toast,
  body:has(.layout) .toast-undo {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1400 !important;
    max-width: calc(100vw - 20px) !important;
  }

  /* 宽表在横屏手机中同样卡片化，保留页面内横向滚动容器。 */
  .layout .mobile-card-panel {
    overflow: visible !important;
    padding: 10px !important;
  }

  .layout .mobile-card-panel > .table-scroll-hint,
  .layout .mobile-card-wrap .table-scroll-hint {
    display: none !important;
  }

  .layout .mobile-card-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .layout table.mobile-card-table {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
    table-layout: auto !important;
  }

  .layout table.mobile-card-table thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .layout table.mobile-card-table tbody {
    display: block !important;
    width: 100% !important;
  }

  .layout table.mobile-card-table tbody tr.mobile-card-row {
    display: block !important;
    width: 100% !important;
    margin: 0 0 9px !important;
    padding: 9px 10px !important;
    border: 1px solid var(--c-border, #e2e8f0) !important;
    border-radius: 12px !important;
    background: var(--c-bg-card, #fff) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.045) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .layout table.mobile-card-table td {
    display: grid !important;
    grid-template-columns: minmax(76px, 34%) minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 10px !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 7px 0 !important;
    border: 0 !important;
    border-bottom: 1px dashed var(--c-border-subtle, #edf1f7) !important;
    color: var(--c-ink, #1f2937) !important;
    font-size: 13.5px !important;
    line-height: 1.5 !important;
    text-align: right !important;
    overflow-wrap: anywhere !important;
    box-sizing: border-box !important;
  }

  .layout table.mobile-card-table td:last-child {
    border-bottom: 0 !important;
  }

  .layout table.mobile-card-table td::before {
    content: attr(data-label);
    min-width: 0 !important;
    color: var(--c-ink-muted, #64748b) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
  }

  .layout table.mobile-card-table td.mobile-card-check-cell {
    grid-template-columns: minmax(76px, 34%) auto !important;
    justify-content: start !important;
  }

  .layout table.mobile-card-table td.mobile-card-check-cell input {
    justify-self: end !important;
  }

  .layout table.mobile-card-table td.mobile-card-action-cell {
    display: block !important;
    padding-top: 11px !important;
    text-align: left !important;
  }

  .layout table.mobile-card-table td.mobile-card-action-cell::before {
    display: block !important;
    margin-bottom: 8px !important;
  }

  .layout table.mobile-card-table td.mobile-card-action-cell > div,
  .layout table.mobile-card-table td.mobile-card-action-cell .row-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .layout table.mobile-card-table td.mobile-card-action-cell .btn,
  .layout table.mobile-card-table td.mobile-card-action-cell button,
  .layout table.mobile-card-table td.mobile-card-action-cell a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    margin: 0 !important;
  }

  .layout table.mobile-card-table tr.mobile-card-empty-row {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .layout table.mobile-card-table tr.mobile-card-empty-row td {
    display: block !important;
    padding: 30px 12px !important;
    border: 1px dashed var(--c-border, #e2e8f0) !important;
    border-radius: 12px !important;
    text-align: center !important;
  }

  .layout table.mobile-card-table tr.mobile-card-empty-row td::before {
    content: none !important;
    display: none !important;
  }

  .layout .table-wrap:not(.mobile-card-wrap),
  .layout .table-responsive:not(.mobile-card-wrap) {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* 横屏手机的统一触控尺寸与独立手机工作台底栏保护。 */
@media (max-width: 932px) and (max-height: 500px) and (orientation: landscape) {
  .layout .btn,
  .layout button:not(.close):not(.essay-dialog-close),
  .layout .tab-btn,
  .layout .shop-tab-btn,
  .layout .theme-apply-btn,
  .layout .rollcall-btn,
  .layout .page-btn,
  .layout .more-menu-btn,
  .layout .hw-mini-btn,
  .layout .hw-preset-btn {
    min-height: 44px !important;
    box-sizing: border-box !important;
    touch-action: manipulation;
  }

  .layout tbody a:not(.btn),
  .layout tbody button:not(.btn) {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  body:has(.mobile-header) .btn-switch-pc,
  body:has(.mobile-header) .btn-menu-toggle {
    min-width: 44px !important;
    min-height: 44px !important;
  }

  body:has(.mobile-header) .mobile-tabbar {
    display: flex !important;
    height: calc(52px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    box-sizing: border-box !important;
  }

  body:has(.mobile-header) .mobile-tab-item,
  body:has(.mobile-header) .mobile-tab-item:link,
  body:has(.mobile-header) .mobile-tab-item:visited,
  body:has(.mobile-header) .mobile-tab-item:hover,
  body:has(.mobile-header) .mobile-tab-item:focus,
  body:has(.mobile-header) .mobile-tab-item:active,
  body:has(.mobile-header) .mobile-tab-item.active {
    min-height: 52px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body:has(.mobile-header) .mobile-container {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 768px) {
  .layout .row-more {
    display: none !important;
  }

  .layout tbody a:not(.btn),
  .layout tbody button:not(.btn),
  .layout a[onclick="resetDefaultPrompt()"] {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  .layout .preset-chip,
  .layout .score-pill,
  .layout .hw-mini-btn,
  .layout .hw-preset-btn {
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  .layout .page-btn {
    min-width: 44px !important;
  }

  .layout .board-left .btn {
    min-width: 44px !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 0 8px !important;
    line-height: 42px !important;
    box-sizing: border-box !important;
  }

  .layout .seat-cell {
    min-height: 48px !important;
    height: 48px !important;
    line-height: 48px !important;
  }

  body:has(.mobile-header) .btn-switch-pc {
    min-width: 44px !important;
    justify-content: center !important;
  }

  body:has(.mobile-header) .btn-menu-toggle {
    width: 44px !important;
    min-width: 44px !important;
    flex: 0 0 44px !important;
  }
}
