/* ────────────────────────────────────────────────────────────
   智力象管理系统 · 设计系统 v2
   设计理念：暖纸底 + 深翡翠 + 赤陶橙 / 细线分层 / 极少阴影
   ──────────────────────────────────────────────────────────── */

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

:root {
    /* ── 色板 · 暖纸亮色 ── */
    --bg:           #f5f1e8;   /* 暖米白主背景 */
    --bg-deep:      #ede7d6;   /* 略深的米色，用于分区 */
    --surface:      #fffdf7;   /* 卡片/面板，近白纸 */
    --surface-2:    #f0eadb;   /* 次级面板 / hover 底 */
    --surface-3:    #e8e1cf;   /* 三级面板 / 已选中 */

    --border:       #ddd3bc;   /* 暖边线主色 */
    --border-soft:  #e8e0cc;   /* 更轻的分割线 */
    --border-strong:#b8ad93;   /* 强调边线 */

    --text:         #1a1814;   /* 近黑暖墨 */
    --text-dim:     #5c5546;   /* 次级文字 */
    --text-faint:   #8e8472;   /* 弱文字 / 占位 */
    --text-mute:    #a99f8a;   /* 更弱，用于元信息 */

    /* ── 强调色 ── */
    --accent:       #0f766e;   /* 深翡翠 teal，主操作 */
    --accent-dark:  #0b5d56;
    --accent-light: #14b8a6;
    --accent-bg:    #d9f5f0;   /* 翡翠浅底 */
    --accent-bg-2:  #eafaf7;

    --clay:         #c2410c;   /* 赤陶橙，辅助强调 / 警示 */
    --clay-bg:      #fdebd9;
    --amber:        #b45309;   /* 琥珀，潜在/警告 */
    --amber-bg:     #fef3c7;
    --moss:         #4d7c0f;   /* 苔绿，正常/成功 */
    --moss-bg:      #ecfccb;
    --slate:        #475569;   /* 石板灰，历史/中性 */
    --slate-bg:     #e2e8f0;
    --rose:         #be123c;   /* 玫红，扣款/危险 */
    --rose-bg:      #ffe4e6;

    /* ── 字体 ── */
    --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', 'SF Mono', 'Fira Code', Consolas, monospace;
    --font: var(--font-sans);

    /* ── 间距 / 圆角 / 阴影 ── */
    --r-sm: 4px;
    --r:    6px;
    --r-md: 8px;
    --r-lg: 10px;
    --r-xl: 14px;
    --shadow-sm: 0 1px 0 rgba(26,24,20,.04);
    --shadow:     0 1px 2px rgba(26,24,20,.06), 0 0 0 1px rgba(26,24,20,.02);
    --shadow-md:  0 4px 12px rgba(26,24,20,.08);
    --shadow-lg:  0 12px 32px rgba(26,24,20,.10);

    /* ── 布局尺寸 ── */
    --sidebar-w: 232px;
    --topbar-h:  56px;
    --content-max: 1440px;
}

html { overflow-y: scroll; scrollbar-gutter: stable; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'cv11', 'ss01';
    font-size: 14px;
}

::selection { background: var(--accent-bg); color: var(--accent-dark); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-dark); }

/* ────────────────────────────────────────────────────────────
   布局骨架：sidebar + topbar + main
   ──────────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── 侧边栏 ── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}
.sidebar-brand {
    padding: 18px 22px 16px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--topbar-h);
}
.sidebar-brand .mark {
    width: 26px; height: 26px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -.02em;
}
.sidebar-brand .name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -.01em;
}
.sidebar-brand .name small {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-faint);
    font-family: var(--font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: 1px;
}

.sidebar-section { padding: 14px 0 6px; }
.sidebar-label {
    padding: 4px 22px;
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text-mute);
    margin-bottom: 4px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; padding: 0 10px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    transition: background .12s, color .12s;
    position: relative;
}
.sidebar-nav a:hover {
    background: var(--surface-2);
    color: var(--text);
}
.sidebar-nav a.active {
    background: var(--accent-bg);
    color: var(--accent-dark);
    font-weight: 600;
}
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 6px; bottom: 6px;
    width: 2px;
    background: var(--accent);
    border-radius: 2px;
}
.sidebar-nav a .ico {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-faint);
    width: 16px;
    text-align: center;
}
.sidebar-nav a.active .ico { color: var(--accent); }

.sidebar-foot {
    margin-top: auto;
    padding: 12px 14px;
    border-top: 1px solid var(--border-soft);
    background: var(--surface-2);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: var(--r);
}
.sidebar-user .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--clay);
    color: #fff;
    display: grid; place-items: center;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    flex-shrink: 0;
}
.sidebar-user .info { min-width: 0; flex: 1; }
.sidebar-user .info .nm {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user .info .rl {
    font-size: 10px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.sidebar-user .out {
    color: var(--text-faint);
    font-size: 11px;
    padding: 4px 6px;
    border-radius: var(--r-sm);
    transition: all .12s;
}
.sidebar-user .out:hover { color: var(--rose); background: var(--rose-bg); }

/* ── 主区域 ── */
.main-area {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── 顶部工具栏 ── */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
}
.topbar .crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-faint);
    font-family: var(--font-mono);
}
.topbar .crumb .sep { color: var(--border-strong); }
.topbar .crumb .current { color: var(--text); font-weight: 600; }
.topbar .crumb a { color: var(--text-dim); }
.topbar .spacer { flex: 1; }
.topbar .actions { display: flex; align-items: center; gap: 8px; }
.topbar .clock {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
    padding: 4px 10px;
    background: var(--surface-2);
    border-radius: var(--r);
    letter-spacing: .02em;
}

