/* ============================================================
   教师打卡系统 · 公共样式
   目录结构
   1. 设计变量（色板 / 字阶 / 圆角 / 阴影 / 间距）
   2. 基础重置与排版
   3. 页面骨架（顶栏 / 主体 / 页头 / 页脚）
   4. 面板 Panel
   5. 按钮 Button
   6. 表单 Field / Input / Select
   7. 标签 Tag / 徽章 Badge
   8. 数据表 Table（含手机端堆叠模式）
   9. 列表卡片 List-row
   10. 分页 Pagination
   11. 空状态 Empty
   12. 弹层 Modal 基础
   13. 工具类
   ============================================================ */

/* ---------- 1. 设计变量 ---------- */
:root {
    /* 纸墨色系：暖灰底 + 纸白面板，避免高饱和渐变 */
    --c-bg: #f4f3f0;
    --c-surface: #ffffff;
    --c-surface-2: #faf9f7;
    --c-surface-hover: #f7f6f3;

    --c-ink: #14171a;
    --c-ink-2: #4d535b;
    --c-ink-3: #8b9099;
    --c-ink-4: #b3b7bd;

    --c-line: rgba(20, 23, 26, 0.12);
    --c-line-soft: rgba(20, 23, 26, 0.07);

    /* 主色：深藏青；点缀：哑金 */
    --c-brand: #1f3d5c;
    --c-brand-deep: #16293d;
    --c-brand-soft: rgba(31, 61, 92, 0.07);
    --c-gold: #a3762f;

    /* 语义色：上课 / 下课 / 警示 */
    --c-go: #15704f;
    --c-go-soft: rgba(21, 112, 79, 0.10);
    --c-stop: #9c3b2e;
    --c-stop-soft: rgba(156, 59, 46, 0.10);
    --c-warn: #8a6d1f;

    --r-sm: 4px;
    --r-md: 7px;
    --r-lg: 12px;

    --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-2: 0 12px 32px -20px rgba(16, 24, 40, 0.40);
    --shadow-pop: 0 24px 60px -28px rgba(16, 24, 40, 0.45);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
    --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
        "Songti SC", "STSong", serif;

    --maxw: 1080px;
    --maxw-narrow: 720px;
    --gutter: 20px;
}

/* ---------- 2. 基础重置与排版 ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.65;
    color: var(--c-ink);
    background: var(--c-bg);
    /* 极淡的纸张纹理感：两道窄渐变，不用彩色 */
    background-image: linear-gradient(180deg, rgba(31, 61, 92, 0.035), rgba(31, 61, 92, 0) 320px);
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.3px;
    color: var(--c-ink);
}

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

a:hover {
    color: var(--c-brand-deep);
}

b,
strong {
    font-weight: 600;
}

.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

:focus-visible {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
}

/* ---------- 3. 页面骨架 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(244, 243, 240, 0.92);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--c-line);
}

.site-header .bar {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: 62px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--c-ink);
}

.brand:hover {
    color: var(--c-ink);
}

/* 品牌标记：一个描边方框，替代 emoji */
.brand .mark {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border: 1.5px solid var(--c-brand);
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 600;
    color: var(--c-brand);
}

.brand .word {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1.5px;
}

.brand .sub {
    display: block;
    font-family: var(--font-serif);
    font-size: 10px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--c-ink-3);
    line-height: 1;
    margin-top: 2px;
}

/* 学校切换器：登录后品牌位显示当前学校，多校时可展开下拉（school-switch.js） */
.school-switch {
    position: relative;
}

button.school-toggle {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.school-toggle .caret {
    font-size: 10px;
    color: var(--c-ink-3);
    margin-left: 2px;
}

.school-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 80;
    min-width: 200px;
    padding: 6px;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
}

.school-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    background: none;
    border: 0;
    border-radius: var(--r-sm);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    color: var(--c-ink-2);
    text-align: left;
}

.school-option:hover {
    background: var(--c-surface-hover);
    color: var(--c-ink);
}

.school-option.selected {
    color: var(--c-brand);
    font-weight: 600;
    background: var(--c-brand-soft);
}

.school-option-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav a {
    font-size: 14px;
    color: var(--c-ink-2);
    padding: 7px 12px;
    border-radius: var(--r-sm);
    transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
    color: var(--c-brand);
    background: var(--c-brand-soft);
}

