/* ============================================
   教师工作台 - 样式表
   现代 · 柔和 · 聚焦
   ============================================ */

:root {
    /* 主色（统一蓝色系，聚焦标准蓝） */
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-primary-soft: #dbeafe;
    --color-accent: #f97316;
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;

    /* 背景与表面 */
    --bg-app: #F4F2EE;
    --bg-surface: #FFFFFF;
    --bg-surface-2: #FBF9F5;
    --bg-sidebar: #2E3A46;

    /* 文本 */
    --color-text: #2E3238;
    --color-text-secondary: #5A626C;
    --color-text-muted: #98A0AA;
    --color-text-inverse: #EAF0F5;

    /* 边框与阴影 */
    --border: #EAE7E1;
    --border-strong: #DCD8D0;
    --shadow-sm: 0 1px 3px rgba(40, 50, 60, 0.06);
    --shadow-md: 0 4px 16px rgba(40, 50, 60, 0.08);
    --shadow-lg: 0 12px 32px rgba(40, 50, 60, 0.12);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html, body {
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--bg-app);
    /* ★ v39.18：强制字体大小（微信 webview 会自动放大到 16-18px） */
    font-size: 14px !important;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* ★ 禁止微信/移动浏览器自动放大字体（none 比 100% 兼容性更好，Firefox 不再报「值非法」） */
    -webkit-text-size-adjust: none !important;
    text-size-adjust: 100% !important;
    /* 防止 iOS 横竖屏切换时自动缩放 */
    -webkit-tap-highlight-color: transparent;
    /* 防止水平滚动（微信内常见问题） */
    max-width: 100vw;
    overflow-x: hidden;
}

/* ★ v39.18：微信 UA 专用字体约束（双重保险） */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    html { font-size: 14px !important; }
    body { font-size: 14px !important; }
}