/* ── 主内容 ── */
.main { flex: 1; min-width: 0; padding: 28px; }
.main-inner { width: 100%; max-width: var(--content-max); margin: 0 auto; }

/* ── 移动端：侧边栏收起 + 全站组件适配 ── */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-area { margin-left: 0; }
    .menu-toggle { display: inline-flex !important; }

    /* 内容区内边距收紧 */
    .main { padding: 16px 14px; }
    .main-inner { max-width: 100%; }

    /* 表格可横向滚动，避免撑破布局 */
    .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tbl { font-size: 12px; min-width: 540px; }
    .tbl thead th, .tbl tbody td { padding: 9px 12px; }

    /* 表单网格单列 */
    .form-grid { grid-template-columns: 1fr; }

    /* 卡片头允许换行 */
    .card-head { flex-wrap: wrap; }

    /* 紧凑搜索框占满 */
    .search-compact { width: 100%; }
    .search-compact input,
    .search-compact input:focus { width: 100%; }

    /* 顶栏时钟在手机隐藏，省空间 */
    .topbar .clock { display: none; }

    /* 分页换行 */
    .pager { flex-wrap: wrap; }

    /* 分段控件 / 过滤药丸：横向滑动而非换行挤压 */
    .segmented { display: flex; max-width: 100%; overflow-x: auto; }
    .filter-pills { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }

    /* 仪表盘两栏 → 单列 */
    .dash-grid { grid-template-columns: 1fr; }

    /* 课程管理：左导航转为顶部横向滑动筛选条 */
    .course-layout { flex-direction: column; gap: 12px; }
    .subject-nav {
        width: 100%; position: static; max-height: none;
        display: flex; gap: 6px; overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding: 8px;
    }
    .subject-nav .title {
        display: flex; align-items: center; flex: 0 0 auto;
        position: sticky; left: 0; z-index: 2;
        background: var(--surface); padding-right: 8px; margin-right: 2px;
        border-right: 1px solid var(--border-soft);
        font-size: 11px; font-weight: 600; color: var(--text-faint);
        letter-spacing: .05em;
    }
    .subject-nav .subject-item { flex: 0 0 auto; scroll-snap-align: start; }
    .subject-nav a {
        border-left: none; border-bottom: 2px solid transparent;
        white-space: nowrap; padding: 8px 14px; flex: 0 1 auto;
    }
    .subject-nav a.active { border-left-color: transparent; border-bottom-color: var(--accent); }
}

@media (max-width: 600px) {
    .main { padding: 12px 10px; }
    .card-body, .card-body.tight { padding: 14px; }
    .card-head { padding: 12px 14px; }
    .page-title { font-size: 19px; }
    .page-head { margin-bottom: 16px; }
    .stats-row { gap: 8px; }
    .tbl thead th, .tbl tbody td { padding: 8px 10px; }
    .class-card .cmeta { grid-template-columns: 1fr; }
    .hero { padding: 36px 0 24px; }
    .hero h1 { font-size: 26px; }
    .persona-card, .class-card { padding: 14px; }
    .page-tools { width: 100%; }
    .page-tools .btn { flex: 1 1 auto; }

    /* 信息带换行，筛选栏在手机端纵向堆叠且控件满宽 */
    .page-band { flex-wrap: wrap; gap: 10px; }
    .nc-bar, .an-bar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
    .nc-bar > *, .an-bar > * { width: 100%; }
    .nc-hint, .an-hint { margin-left: 0; }
}
.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    width: 32px; height: 32px;
    border-radius: var(--r);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-dim);
}