.site-nav .who {
    font-size: 13px;
    color: var(--c-ink-3);
    padding-left: 14px;
    margin-left: 4px;
    border-left: 1px solid var(--c-line);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* 退出登录：导航内的 POST 表单，外观与导航链接一致 */
.site-nav .nav-logout {
    display: flex;
}

.site-nav .logout-btn,
.site-nav .nav-login-btn {
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 0;
    color: var(--c-ink-2);
    padding: 7px 12px;
    border: none;
    border-radius: var(--r-sm);
    background: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.site-nav .logout-btn:hover {
    color: var(--c-stop);
    background: var(--c-stop-soft);
}

/* 「去登录」只是导航里的一个入口，配色跟着其他链接走 */
.site-nav .nav-login-btn:hover {
    color: var(--c-brand);
    background: var(--c-brand-soft);
}

.page {
    flex: 1;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 32px var(--gutter) 40px;
}

.page.narrow {
    max-width: var(--maxw-narrow);
}

.page-head {
    margin-bottom: 22px;
}

.eyebrow {
    font-family: var(--font-serif);
    font-size: 11px;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--c-gold);
    margin-bottom: 8px;
}

.page-title {
    font-size: 26px;
    letter-spacing: 1px;
}

.page-title .count {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--c-ink-3);
    margin-left: 10px;
    letter-spacing: 0;
}

.page-desc {
    margin-top: 8px;
    font-size: 14px;
    color: var(--c-ink-3);
}

.page-desc .sep {
    color: var(--c-ink-4);
    margin: 0 8px;
}

/* 通用分隔符：卡片副标题等未单独定义过的容器共用这一档间距 */
.sep {
    color: var(--c-ink-4);
    margin: 0 7px;
}

.head-rule {
    margin-top: 18px;
    height: 1px;
    background: linear-gradient(90deg, var(--c-brand) 0 44px, var(--c-line-soft) 44px 100%);
}

.site-footer {
    padding: 24px var(--gutter) 40px;
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.6px;
    color: var(--c-ink-4);
    border-top: 1px solid var(--c-line-soft);
    margin-top: 8px;
}

/* ---------- 4. 面板 ---------- */
.panel {
    background: var(--c-surface);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.panel + .panel {
    margin-top: 16px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
    border-bottom: 1px solid var(--c-line-soft);
}

.panel-head h2 {
    font-size: 17px;
    letter-spacing: 0.8px;
}

.panel-head .total {
    font-size: 13px;
    color: var(--c-ink-3);
}

.panel-head .total b {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 600;
    color: var(--c-brand);
    margin: 0 3px;
}

.panel-body {
    padding: 22px;
}

.panel-body.flush {
    padding: 0;
}

.section-label {
    font-size: 12px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--c-ink-3);
    font-family: var(--font-serif);
}

/* ---------- 5. 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    background: var(--c-surface);
    color: var(--c-ink);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.btn-primary {
    background: var(--c-brand);
    border-color: var(--c-brand);
    color: #fff;
}

.btn-primary:hover {
    background: var(--c-brand-deep);
    border-color: var(--c-brand-deep);
    color: #fff;
}

.btn-ghost {
    border-color: var(--c-line);
    color: var(--c-ink-2);
    background: transparent;
}

.btn-ghost:hover {
    border-color: var(--c-brand);
    color: var(--c-brand);
    background: var(--c-brand-soft);
}

/* 删除类按钮：静态即红，一眼可辨危险操作 */
.btn-ghost.btn-danger {
    border-color: rgba(156, 59, 46, 0.45);
    color: var(--c-stop);
}

.btn-ghost.btn-danger:hover {
    border-color: var(--c-stop);
    color: var(--c-stop);
    background: var(--c-stop-soft);
}

.btn-go {
    background: var(--c-go);
    border-color: var(--c-go);
    color: #fff;
}

.btn-go:hover {
    background: #0f5d41;
    border-color: #0f5d41;
    color: #fff;
}

.btn-stop {
    background: var(--c-stop);
    border-color: var(--c-stop);
    color: #fff;
}

.btn-stop:hover {
    background: #853025;
    border-color: #853025;
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    height: 48px;
    font-size: 15px;
    padding: 0 24px;
}

.btn-sm {
    height: 32px;
    font-size: 13px;
    padding: 0 12px;
    letter-spacing: 0.5px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn:disabled:hover {
    background: var(--c-brand);
    border-color: var(--c-brand);
    color: #fff;
}

/* 文字链接式操作（返回、次要动作） */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--c-ink-2);
    padding: 6px 0;
    border-bottom: 1px solid transparent;
}