a { color: var(--color-primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

/* ============ 布局骨架 ============ */
.app-layout { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    color: var(--color-text-inverse);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.28s ease;
}

.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.sidebar-brand .sub { font-size: 12px; color: rgba(234, 240, 245, 0.55); margin-top: 4px; }
/* 门户：侧边栏身份行（多用户版） */
.sidebar-userline {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px; flex-wrap: wrap;
}
.sidebar-user-name { font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-user-role {
    font-size: 11px; color: #fff;
    background: var(--color-primary);
    padding: 1px 8px; border-radius: 9px; white-space: nowrap;
}
.sidebar-class-extra {
    font-size: 11px; color: rgba(234, 240, 245, 0.7);
    margin-top: 4px; line-height: 1.5;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-section { margin-bottom: 16px; }
.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(234, 240, 245, 0.4);
    padding: 0 12px 6px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(234, 240, 245, 0.82);
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
}
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item.active { background: var(--color-primary); color: #fff; font-weight: 600; }
.nav-badge {
    margin-left: auto;
    background: var(--color-accent);
    color: #fff;
    font-size: 11px;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 5px;
}

.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-footer .hint { font-size: 11px; color: rgba(234, 240, 245, 0.4); }

/* ---------- 主内容 ---------- */
.main-content {
    flex: 1;
    margin-left: 220px;
    min-width: 0;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.top-bar-left { display: flex; align-items: center; gap: 14px; }
.top-bar-left h2 { font-size: 17px; font-weight: 700; }
.top-bar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.menu-btn { display: none; }

/* 门户：顶栏用户芯片 */
.top-user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px; border-radius: 20px;
    background: var(--bg-surface-2); border: 1px solid var(--border-strong);
    color: var(--color-text); text-decoration: none;
    transition: box-shadow .15s, border-color .15s;
}
.top-user-chip:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: var(--color-primary); }
.top-user-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #6b7bff);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px;
}
.top-user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.top-user-name { font-size: 13px; font-weight: 600; }
.top-user-role { font-size: 11px; color: var(--color-text-muted); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    transition: all 0.15s;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: var(--bg-surface-2); color: var(--color-text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- 提示条 ---------- */
.notice-bar {
    margin: 20px 28px 0;
    background: linear-gradient(135deg, #FDF6EC, #F9EFDF);
    border: 1px solid #F0DFC4;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #8A6D3B;
}
.notice-icon { font-size: 16px; }

/* ---------- 内容区 ---------- */
.content-body { padding: 20px 28px 32px; }
.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}
.main-left { display: flex; flex-direction: column; gap: 20px; }
.main-right { display: flex; flex-direction: column; gap: 16px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.card-body { padding: 16px 20px; }

/* ---------- 问候卡 ---------- */
.welcome-card {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 22px 24px 20px;
    box-shadow: var(--shadow-md);
}
.welcome-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* 问候语降噪：缩小、变浅，作为辅助信息 */
.welcome-greet { font-size: 14px; color: #dbeafe; font-weight: 500; }
.welcome-greet #greeting { color: rgba(255, 255, 255, 0.92); }

/* 下一节课（核心信息）：学科大字号 + 副标题 */
.next-class-box {
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 14px;
}
.next-class-badge {
    background: #fff; color: var(--color-primary);
    font-weight: 700; font-size: 13px;
    padding: 6px 12px; border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.next-class-info { flex: 1; min-width: 0; }
.next-class-info .nc-label { font-size: 12px; color: rgba(255, 255, 255, 0.75); }
.next-class-info .nc-subject { font-size: 24px; font-weight: 700; line-height: 1.25; }
.next-class-info .nc-meta { font-size: 13px; color: rgba(255, 255, 255, 0.88); margin-top: 2px; }
.next-class-info .nc-time { font-size: 13px; opacity: 0.9; margin-top: 2px; }

/* 全部完成的安抚状态 */
.next-class-all-done {
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}

/* 记一笔：幽灵按钮（白底 + 蓝字） */
.btn-record {
    margin-left: auto;
    flex-shrink: 0;
    background: #fff;
    color: var(--color-primary);
    padding: 8px 16px; border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.15s;
}
.btn-record:hover { background: #eff6ff; }

/* 今日已完成折叠区 */
.today-done-wrap { margin-top: 12px; }
.today-done-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px dashed rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.today-done-toggle:hover { background: rgba(255, 255, 255, 0.2); }
.today-done-toggle .done-count {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-success);
    border-radius: 10px;
    padding: 0 8px;
    font-size: 12px;
}
.today-done-toggle .toggle-caret { margin-left: auto; transition: transform 0.2s; }
.today-done-toggle.open .toggle-caret { transform: rotate(180deg); }
.today-done-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }


/* ---------- 快捷入口 ---------- */
.systems-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.system-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.18s;
    background: var(--bg-surface-2);
}
.system-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.sys-status {
    position: absolute; top: 12px; right: 12px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--color-success);
}
.sys-status.no-config { background: #C9CDD3; }
.sys-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px;
}
.sys-name { font-weight: 600; font-size: 14px; }
.sys-desc { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.system-card.add-new { border-style: dashed; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--color-text-muted); }
.system-card.add-new .sys-icon { margin-bottom: 6px; }
.system-card.add-new .sys-name { color: var(--color-text-secondary); }

/* ---------- 待办 ---------- */
.todo-list { display: flex; flex-direction: column; }
.todo-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.todo-item:last-child { border-bottom: none; }
.todo-check {
    width: 20px; height: 20px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.todo-check:hover { border-color: var(--color-primary); background: rgba(59, 130, 246, 0.1); }
.todo-icon { color: var(--color-primary); display: flex; flex-shrink: 0; }
.todo-content { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-date { font-size: 12px; flex-shrink: 0; }
.todo-date.normal { color: var(--color-text-muted); }
.todo-date.overdue { color: var(--color-accent); font-weight: 600; }
.todo-action {
    padding: 4px 12px; border-radius: 6px;
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-success);
    font-size: 12px; font-weight: 500;
    flex-shrink: 0;
    transition: all 0.15s;
}
.todo-action:hover { background: var(--color-success); color: #fff; }

/* ---------- 表单输入 ---------- */
.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-surface);
    color: var(--color-text);
    outline: none;
    transition: border 0.15s, box-shadow 0.15s;
}
.form-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }

/* ---------- 今日节奏 ---------- */
.rhythm-card { text-align: center; }
/* 日期缩小：移到面板顶部小字，降低视觉权重 */
.rhythm-date { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 6px 0 2px; }
.rhythm-date .day { font-size: 22px; font-weight: 700; color: var(--color-primary); line-height: 1; }
.rhythm-date .month { font-size: 13px; color: var(--color-text-secondary); }
.rhythm-week { font-size: 12px; color: var(--color-text-muted); margin-bottom: 14px; }
.rhythm-stats { display: flex; flex-direction: column; gap: 10px; }
.rhythm-stat {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-surface-2);
    border-radius: var(--radius-sm);
}
.rhythm-stat-left { display: flex; align-items: center; gap: 8px; color: var(--color-text-secondary); font-size: 13px; }
.rhythm-stat-left svg { color: var(--color-primary); }
/* 三个行动数字放大为核心指标 */
.rhythm-stat-left span { font-weight: 700; color: var(--color-text); font-size: 20px; }
.rhythm-summary { margin-top: 12px; font-size: 12px; color: var(--color-text-muted); }

/* ---------- 提示卡片 ---------- */
.hint-card {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px; color: var(--color-text-secondary);
    box-shadow: var(--shadow-sm);
}
.hint-card .icon { font-size: 18px; }

/* ---------- 补测 ---------- */
.makeup-list { display: flex; flex-direction: column; }
.makeup-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.makeup-item:last-child { border-bottom: none; }
.makeup-item:hover { background: var(--bg-surface-2); }
.makeup-row { display: flex; align-items: center; gap: 10px; }
.makeup-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(249, 115, 22, 0.15);
    color: var(--color-accent);
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.makeup-info { flex: 1; min-width: 0; }
.makeup-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.makeup-content { font-size: 12px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.makeup-expand { color: var(--color-text-muted); font-size: 12px; transition: transform 0.2s; }
.makeup-item.expanded .makeup-expand { transform: rotate(180deg); }

/* 补测状态标签（颜色统一：待补测橙 / 已通过绿 / 已逾期红） */
.makeup-status {
    flex-shrink: 0;
    font-size: 11px; font-weight: 600;
    padding: 2px 10px; border-radius: 10px;
    white-space: nowrap;
}
.makeup-status.pending { background: rgba(249, 115, 22, 0.14); color: #ea580c; }
.makeup-status.overdue { background: rgba(239, 68, 68, 0.14); color: var(--color-danger); }
.makeup-status.passed { background: rgba(34, 197, 94, 0.14); color: #16a34a; }

/* 补测展开详情 */
.makeup-detail {
    margin-top: 8px; padding: 10px 12px;
    background: var(--bg-surface-2);
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.makeup-detail .md-row { display: flex; gap: 8px; padding: 2px 0; color: var(--color-text-secondary); }
.makeup-detail .md-label { color: var(--color-text-muted); flex-shrink: 0; }
.makeup-detail .md-actions { display: flex; gap: 6px; margin-top: 8px; }
.md-btn {
    padding: 4px 12px; border-radius: 6px;
    font-size: 12px; font-weight: 500;
    border: 1px solid var(--border-strong);
    color: var(--color-text-secondary);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.15s;
}
.md-btn.primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.md-btn.primary:hover { background: var(--color-primary-dark); }
.md-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.md-btn.danger { color: var(--color-danger); border-color: rgba(239, 68, 68, 0.4); }
.md-btn.danger:hover { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }

/* 今日节奏进度条 */
.rhythm-progress { margin-top: 14px; text-align: left; }
.rp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.rp-label { font-size: 12px; color: var(--color-text-secondary); }
.rp-value { font-size: 12px; font-weight: 700; color: var(--color-primary); }
.rp-bar { height: 8px; background: var(--bg-surface-2); border-radius: 6px; overflow: hidden; }
.rp-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 6px; transition: width 0.5s ease; }
.rp-fill.full { background: linear-gradient(90deg, #22c55e, #16a34a); }

/* ---------- 课表 ---------- */
.schedule-list { display: flex; flex-direction: column; }
.schedule-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.schedule-item:last-child { border-bottom: none; }
.sch-time { font-size: 14px; font-weight: 700; color: var(--color-primary); width: 42px; flex-shrink: 0; }
.sch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; }
.sch-info { flex: 1; min-width: 0; }
.sch-name { font-size: 14px; font-weight: 500; }
.sch-meta { font-size: 12px; color: var(--color-text-muted); }
.sch-status { font-size: 12px; color: var(--color-primary); flex-shrink: 0; }
.sch-status.done { color: var(--color-text-muted); }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 24px 16px; color: var(--color-text-muted); }
.empty-state .icon { font-size: 28px; margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ---------- Toast ---------- */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 10px;
    max-width: 320px;
}
.toast {
    display: flex; align-items: center; gap: 8px;
    background: #fff;
    color: var(--color-text);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    animation: slideIn 0.3s ease;
    border-left: 3px solid var(--color-success);
}
.toast.error { border-left-color: var(--color-accent); }
.toast.info { border-left-color: var(--color-primary); }
.toast-icon { font-weight: 700; }
.toast.hiding { animation: slideOut 0.3s ease forwards; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ============ 登录页 ============ */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #F0EBE3, #E8F3EC);
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%; max-width: 380px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.login-logo {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.login-card h2 { font-size: 20px; font-weight: 700; }
.subtitle { color: var(--color-text-muted); font-size: 13px; margin: 6px 0 24px; }
.login-form { text-align: left; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 600;
    transition: background 0.15s;
}
.login-btn:hover { background: var(--color-primary-dark); }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--color-text-muted); }

/* ============ 跳转页 ============ */
.jump-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #F0EBE3, #E8F3EC);
    padding: 20px;
}
.jump-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.jump-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.jump-title { font-size: 17px; font-weight: 600; }
.jump-desc { font-size: 13px; color: var(--color-text-muted); margin-top: 8px; }
.jump-manual { margin-top: 20px; text-align: left; }
.jump-manual .field {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-surface-2);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.jump-manual .label { font-size: 13px; color: var(--color-text-secondary); }
.jump-manual .value { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.copy-btn {
    font-size: 12px; color: var(--color-primary);
    padding: 2px 8px; border-radius: 4px;
}
.copy-btn:hover { background: rgba(59, 130, 246, 0.1); }

/* ============ 隐藏类 ============ */
.hidden { display: none !important; }

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
    .main-right { order: -1; }
    .systems-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-btn { display: inline-flex; }
    .top-bar { padding: 14px 16px; }
    .top-bar-left h2 { font-size: 16px; }
    .notice-bar { margin: 14px 16px 0; }
    .content-body { padding: 14px 16px 24px; }
    .systems-grid { grid-template-columns: repeat(2, 1fr); }
    .welcome-card { padding: 20px; }
    .welcome-header { flex-direction: column; gap: 12px; }
    .next-class-box { flex-wrap: wrap; }
    .btn-record { margin-left: 0; }
    .toast-container { left: 16px; right: 16px; max-width: none; }
}

/* 侧边栏遮罩 */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
}
.sidebar-overlay.show { display: block; }

/* ★ v39.6：移动端表格横向滚动（班级多列表格在窄屏不再挤压，可左右滑动） */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
    .table-scroll > table { min-width: 560px; }
    .table-scroll > table.nap-table { min-width: 420px; }
}

@media (max-width: 480px) {
    .systems-grid { grid-template-columns: 1fr; }
}

/* ★ v39.17：微信 / 移动端 webview 全局优化 */
@media (max-width: 768px) {
    /* 微信内字体偏大修正 */
    html { font-size: 14px !important; }
    body { font-size: 14px; }

    /* 卡片间距收紧（手机屏幕空间有限） */
    .content-body { padding: 10px 12px 20px; }
    .notice-bar { margin: 10px 12px 0; padding: 10px 12px; }

    /* 表格字号缩小，适应窄屏 */
    .duty-table { font-size: 12px; }
    .duty-table th { font-size: 12px; padding: 8px 6px; }
    .duty-table td { font-size: 12px; padding: 7px 6px; }

    /* 按钮适配触控 */
    .btn { padding: 7px 14px; font-size: 13px; }
    .btn-sm { padding: 4px 10px; font-size: 12px; }
    .btn-mini { padding: 3px 8px; font-size: 11px; }

    /* 顶部栏紧凑 */
    .top-bar { padding: 10px 12px; min-height: 44px; }
    .top-bar-left h2 { font-size: 15px; }

    /* 卡片标题字号 */
    .card-title { font-size: 15px; }
    .section-title { font-size: 14px; }

    /* 弹窗/模态框全屏优化 */
    .modal-overlay { padding: 16px 12px; align-items: flex-end; }
    .modal-box { max-height: 85vh; border-radius: 14px 14px 0 0; }

    /* Tab 栏底部安全区域（iPhone X+ 底部横条） */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .mobile-tab-bar { padding-bottom: env(safe-area-inset-bottom); }
    }
}

/* ★ v39.17：超小屏（iPhone SE / 小屏微信）进一步收紧 */
@media (max-width: 375px) {
    .content-body { padding: 8px 10px 16px; }
    .duty-table { font-size: 11px; }
    .duty-table th, .duty-table td { padding: 6px 4px; }
    .systems-grid { gap: 8px; }
}

/* ============================================
   课程表模块
   ============================================ */
.card-header-actions { display: flex; align-items: center; gap: 8px; }

/* 视图切换 */
.view-tabs {
    display: inline-flex;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 14px;
}
.view-tab {
    padding: 6px 18px;
    font-size: 13px;
    border-radius: 6px;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}
.view-tab.active {
    background: var(--color-primary);
    color: #fff;
    font-weight: 500;
}

/* 班级选择器 */
.class-selector { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.class-selector-label { font-size: 13px; color: var(--color-text-secondary); }

/* 周课程表网格 */
.week-table { overflow-x: auto; }
.week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; min-width: 560px; }
.week-head { margin-bottom: 6px; }
.week-head .week-cell {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    padding: 8px 4px;
    background: var(--bg-surface-2);
    border-radius: 8px;
}
.week-head .week-cell.today { background: var(--color-primary); color: #fff; }
.week-cell { display: flex; flex-direction: column; gap: 6px; min-height: 60px; }
.week-course {
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    position: relative;
    transition: all 0.2s;
}
.week-course:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.week-course-name { font-size: 13px; font-weight: 600; color: var(--color-text); }
.week-course-time { font-size: 11px; color: var(--color-primary); margin-top: 2px; }
.week-course-loc { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.week-course-class { font-size: 11px; color: var(--color-accent); margin-top: 2px; }
.week-course-actions {
    display: flex; gap: 4px; margin-top: 6px;
    opacity: 0; transition: opacity 0.2s;
}
.week-course:hover .week-course-actions { opacity: 1; }
.week-empty { color: var(--color-text-muted); font-size: 12px; text-align: center; padding: 16px 0; }

.mini-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-strong);
    color: var(--color-text-secondary);
    background: var(--bg-surface);
    transition: all 0.2s;
}
.mini-btn.edit:hover { color: var(--color-primary); border-color: var(--color-primary); }
.mini-btn.del:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* 分段控件 */
.seg-control { display: inline-flex; background: var(--bg-surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.seg-btn { padding: 6px 18px; font-size: 13px; border-radius: 6px; color: var(--color-text-secondary); transition: all 0.2s; }
.seg-btn.active { background: var(--color-primary); color: #fff; }

/* 弹窗 */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(30, 38, 46, 0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
    padding: 16px;
}
.modal {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { font-size: 16px; color: var(--color-text-muted); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--bg-surface-2); color: var(--color-text); }
.modal-body { padding: 20px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

/* ★ v39.41：课后服务设置（多老师）弹窗样式 */
.aft-table td.aft-cell { text-align: center; vertical-align: middle; padding: 6px 4px; }
.aft-ck { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; cursor: pointer; color: var(--color-text-secondary); }
.aft-ck input { width: 15px; height: 15px; }
.afc-tbox {
    margin-top: 4px; min-height: 22px; display: flex; flex-wrap: wrap; gap: 3px;
    justify-content: center; align-items: center; cursor: pointer; border-radius: 6px; padding: 2px 3px;
}
.afc-tbox.off { visibility: hidden; }
.afc-tbox:hover { background: var(--bg-surface-2); }
.aft-tip { font-size: 12px; color: var(--color-primary); border: 1px dashed var(--color-primary); border-radius: 10px; padding: 1px 8px; }
.aft-chip { font-size: 11px; background: #e6f7ff; color: #0958d9; border-radius: 10px; padding: 1px 7px; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.aft-chip.more { background: #f0f0f0; color: #666; }
.aft-pop {
    position: fixed; z-index: 200; width: 256px; max-height: 320px;
    background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
}
.aft-pop.hidden { display: none; }
.aft-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); }
.aft-pop-x { font-size: 14px; color: var(--color-text-muted); padding: 2px 6px; border-radius: 6px; }
.aft-pop-x:hover { background: var(--bg-surface-2); }
.aft-pop-search { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.aft-pop-list { flex: 1; overflow-y: auto; padding: 6px 8px; }
.aft-pop-item { display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.aft-pop-item:hover { background: var(--bg-surface-2); }
.aft-pop-item input { width: 15px; height: 15px; }
.aft-pop-foot { padding: 8px 10px; border-top: 1px solid var(--border); text-align: right; }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--color-text-secondary); margin-bottom: 6px; }
.form-label .req { color: var(--color-accent); }

/* 班级管理列表 */
.class-manage-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.class-manage-info { flex: 1; min-width: 0; }
.class-manage-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.class-manage-name { font-size: 14px; font-weight: 600; }
.class-manage-grade { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.class-add-row { display: flex; gap: 8px; }
.class-add-row .form-input { flex: 1; }


/* ============================================
   通用数据页面（成绩/考勤/汇总/报表/保险箱）
   ============================================ */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar .form-input { margin-bottom: 0; }

/* 数据表格 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: var(--bg-surface-2); color: var(--color-text-secondary); font-weight: 600; font-size: 13px; white-space: nowrap; }
.data-table tr:hover td { background: var(--bg-surface-2); }
.score-num { font-weight: 600; color: var(--color-primary); }

/* 考勤按钮 */
.att-btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.att-btn {
    padding: 4px 12px; font-size: 12px; border-radius: 6px;
    border: 1px solid var(--border-strong); color: var(--color-text-secondary);
    background: var(--bg-surface); transition: all 0.2s;
}
.att-btn:hover { border-color: var(--color-primary); }
.att-btn.active.present { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.att-btn.active.late { background: #D9A15B; color: #fff; border-color: #D9A15B; }
.att-btn.active.leave { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.att-btn.active.absent { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.att-remark { margin: 0; padding: 4px 8px; font-size: 13px; }
.att-summary { font-size: 13px; color: var(--color-text-secondary); }

/* 汇总卡片 */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.summary-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 20px;
    box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.summary-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.summary-icon { font-size: 28px; margin-bottom: 10px; }
.summary-value { font-size: 32px; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.summary-title { font-size: 14px; font-weight: 600; color: var(--color-text-secondary); margin-top: 6px; }
.summary-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

/* 柱状图 */
.chart-box { min-height: 260px; }
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 220px; padding: 20px 8px 0; overflow-x: auto; }
.bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 40px; height: 100%; }
.bar-val { font-size: 11px; color: var(--color-text-muted); margin-bottom: 4px; }
.bar { width: 100%; max-width: 40px; background: var(--bg-surface-2); border-radius: 6px 6px 0 0; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; background: var(--color-primary); border-radius: 6px 6px 0 0; transition: height 0.4s; }
.bar-label { font-size: 11px; color: var(--color-text-secondary); margin-top: 6px; white-space: nowrap; }

/* 统计行 */
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-chip {
    flex: 1; min-width: 120px; text-align: center; padding: 16px;
    background: var(--bg-surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.stat-chip-label { display: block; font-size: 12px; color: var(--color-text-muted); margin-bottom: 4px; }
.stat-chip-value { font-size: 22px; font-weight: 700; color: var(--color-primary); }

/* 保险箱 */
.vault-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px; border-bottom: 1px solid var(--border);
}
.vault-item:last-child { border-bottom: none; }
.vault-icon { font-size: 24px; }
.vault-info { flex: 1; min-width: 0; }
.vault-title { font-size: 14px; font-weight: 600; }
.vault-meta { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.vault-note { font-size: 12px; color: var(--color-text-secondary); margin-top: 4px; }
.vault-actions { display: flex; gap: 6px; }

/* 学生管理 */
.student-add-row { display: flex; gap: 8px; margin-bottom: 14px; }
.student-add-row .form-input { flex: 1; }
.student-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.student-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: var(--bg-surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.student-item small { color: var(--color-text-muted); }

textarea.form-input { resize: vertical; }

/* ========== 顶栏实时时钟（放大 · 深色 · 靠左，紧邻标题） ========== */
.top-clock {
    display: flex; align-items: baseline; gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
}
.top-clock .clock-time {
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
    font-size: 19px;
}

/* ========== 顶栏提醒胶囊（🔔 动画） ========== */
.bell-hint {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 20px;
    padding: 6px 14px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}
.bell-hint .bell-icon {
    display: inline-block;
    animation: bellSwing 1.6s ease-in-out infinite;
    transform-origin: top center;
}
@keyframes bellSwing {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(14deg); }
    40% { transform: rotate(-12deg); }
    60% { transform: rotate(8deg); }
    80% { transform: rotate(-6deg); }
}

/* ========== 今日课程面板 ========== */
.today-panel {
    background: rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-top: 14px;
}
.today-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.today-panel-title { font-size: 14px; font-weight: 600; }
.today-panel-count {
    font-size: 12px; background: rgba(255, 255, 255, 0.2);
    border-radius: 12px; padding: 2px 10px;
}
.today-course-list { display: flex; flex-direction: column; gap: 8px; }
.today-course-item {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    color: var(--color-text);
}
.today-course-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.today-course-item.done { opacity: 0.62; }
.tc-period {
    flex-shrink: 0;
    font-size: 11px; font-weight: 600;
    background: var(--color-primary); color: #fff;
    border-radius: 6px; padding: 4px 8px;
    text-align: center; line-height: 1.3;
    min-width: 52px;
}
.tc-period.pm { background: var(--color-accent); }
.tc-main { flex: 1; min-width: 0; }
.tc-title { font-size: 14px; font-weight: 600; }
.tc-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 1px; }
.tc-status { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--color-primary); white-space: nowrap; }
.tc-status.done { color: var(--color-text-muted); font-weight: 400; }
.tc-status.now { color: var(--color-accent); }
.today-empty {
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius-sm);
    padding: 14px;
    color: var(--color-text-secondary);
    font-size: 13px;
}
.today-empty .week-hint { margin-top: 6px; font-size: 12px; color: var(--color-text-muted); }

/* ========== 完整课程表（节次 × 周一至周五） ========== */
.tt-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tt-table {
    display: grid;
    grid-template-columns: 56px repeat(5, minmax(64px, 1fr));
    gap: 4px;
    min-width: 400px;
}
.tt-cell {
    border-radius: 8px;
    min-height: 58px;
    padding: 6px;
    font-size: 12px;
}
.tt-head {
    background: var(--bg-surface-2);
    text-align: center;
    font-weight: 600;
    color: var(--color-text-secondary);
    display: flex; align-items: center; justify-content: center;
    min-height: 34px;
    font-size: 13px;
}
.tt-head.today { background: var(--color-primary); color: #fff; }
.tt-period-cell {
    background: var(--bg-surface-2);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
}
.tt-period-cell .p-no { font-weight: 700; color: var(--color-text); font-size: 12px; }
.tt-period-cell .p-time { color: var(--color-text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.tt-period-cell.pm-session { background: rgba(249, 115, 22, 0.10); }
.tt-slot {
    background: var(--bg-surface);
    border: 1px dashed var(--border-strong);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.tt-slot .slot-plus { font-size: 16px; line-height: 1; color: var(--color-text-muted); }
.tt-slot .slot-hint { font-size: 10px; color: var(--color-text-muted); opacity: 0; transition: opacity 0.15s; }
.tt-slot:hover { border-color: var(--color-primary); color: var(--color-primary); background: rgba(59, 130, 246, 0.06); }
.tt-slot:hover .slot-plus { color: var(--color-primary); }
.tt-slot:hover .slot-hint { opacity: 1; color: var(--color-primary); }
.tt-course {
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--color-primary);
    cursor: pointer;
    transition: all 0.15s;
    display: flex; flex-direction: column; gap: 2px;
    position: relative;
}
.tt-course:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); }
.tt-course .c-subject { font-weight: 600; color: var(--color-text); font-size: 13px; }
.tt-course .c-class { color: var(--color-accent); font-size: 11px; }
.tt-course .c-loc { color: var(--color-text-muted); font-size: 11px; }
.tt-course.finished { opacity: 0.55; }
.tt-course.ongoing { border-left-color: var(--color-accent); background: rgba(249, 115, 22, 0.08); }
/* 课程卡片 hover 快捷操作浮层 */
.tt-course-actions {
    position: absolute; top: 4px; right: 4px;
    display: flex; gap: 3px;
    opacity: 0; transform: translateY(-2px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}
.tt-course:hover .tt-course-actions { opacity: 1; transform: translateY(0); pointer-events: auto; }
.tt-act {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    cursor: pointer;
    line-height: 1.4;
}
.tt-act.del { color: var(--color-danger); border-color: var(--color-danger); }
.tt-act:hover { background: var(--color-primary); color: #fff; }
.tt-act.del:hover { background: var(--color-danger); color: #fff; }
.tt-cell.flash { animation: cellFlash 1.6s ease; }
@keyframes cellFlash {
    0%, 60% { box-shadow: 0 0 0 3px var(--color-accent); background: rgba(249, 115, 22, 0.18); }
    100% { box-shadow: none; }
}

/* 班级选择下拉 */
.class-select { max-width: 200px; }

/* 课节时间设置 */
.period-row {
    display: grid;
    grid-template-columns: 64px 1fr 14px 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.period-row .p-label { font-size: 13px; font-weight: 600; color: var(--color-text-secondary); }
.period-row .p-sep { text-align: center; color: var(--color-text-muted); }
.period-session-title {
    font-size: 12px; font-weight: 600; color: var(--color-text-muted);
    margin: 12px 0 8px; letter-spacing: 1px;
}
.period-session-title:first-child { margin-top: 0; }

/* 课程弹窗删除按钮 */
.btn-danger {
    background: transparent; color: var(--color-accent);
    border: 1px solid var(--color-accent);
    margin-right: auto;
}
.btn-danger:hover { background: var(--color-accent); color: #fff; }




/* ============================================
   系统设置页 / 补测管理页（标准表单布局）
   ============================================ */

/* 宽弹窗（系统设置、含登录配置） */
.modal-lg { max-width: 520px; }

/* 标准表单字段：标签在上，输入框在下，独占一行 */
.form-field { margin-bottom: 18px; }
.form-field .form-label { display: block; font-size: 13px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 8px; }
.form-field .form-input { height: 42px; }

/* 统一输入框高度、圆角、边框、focus */
.form-input {
    height: 42px;
    border-radius: 8px;
    border-color: #d1d5db;
}
.form-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
textarea.form-input { height: auto; }

/* 弹窗底部按钮固定 */
.modal-footer-fixed {
    position: sticky;
    bottom: 0;
    background: var(--bg-surface);
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
    gap: 10px;
}

/* 配置登录账号折叠块 */
.login-config-block {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    overflow: hidden;
}
.lc-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface-2);
    font-size: 14px; font-weight: 600; color: var(--color-text);
    cursor: pointer;
    border: none;
}
.lc-toggle .toggle-caret { color: var(--color-text-muted); transition: transform 0.2s; }
.lc-toggle.open .toggle-caret { transform: rotate(180deg); }
.lc-body { padding: 16px; }
.lc-hint { font-size: 12px; color: #9ca3af; margin-bottom: 12px; }
.lc-hint:not(:first-child) { margin-top: 4px; margin-bottom: 0; }

/* 系统管理列表 */
.sys-manage-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
}
.sys-manage-item:last-child { border-bottom: none; }
.sys-manage-icon { font-size: 24px; flex-shrink: 0; }
.sys-manage-info { flex: 1; min-width: 0; }
.sys-manage-name { font-size: 15px; font-weight: 600; }
.sys-manage-desc { font-size: 12px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-manage-meta { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }
.sys-manage-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* 补测管理表格勾选 */
.data-table td .makeup-status { font-size: 11px; }


/* ========== v20260831e 重构追加：三栏布局 + 大日期 + 倒计时 ========== */

/* --- 顶部栏日期放大 --- */
.top-clock {
    font-size: 19px;
    font-weight: 600;
    color: var(--color-text);
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
}
.clock-time {
    color: var(--color-primary);
    font-size: 20px;
    font-weight: 700;
}

/* --- 三栏固定布局 --- */
.dashboard-three-col {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.dash-col-left {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 16px;
}
.dash-col-center {
    flex: 1;
    min-width: 0;
}
.dash-col-right {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 16px;
}

@media (max-width: 1200px) {
    .dashboard-three-col {
        flex-direction: column;
    }
    .dash-col-left,
    .dash-col-right {
        width: 100%;
        position: static;
    }
}

/* --- 左栏：今日课程面板 --- */
.today-course-panel {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1d4ed8 100%);
    border-radius: 12px;
    padding: 16px;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.tcp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    opacity: 0.9;
}
.tcp-title {
    font-size: 14px;
    font-weight: 500;
}
.tcp-count {
    font-size: 12px;
    opacity: 0.85;
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 下一节课大卡片 */
.next-class-card {
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    backdrop-filter: blur(4px);
}
.next-class-empty {
    text-align: center;
    padding: 20px 10px;
    font-size: 15px;
    line-height: 1.6;
}
.next-class-empty small {
    opacity: 0.7;
    font-size: 13px;
}
.next-class-inner {
    text-align: center;
}
.next-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.next-badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
}
.next-time {
    font-size: 12px;
    opacity: 0.85;
}
.next-subject {
    font-size: 24px;
    font-weight: 700;
    margin: 4px 0;
}
.next-class-name {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
}
.next-loc {
    font-size: 12px;
    opacity: 0.75;
}

/* 倒计时 */
.countdown-box {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.15);
}
.countdown-box.urgent {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    animation: pulseUrgent 1.5s ease infinite;
}
@keyframes pulseUrgent {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 0 4px rgba(239,68,68,0.1); }
}
.countdown-label {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 2px;
}
.countdown-time {
    font-size: 22px;
    font-weight: 700;
    color: #fbbf24;
}

/* 今日已完成折叠 */
.today-done-wrap {
    margin-bottom: 12px;
}
.today-done-toggle {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.today-done-toggle:hover {
    background: rgba(255,255,255,0.15);
}
.today-done-toggle .done-count {
    background: rgba(255,255,255,0.2);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 11px;
}
.today-done-toggle .toggle-caret {
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 10px;
}
.today-done-toggle.open .toggle-caret {
    transform: rotate(180deg);
}
.today-done-list {
    margin-top: 6px;
    padding-left: 8px;
}
.today-done-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    opacity: 0.8;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.today-done-item:last-child {
    border-bottom: none;
}
.done-check {
    color: #86efac;
    font-weight: bold;
}
.done-subject {
    flex: 1;
}
.done-time {
    opacity: 0.6;
    font-size: 11px;
}

/* 记一笔按钮 */
.btn-record {
    width: 100%;
    background: rgba(255,255,255,0.95);
    color: var(--color-primary);
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-record:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- 中栏：课程表面板 --- */
.schedule-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}
.schedule-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
    gap: 8px;
}
.schedule-tabs {
    display: flex;
    gap: 4px;
}
.schedule-tab {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.schedule-tab:hover {
    background: var(--color-bg);
    color: var(--color-text);
}
.schedule-tab.active {
    background: var(--color-primary);
    color: white;
    font-weight: 500;
}
.schedule-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.class-select-sm {
    padding: 5px 10px;
    font-size: 13px;
    min-width: 120px;
}
.schedule-grid-wrap {
    padding: 12px;
    overflow-x: auto;               /* ★ 允许课程表横向滚动 */
    -webkit-overflow-scrolling: touch;
}

/* 课程表今天列高亮 */
.sch-th.today-col-header {
    background: var(--color-primary) !important;
    color: white !important;
    font-weight: 600;
}
.sch-cell.today-col-cell {
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* --- 右栏：紧凑卡片 --- */
.side-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 12px;
    overflow: hidden;
}
.side-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}
.side-card-header svg {
    color: var(--color-primary);
}
.side-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.side-card-body {
    padding: 10px 14px;
}

/* 今日节奏卡片 */
.rhythm-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 12px;
    overflow: hidden;
}
.rhythm-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}
.rhythm-header svg {
    color: var(--color-primary);
}
.rhythm-body {
    padding: 14px;
}
.rhythm-date-big {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}
.day-big {
    font-size: 42px;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
}
.month-week {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    color: var(--color-text-secondary);
}
.rhythm-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.rstat {
    text-align: center;
}
.rstat-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
}
.rstat-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 2px;
}
.rhythm-progress {
    margin-bottom: 8px;
}
.rhythm-summary {
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: center;
}

/* 代办紧凑列表 */
.todo-list-compact {
    max-height: 200px;
    overflow-y: auto;
}
.todo-item-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}
.todo-item-compact:last-child {
    border-bottom: none;
}
.todo-item-compact.completed {
    opacity: 0.5;
}
.todo-item-compact.completed .todo-text {
    text-decoration: line-through;
}
.todo-check {
    color: var(--color-primary);
    font-size: 14px;
    flex-shrink: 0;
}
.todo-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.todo-due {
    font-size: 11px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}
.todo-due.overdue {
    color: #ef4444;
    font-weight: 500;
}
.todo-quick-add {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}
.todo-quick-add .form-input {
    flex: 1;
    padding: 6px 10px;
    font-size: 13px;
}

/* 补测紧凑列表 */
.makeup-list-compact {
    max-height: 220px;
    overflow-y: auto;
}
.makeup-item-compact {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}
.makeup-item-compact:last-child {
    border-bottom: none;
}
.makeup-main {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.makeup-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text);
}
.makeup-content {
    font-size: 12px;
    color: var(--color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.makeup-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}
.makeup-due {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 2px;
}
.makeup-due.overdue {
    color: #ef4444;
}

/* 快捷入口紧凑网格 */
.systems-grid-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.sys-item-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--color-bg);
}
.sys-item-compact:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}
.sys-icon-compact {
    font-size: 20px;
}
.sys-name-compact {
    font-size: 11px;
    color: var(--color-text);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
/* 德育等支持 SSO 一键登录的入口 */
.sys-item-compact.sso-item .sys-icon-compact,
.sys-item-compact.sso-item { color: var(--color-primary); }
.sys-item-compact.sso-item { background: linear-gradient(180deg, rgba(37,99,235,.06), rgba(37,99,235,.02)); }
/* 德育助手：图标加大 + 圆底高亮 */
.sys-item-compact.sso-item .sys-icon-compact {
    font-size: 26px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.sys-item-compact.sso-item .sys-name-compact {
    font-weight: 600;
    color: var(--color-primary);
}
.sso-tag {
    display: block; font-style: normal;
    font-size: 9px; color: #fff;
    background: var(--color-primary); border-radius: 7px;
    padding: 0 5px; margin-top: 2px; white-space: nowrap;
}

/* 空状态小 */
.empty-state-sm {
    text-align: center;
    padding: 16px 10px;
    color: var(--color-text-secondary);
    font-size: 12px;
}

/* 小按钮 */
.btn-xs {
    padding: 3px 8px;
    font-size: 12px;
}
.mini-btn.primary {
    background: var(--color-primary);
    color: white;
    border: none;
}
.mini-btn.primary:hover {
    background: #1d4ed8;
}

/* ========== v20260831-layout 布局重构 + 课程表编辑模式 ========== */

/* 三栏新比例 38:30:32 */
.dash-col-left { width: 38%; }
.dash-col-center { width: 30%; }
.dash-col-right { width: 32%; }

@media (max-width: 1200px) {
    .dashboard-three-col { flex-direction: column; }
    .dash-col-left, .dash-col-center, .dash-col-right {
        width: 100%;
        position: static;
    }
}

/* 课程表编辑模式：默认只读，空格子无+号，课程无操作按钮 */
#scheduleGrid:not(.edit-mode) .tt-slot {
    cursor: default;
    border-style: solid;
    border-color: #e5e7eb;
    background: var(--bg-surface);
}
#scheduleGrid:not(.edit-mode) .tt-slot .slot-plus,
#scheduleGrid:not(.edit-mode) .tt-slot .slot-hint {
    display: none;
}
#scheduleGrid:not(.edit-mode) .tt-course-actions {
    display: none !important;
}

/* 课程表编辑模式：空格子出现+号，课程hover显示编辑按钮 */
#scheduleGrid.edit-mode .tt-slot {
    cursor: pointer;
    border-style: dashed;
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.04);
}
#scheduleGrid.edit-mode .tt-slot:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--color-primary);
}
#scheduleGrid.edit-mode .tt-slot .slot-plus,
#scheduleGrid.edit-mode .tt-slot .slot-hint {
    display: block;
}
#scheduleGrid.edit-mode .tt-course-actions {
    display: flex;
    position: absolute; top: 4px; right: 4px;
    gap: 3px;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}