/* ────────────────────────────────────────────────────────────
   页面头：标题 + 工具条
   ──────────────────────────────────────────────────────────── */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--text);
    line-height: 1.2;
}
/* 默认主题标题：底部一道淡色装饰线（其它主题用更高优先级覆盖） */
.page-title::after {
    content: '';
    display: block;
    width: 46px; height: 3px;
    margin-top: 6px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 2px;
    opacity: .85;
}
.page-title .sub {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-faint);
    font-family: var(--font-mono);
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-top: 4px;
}
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── 分段标签（segmented control）── */
.segmented {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 3px;
}
.segmented a {
    padding: 6px 14px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    transition: all .12s;
    white-space: nowrap;
}
.segmented a:hover { color: var(--text); }
.segmented a.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}
.segmented .count {
    font-family: var(--font-mono);
    font-size: 10px;
    margin-left: 4px;
    color: var(--text-mute);
    font-weight: 500;
}
.segmented a.active .count { color: var(--accent); }

/* ── 过滤药丸 ── */
.filter-pills { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filter-pills a {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: all .12s;
    background: var(--surface);
}
.filter-pills a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg-2);
}
.filter-pills a.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── 紧凑搜索框 ── */
.search-compact { position: relative; }
.search-compact input {
    padding: 6px 32px 6px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-family: var(--font);
    background: var(--surface);
    width: 200px;
    outline: none;
    transition: all .15s;
    color: var(--text);
}
.search-compact input::placeholder { color: var(--text-mute); }
.search-compact input:focus {
    border-color: var(--accent);
    width: 240px;
    box-shadow: 0 0 0 3px var(--accent-bg);
}
.search-compact button {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-faint);
    padding: 2px 4px;
}
.search-compact button:hover { color: var(--accent); }

/* ────────────────────────────────────────────────────────────
   KPI / 统计行
   ──────────────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 18px;
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.stat-card .label {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
    margin-bottom: 6px;
}
.stat-card .value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.stat-card .delta {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
    font-family: var(--font-mono);
}
.stat-card.accent { border-left: 3px solid var(--accent); }
.stat-card.accent .value { color: var(--accent-dark); }
.stat-card.clay   { border-left: 3px solid var(--clay); }
.stat-card.clay .value { color: var(--clay); }
.stat-card.amber  { border-left: 3px solid var(--amber); }
.stat-card.moss   { border-left: 3px solid var(--moss); }
.stat-card.moss .value { color: var(--moss); }
.stat-card.rose   { border-left: 3px solid var(--rose); }
.stat-card.rose .value { color: var(--rose); }

/* ────────────────────────────────────────────────────────────
   卡片
   ──────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 16px;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card-head {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
}
.card-head h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-head .h-meta {
    font-size: 11px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.card-body { padding: 20px; }
.card-body.tight { padding: 14px 18px; }
.card-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--border-soft);
    background: var(--surface-2);
    font-size: 12px;
    color: var(--text-faint);
}

/* ────────────────────────────────────────────────────────────
   表格
   ──────────────────────────────────────────────────────────── */
.tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: var(--surface);
}
.tbl thead th {
    text-align: left;
    padding: 10px 16px;
    background: var(--surface-2);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-family: var(--font-mono);
    position: sticky;
    top: 0;
}
.tbl tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
    vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover td { background: var(--accent-bg-2); }
.tbl td.num,
.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.tbl td.mono { font-family: var(--font-mono); font-size: 12px; }
.tbl a.link { font-weight: 500; }

.tbl-wrap {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
}

/* ────────────────────────────────────────────────────────────
   徽章 / 标签
   ──────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    font-family: var(--font-mono);
    text-transform: uppercase;
}
.b-moss   { background: var(--moss-bg);   color: var(--moss); }
.b-amber  { background: var(--amber-bg);  color: var(--amber); }
.b-slate  { background: var(--slate-bg);  color: var(--slate); }
.b-accent { background: var(--accent-bg); color: var(--accent-dark); }
.b-clay   { background: var(--clay-bg);   color: var(--clay); }
.b-rose   { background: var(--rose-bg);   color: var(--rose); }

.chip {
    display: inline-block;
    font-size: 12px;
    padding: 4px 11px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    transition: all .12s;
    font-weight: 500;
}
.chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg-2);
}
.chip.solid { background: var(--accent-bg); color: var(--accent-dark); border-color: transparent; }

.chip-tag {
    display: inline-block;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 4px;
    font-weight: 500;
    background: var(--accent-bg);
    color: var(--accent-dark);
}
.chip-tag.clay { background: var(--clay-bg); color: var(--clay); }
.chip-tag.amber { background: var(--amber-bg); color: var(--amber); }

.role-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--r-sm);
    font-size: 11px;
    background: var(--surface-2);
    color: var(--text-dim);
    border: 1px solid var(--border-soft);
    font-weight: 500;
    margin: 1px 2px;
}

/* 选中标签（搜索条件用） */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 12px;
    background: var(--accent-bg);
    color: var(--accent-dark);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
}
.tag-pill .x {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: .5;
    padding: 0 2px;
}
.tag-pill .x:hover { opacity: 1; }
.tag-pill.clay { background: var(--clay-bg); color: var(--clay); }
.tag-pill.amber { background: var(--amber-bg); color: var(--amber); }