.link-arrow:hover {
    color: var(--c-brand);
    border-bottom-color: var(--c-brand);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.toolbar .spacer {
    margin-left: auto;
}

/* ---------- 6. 表单 ---------- */
.field {
    margin-bottom: 16px;
}

.field > label,
.label {
    display: block;
    font-size: 12px;
    letter-spacing: 1.2px;
    color: var(--c-ink-3);
    margin-bottom: 7px;
}

.input,
.select,
textarea.input {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    font-family: inherit;
    font-size: 15px;
    color: var(--c-ink);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
    color: var(--c-ink-4);
}

.input:hover,
.select:hover {
    border-color: var(--c-ink-4);
}

.input:focus,
.select:focus {
    border-color: var(--c-brand);
    box-shadow: 0 0 0 3px var(--c-brand-soft);
}

.select {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238b9099' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.select:disabled,
.select.locked {
    background-color: var(--c-surface-2);
    color: var(--c-ink-3);
    cursor: not-allowed;
}

/* 只读展示框（如锁定的学校名） */
.static-field {
    height: 42px;
    line-height: 40px;
    padding: 0 13px;
    font-size: 15px;
    color: var(--c-ink-2);
    background: var(--c-surface-2);
    border: 1px dashed var(--c-line);
    border-radius: var(--r-md);
}

.field-hint {
    margin-top: 7px;
    font-size: 12px;
    color: var(--c-ink-3);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    font-size: 14px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    margin-bottom: 18px;
}

.alert-error {
    background: var(--c-stop-soft);
    border-color: rgba(156, 59, 46, 0.22);
    color: var(--c-stop);
}

.alert-success {
    background: var(--c-go-soft);
    border-color: rgba(21, 112, 79, 0.22);
    color: var(--c-go);
}

/* info / warning 走中性色，不与成败提示抢注意力 */
.alert-info,
.alert-warning {
    background: var(--c-surface-2);
    border-color: var(--c-line);
    color: var(--c-ink-2);
}

.alert::before {
    content: "";
    width: 3px;
    align-self: stretch;
    flex-shrink: 0;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.65;
}

/* 内联筛选表单（记录页顶部） */
.filters {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 22px;
    background: var(--c-surface);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.filters .field {
    margin: 0;
    min-width: 168px;
}

.filters .actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.filters .actions .link-arrow {
    height: 40px;
}

input[type="date"].input {
    min-width: 168px;
    font-variant-numeric: tabular-nums;
}

input[type="date"].input::-webkit-calendar-picker-indicator {
    opacity: 0.45;
    cursor: pointer;
    transition: opacity 0.15s;
}

input[type="date"].input:hover::-webkit-calendar-picker-indicator {
    opacity: 0.85;
}

/* ---------- 7. 标签 / 徽章 ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px;
    font-size: 12px;
    letter-spacing: 0.4px;
    border-radius: var(--r-sm);
    background: var(--c-surface-2);
    border: 1px solid var(--c-line-soft);
    color: var(--c-ink-2);
    white-space: nowrap;
}

/* 前置小圆点，替代 emoji 表示状态 */
.tag::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}

.tag-plain::before {
    content: none;
}

.tag-start,
.type-tag.start {
    background: var(--c-go-soft);
    border-color: rgba(21, 112, 79, 0.2);
    color: var(--c-go);
}

.tag-end,
.type-tag.end {
    background: var(--c-stop-soft);
    border-color: rgba(156, 59, 46, 0.2);
    color: var(--c-stop);
}

.tag-role {
    background: var(--c-brand-soft);
    border-color: rgba(31, 61, 92, 0.18);
    color: var(--c-brand);
}

/* ---------- 8. 数据表 ---------- */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.data thead th {
    font-family: var(--font-serif);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--c-ink-3);
    text-align: left;
    padding: 13px 22px;
    background: var(--c-surface-2);
    border-bottom: 1px solid var(--c-line-soft);
    white-space: nowrap;
}

table.data tbody td {
    padding: 14px 22px;
    border-bottom: 1px solid var(--c-line-soft);
    color: var(--c-ink);
    vertical-align: top;
}

table.data tbody tr:last-child td {
    border-bottom: none;
}

table.data tbody tr:hover {
    background: var(--c-surface-hover);
}

table.data .col-time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--c-ink-2);
}

/* 课表首列（节次+时间）：窄列不换行，给星期格子让宽度 */
table.data .col-period {
    white-space: nowrap;
    width: 1%;
    color: var(--c-ink-2);
}

table.data .cell-strong {
    font-weight: 500;
}

table.data .cell-sub {
    margin-top: 3px;
    font-size: 12px;
    color: var(--c-ink-3);
}

/* 行内操作按钮组（教师名单：修改 / 删除） */
table.data .cell-ops {
    white-space: nowrap;
}

table.data .cell-ops .btn + .btn {
    margin-left: 8px;
}

/* ---------- 9. 列表卡片 ---------- */
.list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 22px;
    background: var(--c-surface);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

a.list-row:hover {
    color: inherit;
    border-color: var(--c-brand);
    box-shadow: var(--shadow-2);
}

/* 操作区可能有多个入口（学校管理页：教师管理 + 打卡管理 + 班级列表） */
.list-row .cta {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 列表行操作按钮统一规格：主次只靠颜色区分，不再高低错落 */
.list-row .cta .btn {
    height: 36px;
    padding: 0 14px;
}

/* 左侧编号轨：用序号代替色条 */
.list-row .idx {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--c-ink-4);
    width: 42px;
    flex-shrink: 0;
    line-height: 1.2;
}

.list-row .main {
    flex: 1;
    min-width: 240px;
}

.list-row .title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.list-row .meta {
    margin-top: 6px;
    font-size: 13px;
    color: var(--c-ink-3);
    line-height: 1.7;
    word-break: break-all;
}

.list-row .meta .sep {
    color: var(--c-ink-4);
    margin: 0 7px;
}

.list-row .side {
    text-align: right;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--c-ink-4);
    line-height: 1.7;
}