#scheduleGrid.edit-mode .tt-course:hover .tt-course-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 编辑课表按钮激活状态（绿色） */
#btnEditTimetable.btn-primary {
    background: var(--color-success);
    border-color: var(--color-success);
}
#btnEditTimetable.btn-primary:hover {
    background: #16a34a;
    border-color: #16a34a;
}
/* ========== v20260901-fix 卡片高度固定，三栏强制对齐 ========== */

/* 1. 三栏容器：强制撑满视口剩余高度，三栏等高 */
.dashboard-three-col {
    align-items: stretch;                 /* 强制三栏等高 */
    height: calc(100vh - 160px);        /* 减去顶部栏+提示条+padding */
    min-height: 520px;
}

/* 2. 三列统一为 flex 列，内部卡片纵向分配空间 */
.dash-col-left,
.dash-col-center,
.dash-col-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 16px;
}

/* 3. 左栏：课程表唯一卡片，撑满整列 */
.dash-col-left .schedule-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;          /* 关键：允许 flex 子项收缩 */
    overflow: hidden;
}
.dash-col-left .schedule-panel-header {
    flex-shrink: 0;         /* 头部不压缩 */
}
.dash-col-left .schedule-grid-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;       /* 课表内容超出时内部滚动 */
    overflow-x: auto;       /* ★ 允许课程表横向滚动（周四周五） */
    -webkit-overflow-scrolling: touch;
}

