/* ===== 智能排课系统 样式（扁平化商务风） ===== */
:root{
  --primary:#2f6fed;
  --primary-dark:#2458c4;
  --primary-light:#eaf1ff;
  --success:#16a34a;
  --danger:#dc2626;
  --warning:#d97706;
  --text:#1f2937;
  --text-2:#6b7280;
  --border:#e5e7eb;
  --bg:#f3f5f9;
  --card:#ffffff;
  --sidebar-w:200px;
  --radius:8px;
  --shadow:0 1px 3px rgba(0,0,0,.08);
}
*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
body{font-family:"Microsoft YaHei","PingFang SC",-apple-system,Segoe UI,sans-serif;color:var(--text);background:var(--bg);font-size:14px;line-height:1.6}
#app{display:flex;flex-direction:column;height:100vh;height:100dvh}

/* ===== 启动遮罩（首屏加载/鉴权期间全屏覆盖，防止闪现后台界面） ===== */
.boot-splash{position:fixed;inset:0;background:linear-gradient(135deg,#eef3fb 0%,#dbe7f7 55%,#cfdff5 100%);display:flex;align-items:center;justify-content:center;z-index:400;padding:20px}
.bs-card{display:flex;flex-direction:column;align-items:center;gap:12px}
.bs-logo{width:52px;height:52px;font-size:25px;border-radius:12px;background:linear-gradient(135deg,#2f6fed,#5b8def);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;box-shadow:0 8px 20px rgba(47,111,237,.28)}
.bs-title{font-size:17px;font-weight:600;color:var(--text)}
.bs-text{font-size:13px;color:var(--text-2)}
.bs-spinner{width:26px;height:26px;border-radius:50%;border:3px solid #c7dcff;border-top-color:var(--primary);animation:bsSpin .8s linear infinite}
@keyframes bsSpin{to{transform:rotate(360deg)}}

/* ===== 系统登录门禁 ===== */
.login-gate{position:fixed;inset:0;background:linear-gradient(135deg,#eef3fb 0%,#dbe7f7 55%,#cfdff5 100%);display:flex;align-items:center;justify-content:center;z-index:300;padding:20px}
.lg-card{background:#fff;border-radius:14px;box-shadow:0 24px 60px rgba(15,23,42,.18);padding:32px 28px 24px;width:392px;max-width:94vw}
.lg-brand{display:flex;align-items:center;gap:12px;margin-bottom:22px}
.lg-brand .logo{width:46px;height:46px;font-size:22px;border-radius:10px}
.lg-brand h2{font-size:19px;font-weight:700;line-height:1.3}
.lg-brand p{font-size:12.5px;color:var(--text-2)}
.lg-card .form-item{margin-bottom:14px}
.lg-card input{height:42px;font-size:14.5px;width:100%}
.lg-btn{width:100%;height:42px;margin-top:6px;font-size:15px;letter-spacing:4px}
.lg-err{margin-top:10px;background:#fee2e2;color:#991b1b;border-radius:6px;padding:8px 12px;font-size:13px}
.lg-tip{margin-top:16px;font-size:12px;color:var(--text-2);text-align:center;line-height:1.8}
.lg-tip b{color:var(--primary)}

/* ===== 顶部栏 ===== */
.topbar{height:56px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;gap:10px;padding:0 16px;flex-shrink:0;box-shadow:var(--shadow);z-index:20}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.menu-toggle{display:none;font-size:17px;padding:0 10px}
.topbar .menu-toggle{display:none}
.logo{width:36px;height:36px;background:linear-gradient(135deg,#2f6fed,#5b8def);color:#fff;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700}
.brand h1{font-size:17px;font-weight:600;line-height:1.2}
.top-actions{display:flex;align-items:center;gap:8px}
.storage-tip{font-size:12px;color:var(--text-2);margin-right:6px}
.cur-file{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:280px;height:28px;padding:0 10px;border:1px solid var(--border);background:#f8fafc;border-radius:999px;cursor:pointer;font-size:12px;color:var(--text-2);font-family:inherit;flex-shrink:1}
.cur-file:hover{background:var(--primary-light);border-color:var(--primary)}
.cur-file b{color:var(--text);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:190px}
.cur-file .cur-file-label{flex-shrink:0}
body[data-role="teacher"] .cur-file{display:none!important}

/* ===== 布局 ===== */
.layout{flex:1;display:flex;min-height:0}

/* ===== 侧边栏 ===== */
.sidebar{width:var(--sidebar-w);background:#fff;border-right:1px solid var(--border);overflow-y:auto;padding:10px 0;flex-shrink:0;display:flex;flex-direction:column}
.menu-group{margin-bottom:6px}
.menu-title{padding:8px 16px 4px;font-size:12px;color:var(--text-2);font-weight:600;letter-spacing:.5px}
.menu-item{display:block;padding:8px 16px 8px 22px;color:var(--text);text-decoration:none;font-size:13.5px;cursor:pointer;border-left:3px solid transparent;transition:all .15s}
.menu-item:hover{background:var(--primary-light);color:var(--primary)}
.menu-item.active{background:var(--primary-light);color:var(--primary);border-left-color:var(--primary);font-weight:600}
.menu-badge{display:inline-block;min-width:16px;height:16px;line-height:16px;padding:0 5px;margin-left:6px;border-radius:9px;background:#ef4444;color:#fff;font-size:11px;text-align:center;vertical-align:1px}

/* ---------- 教师资料修改申请（待审核提示 / 差异展示） ---------- */
.pf-note{border-radius:8px;padding:9px 12px;font-size:12.5px;line-height:1.9;margin-bottom:10px}
.pf-note-warn{background:#fef9c3;border:1px solid #fde68a;color:#92400e}
.pf-note-err{background:#fee2e2;border:1px solid #fecaca;color:#991b1b}
.pf-note-ok{background:#dcfce7;border:1px solid #bbf7d0;color:#166534}
.pf-diff{font-size:12.5px;line-height:1.9}
.pf-diff b{font-weight:600;color:var(--text-2);margin-right:2px}
.pf-diff .pf-old{color:var(--text-2)}
.pf-diff .pf-new{color:var(--primary);font-weight:600}
.sidebar-foot{margin-top:auto;border-top:1px solid var(--border);padding:10px 14px;display:flex;flex-direction:column;gap:8px;position:sticky;bottom:0;background:#fff}
.sf-user{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:13px}
.sf-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sf-actions{display:flex;gap:6px}
.sf-actions .btn{flex:1;min-width:0}
.sidebar-mask{display:none}

/* ===== 内容区 ===== */
.content{flex:1;overflow-y:auto;padding:18px 22px;min-width:0}
.page-title{font-size:18px;font-weight:600;margin-bottom:4px;display:flex;align-items:center;gap:10px}
.page-desc{color:var(--text-2);font-size:13px;margin-bottom:16px}
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:16px;margin-bottom:16px;box-shadow:var(--shadow)}
.card-title{font-size:14px;font-weight:600;margin-bottom:12px;color:var(--text);display:flex;align-items:center;justify-content:space-between}

/* ===== 表单 ===== */
.form-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.form-item{display:flex;flex-direction:column;gap:4px}
.form-item label{font-size:12.5px;color:var(--text-2);font-weight:500}
.form-item label b{color:var(--danger);font-weight:600}
input[type=text],input[type=number],input[type=password],input[type=date],input[type=time],input[type=datetime-local],select,textarea{height:34px;border:1px solid var(--border);border-radius:6px;padding:0 10px;font-size:13.5px;font-family:inherit;background:#fff;color:var(--text);outline:none;transition:border .15s,box-shadow .15s}
input[type=date],input[type=time],input[type=datetime-local]{display:flex;align-items:center;line-height:normal}
input[type=date]::-webkit-calendar-picker-indicator,input[type=time]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator{cursor:pointer;opacity:.7}
input[type=date]::-webkit-calendar-picker-indicator:hover,input[type=time]::-webkit-calendar-picker-indicator:hover,input[type=datetime-local]::-webkit-calendar-picker-indicator:hover{opacity:1}
textarea{height:auto;padding:8px 10px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 2px rgba(47,111,237,.12)}
input[type=checkbox]{width:16px;height:16px;accent-color:var(--primary);cursor:pointer}
input[type=number]{width:100%}
.form-row{display:flex;gap:8px;align-items:center}

/* ===== 按钮 ===== */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:34px;padding:0 14px;border:1px solid var(--border);background:#fff;color:var(--text);border-radius:6px;font-size:13.5px;cursor:pointer;transition:all .15s;font-family:inherit;white-space:nowrap}
.btn:hover{border-color:var(--primary);color:var(--primary);background:var(--primary-light)}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark);border-color:var(--primary-dark);color:#fff}
.btn-success{background:var(--success);border-color:var(--success);color:#fff}
.btn-success:hover{background:#128a3c;border-color:#128a3c;color:#fff}
.btn-danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn-danger:hover{background:#b91c1c;border-color:#b91c1c;color:#fff}
.btn-warning{background:var(--warning);border-color:var(--warning);color:#fff}
.btn-warning:hover{background:#b45309;border-color:#b45309;color:#fff}
.btn-sm{height:28px;padding:0 10px;font-size:12.5px;border-radius:5px}
.btn-lg{height:40px;padding:0 20px;font-size:14px}
.btn-ghost{border-color:transparent;background:transparent;color:var(--text-2)}
.btn-ghost:hover{background:#f3f4f6;color:var(--text);border-color:transparent}

/* ===== 表格 ===== */
.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:6px}
table.data-table{width:100%;border-collapse:collapse;font-size:13px;min-width:600px}
.data-table th,.data-table td{padding:8px 10px;border-bottom:1px solid var(--border);text-align:left;vertical-align:middle}
.data-table th{background:#f8fafc;font-weight:600;color:var(--text-2);font-size:12.5px;position:sticky;top:0;white-space:nowrap}
.data-table tr:hover td{background:#f8fafc}
.data-table td.actions{white-space:nowrap}
.data-table .num{text-align:center}
.data-table .tag{display:inline-block;padding:1px 8px;border-radius:10px;font-size:11.5px;background:var(--primary-light);color:var(--primary);margin-right:4px}
.data-table .tag-gray{background:#f3f4f6;color:var(--text-2)}
.data-table .tag-green{background:#dcfce7;color:#166534}
.data-table .tag-red{background:#fee2e2;color:#991b1b}

/* ===== 学生照片 ===== */
.stu-photo{width:32px;height:40px;object-fit:cover;border-radius:3px;border:1px solid var(--border);display:block;cursor:zoom-in;background:#f8fafc}
.stu-photo-lg{width:96px;height:128px;object-fit:cover;border-radius:4px;border:1px solid var(--border);display:block;background:#f8fafc}
.stu-photo-empty{width:96px;height:128px;border:1px dashed #cbd5e1;border-radius:4px;display:flex;align-items:center;justify-content:center;color:var(--text-2);font-size:12px;background:#f8fafc}

/* ===== 工具条 ===== */
.toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.toolbar .spacer{flex:1}
.toolbar .hint{font-size:12px;color:var(--text-2)}

/* ===== 课表 ===== */
.tt-table{width:100%;border-collapse:collapse;font-size:12px;background:#fff}
.tt-table th,.tt-table td{border:1px solid #cbd5e1;padding:0;vertical-align:top}
.tt-table th{background:#f1f5f9;padding:6px 4px;font-weight:600;color:#334155;text-align:center}
.tt-table td.time-col{background:#f8fafc;color:var(--text-2);font-size:12px;text-align:center;padding:4px 6px;width:88px;white-space:nowrap}
.tt-cell{min-height:64px;padding:4px 5px;position:relative;cursor:default;transition:background .15s}
.tt-cell:hover{background:#f0f7ff}
.tt-cell .tt-subject{font-weight:600;font-size:12.5px;color:#1e40af;line-height:1.35;word-break:break-all}
.tt-cell .tt-teacher{color:var(--text-2);font-size:11px;margin-top:2px;word-break:break-all}
.tt-cell .tt-loc{color:#0e7490;font-size:10.5px;word-break:break-all}
.tt-cell.locked .tt-subject::after{content:"#";color:var(--danger);font-weight:700;margin-left:2px}
.tt-cell.combined .tt-subject::after{content:"*";color:var(--warning);font-weight:700;margin-left:2px}
.tt-cell.odd-even{background:linear-gradient(135deg,#fff7ed 0%,#fff 60%)}
.tt-cell.fixed-bg{background:#f0fdf4}
.tt-cell.ban-bg{background:#fef2f2;color:#b91c1c;text-align:center;font-size:11px}
.tt-cell.free-bg{background:#fafafa;text-align:center;color:#d1d5db;font-size:11px}
.tt-cell.empty-cell{background:#fff;text-align:center;color:#e5e7eb}
.tt-cell.hole-bg{background:#fffbeb;outline:1px dashed #f59e0b;outline-offset:-2px;text-align:center;color:#b45309;font-size:11px}
.tt-cell.sel{outline:2px solid var(--primary);outline-offset:-2px;background:#e0ecff!important}
.tt-cell.swapable{outline:2px solid var(--success);outline-offset:-2px;background:#ecfdf5!important;cursor:pointer}
.tt-cell.dragover{background:#c7f9d9!important}
.tt-cell.conflict{outline:2px solid #dc2626;outline-offset:-2px;background:#fef2f2}
.tt-cell.conflict .tt-subject{color:#b91c1c}
.tt-cell.conflict::after{content:"!";position:absolute;bottom:2px;right:4px;font-size:10px;font-weight:700;color:#dc2626}
.tt-cell .tt-week{position:absolute;top:2px;right:4px;font-size:10px;color:#b45309;font-weight:600}
.tt-toolbar{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-bottom:10px}
.tt-toolbar .tt-title{font-size:15px;font-weight:600;margin-right:10px}
.tt-legend{display:flex;gap:14px;font-size:12px;color:var(--text-2);align-items:center;flex-wrap:wrap}
.tt-legend span b{font-weight:600}
.week-col{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}
.week-col .wcol{display:flex;flex-direction:column;gap:6px;width:calc((100% - 48px)/8);min-width:150px}
.week-col .wcol-head{text-align:center;font-weight:600;background:#f1f5f9;padding:4px;border-radius:4px}
.week-col .wcell{border:1px solid #e2e8f0;border-radius:4px;padding:5px;background:#fff;font-size:12px;min-height:56px}
.week-col .wcell .tt-subject{font-weight:600;color:#1e40af}
.week-col .wcell .tt-teacher{color:var(--text-2);font-size:11px}

/* ===== 统计 ===== */
.stat-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-bottom:16px}
.stat-cards.stat-cards-4{grid-template-columns:repeat(4,1fr)}
.stat-cards.stat-cards-4 .stat-card .label .sc4-sub{white-space:nowrap}
.stat-card{background:#fff;border:1px solid var(--border);border-radius:8px;padding:14px;text-align:center}
.stat-card .num{font-size:26px;font-weight:700;color:var(--primary)}
.stat-card .label{font-size:12.5px;color:var(--text-2);margin-top:4px}

/* ===== 弹窗 ===== */
.modal-mask{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:center;justify-content:center;z-index:100;padding:20px}
.modal{background:#fff;border-radius:10px;width:560px;max-width:96vw;max-height:88vh;display:flex;flex-direction:column;box-shadow:0 20px 40px rgba(0,0,0,.2)}
.modal-head{padding:14px 18px;border-bottom:1px solid var(--border);font-size:15px;font-weight:600;display:flex;justify-content:space-between;align-items:center}
.modal-body{padding:16px 18px;overflow-y:auto;flex:1}
.modal-foot{padding:12px 18px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px}
.modal-close{background:none;border:none;font-size:18px;cursor:pointer;color:var(--text-2);line-height:1}
.modal-close:hover{color:var(--text)}

/* ===== 顶栏登录信息与下拉菜单 ===== */
.tb-who-wrap{position:relative;display:flex;align-items:center;margin-right:auto;min-width:0}
.tb-who{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;margin-left:4px;cursor:pointer;user-select:none;min-width:0}
.tb-who b{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.tb-who .badge{white-space:nowrap;flex-shrink:0}
.tb-who:hover b{color:var(--primary)}
.tb-who::after{content:'▾';font-size:11px;color:var(--text-2)}
.tb-menu{position:absolute;top:calc(100% + 10px);left:0;min-width:150px;background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 30px rgba(15,23,42,.14);padding:6px;z-index:150}
.tb-menu-item{display:block;width:100%;text-align:left;padding:8px 12px;border:0;background:transparent;border-radius:8px;cursor:pointer;font-size:13.5px;color:var(--text);font-family:inherit}
.tb-menu-item:hover{background:var(--bg);color:var(--primary)}

/* ===== 抽屉（个人信息） ===== */
.drawer-mask{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;justify-content:flex-end;z-index:120}
.drawer{width:560px;max-width:94vw;height:100%;background:#fff;display:flex;flex-direction:column;box-shadow:-12px 0 32px rgba(15,23,42,.18);animation:drawerIn .2s ease-out}
@keyframes drawerIn{from{transform:translateX(24px);opacity:.4}to{transform:none;opacity:1}}
.drawer-head{padding:14px 18px;border-bottom:1px solid var(--border);font-size:15px;font-weight:600;display:flex;justify-content:space-between;align-items:center}
.drawer-close{background:none;border:none;font-size:18px;cursor:pointer;color:var(--text-2);line-height:1}
.drawer-close:hover{color:var(--text)}
.drawer-body{padding:16px 18px;overflow-y:auto;flex:1}
.drawer-foot{padding:12px 18px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px;background:#fff}

/* ===== 通知 ===== */
.toast-wrap{position:fixed;top:16px;right:16px;z-index:200;display:flex;flex-direction:column;gap:8px}
.toast{padding:10px 16px;border-radius:8px;color:#fff;font-size:13.5px;box-shadow:0 6px 16px rgba(0,0,0,.15);animation:slideIn .25s ease;max-width:360px}
.toast.success{background:var(--success)}
.toast.error{background:var(--danger)}
.toast.info{background:var(--primary)}
.toast.warning{background:var(--warning)}
@keyframes slideIn{from{transform:translateX(30px);opacity:0}to{transform:none;opacity:1}}

/* ===== 进度条 ===== */
.progress-wrap{margin:16px 0}
.progress-bar{height:18px;background:#e5e7eb;border-radius:9px;overflow:hidden}
.progress-bar .fill{height:100%;background:linear-gradient(90deg,#2f6fed,#5b8def);border-radius:9px;transition:width .2s;width:0%}
.progress-text{font-size:12.5px;color:var(--text-2);margin-top:6px;text-align:center}

/* ===== 日志 ===== */
.log-list{max-height:500px;overflow-y:auto;font-size:12.5px}
.log-item{padding:6px 8px;border-bottom:1px dashed var(--border);display:flex;gap:10px}
.log-item .time{color:var(--text-2);white-space:nowrap}
.log-item .msg{flex:1}
.log-item.warn .msg{color:var(--warning)}
.log-item.error .msg{color:var(--danger)}

/* ===== 打印 ===== */
#printArea{display:none}
@media print{
  body *{visibility:hidden}
  #printArea,#printArea *{visibility:visible}
  #printArea{display:block;position:absolute;left:0;top:0;width:100%}
  #printArea .print-title{text-align:center;font-size:16px;font-weight:700;margin-bottom:8px}
  #printArea .print-sub{text-align:center;font-size:12px;color:#555;margin-bottom:12px}
  #printArea table.tt-table{font-size:10px}
  #printArea .tt-cell{min-height:30px;padding:2px 3px}
  #printArea .tt-cell .tt-teacher,#printArea .tt-cell .tt-loc{font-size:9px}
  #printArea .tt-table th{background:#e5e7eb!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  #printArea .tt-cell.fixed-bg,#printArea .tt-cell.odd-even,#printArea .tt-cell.ban-bg,#printArea .tt-cell.free-bg,#printArea .tt-cell.hole-bg{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  #printArea .stat-table{width:100%;border-collapse:collapse;font-size:11px}
  #printArea .stat-table th,#printArea .stat-table td{border:1px solid #999;padding:4px 6px;text-align:center}
  #printArea .notice-box{border:1px solid #333;padding:14px;margin:10px 0;font-size:13px}
}

/* ===== 空状态 ===== */
.empty-tip{padding:40px;text-align:center;color:var(--text-2);font-size:13.5px}
.empty-tip .big{font-size:40px;margin-bottom:10px}

/* ===== 其他 ===== */
.badge{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:11px;font-size:11.5px;background:var(--primary-light);color:var(--primary);font-weight:600}
.badge-danger{background:#fee2e2;color:#b91c1c}
.badge-success{background:#dcfce7;color:#166534}
.badge-blue{background:#dbeafe;color:#1d4ed8}
.badge-warn{background:#fef3c7;color:#b45309}
.hidden{display:none!important}
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}
.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}
.flex{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.flex-between{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px}
.text-2{color:var(--text-2)}
.text-danger{color:var(--danger)}
.text-success{color:var(--success)}
.text-warning{color:var(--warning)}
.small{font-size:12px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:1200px){.grid-2{grid-template-columns:1fr}}
.split-line{border:none;border-top:1px solid var(--border);margin:14px 0}
.tree-item{padding:4px 8px;border-radius:4px;cursor:pointer;font-size:13px}
.tree-item:hover{background:var(--primary-light)}
.tree-item.active{background:var(--primary-light);color:var(--primary);font-weight:600}
.checkbox-inline{display:flex;align-items:center;gap:6px;font-size:13px;cursor:pointer;user-select:none}
.checkbox-inline input{width:15px;height:15px}

/* ---------- 作息时间表 ---------- */
.bell-table{width:100%;border-collapse:collapse;font-size:13px}
.bell-table th,.bell-table td{border:1px solid var(--border);padding:4px 8px;vertical-align:middle}
.bell-table th{background:#f1f5f9;font-weight:600;text-align:center;font-size:12.5px;color:#334155}
.bell-table .bt-period{background:#f8fafc;font-weight:700;text-align:center;color:#334155;white-space:nowrap}
.bell-table .bt-name{text-align:left;font-size:12.5px;color:var(--text-1);white-space:nowrap}
.bell-table input{width:100%;min-width:96px;height:28px;font-size:12.5px;padding:0 8px;border:1px solid var(--border);border-radius:6px;background:#fff}
.bell-table input:focus{border-color:var(--primary);outline:none;box-shadow:0 0 0 2px var(--primary-light)}
.bell-table .bt-bin{display:flex;align-items:center;gap:6px;margin:3px 0}
.bell-table .bt-bin .bt-btag{flex:none;font-size:11px;color:var(--text-2);background:#f1f5f9;border-radius:4px;padding:1px 5px;line-height:16px}
.bell-table .bt-bin input{flex:1;min-width:70px}

/* ---------- 校历 ---------- */
.cal-table{width:100%;border-collapse:collapse;font-size:12.5px}
.cal-table .cal-title{caption-side:top;text-align:center;font-weight:700;font-size:15px;color:#1e293b;padding:4px 0 8px}
.cal-table th,.cal-table td{border:1px solid var(--border);padding:3px 6px;vertical-align:top}
.cal-table th{background:#f1f5f9;font-weight:600;text-align:center;font-size:12.5px;color:#334155}
.cal-table .cal-month{background:#f8fafc;font-weight:700;text-align:center;vertical-align:middle;color:#334155;white-space:nowrap}
.cal-table .cal-week{text-align:center;vertical-align:middle;color:#64748b;font-variant-numeric:tabular-nums}
.cal-table td.cal-day{cursor:pointer;text-align:center;min-width:66px}
.cal-table td.cal-day:hover{background:#f0f7ff}
.cal-table td.cal-events{cursor:pointer;text-align:left;min-width:220px;max-width:360px;font-size:11.5px;color:#475569}
.cal-table td.cal-events:hover{background:#f0f7ff}
.cal-table.readonly td.cal-day,.cal-table.readonly td.cal-events{cursor:default}
.cal-table.readonly td.cal-day:hover,.cal-table.readonly td.cal-events:hover{background:transparent}
.cal-date{font-weight:600;color:#334155;font-variant-numeric:tabular-nums}
.cal-note{font-size:11px;margin-top:2px;color:#64748b}
.cal-table td.cal-rest .cal-date,.cal-table td.cal-rest .cal-note{color:#94a3b8}
.cal-table td.cal-hol .cal-note{color:#dc2626}
.cal-table td.cal-makeup .cal-note{color:#2563eb}
.cal-table td.cal-exam .cal-note{color:#d97706}
.cal-table td.cal-report .cal-note{color:#0f766e}
.cal-ev{line-height:1.55}
/* 教师端校历记事：日期格可点击 + 状态圆点（蓝=已记事/橙=提醒中/红=已过期未完成/灰=已完成） */
.cal-table td.cal-day{position:relative}
.cal-table.readonly td.cal-day.cal-pick{cursor:pointer}
.cal-table.readonly td.cal-day.cal-pick:hover{background:#f0f7ff}
.cal-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#2563eb;vertical-align:middle}
.cal-table td.cal-day .cal-dot{position:absolute;top:4px;right:4px}
.cal-dot-remind{background:#f59e0b}
.cal-dot-over{background:#dc2626}
.cal-dot-done{background:#94a3b8}
/* 教师端顶部「待办提醒」条（命中提前提醒窗口的记事） */
.remind-strip{border-left:4px solid #f59e0b}
.remind-items{display:flex;flex-wrap:wrap;gap:8px}
.remind-item{display:inline-flex;align-items:center;gap:6px;background:#fffbeb;border:1px solid #fde68a;border-radius:8px;padding:5px 10px;font-size:12.5px;color:#78350f;cursor:pointer;max-width:100%}
.remind-item:hover{background:#fef3c7}
.remind-when{flex:none;background:#f59e0b;color:#fff;border-radius:999px;padding:0 8px;font-size:11.5px;line-height:18px}

/* ---------- 教师签到 ---------- */
.att-clock{font-size:22px;font-weight:700;color:var(--primary);font-variant-numeric:tabular-nums;line-height:32px}
.att-list{display:flex;flex-direction:column;gap:10px}
.att-item{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff;border:1px solid var(--border);border-radius:10px;padding:12px 16px;transition:border-color .2s,background .2s}
.att-item:hover{border-color:var(--primary-light)}
.att-item-signed{background:#f8fdf9;border-color:#cfe9d6}
.att-item-main{min-width:0}
.att-item-time{font-size:14px;margin-bottom:2px}
.att-item-subj{font-size:16px;font-weight:700;color:var(--text-1)}
.att-item-cls{font-size:12.5px;color:var(--text-2);margin-top:2px}
.att-item-side{display:flex;flex-direction:column;align-items:flex-end;gap:4px;min-width:150px}
.att-status{display:inline-flex;align-items:center;height:22px;padding:0 10px;border-radius:11px;font-size:12px;font-weight:600}
.att-st-wait{background:#f1f5f9;color:#64748b}
.att-st-run{background:#fef3c7;color:#92400e}
.att-st-ok{background:#dcfce7;color:#166534}
.att-st-done{background:var(--primary-light);color:var(--primary)}
.att-st-late{background:#fee2e2;color:#b91c1c}
.att-st-end{background:#e2e8f0;color:#475569}
/* 上课签到：日期标签与组件同行 + 大字时钟独占一行 + 课程状态移至课时区右上角 */
.att-date-row{flex-direction:row;align-items:center;gap:8px}
.att-date-row label{white-space:nowrap}
.att-date-row input{flex:0 1 200px;min-width:0}
.att-clock.att-clock-lg{font-size:30px;line-height:40px;margin-top:6px}
.att-item-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.att-item-top .att-item-time{min-width:0}
.att-item-top .att-status{flex-shrink:0;margin-top:1px}
#attList .att-item-main{flex:1 1 auto}
.att-item-geo{font-size:12px;color:var(--text-2);margin-top:2px;font-variant-numeric:tabular-nums}
/* 连排同课程合并行（同一班级同一门课连续节次合并显示为一条） */
.att-item-block{border:1px solid var(--primary-light);background:#f8fbff}
.att-item-block .att-item-time{min-width:0}
/* 移动端：时钟与签到日期同行、靠右对齐（桌面保留 30px 大字独占一行） */
@media(max-width:768px){
  .att-top-row{display:flex;align-items:center;gap:8px}
  .att-top-row .att-date-row{flex:1 1 auto;min-width:0}
  .att-top-row .att-clock.att-clock-lg{flex-shrink:0;font-size:22px;line-height:32px;margin-top:0}
}
.drag-src{opacity:.45}
.drag-over{outline:2px dashed var(--primary);outline-offset:-2px;background:#eef4ff}

/* ---------- 教师端标签栏（桌面端在卡片内，移动端固定底部） ---------- */
.pt-tabs{display:flex;flex-wrap:wrap;gap:8px}
/* 分组主菜单（校历作息 / 师生考勤）：点击弹出子菜单，选择子菜单项进入功能页 */
.pt-tab-group{position:relative;display:flex}
.pt-caret{font-size:9px;vertical-align:1px;opacity:.85;letter-spacing:0}
.pt-submenu{position:absolute;top:calc(100% + 8px);left:0;z-index:95;display:flex;flex-direction:column;gap:6px;background:#fff;border:1px solid var(--border);border-radius:10px;padding:8px;box-shadow:0 8px 24px rgba(15,23,42,.16);min-width:118px}
.pt-tabs .pt-submenu .btn{width:100%;flex:0 0 auto;min-width:0;height:auto;justify-content:center;white-space:nowrap;padding:8px 14px;font-size:12.5px;letter-spacing:0}

/* ---------- 角色适配：教师角色（仅教师端，移动优先） ---------- */
body[data-role="teacher"] .sidebar,
body[data-role="teacher"] .sidebar-mask,
body[data-role="teacher"] .menu-toggle{display:none!important}
body[data-role="teacher"] #btnNewFile,
body[data-role="teacher"] #btnOpenFile,
body[data-role="teacher"] #btnBackup,
body[data-role="teacher"] #btnRestore,
body[data-role="teacher"] .storage-tip{display:none!important}
body[data-role="teacher"] .content{max-width:900px;margin:0 auto;width:100%}

/* ---------- 角色适配：学生角色（仅学生端·我的签到） ---------- */
body[data-role="student"] .sidebar,
body[data-role="student"] .sidebar-mask,
body[data-role="student"] .menu-toggle{display:none!important}
body[data-role="student"] #btnNewFile,
body[data-role="student"] #btnOpenFile,
body[data-role="student"] #btnBackup,
body[data-role="student"] #btnRestore,
body[data-role="student"] .cur-file,
body[data-role="student"] .storage-tip{display:none!important}
body[data-role="student"] .content{max-width:900px;margin:0 auto;width:100%}

/* ---------- 角色适配：教务主任（只读，仅数据大屏；顶栏不提供读写入口） ---------- */
body[data-role="director"] #btnNewFile,
body[data-role="director"] #btnOpenFile,
body[data-role="director"] #btnBackup,
body[data-role="director"] #btnRestore,
body[data-role="director"] .storage-tip,
body[data-role="director"] .cur-file{display:none!important}

/* ---------- 数据大屏页面（内嵌预览 + 大屏管理配置） ---------- */
.ds-preview-wrap{position:relative;width:100%;height:540px;overflow:hidden;border-radius:10px;border:1px solid #1c2a46;background:#0b1220}
.ds-preview-frame{position:absolute;top:0;left:0;width:1920px;height:1080px;border:0;transform-origin:0 0;pointer-events:none}
.sm-row{display:flex;align-items:center;gap:12px;padding:9px 12px;border:1px solid var(--border);border-radius:8px;margin-bottom:6px;background:#fff;transition:background .15s,border-color .15s}
.sm-row:hover{border-color:var(--primary)}
.sm-row-off{opacity:.55;background:#f8fafc}
.sm-switch{flex:0 0 auto;font-size:12.5px;color:var(--text-2);cursor:pointer;user-select:none;white-space:nowrap}
.sm-switch input{margin-right:4px;vertical-align:-2px}
.sm-main{flex:1 1 auto;min-width:0}
.sm-title{font-size:13.5px;font-weight:600}
.sm-ord{flex:0 0 auto;display:flex;gap:4px}
.sm-ord .btn{padding:2px 8px;line-height:1.4}

/* ---------- 移动端适配（管理员：抽屉菜单；教师：底部导航） ---------- */
@media(max-width:900px){
  .topbar .menu-toggle{display:inline-flex}
  .storage-tip{display:none}
  .sidebar{position:fixed;top:56px;left:0;bottom:0;width:232px;z-index:120;transform:translateX(-105%);transition:transform .22s ease;box-shadow:4px 0 18px rgba(15,23,42,.14)}
  body.sidebar-open .sidebar{transform:none}
  .sidebar-foot{position:static}
  .sidebar-mask{display:none;position:fixed;inset:56px 0 0;background:rgba(15,23,42,.4);z-index:110}
  body.sidebar-open .sidebar-mask{display:block}
  .content{padding:14px}
  .form-grid{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}
}
@media(max-width:768px){
  .pt-tabs{position:fixed;left:0;right:0;bottom:0;flex-wrap:nowrap;background:#fff;border-top:1px solid var(--border);padding:6px 8px calc(6px + env(safe-area-inset-bottom));z-index:90;box-shadow:0 -2px 10px rgba(15,23,42,.06);gap:4px;margin-top:0!important}
  .pt-tabs .btn{flex:1;min-width:0;justify-content:center;height:40px;padding:0 1px;font-size:11px;letter-spacing:-.2px}
  .pt-tab-group{flex:1;min-width:0}
  .pt-submenu{bottom:calc(100% + 10px);top:auto;left:50%;transform:translateX(-50%)}
  .pt-head{margin-bottom:12px;gap:6px 10px}
  .pt-head-main{flex:1 1 100%}
  .pt-head .page-desc{display:none}
  .pt-head .page-title{font-size:17px}
  .pt-school{padding:4px 11px;border-radius:12px;margin-top:2px;font-size:12px}
  .content.portal-wrap{padding-bottom:calc(78px + env(safe-area-inset-bottom))}
  /* 顶栏精简：左侧保留 软件图标+名称，右侧保留 账号（角色徽章+姓名）与退出 */
  .tb-who-wrap{margin-left:auto;margin-right:0}
  .tb-menu{left:auto;right:0}
  #tbWhoAcc{display:none}
}
@media(max-width:640px){
  .topbar{padding:0 10px;gap:8px}
  .brand{min-width:0;overflow:hidden}
  .brand h1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14.5px;min-width:0}
  .toast-wrap{top:auto;bottom:16px;left:12px;right:12px}
  .toast{max-width:none}
  body[data-role="teacher"] .toast-wrap{bottom:84px}
  .content{padding:10px}
  .card{padding:12px}
  .page-title{font-size:16px}
  .form-grid{grid-template-columns:1fr}
  .top-actions .btn{display:none}
  .top-actions .btn.btn-primary{display:inline-flex}
  body[data-role="teacher"] .top-actions .btn{display:inline-flex}
  body[data-role="student"] .top-actions .btn{display:inline-flex}
  .cur-file{max-width:132px}
  .cur-file .cur-file-label{display:none}
  .cur-file b{max-width:110px}
  .att-item{flex-direction:column;align-items:stretch}
  .att-item-side{flex-direction:row;align-items:center;justify-content:flex-end;min-width:0}
  .modal-foot .btn,.drawer-foot .btn{flex:1}
}
@media(max-width:420px){
  .tb-who b{max-width:72px}
  .modal{width:100%}
}
@media(max-width:359px){
  .brand h1{display:none}
}

/* ---------- 斑马纹表格（仅 .data-table.zebra 生效，其他页面不受影响） ---------- */
.data-table.zebra tbody tr:nth-child(even) td{background:#f7fafd}
.data-table.zebra tbody tr:hover td{background:#edf3fd}

/* ---------- 教师端：代课申请（紧凑统计条 + 编号分区） ---------- */
.sb-statline{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;margin-bottom:12px}
.sb-stat{background:#f8fafc;border:1px solid var(--border);border-radius:8px;padding:8px 10px;text-align:center}
.sb-stat b{display:block;font-size:18px;font-weight:700;color:var(--primary);line-height:1.3;font-variant-numeric:tabular-nums}
.sb-stat span{display:block;font-size:11.5px;color:var(--text-2);margin-top:2px}
.pt-sec{border:1px solid var(--border);border-radius:10px;padding:14px 16px;margin-top:14px;background:#fff}
.pt-sec-head{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--text);margin-bottom:10px}
.pt-sec-no{flex-shrink:0;width:20px;height:20px;border-radius:50%;background:var(--primary);color:#fff;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center}
.pt-sec .page-desc{margin-bottom:10px}

/* ---------- 教师端：课时调整（日期/课程组件等宽 + 操作按钮同排） ---------- */
.sb-form input,.sb-form select{width:100%;min-width:0}

/* ---------- 教师端：页头（标题 + 学校/学期徽标） ---------- */
.pt-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px 16px;flex-wrap:wrap}
.pt-head-main{min-width:0;flex:1 1 260px}
.pt-head .page-desc{margin-bottom:14px}
.pt-school{display:inline-flex;align-items:baseline;gap:8px;max-width:100%;margin-top:3px;padding:5px 13px;background:#fff;border:1px solid var(--border);border-radius:999px;font-size:12.5px;color:var(--text-2)}
.pt-school b{color:#0f172a;font-size:13px;font-weight:600;white-space:nowrap}
.pt-school span{word-break:break-all}

/* ---------- 教师端：我的课表（列为星期 + 学科配色） ---------- */
.pt-legend{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 8px;font-size:12px;color:var(--text-2)}
.pt-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:4px;vertical-align:-1px}
.pt-tt{min-width:680px}
.pt-tt th.today{background:#e8efff;color:var(--primary)}
.pt-tt th .today-tag{display:block;font-size:10px;font-weight:500;color:var(--primary)}
.pt-tt td.time-col{width:104px;padding:6px 4px}
.pt-tt td.time-col b{display:block;font-weight:600;color:#334155;font-size:12px}
.pt-tt td.time-col .pt-time{display:block;font-size:10.5px;color:var(--text-2);margin-top:2px;font-variant-numeric:tabular-nums}
.pt-tt .tt-cell{min-height:72px}
.pt-tt .tt-item{border-left:3px solid var(--pc,#e2e8f0);border-radius:0 4px 4px 0;padding:3px 0 3px 7px}
.pt-tt .tt-item + .tt-item{margin-top:6px}
.pt-tt .tt-cell .tt-subject{color:var(--pc,#1e40af)}
.pt-tt .tt-cell .tt-loc{margin-top:1px}
.pt-tt td.today-col{background:#fbfdff}

/* ---------- 教师端：签到记录分页 ---------- */
.pt-pager{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.pt-pager .spacer{flex:1}
.pt-pager select{height:28px;font-size:12.5px;color:var(--text-2)}
@media(max-width:768px){
  /* 任课统计：移动端统计卡片一行 3 个（6 张卡两行） */
  .stat-cards.stat-cards-3{grid-template-columns:repeat(3,1fr);gap:8px}
  .stat-cards.stat-cards-3 .stat-card{padding:10px 4px}
  .stat-cards.stat-cards-3 .stat-card .num{font-size:20px}
  .stat-cards.stat-cards-3 .stat-card .label{font-size:11px}
  /* 签到统计：统计卡片一行 4 个（4 张卡一行） */
  .stat-cards.stat-cards-4{grid-template-columns:repeat(4,1fr);gap:8px}
  .stat-cards.stat-cards-4 .stat-card{padding:10px 3px}
  .stat-cards.stat-cards-4 .stat-card .num{font-size:18px}
  .stat-cards.stat-cards-4 .stat-card .label{font-size:10.5px}
  /* 签到统计：移动端（本月·节）整体换行到独立一行，不在括号中间断开 */
  .stat-cards.stat-cards-4 .stat-card .label .sc4-sub{display:block}
  /* 课时调整：移动端统计卡片一行 3 个（6 张卡两行） */
  .sb-statline{grid-template-columns:repeat(3,1fr);gap:8px}
  .sb-stat{padding:8px 6px}
  .sb-stat span{font-size:11px}
  /* 课时调整：查找/无需协调 按钮同排等宽，主文案与括注分行显示 */
  .sb-actions{flex-wrap:nowrap;gap:6px}
  .sb-actions .btn{flex:1 1 0;min-width:0;height:38px;padding:0 4px;font-size:12px;letter-spacing:-.2px;white-space:normal;line-height:1.15;flex-direction:column;gap:1px}
}
@media(max-width:640px){
  .pt-pager .spacer{display:none}
  .pt-pager > span.text-2{flex-basis:100%}
}
/* 超窄屏：签到统计卡片压缩内边距与字号，保证（本月·节）单行完整显示 */
@media(max-width:359px){
  .stat-cards.stat-cards-4 .stat-card{padding:10px 1px}
  .stat-cards.stat-cards-4 .stat-card .label{font-size:10px}
}

/* ===== 学生考勤弹窗（卡片式：照片+姓名，点击卡片选状态） ===== */
.stuatt-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;padding:2px 2px 4px}
.stuatt-card{position:relative;border:2px solid var(--border);border-radius:10px;background:#fff;padding:6px;cursor:pointer;text-align:center;transition:border-color .12s,box-shadow .12s}
.stuatt-card:hover{box-shadow:0 2px 10px rgba(15,23,42,.10)}
.stuatt-card[data-status="present"]{border-color:var(--success)}
.stuatt-card[data-status="late"]{border-color:var(--warning)}
.stuatt-card[data-status="absent"]{border-color:var(--danger)}
.stuatt-card[data-status="leave"]{border-color:var(--primary)}
.stuatt-photo{width:100%;aspect-ratio:1/1;border-radius:8px;overflow:hidden;background:#eef2f7}
.stuatt-photo img{width:100%;height:100%;object-fit:cover;display:block}
.stuatt-photo-fb{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:30px;font-weight:600;color:#fff;background:linear-gradient(135deg,#9fb3d1,#64748b)}
.stuatt-name{margin-top:5px;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stuatt-chip{display:inline-block;margin-top:3px;font-size:11px;line-height:1;padding:3px 8px;border-radius:999px;background:#eef2f7;color:var(--text-2)}
.stuatt-chip.st-present{background:#dcfce7;color:#15803d}
.stuatt-chip.st-late{background:#fef3c7;color:#b45309}
.stuatt-chip.st-absent{background:#fee2e2;color:#b91c1c}
.stuatt-chip.st-leave{background:var(--primary-light);color:var(--primary-dark)}
.stuatt-ovl{position:absolute;inset:0;border-radius:9px;background:rgba(255,255,255,.97);display:none;flex-direction:column;justify-content:center;gap:6px;padding:8px}
.stuatt-card.open .stuatt-ovl{display:flex}
.stuatt-ovl-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px}
.stuatt-ovl-grid button{border:1px solid var(--border);background:#fff;border-radius:7px;padding:7px 0;font-size:12px;cursor:pointer;color:var(--text);line-height:1}
.stuatt-ovl-grid button.s-present{background:var(--success);border-color:var(--success);color:#fff}
.stuatt-ovl-grid button.s-late{background:var(--warning);border-color:var(--warning);color:#fff}
.stuatt-ovl-grid button.s-absent{background:var(--danger);border-color:var(--danger);color:#fff}
.stuatt-ovl-grid button.s-leave{background:var(--primary);border-color:var(--primary);color:#fff}
.stuatt-ovl-grid button.s-suspend{background:#f5f3ff;border-color:#c4b5fd;color:#6d28d9}
.stuatt-ovl-grid button.s-drop{background:#334155;border-color:#334155;color:#fff}
.stuatt-note-in{width:100%;border:1px solid var(--border);border-radius:7px;padding:5px 7px;font-size:12px;background:#fff}
.stuatt-note-in:focus{outline:none;border-color:var(--primary)}
.stuatt-filters{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}
.stuatt-fbtn{border:1px solid var(--border);background:#fff;border-radius:999px;padding:4px 12px;font-size:12.5px;cursor:pointer;color:var(--text);line-height:1.4;transition:border-color .12s,background .12s,color .12s}
.stuatt-fbtn:hover{border-color:var(--primary)}
.stuatt-fbtn b{font-weight:600;margin-left:2px}
.stuatt-fbtn.active{background:var(--primary);border-color:var(--primary);color:#fff}
@media(max-width:640px){.stuatt-grid{grid-template-columns:repeat(2,1fr)}}