/* ---------- 10. 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 20px 0 4px;
    font-size: 14px;
}

.pagination a,
.pagination span {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-sm);
    background: var(--c-surface);
    color: var(--c-ink-2);
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.pagination a:hover {
    border-color: var(--c-brand);
    color: var(--c-brand);
    background: var(--c-brand-soft);
}

.pagination .current {
    background: var(--c-brand);
    border-color: var(--c-brand);
    color: #fff;
    font-weight: 500;
}

.pagination .disabled {
    color: var(--c-ink-4);
    background: var(--c-surface-2);
    border-color: var(--c-line-soft);
    cursor: not-allowed;
}

/* ---------- 11. 空状态 ---------- */
.empty {
    padding: 66px 24px;
    text-align: center;
    color: var(--c-ink-3);
}

.empty .glyph {
    width: 46px;
    height: 46px;
    margin: 0 auto 16px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    color: var(--c-ink-4);
}

.empty .glyph svg {
    width: 20px;
    height: 20px;
}

.empty .title {
    font-size: 15px;
    color: var(--c-ink-2);
    letter-spacing: 0.6px;
}

.empty .sub {
    margin-top: 6px;
    font-size: 13px;
    color: var(--c-ink-4);
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- 12. 弹层基础 ---------- */
.mask {
    position: fixed;
    inset: 0;
    background: rgba(20, 23, 26, 0.42);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    animation: fade-in 0.18s ease;
}

.mask.hidden {
    display: none;
}

.sheet {
    width: 400px;
    max-width: 100%;
    background: var(--c-surface);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop);
    overflow: hidden;
    animation: rise 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- 13. 工具类 ---------- */
.muted { color: var(--c-ink-3); }
.strong { font-weight: 600; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack-narrow { max-width: 420px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

.mono {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
    font-size: 11px;
    letter-spacing: 0;
    line-height: 1.6;
    color: var(--c-ink-4);
    word-break: break-all;
}

/* 单元素类型标签的基础样式由 .tag 提供，.type-tag 只负责取色 */
.type-tag {
    font-variant-numeric: tabular-nums;
}

/* 独立居中卡片（信息完善等单步表单） */
.center-stage {
    flex: 1;
    display: grid;
    place-items: center;
    width: 100%;
    padding: 40px 16px;
}

.auth-card {
    width: 420px;
    max-width: 100%;
    padding: 28px;
}

/* 教师新增/编辑与删除确认页：字段比登录卡多，给点宽度并居中 */
.form-card {
    width: 520px;
    max-width: 100%;
    margin: 0 auto;
}

.auth-card .card-title {
    font-size: 21px;
    letter-spacing: 1px;
}

.auth-card .card-sub {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--c-ink-3);
}

.auth-card .card-sub .highlight {
    color: var(--c-brand);
    font-weight: 500;
}

.auth-card .card-foot {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--c-line-soft);
    font-size: 12px;
    letter-spacing: 0.4px;
    color: var(--c-ink-4);
    text-align: center;
}

/* 二维码缩略格 */
.qr-cell {
    flex-shrink: 0;
    text-align: center;
}

.qr-frame {
    display: block;
    width: 148px;
    height: 148px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--c-line-soft);
    border-radius: var(--r-md);
}

.qr-canvas {
    display: block;
    width: 212px;
    height: auto;
    background: #fff;
    border: 1px solid var(--c-line-soft);
    border-radius: var(--r-md);
}

/* ============================================================
   响应式：≤ 860px 收紧留白，≤ 600px 单列 + 表格堆叠
   ============================================================ */
@media screen and (max-width: 860px) {
    .page { padding: 24px 16px 32px; }
    .page-title { font-size: 23px; }
    .list-row { padding: 18px; gap: 14px; }
    table.data thead th,
    table.data tbody td { padding-left: 16px; padding-right: 16px; }
}