/* 4. 中栏：今日课程固定 55%，快捷入口撑满剩余 */
.dash-col-center .today-course-panel {
    flex: 0 0 55%;          /* 固定占比，不随内容伸缩 */
    min-height: 0;
    overflow-y: auto;       /* 内部超出滚动 */
}
.dash-col-center .side-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0;       /* 取消原始 margin，避免双重间距 */
}
.dash-col-center .side-card .side-card-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;       /* 快捷入口网格超出时滚动 */
}

/* 5. 右栏：代办 60%，补测 40% */
.dash-col-right #todoSection {
    flex: 0 0 60%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0;
}
.dash-col-right .side-card:last-child {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0;
}
.dash-col-right .side-card-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* 代办清单：列表区滚动，输入框始终贴底 */
.dash-col-right #todoSection .side-card-body {
    display: flex;
    flex-direction: column;
}
.dash-col-right .todo-list-compact {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.dash-col-right .todo-quick-add {
    flex-shrink: 0;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}

/* 6. 响应式：小于 1200px 恢复自然高度（移动端不固定） */
@media (max-width: 1200px) {
    .dashboard-three-col {
        height: auto;
        min-height: auto;
    }
    .dash-col-left,
    .dash-col-center,
    .dash-col-right {
        height: auto;
    }
    .dash-col-center .today-course-panel,
    .dash-col-right #todoSection {
        flex: none;
    }
    .dash-col-left .schedule-panel,
    .dash-col-center .side-card,
    .dash-col-right .side-card {
        overflow: visible;
    }
    .dash-col-left .schedule-grid-wrap,
    .dash-col-center .side-card .side-card-body,
    .dash-col-right .side-card-body,
    .dash-col-right .todo-list-compact {
        overflow: visible;
    }
}
/* ========== v20260901b 强制三栏等高 + 卡片固定高度 ========== */