/* ────────────────────────────────────────────────────────────
   按钮
   ──────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--r);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    transition: all .12s;
    white-space: nowrap;
    line-height: 1.4;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-dark);
    color: #fff;
}
.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-dim);
}
.btn-ghost:hover {
    border-color: var(--border-strong);
    color: var(--text);
    background: var(--surface-2);
}
.btn-clay { background: var(--clay); color: #fff; }
.btn-clay:hover { background: #9a3309; color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

/* ────────────────────────────────────────────────────────────
   表单
   ──────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-family: var(--font-mono);
    margin-bottom: 6px;
}
.field label .req { color: var(--clay); margin-left: 2px; }
.input,
.select,
.textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    font-size: 14px;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: all .15s;
}
.input::placeholder,
.textarea::placeholder { color: var(--text-mute); }
.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
.textarea { resize: vertical; min-height: 80px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ── 警告条 ── */
.alert {
    padding: 10px 14px;
    border-radius: var(--r);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-error { background: var(--rose-bg); color: var(--rose); border-color: #fecdd3; }
.alert-info  { background: var(--accent-bg-2); color: var(--accent-dark); border-color: var(--accent-bg); }

/* ────────────────────────────────────────────────────────────
   分页
   ──────────────────────────────────────────────────────────── */
.pager {
    display: flex;
    gap: 4px;
    margin-top: 22px;
    justify-content: center;
    align-items: center;
}
.pager a,
.pager span {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    color: var(--text-dim);
    background: var(--surface);
    transition: all .1s;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg-2); }
.pager .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.pager .gap { border: none; background: transparent; color: var(--text-mute); }

/* ────────────────────────────────────────────────────────────
   空状态
   ──────────────────────────────────────────────────────────── */
.empty {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-faint);
}
.empty .glyph {
    font-family: var(--font-mono);
    font-size: 28px;
    color: var(--border-strong);
    margin-bottom: 10px;
    letter-spacing: .08em;
}
.empty .msg { font-size: 13px; }
.empty .hint { font-size: 11px; color: var(--text-mute); margin-top: 4px; font-family: var(--font-mono); }

/* ────────────────────────────────────────────────────────────
   网格布局
   ──────────────────────────────────────────────────────────── */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 12px;
}

/* 人员卡片（员工） */
.persona-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 18px;
    transition: all .15s;
}
.persona-card:hover {
    border-color: var(--accent);
    background: var(--accent-bg-2);
}
.persona-card .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.persona-card .av {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--clay);
    color: #fff;
    display: grid; place-items: center;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
    flex-shrink: 0;
}
.persona-card .nm { font-size: 14px; font-weight: 600; color: var(--text); }
.persona-card .mt { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); margin-bottom: 8px; }
.persona-card .roles { display: flex; flex-wrap: wrap; gap: 3px; }

/* 班级卡片 */
.class-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 18px;
    transition: all .15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.class-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: inherit;
}
.class-card .cn {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.35;
    color: var(--text);
}
.class-card .cmeta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 14px;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 10px;
}
.class-card .cmeta .l {
    color: var(--text-mute);
    font-size: 10px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .05em;
    display: block;
    margin-bottom: 1px;
}
.class-card .cbar {
    height: 3px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}
.class-card .cbar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width .3s;
}
.class-card .cfoot {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.class-card .cfoot .cnt {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    letter-spacing: -.02em;
}
.class-card .cfoot .cnt.mute { color: var(--text-mute); }
.class-card .cfoot .cnt .u { font-size: 12px; font-weight: 500; color: var(--text-faint); margin-left: 2px; font-family: var(--font); }
.class-card .cfoot .more { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }

/* ────────────────────────────────────────────────────────────
   首页 hero / features
   ──────────────────────────────────────────────────────────── */
.hero {
    padding: 56px 0 36px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 32px;
}
.hero .eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--accent);
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.hero .eyebrow::before {
    content: '';
    width: 18px; height: 1px;
    background: var(--accent);
}
.hero h1 {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.15;
    margin-bottom: 14px;
    color: var(--text);
}
.hero h1 .accent { color: var(--accent); }
.hero .lede {
    font-size: 15px;
    color: var(--text-dim);
    max-width: 580px;
    margin-bottom: 22px;
    line-height: 1.6;
}
.hero .cta-row { display: flex; gap: 10px; flex-wrap: wrap; }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 8px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 22px;
    transition: all .15s;
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.feature .ico {
    width: 32px; height: 32px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
}
.feature h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.feature p { font-size: 13px; color: var(--text-dim); line-height: 1.55; }