@media screen and (max-width: 600px) {
    body { font-size: 14px; }
    .site-header .bar { height: 56px; gap: 10px; padding: 0 14px; }
    .brand .word { font-size: 15px; letter-spacing: 1px; }
    .brand .sub { display: none; }
    .site-nav a { padding: 6px 9px; font-size: 13px; }
    .site-nav .logout-btn,
    .site-nav .nav-login-btn { padding: 6px 9px; font-size: 13px; }
    .site-nav .who { display: none; }

    .page { padding: 20px 14px 28px; }
    .page-title { font-size: 21px; letter-spacing: 0.5px; }
    .panel-head,
    .panel-body,
    .filters { padding-left: 16px; padding-right: 16px; }

    .list-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .list-row .idx { width: auto; font-size: 16px; }
    .list-row .main { flex: 1 1 auto; }
    .list-row .side { display: none; }
    .list-row .cta { flex: 1 1 100%; flex-direction: column; align-items: stretch; }
    .list-row .cta .btn { width: 100%; }

    .qr-cell { flex: 1 1 100%; text-align: left; }
    .qr-frame { width: 132px; height: 132px; margin: 0 auto; }
    .qr-canvas { width: 280px; margin: 0 auto; }

    .auth-card { padding: 22px 18px; }

    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .filters .field { width: 100%; min-width: 0; }
    .filters .actions { margin-left: 0; width: 100%; }
    .filters .actions .btn { flex: 1; }

    /* 表格转为堆叠卡片：td 上通过 data-label 显示字段名 */
    table.data thead { display: none; }

    table.data,
    table.data tbody,
    table.data tr,
    table.data td {
        display: block;
        width: 100%;
    }

    table.data tbody tr {
        padding: 12px 16px;
        border-bottom: 1px solid var(--c-line-soft);
    }

    table.data tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 6px 0;
        border-bottom: none;
    }

    table.data tbody td::before {
        content: attr(data-label);
        font-family: var(--font-serif);
        font-size: 11px;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        color: var(--c-ink-4);
        flex-shrink: 0;
    }

    table.data tbody td:not([data-label])::before {
        content: none;
    }

    .pagination { gap: 4px; }
    .pagination a,
    .pagination span { min-width: 32px; height: 32px; }
}

/* 8/9 列的宽表（全校对比矩阵、课表变更审核表）在 601~760px 一行摆不下，
   实测对比表 760px 溢 97px、审核表 700px 溢 70px —— 只留一条横向滚动条等于看不见内容。
   所以这类表提前套用与手机端同款的堆叠卡片，由模板挂 .stack-medium 显式声明，
   不改变其他表在 601~760px 的既有形态。≤600 时与上面的通用堆叠同形，重复声明不影响结果。 */
@media screen and (max-width: 760px) {
    table.data.stack-medium thead { display: none; }

    table.data.stack-medium,
    table.data.stack-medium tbody,
    table.data.stack-medium tr,
    table.data.stack-medium td {
        display: block;
        width: 100%;
    }

    table.data.stack-medium tbody tr {
        padding: 12px 16px;
        border-bottom: 1px solid var(--c-line-soft);
    }

    table.data.stack-medium tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 6px 0;
        border-bottom: none;
    }

    table.data.stack-medium tbody td::before {
        content: attr(data-label);
        font-family: var(--font-serif);
        font-size: 11px;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        color: var(--c-ink-4);
        flex-shrink: 0;
    }
}

/* ===== 课表页：可点格子与课程编辑弹窗 ===== */

/* 桌面端：定宽布局把 8 列平分表宽，周一~周日一行装全，不再挤成横向滚动条；
   格子文字允许折行兜底，超长周次串换行而不是撑破表宽 */
table.data.tt-table {
    table-layout: fixed;
}

table.data.tt-table .col-period {
    width: 92px;
    white-space: normal;
}

table.data.tt-table th,
table.data.tt-table td {
    text-align: center;
    padding: 10px 6px;
}

table.data.tt-table thead th {
    padding: 12px 4px;
}

/* 课程卡片：格子里的可点击块 */
.tt-chip {
    display: block;
    margin: 2px auto;
    padding: 5px 4px;
    border-radius: 8px;
    background: var(--c-brand-soft);
    border-left: 3px solid var(--c-brand);
    cursor: pointer;
    line-height: 1.35;
    text-align: center;
}

.tt-chip:hover {
    background: rgba(31, 61, 92, 0.14);
}

/* 管理端只读课表：同一张卡片但不点得动 */
.tt-chip.tt-chip-view,
.tt-chip.tt-chip-view:hover {
    cursor: default;
    background: var(--c-brand-soft);
}

.tt-chip-name {
    display: block;
    font-weight: 500;
    color: var(--c-ink);
    overflow-wrap: anywhere;
}

.tt-chip-sub {
    display: block;
    font-size: 12px;
    color: var(--c-ink-2);
    overflow-wrap: anywhere;
}

/* 考勤印章：整格的结论标记，落在格子右上角（.tt-cell 是定位锚点）。
   零色块口径照旧——background 必须 transparent，颜色只从 currentColor 走描边和字，
   不铺底、不用 mix-blend-mode（试过 multiply，字会发灰看不清）。 */
table.data.tt-table .tt-cell {
    position: relative;
}

.tt-stamp {
    position: absolute;
    inset: 5px 7px auto auto;           /* 右侧多让 2px：倾斜会把底部甩过竖线 */
    z-index: 3;
    padding: 1px 7px;
    border: 1.5px solid currentColor;
    border-radius: 6px;
    background: transparent;
    font-family: var(--font-serif);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 1.5px;
    text-indent: 1.5px;
    white-space: nowrap;
    transform: rotate(-6deg);
    transform-origin: top right;        /* 绕贴住的那角转：上沿锁死不越横线，竖线方向靠 inset 让位 */
    pointer-events: none;               /* 章是标记，不能挡住卡片与 ＋ 号点击 */
}