/* 1. 三栏容器：强制等高、撑满视口 */
.content-body .dashboard-three-col {
    align-items: stretch !important;
    height: calc(100vh - 152px) !important;
    min-height: 480px !important;
}

/* 2. 三列统一 flex 列，取消 sticky（sticky 会阻止 flex 分配高度） */
.content-body .dashboard-three-col > .dash-col-left,
.content-body .dashboard-three-col > .dash-col-center,
.content-body .dashboard-three-col > .dash-col-right {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    position: relative !important;
    top: auto !important;
    gap: 16px !important;
}

/* 3. 左栏：课程表唯一卡片，撑满整列 */
.content-body .dash-col-left > .schedule-panel {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin-bottom: 0 !important;
}
.content-body .dash-col-left .schedule-panel-header {
    flex-shrink: 0 !important;
}
.content-body .dash-col-left .schedule-grid-wrap {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: auto !important;       /* ★ 关键：允许课程表横向滚动（周四周五不再被截断） */
    -webkit-overflow-scrolling: touch;
}

/* 4. 中栏：今日课程 55%，快捷入口 45% */
.content-body .dash-col-center > .today-course-panel {
    flex: 0 0 55% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    margin-bottom: 0 !important;
}
.content-body .dash-col-center > .side-card {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.content-body .dash-col-center > .side-card > .side-card-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}

/* 5. 右栏：代办 58%，补测 42% */
.content-body .dash-col-right > .side-card:first-child {
    flex: 0 0 58% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin-bottom: 0 !important;
}
.content-body .dash-col-right > .side-card:last-child {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin-bottom: 0 !important;
}
.content-body .dash-col-right > .side-card > .side-card-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}

/* 代办：列表区滚动，输入框始终贴底 */
.content-body .dash-col-right .todo-list-compact {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
}
.content-body .dash-col-right .todo-quick-add {
    flex-shrink: 0 !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid var(--border) !important;
}

/* 6. 响应式：小于 1200px 恢复自然流 */
@media (max-width: 1200px) {
    .content-body .dashboard-three-col {
        height: auto !important;
        min-height: auto !important;
    }
    .content-body .dashboard-three-col > .dash-col-left,
    .content-body .dashboard-three-col > .dash-col-center,
    .content-body .dashboard-three-col > .dash-col-right {
        height: auto !important;
        position: static !important;
    }
    .content-body .dash-col-center > .today-course-panel,
    .content-body .dash-col-right > .side-card:first-child {
        flex: none !important;
    }
    .content-body .dash-col-left > .schedule-panel,
    .content-body .dash-col-center > .side-card,
    .content-body .dash-col-right > .side-card {
        overflow: visible !important;
    }
    .content-body .dash-col-left .schedule-grid-wrap,
    .content-body .dash-col-center > .side-card > .side-card-body,
    .content-body .dash-col-right > .side-card > .side-card-body,
    .content-body .dash-col-right .todo-list-compact {
        overflow: visible !important;
    }
}

/* ============================================================
   ★ v39.33：首页两栏布局（删除代办清单/补测后重排）
   ------------------------------------------------------------
   原三栏 38/30/32，右栏整列删掉后：
     左栏（课程表）62% —— 获得更宽的行，课题名不再挤成两行
     右栏（今日课程 + 快捷入口）38%
   课程表「不折叠」：把 grid-wrap 的 overflow 全部放开、
   卡片高度改为 auto，让 7 节课一次性全部铺开显示。
   ============================================================ */