/* ────────────────────────────────────────────────────────────
   登录页（分屏）
   ──────────────────────────────────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.auth-pane {
    background: var(--surface);
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border);
}
.auth-pane .brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
}
.auth-pane .brand-mark .mark {
    width: 28px; height: 28px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
}
.auth-pane .brand-mark .nm { font-size: 15px; font-weight: 600; color: var(--text); }
.auth-pane h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: 8px;
    color: var(--text);
}
.auth-pane .sub {
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 28px;
    font-family: var(--font-mono);
}
.auth-form { max-width: 360px; }
.auth-hint {
    margin-top: 22px;
    padding: 10px 12px;
    background: var(--surface-2);
    border-radius: var(--r);
    font-size: 12px;
    color: var(--text-faint);
    border: 1px dashed var(--border);
    font-family: var(--font-mono);
    max-width: 360px;
}
.auth-hint code {
    color: var(--accent);
    background: var(--accent-bg);
    padding: 1px 5px;
    border-radius: 3px;
}

.auth-aside {
    background: var(--accent-dark);
    color: #fff;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.auth-aside::before {
    content: '';
    position: absolute;
    top: -50%; right: -30%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(20,184,166,.25), transparent 60%);
    border-radius: 50%;
}
.auth-aside .quote {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -.01em;
    position: relative;
    z-index: 1;
    max-width: 460px;
}
.auth-aside .quote .accent { color: #5eead4; }
.auth-aside .meta {
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(255,255,255,.6);
    letter-spacing: .04em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}
.auth-aside .meta strong { color: #fff; font-weight: 600; }

@media (max-width: 800px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-pane {
        padding: 40px 24px;
        border-right: none;
        align-items: center;
    }
    .auth-pane .brand-mark { justify-content: center; }
    .auth-pane h2 { font-size: 22px; }
    .auth-form { max-width: 100%; width: 100%; }
    .auth-hint { max-width: 100%; }
    .auth-pane .alert { max-width: 100% !important; width: 100%; }
}

@media (max-width: 480px) {
    .auth-pane { padding: 28px 18px; }
    .auth-pane .brand-mark { margin-bottom: 28px; }
    .auth-pane h2 { font-size: 20px; }
    .auth-pane .sub { font-size: 12px; margin-bottom: 22px; }
    .auth-pane .brand-mark .nm { font-size: 14px; }
    .auth-form .field { margin-bottom: 14px; }
    .auth-form .input { font-size: 16px; }
    .auth-hint { font-size: 11px; padding: 8px 10px; }
}

/* ────────────────────────────────────────────────────────────
   仪表盘
   ──────────────────────────────────────────────────────────── */
.dash-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-top: 16px;
}
.dash-grid .col { display: flex; flex-direction: column; gap: 16px; }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.quick-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 18px;
    text-decoration: none;
    color: inherit;
    transition: all .15s;
    display: block;
}
.quick-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: inherit;
}
.quick-card .ico {
    width: 28px; height: 28px;
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 10px;
}
.quick-card .tt { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.quick-card .ds { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.quick-card .ar { font-size: 11px; color: var(--accent); font-family: var(--font-mono); margin-top: 8px; }

/* 简易柱状/趋势 */
.trend {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 80px;
    padding: 8px 0;
}
.trend .bar {
    flex: 1;
    background: var(--accent-bg);
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    transition: background .12s;
    position: relative;
}
.trend .bar.hi { background: var(--accent); }
.trend .bar:hover { background: var(--accent-dark); }
.trend-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-faint);
    margin-top: 4px;
    letter-spacing: .04em;
}

/* 活动列表 */
.feed { display: flex; flex-direction: column; }
.feed-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
}
.feed-item:last-child { border-bottom: none; }
.feed-item .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}
.feed-item .dot.clay { background: var(--clay); }
.feed-item .dot.amber { background: var(--amber); }
.feed-item .dot.moss { background: var(--moss); }
.feed-item .body { flex: 1; min-width: 0; }
.feed-item .body .ln { font-size: 13px; color: var(--text); }
.feed-item .body .ln strong { font-weight: 600; }
.feed-item .body .ts { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 1px; letter-spacing: .04em; }

/* ────────────────────────────────────────────────────────────
   课程管理专用
   ──────────────────────────────────────────────────────────── */