/* 双圈：外层一道淡细线，印章感来自这一圈而不是底色 */
.tt-stamp::after {
    content: "";
    position: absolute;
    inset: -3px -3px;
    border: 1px solid currentColor;
    border-radius: 9px;
    opacity: .45;
}

table.data.tt-table .tt-stamp--ok { color: var(--c-go); }
/* 缺勤最该被看见：描边加重一档 */
table.data.tt-table .tt-stamp--miss { color: var(--c-stop); border-width: 2px; }
/* 未开始：不是结论，只是「判定线未到」，所以用中性墨色，别借用成功/缺勤的语义色 */
table.data.tt-table .tt-stamp--todo { color: var(--c-ink-3); }

/* 让位：有考勤结论的卡片顶部腾出一行，章绝不压在科目名上。
   靠模板挂 .has-att 而不是 :has()——学校机房老浏览器不认 :has() */
table.data.tt-table .tt-chip.has-att {
    padding-top: 20px;
}

/* 上课周次：默认不显示（“数学 2024级8班”而不是“… 1-25 周”），
   页头「显示周次」勾上后由 timetable-weeks.js 给本面板三份表加 .tt-weeks-on */
table.data.tt-table .tt-chip-weeks {
    display: none;
}

table.data.tt-table.tt-weeks-on .tt-chip-weeks {
    display: block;
}

/* 空格子的 ＋ 号（教师端是 span，管理端直改形态是链接） */
.tt-add-chip,
.tt-add-link {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    color: var(--c-ink-4);
    cursor: pointer;
    border-radius: 6px;
    user-select: none;
}

/* 管理端点格直改：卡片与 ＋ 号外观同教师端，只是它们是可点的链接 */
.tt-chip-edit,
.tt-add-link {
    text-decoration: none;
}

.tt-cell:hover .tt-add-chip,
.tt-cell:hover .tt-add-link {
    color: var(--c-brand);
}

/* 手机端（≤600px）：课表不转堆叠卡片，7 天仍摆成一行表；格子里只留课程名 + 班级，
   教室/周次/节次时间收起来，一屏不用横向滚就能看全一周。
   本块必须放在上面的桌面课表样式之后：与通用堆叠规则同特异性，靠后来者胜出 */
@media screen and (max-width: 600px) {
    table.data.tt-table { display: table; width: 100%; }
    table.data.tt-table tbody { display: table-row-group; width: auto; }
    table.data.tt-table tr { display: table-row; width: auto; padding: 0; border-bottom: none; }
    table.data.tt-table thead { display: table-header-group; }

    table.data.tt-table th,
    table.data.tt-table td {
        display: table-cell;
        width: auto;
        padding: 4px 2px;
        border-bottom: 1px solid var(--c-line-soft);
    }

    table.data.tt-table thead th {
        padding: 7px 1px;
        font-size: 11px;
        letter-spacing: 0;
        text-align: center;
    }

    table.data.tt-table tbody tr:last-child td { border-bottom: none; }
    table.data.tt-table tbody td::before { content: none; }
    table.data.tt-table .col-period { width: 40px; }
    table.data.tt-table .col-period .cell-strong { font-size: 12px; }
    table.data.tt-table .col-period .cell-sub { display: none; }

    table.data.tt-table .tt-chip {
        padding: 2px 1px;
        border-left-width: 2px;
        border-radius: 5px;
    }

    table.data.tt-table .tt-chip-name { font-size: 11px; }
    table.data.tt-table .tt-chip-sub { font-size: 10px; }
    /* 考勤章不跟着收掉：手机上看课表最关心的就是结论；但格子只有几十 px 宽，
       章必须缩字号、收字距与内边距，并清掉双圈（细线在窄格子里会糊成一团） */
    table.data.tt-table .tt-stamp {
        inset: 2px 4px auto auto;
        padding: 0 3px;
        font-size: 9px;
        letter-spacing: 0;
        text-indent: 0;
        border-width: 1px;
    }

    table.data.tt-table .tt-stamp::after { content: none; }
    table.data.tt-table .tt-stamp--miss { border-width: 1.5px; }
    table.data.tt-table .tt-chip.has-att { padding-top: 15px; }
    table.data.tt-table .tt-chip-room,
    table.data.tt-table .tt-chip-weeks,
    table.data.tt-table.tt-weeks-on .tt-chip-weeks { display: none; }
    table.data.tt-table .tt-add-chip { font-size: 11px; min-width: 0; }
}

/* 中等宽度桌面（601~1080px）：7 天一行摆不下，拆成两行——
   第一行周一到周五（tt-days-a 藏 6/7），第二行周六、周日（tt-days-b 藏 1~5，节次列保留做行头）。
   更宽用整周单行（tt-week-full），更窄走上面的手机端一行。 */
.tt-week-split { display: none; }

@media screen and (min-width: 601px) and (max-width: 1080px) {
    .tt-week-full { display: none; }
    .tt-week-split { display: block; }

    .tt-days-a [data-w="6"],
    .tt-days-a [data-w="7"],
    .tt-days-b [data-w="1"],
    .tt-days-b [data-w="2"],
    .tt-days-b [data-w="3"],
    .tt-days-b [data-w="4"],
    .tt-days-b [data-w="5"] {
        display: none;
    }
}