.dashboard-two-col {
    display: flex !important;
    gap: 16px !important;
    align-items: stretch !important;
}
.dashboard-two-col > .dash-col-left  { flex: 0 0 62% !important; width: 62% !important; }
.dashboard-two-col > .dash-col-center { flex: 1 1 auto !important; width: auto !important; }

/* ★ v39.35：课程表恢复「容器内纵向滚动 + 表头吸顶」
   （v39.33 曾改为 overflow:visible 让表格自然撑高；但 v39.35 把课表挪到左列上方、
     下方还要放「今日课程」，必须给课表一个可视高度上限，才能把今日课程留在首屏内。
     滚动容器 + position:sticky 表头是配套的：overflow:visible 时 sticky 不生效。） */
.content-body .dashboard-two-col .dash-col-left .schedule-grid-wrap,
.dash-col-left .schedule-grid-wrap {
    overflow-x: auto !important;
    overflow-y: auto !important;   /* ★ 内部纵向滚动，配合表头吸顶 */
    flex: 0 0 auto !important;
}
/* 左栏面板高度改为自适应（不再被 calc(100vh-152px) 限制） */
.content-body .dashboard-two-col .dash-col-left,
.content-body .dashboard-two-col > .dash-col-left > .schedule-panel {
    height: auto !important;
}
.content-body .dashboard-two-col > .dash-col-left > .schedule-panel {
    flex: 0 0 auto !important;
    min-height: 0 !important;
}
.content-body .dashboard-two-col {
    height: auto !important;
    min-height: 0 !important;
}

/* ★ v39.35：右栏改为「今日考勤」独立一列（原 .dash-col-center 下的今日课程已移入左列） */
.content-body .dashboard-two-col > .dash-col-right {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}
/* v39.35：原 .dash-col-center > .today-course-panel / .side-card 规则已废弃（中栏不复存在） */

/* ★ 上午 / 下午 分组行 */
.schedule-table tr.st-session-row td.st-session {
    background: linear-gradient(90deg, rgba(37,99,235,.10), rgba(37,99,235,.03));
    color: var(--color-primary, #2563eb);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2px;
    text-align: left;
    padding: 4px 10px;
    border-left: 3px solid var(--color-primary, #2563eb);
}

@media (max-width: 1200px) {
    .dashboard-two-col { flex-direction: column !important; }
    .dashboard-two-col > .dash-col-left,
    .dashboard-two-col > .dash-col-right { width: 100% !important; flex: none !important; }
}

/* ========== v20260902a 日期时间强化 + 三级课程提醒 + 课表临近高亮 ========== */

/* --- 顶栏时钟强化 --- */
.top-clock {
    font-size: 18px;
    font-weight: 700;
    gap: 8px;
    align-items: center;
    margin-left: 16px;
}
.clock-date-chip {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
}
.clock-time {
    font-size: 26px;
    font-weight: 800;
    color: #1e40af;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    line-height: 1;
}
.clock-seconds {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    align-self: flex-end;
    padding-bottom: 2px;
}

/* --- 中栏大日期条 --- */
.date-hero {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.date-hero-week {
    font-size: 22px;
    font-weight: 800;
    color: #1e40af;
}
.date-hero-full {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* --- 三级倒计时 --- */
.countdown-box {
    transition: all 0.3s ease;
}
.countdown-box.warning {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
    animation: pulseWarning 2s ease infinite;
}
.countdown-box.warning .countdown-time {
    color: #fde68a;
}
.countdown-box.urgent {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    animation: pulseUrgent 1.2s ease infinite;
}
.countdown-box.urgent .countdown-time {
    color: #fca5a5;
}
@keyframes pulseWarning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(251,191,36,0.08); }
}
@keyframes pulseUrgent {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239,68,68,0.1); }
}

/* --- 下一节课卡片三级状态 --- */
.next-class-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.next-class-card.urgency-warning {
    background: rgba(251, 191, 36, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.4);
}
.next-class-card.urgency-urgent {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    animation: cardUrgentGlow 1.5s ease infinite;
}
.next-class-card.urgency-ongoing {
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.4);
}
@keyframes cardUrgentGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 16px 4px rgba(239,68,68,0.15); }
}

/* --- 铃铛动态状态 --- */
.bell-hint {
    transition: all 0.3s ease;
}
.bell-hint.bell-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.bell-hint.bell-urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
    animation: bellUrgentPulse 1s ease infinite;
}
.bell-hint.bell-ongoing {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
}
@keyframes bellUrgentPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* --- 课表临近上课特别高亮 --- */
.tt-cell.tt-course.upcoming {
    position: relative;
    border: 2px solid #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
    z-index: 2;
}
.tt-cell.tt-course.warning-cell {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
    animation: cellWarningPulse 2s ease infinite;
}
.tt-cell.tt-course.urgent-cell {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.4);
    animation: cellUrgentPulse 1s ease infinite;
    z-index: 3;
}
@keyframes cellWarningPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(245,158,11,0.25); }
    50% { box-shadow: 0 0 20px rgba(245,158,11,0.45); }
}
@keyframes cellUrgentPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(239,68,68,0.35); }
    50% { box-shadow: 0 0 24px rgba(239,68,68,0.55); }
}
.upcoming-badge {
    position: absolute;
    top: -8px;
    right: -4px;
    background: #3b82f6;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    z-index: 4;
}
.warning-cell .upcoming-badge { background: #f59e0b; }
.urgent-cell .upcoming-badge { background: #ef4444; }

/* --- 今日课程面板视觉升级 --- */
.today-course-panel {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #1e3a8a 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* --- 小屏适配 --- */
@media (max-width: 768px) {
    .clock-date-chip { font-size: 11px; padding: 3px 8px; }
    .clock-time { font-size: 20px; }
    .clock-seconds { display: none; }
    .date-hero-week { font-size: 18px; }
    .date-hero-full { font-size: 12px; }
}

/* ========== v20260902b 桌面端侧边栏折叠（汉堡按钮修复） ========== */
@media (min-width: 769px) {
    .sidebar {
        transition: transform 0.28s ease;
    }
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    .main-content {
        transition: margin-left 0.28s ease;
    }
    .main-content.sidebar-collapsed {
        margin-left: 0;
    }
    .menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ========== v20260902c 顶栏时钟放大 + 星期标签 ========== */
.top-clock {
    gap: 14px;
    align-items: center;
    margin-left: 20px;
}
.clock-date-chip {
    font-size: 15px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 20px;
}
.clock-time {
    font-size: 36px;
    font-weight: 800;
    color: #1e3a8a;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    line-height: 1;
}
.clock-seconds {
    font-size: 18px;
    font-weight: 600;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    align-self: flex-end;
    padding-bottom: 4px;
}

/* 今日课程标题右侧星期标签 */
.tcp-weekday {
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.18);
    padding: 3px 10px;
    border-radius: 10px;
    opacity: 0.9;
}

/* 小屏适配 */
@media (max-width: 768px) {
    .clock-time { font-size: 24px; }
    .clock-date-chip { font-size: 12px; padding: 4px 10px; }
    .clock-seconds { font-size: 14px; }
}

/* ========== v20260903 移动端 APP 化布局 ========== */

/* --- 移动端底部 Tab Bar --- */
.mobile-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-tab-bar-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
}
.mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px 6px;
    color: #9ca3af;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
}
.mobile-tab svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.mobile-tab span {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
}
.mobile-tab.active {
    color: #2563eb;
}
.mobile-tab.active svg {
    stroke: #2563eb;
}

/* --- 移动端抽屉菜单（更多） --- */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.mobile-drawer-overlay.show {
    display: block;
    opacity: 1;
}
.mobile-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom, 0);
    max-height: 70vh;
    overflow-y: auto;
}
.mobile-drawer.show {
    transform: translateY(0);
}
.mobile-drawer-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 10px auto 6px;
}
.mobile-drawer-title {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    padding: 4px 0 12px;
    border-bottom: 1px solid #f3f4f6;
}
.mobile-drawer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px;
}
.mobile-drawer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border-radius: 10px;
    text-decoration: none;
    color: #374151;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}
.mobile-drawer-item:active {
    background: #f3f4f6;
}
.mobile-drawer-item svg {
    width: 26px;
    height: 26px;
    color: #6b7280;
}
.mobile-drawer-item span {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}
.mobile-drawer-item.danger svg,
.mobile-drawer-item.danger span {
    color: #ef4444;
}