.course-layout { display: flex; gap: 20px; align-items: flex-start; }
.subject-nav {
    width: 200px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    position: sticky;
    top: calc(var(--topbar-h) + 28px);
    align-self: flex-start;
    max-height: calc(100vh - var(--topbar-h) - 56px);
    overflow-y: auto;
}
.subject-nav .title {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-faint);
    padding: 14px 16px 8px;
    border-bottom: 1px solid var(--border-soft);
}
.subject-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    text-decoration: none;
    font-size: 13px;
    color: var(--text-dim);
    transition: all .12s;
    border-left: 2px solid transparent;
}
.subject-nav a:hover { background: var(--surface-2); color: var(--text); }
.subject-nav a.active {
    background: var(--accent-bg);
    color: var(--accent-dark);
    border-left-color: var(--accent);
    font-weight: 600;
}
.subject-nav a .badge {
    font-size: 10px;
    background: var(--surface-2);
    color: var(--text-faint);
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 500;
    font-family: var(--font-mono);
    text-transform: none;
    letter-spacing: 0;
}
.subject-nav a.active .badge { background: var(--accent); color: #fff; }
.course-content { flex: 1; min-width: 0; }

.level-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 12px;
    overflow: hidden;
}
.level-head {
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    background: var(--surface);
}
.level-head .grade {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.level-head .grade .sub { font-weight: 400; color: var(--text-faint); font-size: 12px; }
.level-head .count {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-faint);
    background: var(--surface-2);
    padding: 2px 9px;
    border-radius: 10px;
}
.level-head .ic {
    width: 24px; height: 24px;
    border-radius: var(--r-sm);
    display: grid; place-items: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11px;
}
.ic-s { background: var(--accent-bg); color: var(--accent); }
.ic-l { background: var(--amber-bg); color: var(--amber); }
.ic-t { background: var(--moss-bg); color: var(--moss); }

.group-block { padding: 14px 18px; }
.group-block + .group-block { border-top: 1px solid var(--border-soft); }
.group-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    letter-spacing: .02em;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* 搜索区域 */
.search-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 18px;
}
.search-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.search-row .field { flex: 1; min-width: 180px; margin-bottom: 0; }

.result-summary {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 14px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--r);
    border: 1px solid var(--border-soft);
    font-family: var(--font-mono);
    letter-spacing: .02em;
}
.result-summary strong { color: var(--accent); font-weight: 700; font-size: 13px; }

.common-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.common-chip {
    display: inline-block;
    padding: 5px 11px;
    border-radius: var(--r-sm);
    font-size: 12px;
    background: var(--accent-bg);
    color: var(--accent-dark);
    border: 1px solid transparent;
    transition: all .12s;
    font-weight: 500;
}
.common-chip:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }

/* 自动补全下拉 */
.autocomplete-wrap { position: relative; flex: 1; }
.autocomplete-dropdown {
    position: absolute;
    top: 100%; left: 0; right: 0;
    z-index: 50;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    display: none;
    margin-top: 2px;
}
.autocomplete-dropdown.show { display: block; }
.autocomplete-dropdown .item {
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-dim);
    transition: background .1s;
}
.autocomplete-dropdown .item:hover,
.autocomplete-dropdown .item.active {
    background: var(--accent-bg);
    color: var(--accent-dark);
}

/* ────────────────────────────────────────────────────────────
   班级详情
   ──────────────────────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 24px;
}
.detail-item label {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-faint);
    display: block;
    margin-bottom: 4px;
}
.detail-item span { color: var(--text); font-size: 14px; }
.detail-item span.mono { font-family: var(--font-mono); font-size: 13px; }

.back-link {
    font-size: 12px;
    color: var(--text-dim);
    text-decoration: none;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    letter-spacing: .02em;
    transition: color .12s;
}
.back-link:hover { color: var(--accent); }

/* ────────────────────────────────────────────────────────────
   404
   ──────────────────────────────────────────────────────────── */
.err-page { text-align: center; padding: 80px 24px; }
.err-page .code {
    font-family: var(--font-mono);
    font-size: 84px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    letter-spacing: -.04em;
}
.err-page .msg { font-size: 14px; color: var(--text-dim); margin-top: 12px; margin-bottom: 24px; font-family: var(--font-mono); letter-spacing: .04em; }

/* ────────────────────────────────────────────────────────────
   考勤
   ──────────────────────────────────────────────────────────── */
.att-rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.att-rule {
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    padding: 12px 14px;
}
.att-rule .l {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-faint);
    margin-bottom: 4px;
}
.att-rule .v {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}
.att-rule .u { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); margin-left: 4px; font-weight: 500; }

/* ── 公共尾部 ── */
.foot {
    text-align: center;
    padding: 16px 28px;
    color: var(--text-mute);
    font-size: 11px;
    font-family: var(--font-mono);
    letter-spacing: .04em;
    border-top: 1px solid var(--border-soft);
    margin-top: 28px;
}