/* 弹窗 */
.tt-mask {
    position: fixed;
    inset: 0;
    background: rgba(20, 23, 26, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

/* display:flex 会压过 hidden 属性的浏览器默认隐藏，必须显式覆盖 */
.tt-mask[hidden] {
    display: none;
}

/* 弹出时背景高斯模糊 */
.tt-mask {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* ===== 全局确认弹窗（modal.js 注入，全站共用） ===== */

.ui-mask {
    position: fixed;
    inset: 0;
    background: rgba(20, 23, 26, 0.35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 16px;
}

/* display:flex 会压过 hidden 属性的浏览器默认隐藏，必须显式覆盖 */
.ui-mask[hidden] {
    display: none;
}

.ui-modal {
    background: var(--c-surface);
    border-radius: 14px;
    width: 100%;
    max-width: 360px;
    padding: 22px;
    box-shadow: 0 12px 40px rgba(20, 23, 26, 0.25);
}

.ui-title {
    margin: 0 0 8px;
    font-size: 16px;
}

.ui-msg {
    margin: 0 0 18px;
    color: var(--c-ink-2);
    font-size: 14px;
    line-height: 1.6;
}

.ui-actions {
    display: flex;
    gap: 8px;
}

.ui-spacer {
    flex: 1;
}

.tt-modal {
    background: var(--c-surface);
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(20, 23, 26, 0.25);
}

.tt-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.tt-modal-head h3 {
    margin: 0;
    font-size: 17px;
}

.tt-close {
    border: none;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: var(--c-ink-3);
    cursor: pointer;
    padding: 2px 6px;
}

.tt-close:hover {
    color: var(--c-ink);
}

.tt-field {
    margin-bottom: 12px;
}

.tt-field label {
    display: block;
    font-size: 13px;
    color: var(--c-ink-2);
    margin-bottom: 4px;
}

.tt-field .input {
    width: 100%;
    box-sizing: border-box;
}

.tt-hint {
    font-size: 12px;
    color: var(--c-ink-3);
    margin-top: 3px;
}

/* 周次方块：5×5 点选 */
.tt-weeks-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.tt-quick {
    display: inline-flex;
    gap: 4px;
}

.tt-quick-btn {
    border: 1px solid var(--c-line);
    background: var(--c-surface-2);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    color: var(--c-ink-2);
    cursor: pointer;
}

.tt-quick-btn:hover {
    border-color: var(--c-brand);
    color: var(--c-brand);
}

.tt-weeks {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.tt-week {
    position: relative;
    border: 1px solid var(--c-line);
    background: var(--c-surface-2);
    border-radius: 6px;
    padding: 5px 0;
    font-size: 12px;
    color: var(--c-ink-2);
    cursor: pointer;
    text-align: center;
}

.tt-week:hover {
    border-color: var(--c-brand);
}

.tt-week.on {
    background: var(--c-brand);
    border-color: var(--c-brand);
    color: #fff;
}

/* 表单页的方块是 label 套复选框：勾才是真状态，方块只负责外观 */
.tt-week .tt-week-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tt-teacher {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--c-surface-2);
    color: var(--c-ink-2);
    font-size: 14px;
}

.tt-error {
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--c-stop-soft);
    color: var(--c-stop);
    font-size: 13px;
    margin-bottom: 12px;
}

.tt-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.tt-spacer {
    flex: 1;
}

/* 换课申请 */
.tt-swap-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--c-line, rgba(0, 0, 0, 0.08));
}

.tt-swap-item:last-child {
    border-bottom: none;
}

.tt-swap-desc {
    font-size: 14px;
    line-height: 1.6;
}

.tt-swap-desc .highlight {
    color: var(--c-brand);
    font-weight: 600;
}

.tt-swap-reason {
    margin-top: 4px;
    font-size: 13px;
    color: var(--c-ink-2);
}

.tt-swap-ops {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.tt-head-ops {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tt-head-ops .tt-week-filter {
    width: auto;
    padding: 6px 10px;
}

/* 「显示周次」开关：做成 switch 形态。零色块口径下轨道只描 1px 细线，
   状态靠滑块位移 + 线色（中性→品牌色）表达，不铺底色 */
.tt-weeks-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--c-ink-2);
    cursor: pointer;
    user-select: none;
}

.tt-weeks-toggle:hover {
    color: var(--c-brand);
}

.tt-weeks-toggle:hover .tt-weeks-switch {
    border-color: var(--c-brand);
}

/* 原生 checkbox 保留（键盘、读屏、:checked 选择器都靠它），只在视觉上收成一个点 */
.tt-weeks-toggle-input {
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.tt-weeks-switch {
    position: relative;
    flex: none;
    width: 32px;
    height: 18px;
    border: 1px solid var(--c-line);
    border-radius: 999px;
    transition: border-color .15s ease;
}

.tt-weeks-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--c-ink-3);
    transition: transform .15s ease, background-color .15s ease;
}