/* --- 移动端全局布局改造 --- */
@media (max-width: 768px) {
    /* 显示底部导航 */
    .mobile-tab-bar {
        display: block;
    }

    /* body 底部留导航空间 */
    body {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
    }

    /* PWA standalone 模式：顶部留安全区 */
    @media (display-mode: standalone) {
        .top-bar {
            padding-top: calc(env(safe-area-inset-top, 0) + 12px) !important;
        }
    }

    /* 隐藏桌面端侧边栏（改用抽屉） */
    .sidebar {
        transform: translateX(-100%) !important;
        transition: transform 0.28s ease;
    }
    .sidebar.open {
        transform: translateX(0) !important;
    }
    .sidebar-overlay.show {
        display: block;
    }

    /* 主内容区无左边距 */
    .main-content {
        margin-left: 0 !important;
    }

    /* 顶栏简化 */
    .top-bar {
        padding: 12px 16px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    .top-bar-left h2 {
        font-size: 16px !important;
    }
    .top-clock {
        margin-left: 8px !important;
        gap: 8px !important;
    }
    .clock-time {
        font-size: 22px !important;
    }
    .clock-date-chip {
        font-size: 12px !important;
        padding: 4px 10px !important;
    }
    .clock-seconds {
        font-size: 13px !important;
    }
    .bell-hint {
        font-size: 11px !important;
        padding: 4px 10px !important;
    }

    /* 三栏→单栏流式 */
    .dashboard-three-col,
    .dashboard-two-col {
        flex-direction: column !important;
        gap: 12px !important;
        height: auto !important;
    }
    .dash-col-left,
    .dash-col-center,
    .dash-col-right {
        width: 100% !important;
        position: static !important;
        height: auto !important;
    }

    /* ===== ★ v39.29：课程表「一屏放下」 —— 彻底解决周四周五被裁 =====
       旧写法 min-width:340px + repeat(5, minmax(52px,1fr)) 必然溢出：
       手机 CSS 宽 ~390px，减去 content-body 12×2 + card 14×2 + grid-wrap 12×2 = 76px，
       实际可用仅 ~314px < 340px ⇒ 溢出被裁，周四周五看不到，且横向滚动在微信里很难滑。
       新写法：min-width:0 + minmax(0,1fr)，列宽完全由容器决定，永不溢出。 */
    .schedule-panel {
        overflow: visible !important;
    }
    .schedule-grid-wrap {
        overflow-x: visible !important;   /* 不再需要横向滚动 */
        padding: 6px !important;          /* 12px → 6px，再省 12px 宽度 */
    }
    .tt-table {
        min-width: 0 !important;          /* ★ 关键：取消硬最小宽度 */
        width: 100%;
        grid-template-columns: 30px repeat(5, minmax(0, 1fr)) !important;  /* ★ minmax(0,1fr) 允许压缩 */
        gap: 2px;
    }
    .tt-cell {
        min-height: 46px;
        padding: 3px 2px;
        font-size: 11px;
        border-radius: 5px;
        overflow: hidden;
    }
    .tt-head {
        font-size: 11px;
        min-height: 26px;
        letter-spacing: -0.03em;
        padding: 0 1px;
    }
    /* 时间列压缩后：节次号保持可读，时间缩到 8px 且不撑宽 */
    .tt-period-cell { padding: 2px 1px; }
    .tt-period-cell .p-no { font-size: 11px; }
    .tt-period-cell .p-time { font-size: 8px; letter-spacing: -0.04em; white-space: nowrap; }
    /* 课程格：窄列下科目名可换行，班级/地点缩小不撑宽 */
    .tt-course { padding: 3px 2px !important; gap: 1px; }
    .tt-course .c-subject { font-size: 11px; line-height: 1.15; word-break: break-all; }
    .tt-course .c-class,
    .tt-course .c-loc { font-size: 9px; line-height: 1.1; word-break: break-all; }
    .tt-slot .slot-hint { display: none; }   /* 窄屏去掉"点击添加"提示，只留 + */
    .tt-slot .slot-plus { font-size: 14px; }

    /* 今日课程面板 */
    .today-course-panel {
        padding: 14px !important;
    }
    .next-subject {
        font-size: 20px !important;
    }
    .countdown-time {
        font-size: 20px !important;
    }

    /* 按钮触摸友好 */
    .btn {
        min-height: 40px;
        font-size: 14px;
    }
    .btn-sm {
        min-height: 34px;
        font-size: 13px;
    }

    /* 表单元素触摸友好 */
    .form-input {
        min-height: 42px;
        font-size: 15px;
    }

    /* 卡片间距 */
    .side-card {
        margin-bottom: 10px !important;
    }

    /* 弹窗适配 */
    .modal {
        width: 92vw !important;
        max-width: 92vw !important;
        max-height: 85vh;
        overflow-y: auto;
        margin: 5vh auto !important;
    }

    /* 表格横向滚动 */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 隐藏提示条（移动端已移除） */
    .notice-bar {
        display: none !important;
    }
}

/* 小屏进一步优化 */
@media (max-width: 480px) {
    .mobile-drawer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .clock-time {
        font-size: 20px !important;
    }
    .top-bar-left h2 {
        font-size: 14px !important;
    }
}

/* ============================================================
 * 多角色切换：右下浮动按钮 + 弹窗
 * 适配：PC/移动均可见；与 mobile-tab-bar 不冲突（位置不同）。
 * ============================================================ */
.gzt-role-switcher-btn {
    position: fixed;
    right: 18px;
    bottom: 78px;  /* 避开移动端底部 tab bar（默认 56px + 18px 间距） */
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 0;
    border-radius: 22px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.35);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.gzt-role-switcher-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.45);
}
.gzt-role-switcher-btn:active { transform: translateY(0); }
.gzt-role-switcher-btn svg { width: 16px; height: 16px; }
.gzt-role-switcher-label { white-space: nowrap; }

/* ============================================================
 * ★ v39.29：扫码点名 / 独立入口「专注模式」（低成本子应用化第一步）
 *
 * 触发：URL 带 ?ct=<班牌码签名>（扫码）或 ?focus=1（独立入口），
 *       由页面脚本给 <body> 加 .qr-focus。
 * 效果：隐藏工作台外壳（侧栏 / 底部主导航 / 右下身份浮动按钮），
 *       页面只剩「这一件事」——扫码进来就是一张干净的点名页，
 *       不需要重写前端就能拿到「独立考勤子应用」的体验。
 * 安全：仅加 class 触发，未命中参数时零影响；不改任何共享逻辑。
 * ============================================================ */
body.qr-focus .sidebar,
body.qr-focus .mobile-tab-bar,
body.qr-focus .gzt-role-switcher-btn,
body.qr-focus .mobile-drawer { display: none !important; }
body.qr-focus .main-content { margin-left: 0 !important; width: 100%; }
body.qr-focus .content-body { padding-bottom: 20px !important; }
body.qr-focus .top-bar { border-bottom: 1px solid var(--color-border); }

/* 专注模式提示条（默认隐藏，命中专注模式才出现） */
.qr-focus-bar { display: none; }
body.qr-focus .qr-focus-bar {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; line-height: 1.4; color: #1d4ed8;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
    padding: 8px 12px; margin: 0 0 10px;
}
.qr-focus-bar .qf-badge {
    flex-shrink: 0; font-weight: 700; font-size: 11px;
    background: #2563eb; color: #fff; border-radius: 5px; padding: 1px 6px;
}
.qr-focus-bar .qf-back { margin-left: auto; flex-shrink: 0; color: #64748b; font-size: 12.5px; }

@media (max-width: 640px) {
    .gzt-role-switcher-btn {
        right: 12px;
        bottom: 84px;     /* 移动端 tab bar 之上 */
        padding: 6px 12px;
        font-size: 12px;
    }
    .gzt-role-switcher-btn svg { width: 14px; height: 14px; }
}

.gzt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: gztFadeIn .15s ease-out;
}
@keyframes gztFadeIn { from { opacity: 0; } to { opacity: 1; } }

.gzt-modal {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 20px 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: gztPop .18s ease-out;
}
@keyframes gztPop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.gzt-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 14px;
}