/* ── 工具类 ── */
.text-mono { font-family: var(--font-mono); }
.text-faint { color: var(--text-faint); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-clay { color: var(--clay); }
.text-rose { color: var(--rose); }
.tabular { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ────────────────────────────────────────────────────────────
   内容类页面（新内容 feed / 异常 anomaly）· 共享 + 主题区分
   ----------------------------------------------------------------
   两页结构相同但语义不同：
     · 新内容 = 最近同步拉取的内容（收件箱 / feed）→ 翡翠绿
     · 异常   = 未匹配课程库、待标注的内容（告警 / alert）→ 赤陶橙
   通过 .theme-feed / .theme-anomaly 覆盖 --pc，让同一套组件自动换色，
   从视觉上一眼区分两个页面，同时消除重复样式。
   ──────────────────────────────────────────────────────────── */
.theme-feed    { --pc: var(--accent);   --pc-dark: var(--accent-dark); --pc-bg: var(--accent-bg);   --pc-bg2: var(--accent-bg-2); }
.theme-anomaly { --pc: var(--clay);     --pc-dark: var(--clay);        --pc-bg: var(--clay-bg);       --pc-bg2: var(--clay-bg); }

/* 页面头部信息带：图标 + 用途说明 + 状态标签，明确本页是 feed 还是 alert */
.page-band {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); border-left: 3px solid var(--pc);
}
.page-band .pb-ico {
  width: 34px; height: 34px; border-radius: var(--r-md);
  display: grid; place-items: center; font-size: 15px; font-family: var(--font-mono); font-weight: 700;
  background: var(--pc-bg); color: var(--pc-dark); flex-shrink: 0;
}
.page-band .pb-main { flex: 1; min-width: 0; }
.page-band .pb-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--text); line-height: 1.2; }
.page-band .pb-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.page-band .pb-meta { flex-shrink: 0; }

/* 筛选工具条按本页主题色着色（绿 vs 橙），与另一页形成对比 */
.theme-feed .nc-bar, .theme-anomaly .an-bar {
  background: var(--pc-bg2); border-radius: var(--r-md); padding: 10px 12px;
}
.theme-feed .nc-select:focus, .theme-feed .nc-search:focus,
.theme-anomaly .an-select:focus, .theme-anomaly .an-search:focus { border-color: var(--pc); }
.theme-feed .btn-primary, .theme-anomaly .btn-primary { background: var(--pc); }
.theme-feed .btn-primary:hover, .theme-anomaly .btn-primary:hover { background: var(--pc-dark); }

/* 内容单元格 / 提示 / 空状态（原两页内联样式，提升为全局共享） */
.content-cell .txt { font-size: 13px; color: var(--text); line-height: 1.5; }
.empty-content { color: var(--text-faint); font-style: italic; }
.nc-hint, .an-hint { color: var(--text-faint); font-size: 12px; margin-left: auto; }
.nc-empty, .an-empty { text-align: center; color: var(--text-faint); padding: 48px 0; }

/* ── 异常页顶部筛选栏（紧凑单行，搜索+老师+班级+类型+天数+按钮） ── */
.an-top-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--surface-1); border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.an-top-bar .an-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex: 1 1 auto;
}
.an-top-bar .an-search {
  width: 180px; max-width: 220px; padding: 5px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text);
}
.an-top-bar .an-select {
  padding: 5px 8px; font-size: 13px; max-width: 140px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text);
}
.an-top-bar .an-select-sm { max-width: 90px; }
.an-top-bar .btn-sm { padding: 5px 12px; font-size: 13px; }
.an-bar-hint {
  color: var(--text-faint); font-size: 12px; white-space: nowrap;
}

/* 异常页顶部筛选栏 手机端适配 */
@media (max-width: 768px) {
  .an-top-bar { flex-direction: column; align-items: stretch; }
  .an-top-bar .an-bar { flex-direction: column; }
  .an-top-bar .an-bar > * { width: 100%; max-width: none; }
  .an-top-bar .an-search { width: 100%; max-width: none; }
  .an-bar-hint { text-align: center; }
}

/* 上课状态徽章（原仅在页内定义，提升全局） */
.badge.ok    { background: var(--moss-bg);   color: var(--moss); }
.badge.muted { background: var(--surface-2);  color: var(--text-dim); }

/* ────────────────────────────────────────────────────────────
   课时点选弹层（异常页 / 新内容页 共用，lesson-picker.js）
   ──────────────────────────────────────────────────────────── */
.ls-pick-btn {
    width: 100%;
    max-width: 220px;
    text-align: left;
    font-size: 12px;
    padding: 5px 24px 5px 10px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--clay);
    cursor: pointer;
    font-family: var(--font);
    transition: all .12s;
    position: relative;
}
.ls-pick-btn::after {
    content: '▾';
    position: absolute;
    right: 9px;
    color: var(--text-faint);
    font-size: 10px;
}
.ls-pick-btn:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-bg-2); }
.ls-pick-btn:disabled { opacity: .6; cursor: default; }