.tt-weeks-toggle-input:checked + .tt-weeks-switch {
    border-color: var(--c-brand);
}

.tt-weeks-toggle-input:checked + .tt-weeks-switch::after {
    transform: translateX(14px);
    background: var(--c-brand);
}

.tt-weeks-toggle-input:checked ~ .tt-weeks-toggle-text {
    color: var(--c-brand);
}

.tt-weeks-toggle-input:focus-visible + .tt-weeks-switch {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
}

/* ===== 课表管理子页：子导航 / 提示条 / 对比矩阵 / 统计 ===== */

/* 页内子导航（课表管理四个子功能互跳）：全站导航语汇——扁平常文字、零色块；
   当前项只靠品牌色 + 1px 细下划线区分，hover 同样只变色不铺底 */
.subnav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.subnav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0 4px;
    font-size: 14px;
    color: var(--c-ink-2);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.subnav-link:hover {
    color: var(--c-brand);
}

.subnav-link.on {
    color: var(--c-brand);
    font-weight: 500;
    border-bottom-color: var(--c-brand);
}

/* 待处理数：不铺底色，只用品牌色数字跟在项名后面 */
.subnav-badge {
    font-size: 12px;
    color: var(--c-brand);
}

.subnav-link:not(.on) .subnav-badge {
    color: var(--c-ink-3);
}

/* 当前项的下划线直接压在页头细线上，整排读起来就是一条 tab 带。
   这里必须把分隔线改成纯中性色：`.head-rule` 原本开头 44px 是品牌色段，
   紧贴之后它正好落在第一项「操作审核」下面，看着像它一直激活。 */
.subnav + .head-rule {
    margin-top: 0;
    background: var(--c-line-soft);
}

/* 口径提示条（审核页常显等）：白底 + 细描边 + 品牌色左细线，不铺色块 */
.notice {
    margin-top: 16px;
    padding: 10px 14px;
    border: 1px solid var(--c-line-soft);
    border-left: 2px solid var(--c-brand);
    border-radius: var(--r-md);
    background: var(--c-surface);
    font-size: 13px;
    line-height: 1.6;
    color: var(--c-ink);
}

/* 班级课表·对比模式：每格按节次列小字块 */
table.data.tt-cmp-table td {
    vertical-align: top;
    text-align: left;
}

.tt-cmp-cell {
    min-width: 96px;
}

.cmp-line {
    padding: 2px 0;
    font-size: 12px;
    line-height: 1.45;
    border-bottom: 1px dashed var(--c-line-soft);
    overflow-wrap: anywhere;
}

.cmp-line:last-child {
    border-bottom: none;
}

.cmp-line b {
    font-weight: 600;
    color: var(--c-ink);
}

.cmp-meta {
    display: block;
    color: var(--c-ink-2);
}

.cmp-none {
    color: var(--c-ink-4);
}

.tt-cmp-class-link {
    color: var(--c-brand);
    text-decoration: none;
}

.tt-cmp-class-link:hover {
    text-decoration: underline;
}

/* 601~900px：对比矩阵靠收窄保住「一行看全校」的横向形态（实测 760px 溢 97px）。
   不能走堆叠卡片：29 个班堆起来 14913px 长，反而彻底没法对比。
   上界取 900 而不是 860：矩阵自然宽约 843px，而页面内距要到 860px 才收窄，
   861~890 这段实际可用宽度不足，实测溢出 9~28px。
   min-width 601px 是必须的——≤600px 归通用堆叠档管，两边同特异性，越界会把堆叠态的 td 内距顶掉。 */
@media screen and (min-width: 601px) and (max-width: 900px) {
    table.data.tt-cmp-table thead th,
    table.data.tt-cmp-table tbody td {
        padding-left: 6px;
        padding-right: 6px;
    }

    .tt-cmp-cell {
        min-width: 62px;
    }

    .cmp-line {
        font-size: 11px;
    }
}

/* 统计页：总数卡 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.stat-card {
    padding: 14px 16px;
    border: 1px solid var(--c-line-soft);
    border-radius: var(--r-md);
    background: none;
    text-align: center;
}

.stat-num {
    font-size: 26px;
    font-weight: 600;
    color: var(--c-brand);
    line-height: 1.2;
}

.stat-label {
    margin-top: 4px;
    font-size: 12px;
    color: var(--c-ink-2);
}

/* 星期分布的占比条。类名必须带 .stat- 前缀：theme.css 是全站单文件、类名即全局
   命名空间，早先叫 `.bar` 时撞上了 base.html 里 `.site-header .bar`（那条规则没声明
   background，裸 `.bar` 就把整条导航条刷成了品牌深蓝，校名和 logo 框全看不见）。
   轨道用中性线色，只有数据条用品牌色。 */
.stat-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--c-line-soft);
    overflow: hidden;
    min-width: 60px;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--c-brand);
}