.gzt-role-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.gzt-role-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.gzt-role-option:hover { background: #f8fafc; }
.gzt-role-option.active {
    background: #eff6ff;
    border-color: #2563eb;
}
.gzt-role-option input[type=radio] { margin: 0; }
.gzt-role-name { flex: 1; font-size: 14px; color: #1e293b; font-weight: 500; }
.gzt-role-code { font-size: 11px; color: #94a3b8; font-family: ui-monospace, monospace; }

.gzt-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.gzt-btn {
    padding: 8px 18px;
    border: 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .12s;
}
.gzt-btn:disabled { opacity: .5; cursor: not-allowed; }
.gzt-btn-primary   { background: #2563eb; color: #fff; }
.gzt-btn-primary:hover { background: #1d4ed8; }
.gzt-btn-secondary { background: #f1f5f9; color: #475569; }
.gzt-btn-secondary:hover { background: #e2e8f0; }

/* ========== 顶部用户信息区（PC） ========== */
.gzt-user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
}
.gzt-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
}
.gzt-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gzt-user-role {
    font-size: 12px;
    color: var(--color-text-secondary, #64748b);
}
.gzt-user-logout {
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    transition: all .12s;
}
.gzt-user-logout:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* ========== 移动端抽屉用户信息 ========== */
.mobile-drawer-user {
    padding: 18px 16px 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.mobile-drawer-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}
.mobile-drawer-user-role {
    font-size: 12px;
    color: #64748b;
}

/* ========== 德育助手快捷入口 ========== */
.gzt-deyu-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    color: #1e40af;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
    text-decoration: none;
}
.gzt-deyu-entry:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}
.gzt-deyu-entry .icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    flex-shrink: 0;
}
.gzt-deyu-entry .icon svg {
    width: 20px;
    height: 20px;
}
.gzt-deyu-entry .label {
    font-size: 14px;
    font-weight: 600;
}
.gzt-deyu-entry .desc {
    font-size: 12px;
    color: #3b82f6;
    margin-top: 2px;
}

/* 侧边栏德育入口高亮 */
.nav-item.deyu {
    color: #2563eb;
    background: #eff6ff;
}
.nav-item.deyu:hover {
    background: #dbeafe;
}
.nav-item.deyu svg {
    color: #2563eb;
}

/* 移动端抽屉高亮项（德育助手） */
.mobile-drawer-item.highlight {
    background: #eff6ff;
    color: #2563eb;
}
.mobile-drawer-item.highlight svg {
    color: #2563eb;
}

/* 小屏顶部用户区折行优化 */
@media (max-width: 640px) {
    .gzt-user-header { gap: 8px; }
    .gzt-user-meta { display: none; }
    .gzt-user-logout { padding: 4px 8px; font-size: 11px; }
}

/* ================= 今日页仪表盘（dashboard.js） ================= */
/* 课程表 */
.schedule-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.schedule-table th, .schedule-table td {
    border: 1px solid var(--border, #e2e8f0);
    padding: 6px 8px; text-align: center; vertical-align: middle;
}
.schedule-table thead th { background: var(--bg-surface-2, #f8fafc); font-weight: 600; color: var(--color-text-secondary, #475569); }
.st-period { width: 72px; font-size: 12px; color: var(--color-text-secondary, #475569); background: var(--bg-surface-2, #f8fafc); }
.st-time { font-size: 10px; color: var(--color-text-muted, #94a3b8); line-height: 1.3; margin-top: 2px; }
.st-cell { min-width: 88px; height: 56px; cursor: pointer; transition: background .15s; }
.st-empty { color: #cbd5e1; font-size: 16px; }
.st-empty:hover { background: #f0f7ff; color: var(--color-primary, #2563eb); }
.st-filled { background: rgba(37, 99, 235, 0.06); }
.st-filled:hover { background: rgba(37, 99, 235, 0.12); }
.st-subject { font-weight: 600; color: var(--color-primary, #2563eb); font-size: 13px; }
.st-meta { font-size: 11px; color: var(--color-text-muted, #94a3b8); margin-top: 2px; }

/* 今日课程 */
.next-cur-subject { font-size: 20px; font-weight: 700; color: #fff; }
.next-cur-meta { font-size: 13px; color: rgba(255,255,255,.85); margin-top: 6px; }
.next-cur-time { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px; }
.done-item { padding: 6px 0; font-size: 13px; color: var(--color-text-secondary, #475569); border-bottom: 1px dashed var(--border, #e2e8f0); }
.done-item:last-child { border-bottom: none; }

/* 代办 */
.todo-item { cursor: pointer; user-select: none; }
.todo-item .todo-check { border: none; width: auto; height: auto; font-size: 15px; }
.todo-item .todo-title { flex: 1; font-size: 14px; }
.todo-item.done .todo-title { text-decoration: line-through; color: var(--color-text-muted, #94a3b8); }
.todo-due { font-size: 11px; color: var(--color-accent, #f97316); background: rgba(249,115,22,.1); padding: 1px 6px; border-radius: 8px; }

/* 补测 */
.mk-main { font-size: 13px; }
.mk-meta { font-size: 11px; color: var(--color-text-muted, #94a3b8); margin-top: 2px; }
.mk-actions { margin-top: 6px; }
.mk-overdue { font-size: 11px; color: #dc2626; background: rgba(220,38,38,.1); padding: 1px 6px; border-radius: 8px; font-weight: 600; }

/* 班级管理 */
.class-mgr-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border, #e2e8f0); font-size: 14px; }
.class-mgr-item:last-child { border-bottom: none; }
.period-label { font-size: 13px; font-weight: 600; color: var(--color-text-secondary, #475569); }

/* ============================================================
   ★ v39.30：课程表「一屏放下」真修复（微信 / 手机窄屏）
   ------------------------------------------------------------
   ⚠️ 上一版 v39.29 改的是 .tt-table / .tt-cell / .tt-slot —— 那是历史遗留的
      「网格版式」死代码，全站 JS/HTML 都不再生成 tt-* 类名。
      dashboard.js 真正渲染的是普通表格：
          <table class="schedule-table">  (st-period / st-cell / st-subject / st-meta)
      ⇒ v39.29 的 CSS 从未命中，周四、周五依旧被裁到屏幕外。

   真根因（数学上必然溢出）：
      .st-cell   { min-width: 88px }        ← 每列最小 88px
      .st-period { width: 72px }
      ⇒ 表格最小内容宽 = 72 + 5×88 + 边框 ≈ 512px
      ⇒ 而手机可用宽只有 ~330px；外层 .schedule-grid-wrap 又是 overflow-x:auto
      ⇒ 周四/周五被推到屏幕右侧之外，微信里几乎拖不动，用户以为"没有课"。

   修法：table-layout:fixed + width:100% ⇒ 列宽由表格宽度均分，不再看内容脸色；
        再把 .st-cell 的 min-width 归零、文字允许换行 ⇒ 数学上不可能溢出。
   ============================================================ */
@media (max-width: 768px) {
    .schedule-grid-wrap {
        padding: 6px !important;          /* 12px → 6px，再省 12px 宽度 */
        overflow-x: visible !important;   /* ★ 不再需要横向滚动 */
    }
    .schedule-table {
        width: 100% !important;
        table-layout: fixed;              /* ★★ 关键：列宽均分，不再被 min-content 撑破 */
        font-size: 11px;
    }
    .schedule-table th,
    .schedule-table td {
        padding: 3px 2px;
        word-break: break-all;
        overflow-wrap: anywhere;
        overflow: hidden;
    }
    .schedule-table thead th { font-size: 11px; padding: 3px 1px; }
    .schedule-table .st-period {
        width: 28px !important;           /* ★ 72px → 28px */
        padding: 2px 1px !important;
        font-size: 10px;
        line-height: 1.15;
    }
    .schedule-table .st-time { font-size: 8px; letter-spacing: -.04em; margin-top: 1px; }
    .schedule-table .st-cell {
        min-width: 0 !important;          /* ★★ 关键：归零 88px 下限 */
        width: auto !important;
        height: auto;
        min-height: 38px;
        padding: 3px 1px !important;
    }
    .schedule-table .st-subject { font-size: 10px; line-height: 1.15; }
    .schedule-table .st-meta    { font-size: 8px; line-height: 1.1; margin-top: 1px; }
    .schedule-table .st-empty   { font-size: 12px; }

    /* 面板头部：页签 + 课节时间/管理班级/编辑课表/添加课程 挤一行必然溢出被裁 → 允许换行 */
    .schedule-panel-header { padding: 9px 10px; gap: 6px; }
    .schedule-tabs { flex-wrap: wrap; }
    .schedule-tab { padding: 5px 10px; font-size: 13px; }
    .schedule-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
    .schedule-actions .btn { font-size: 12px; padding: 5px 9px; }
    .schedule-actions .class-select-sm { min-width: 0; flex: 1 1 120px; }
}

/* ===== 值日点名共用样式（duty.html / nap.html）v39.39.5 抽取 ===== */
.view-tabs { display: flex; gap: 10px; margin-bottom: 14px; }
.view-tab { border: 1px solid #d9d9d9; background: #fff; border-radius: 8px; padding: 8px 18px;
font-size: 14px; cursor: pointer; }
.view-tab.active { background: #1677ff; color: #fff; border-color: #1677ff; font-weight: 600; }
.rc-dutyline { font-size: 13px; color: #666; margin-bottom: 10px; }
.rc-dutyline b { color: #d46b08; }
.rc-head { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rc-session-card { flex: 1; min-width: 220px; border: 2px solid #e5e7eb; border-radius: 12px;
padding: 16px 18px; cursor: pointer; background: #fff; transition: .15s; }
.rc-session-card:hover { border-color: #91caff; }
.rc-session-card.active { border-color: #1677ff; background: #f0f7ff; box-shadow: 0 2px 8px rgba(22,119,255,.12); }
.rc-session-card .t { font-size: 17px; font-weight: 700; }
.rc-session-card.active .t { color: #0958d9; }
.rc-session-card .s { font-size: 12px; color: #888; margin-top: 4px; }
.rc-feed { background: #f6ffed; border: 1px solid #b7eb8f; border-radius: 10px;
padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.rc-feed:empty { display: none; }
.rc-feed .line { display: flex; gap: 8px; align-items: center; padding: 3px 0; flex-wrap: wrap; }
.rc-feed .line .who { font-weight: 700; color: #389e0d; }
.rc-feed .line .tm { font-size: 11px; color: #8c8c8c; }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rc-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; background: #fff; cursor: default; }
.rc-card.done { border-left: 4px solid #52c41a; }
.rc-card.undone { border-left: 4px solid #d9d9d9; }
.rc-card.confirmed { border-left: 4px solid #1677ff; }
.rc-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.rc-name { font-weight: 700; font-size: 13px; }
.rc-nums { display: flex; gap: 6px; font-size: 11px; color: #555; flex-wrap: wrap; }
.rc-nums .n { padding: 1px 6px; border-radius: 6px; background: #f5f5f5; }
.rc-nums .n.absent { background: #fff1f0; color: #cf1322; font-weight: 600; }
.rc-nums .n.late { background: #fffbe6; color: #d46b08; }
.rc-nums .n.present { background: #f6ffed; color: #389e0d; }
.rc-nums .n.leave { background: #f0f5ff; color: #2f54eb; }
.rc-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.stu-pick { display: flex; flex-wrap: wrap; gap: 8px; max-height: 340px; overflow-y: auto; }
.schip { border: 1px solid #d9d9d9; border-radius: 8px; padding: 6px 10px; font-size: 13px;
cursor: pointer; background: #fff; min-width: 88px; text-align: center; user-select: none; }
.schip.sel { border-color: #1677ff; background: #e6f4ff; color: #0958d9; font-weight: 600; }
.schip.absent { border-color: #ffa39e; background: #fff1f0; }
.schip.late { border-color: #ffd591; background: #fffbe6; }
.schip.present { border-color: #b7eb8f; background: #f6ffed; }
.schip.leave { border-color: #d3adf7; background: #f9f0ff; }
.schip .sub { display: block; font-size: 10px; color: #999; font-weight: 400; }

/* ★ v39.39.6：值日页标题旁星期标签 */
.wk-tag{display:inline-block;margin-left:12px;font-size:19px;font-weight:700;color:#9a3412;background:#ffedd5;border:1px solid #fdba74;padding:2px 14px;border-radius:999px;vertical-align:3px;white-space:nowrap;}