.ls-pop {
    position: fixed;
    z-index: 1000;
    width: 300px;
    max-height: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ls-pop-search {
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 11px 14px;
    font-size: 13px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
}
.ls-pop-search::placeholder { color: var(--text-mute); }
.ls-pop-list { overflow-y: auto; padding: 6px; flex: 1; }
.ls-grp {
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-faint);
    padding: 8px 8px 3px;
}
.ls-opt {
    padding: 8px 10px;
    border-radius: var(--r-sm);
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ls-opt:hover { background: var(--accent-bg); color: var(--accent-dark); }
.ls-opt.rec { background: var(--accent-bg-2); font-weight: 600; }
.ls-rec {
    font-size: 10px;
    background: var(--accent);
    color: #fff;
    padding: 1px 6px;
    border-radius: 8px;
    flex-shrink: 0;
    letter-spacing: .02em;
}
.ls-empty { padding: 18px; text-align: center; color: var(--text-faint); font-size: 12px; }
.ls-hint { padding: 8px 14px; font-size: 11.5px; color: var(--text-faint); background: var(--surface-2); border-radius: var(--r); margin-bottom: 4px; }
.ls-all { padding: 8px 14px; font-size: 12px; color: var(--accent-dark); cursor: pointer; font-weight: 600; border-radius: var(--r); margin-bottom: 4px; }
.ls-all:hover { background: var(--accent-bg); }

/* ────────────────────────────────────────────────────────────
   主题中心（/theme）
   ──────────────────────────────────────────────────────────── */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 18px;
}
.theme-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 20px 22px;
    transition: all .15s;
}
.theme-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.theme-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}
.theme-swatches {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.theme-swatches .sw {
    flex: 1;
    height: 46px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
}
.theme-meta { margin-bottom: 18px; }
.theme-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
    margin-bottom: 8px;
}
.theme-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}
.theme-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.theme-current {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-mono);
    opacity: 0;
    transition: opacity .15s;
}
.theme-card.active .theme-current { opacity: 1; }
.theme-tip {
    margin-top: 22px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--r-md);
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ────────────────────────────────────────────────────────────
   移动端响应式补丁（v26 · 2026-07-26）
   覆盖所有后台页面：表格横向滚动、固定栅格变单列、侧边栏遮罩、
   输入框防 iOS 缩放、顶栏/页面头简化。置于文件末尾以保证优先级。
   ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    html, body { overflow-x: hidden; }
    .main { padding: 16px; }
    .main-inner { max-width: 100%; }

    /* 侧边栏打开时，主区上方浮一层遮罩；点击遮罩触发 footer.php 的外部关闭 JS */
    #sidebar.open ~ .main-area::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        z-index: 90;
    }

    /* 表格横向滚动（覆盖 .tbl-wrap 的 overflow:hidden） */
    .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tbl { min-width: 480px; }

    /* 固定多列栅格 → 单列 */
    .form-grid { grid-template-columns: 1fr; }
    .dash-grid { grid-template-columns: 1fr; }

    /* 顶栏与页面头简化 */
    .topbar { padding: 0 12px; }
    .topbar .clock { display: none; }
    .topbar .crumb { font-size: 12px; }
    .page-head { align-items: flex-start; }
    .page-title { font-size: 18px; }
    .card-head { flex-wrap: wrap; gap: 8px; }

    /* 图片/视频不撑破容器 */
    img, iframe, video { max-width: 100%; height: auto; }

    /* 输入框字号 ≥16px，防 iOS Safari 自动缩放页面 */
    .input, input[type="text"], input[type="password"], input[type="email"],
    input[type="number"], input[type="search"], input[type="tel"], input[type="url"],
    input[type="date"], textarea, select {
        font-size: 16px;
    }

    /* 操作区换行，避免横向溢出 */
    .actions, .card-head .h-meta { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .main { padding: 12px; }
    .page-title { font-size: 16px; }
    .topbar .crumb { font-size: 11px; }
    .tbl thead th, .tbl tbody td { padding: 8px 10px; }
    .btn-lg { width: 100%; }
}

/* ── 通用分页器（异常 / 新内容 等列表页） ── */
.pager {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    justify-content: center;
    padding: 16px 12px; margin-top: 4px;
    font-size: 13px; color: var(--text-dim);
}
.pager .pg {
    display: inline-flex; align-items: center; min-height: 34px; padding: 0 16px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text); text-decoration: none;
    transition: border-color .15s, color .15s, background .15s;
}
.pager .pg:hover { border-color: var(--accent); color: var(--accent); }
.pager .pg.dis { color: var(--text-faint); background: var(--bg-soft); border-color: transparent; pointer-events: none; }
.pager .pg-cur { font-weight: 600; color: var(--text); }
.pager .pg-total { color: var(--text-faint); margin-left: 4px; }
@media (max-width: 600px) {
    .pager { gap: 8px; padding: 14px 8px; }
    .pager .pg { flex: 1 1 auto; justify-content: center; min-height: 38px; }
}
