/* 4fire — 移动优先响应式样式 v0.2（课表表格样式参考旧版课表页） */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --ink: #2b2f3a;
  --ink-2: #8a90a2;
  --line: #e3e6ef;
  --head: #3a4ab0;
  --head2: #5b6bd6;
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --danger: #d84a3f;
  --warn: #b9770e;
  --ok: #1d9e75;
  --radius: 12px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--card); border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 360px; box-shadow: 0 8px 30px rgba(30,35,80,.08); text-align: center; }
.login-card h1 { color: var(--accent); font-size: 26px; letter-spacing: 2px; }
.login-sub { color: var(--ink-2); margin: 6px 0 20px; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.login-err { color: var(--danger); font-size: 13px; margin-top: 10px; }
.login-note { color: var(--ink-2); font-size: 12px; margin-top: 14px; }
.login-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.ltab { flex: 1; border: 1px solid var(--line); background: #fbfbfe; border-radius: 999px; padding: 7px 0; font-size: 13px; color: var(--ink-2); }
.ltab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.otp-row { display: flex; gap: 8px; align-items: stretch; }
.otp-row input { flex: 1; margin-bottom: 0; }
.otp-row .btn { flex: 0 0 auto; padding: 0 14px; font-size: 13px; white-space: nowrap; }
.lform .btn-block { margin-top: 4px; }
.lform { margin-bottom: 4px; }
.lform input { margin-bottom: 12px; }
.lform .otp-row { margin-bottom: 12px; }
.link-btn { border: none; background: none; color: var(--accent); font-size: 13px; margin-top: 10px; }

/* 顶栏 */
.topbar { background: linear-gradient(120deg, var(--head), var(--head2)); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.topbar h1 { font-size: 17px; color: #fff; letter-spacing: 1px; }
.week-badge { font-size: 12px; color: #fff; background: rgba(255,255,255,.18); border-radius: 999px; padding: 2px 10px; }
.topbar .btn-sm { margin-left: auto; }

/* 主体 */
.main { max-width: 1100px; margin: 0 auto; padding: 14px 14px 90px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(30,35,80,.05); }
.card-title { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; font-weight: 500; }
.hint { font-size: 12px; color: var(--ink-2); text-align: center; }

/* 周次切换条 */
.wk-bar { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(30,35,80,.05); flex-wrap: wrap; }
.wk-bar select { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; background: #fff; cursor: pointer; }
.wk-mini { border: none; border-radius: 8px; background: var(--head2); color: #fff; width: 34px; height: 34px; font-size: 18px; font-weight: bold; line-height: 1; }
.wk-mini:active { background: var(--head); }
.wk-btn { border: none; border-radius: 8px; background: var(--head2); color: #fff; padding: 7px 12px; font-size: 13px; }
.wk-btn:active { background: var(--head); }
.wk-today { margin-left: auto; font-size: 13px; color: var(--ink-2); }

/* 今日课程 */
.today-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.today-chip { flex: 0 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 12px; min-width: 130px; }
.today-chip b { display: block; font-size: 13px; }
.today-chip .t-time { color: var(--accent); }
.today-chip.now { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-soft); }
.today-chip.now .t-time { font-weight: 600; }
.today-chip.past { opacity: .35; }
.today-empty { flex: 0 0 auto; color: var(--ink-2); font-size: 13px; padding: 8px 4px; }

/* 课表表格 */
.grid-card { padding: 8px; }
.grid-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wk-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.wk-table th, .wk-table td { border: 1px solid var(--line); vertical-align: top; }
.wk-table thead th { background: var(--head); color: #fff; font-size: 12px; padding: 5px 4px; text-align: center; line-height: 1.3; }
.wk-table thead th .d { display: block; font-size: 10px; font-weight: normal; opacity: .85; margin-top: 0; }
.wk-table thead th.hot { background: #6d7ce0; box-shadow: inset 0 -3px 0 #ffd75e; }
.wk-corner { width: 72px; }
.wk-table thead th.hol-col { background: #c8504a; }
.wk-table thead th.ban-col { background: #b9770e; }
.wk-table thead th .mark { display: block; font-size: 10px; font-weight: bold; margin-top: 0; border-radius: 3px; line-height: 1.4; }
.wk-table thead th .mark.hol { background: #fff; color: #c8504a; }
.wk-table thead th .mark.ban { background: #fff; color: #b9770e; }
/* 节假日提醒横幅 */
.holiday-banner { margin-bottom: 10px; }
.holiday-card { background: #fff8ec; border: 1px dashed #e0a93a; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #8a5200; }
.holiday-card b { color: #c4351b; }
.holiday-card .hol-main { font-size: 13px; }
.holiday-card .hol-sub { margin-top: 3px; font-size: 11px; opacity: .8; }
.holiday-card .hol-todo { margin-top: 5px; background: rgba(226,140,60,.12); border-radius: 6px; padding: 4px 8px; font-size: 11px; }
.today-empty.today-holiday { background: #fff3cd; border-radius: 10px; padding: 10px 14px; color: #8a5200; }
.form-hint { font-size: 12px; color: var(--warn); min-height: 18px; margin: -2px 0 2px; }
.dl-hol { font-size: 11px; border-radius: 6px; padding: 1px 7px; background: #fdecea; color: #c4351b; }
.wk-period { background: #eef0f8; font-size: 12px; color: #444; padding: 6px 4px; text-align: center; width: 72px; }
.wk-period .t { display: block; color: var(--ink-2); font-size: 11px; font-weight: normal; }
.wk-table td { height: 46px; padding: 3px; text-align: center; }
.wk-empty { color: #c4c8d4; font-size: 12px; }
.course { border-radius: 8px; padding: 4px 6px; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 2px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; color: #2b2f3a; }
.course .nm { font-weight: bold; }
.course .pl { opacity: .92; font-size: 11px; }
.course .wk { font-size: 10px; opacity: .75; }
.course.dim { filter: grayscale(.95); opacity: .42; }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 8px; }
.form input, .form select, .form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfe;
}
.form textarea { resize: vertical; }
.form-row { display: flex; gap: 8px; align-items: center; }
.form-row > * { flex: 1; min-width: 0; }
.form-row-txt { flex: 0 0 auto !important; color: var(--ink-2); font-size: 13px; padding: 0 2px; }

/* 课程管理：分组卡片 + 时段子行 */
.cm-group-btns { display: flex; gap: 6px; flex: 0 0 auto; }
.cm-slots { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.cm-slot { display: flex; align-items: center; gap: 6px; background: #f6f7fb; border-radius: 8px; padding: 5px 8px; }
.cm-slot-txt { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-slot .btn { padding: 5px 10px; font-size: 12px; flex: 0 0 auto; }

/* 按钮 */
.btn { border: none; border-radius: 10px; padding: 10px 16px; font-size: 14px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { opacity: .85; }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-danger-ghost { background: transparent; color: var(--danger); border: 1px solid #f0cfc9; }

/* 列表 */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--card); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 2px 8px rgba(30,35,80,.05); }
.item.done { opacity: .55; }
.item-top { display: flex; align-items: flex-start; gap: 10px; }
.item-title { font-weight: 600; flex: 1; word-break: break-all; }
.item-meta { font-size: 12px; color: var(--ink-2); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item-note { font-size: 13px; color: var(--ink-2); margin-top: 6px; word-break: break-all; }
.item-actions { display: flex; gap: 8px; margin-top: 10px; }
.tag { font-size: 11px; border-radius: 6px; padding: 1px 7px; background: var(--accent-soft); color: var(--accent); }
.tag-p-high { background: #fdecea; color: var(--danger); }
.tag-p-mid { background: #faf1dd; color: var(--warn); }
.tag-p-low { background: #e8f3ee; color: var(--ok); }
.overdue { border-left: 4px solid var(--danger); }
.soon { border-left: 4px solid #eba234; }
.dl-overdue { color: var(--danger); font-weight: 600; }
.dl-soon { color: var(--warn); }
.check { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.unread-dot { display: inline-block; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; margin-right: 6px; }
.notice-body { font-size: 13px; color: var(--ink); margin-top: 6px; white-space: pre-wrap; word-break: break-all; }

/* 筛选 */
.filter-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex: 1; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 14px; font-size: 13px; color: var(--ink-2); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-bar select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: 13px; }
.empty { text-align: center; color: var(--ink-2); font-size: 13px; padding: 30px 0; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--card); border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; border: none; background: none; padding: 8px 0 10px; font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tab-ico { font-size: 18px; }
.tab.active { color: var(--accent); }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(20,24,40,.45); }
.modal-body { position: relative; background: var(--card); border-radius: 16px; padding: 20px; width: min(90vw, 380px); max-height: 80vh; overflow: auto; }
.modal-body h3 { margin-bottom: 10px; }
.modal-body p { font-size: 14px; margin: 4px 0; color: var(--ink); }
.modal-body .m-label { color: var(--ink-2); font-size: 12px; }
.modal-body input, .modal-body select, .modal-body textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfe; font-size: 14px;
}
.modal-body textarea { resize: vertical; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
.tt-det { font-size: 12px; color: var(--head); background: #eef0fe; border-radius: 8px; padding: 6px 10px; margin: 4px 0 8px; }

/* 移动端课表压缩 */
@media (max-width: 760px) {
  .wk-table { min-width: 560px; }
  .wk-table thead th { font-size: 11px; padding: 4px 2px; }
  .wk-table thead th .d { font-size: 10px; }
  .wk-period { width: 54px; font-size: 10px; }
  .course { font-size: 10px; padding: 2px 3px; }
  .course .wk { display: none; }
  .wk-today { display: none; }
}

/* 桌面端增强 */
@media (min-width: 768px) {
  .main { padding-bottom: 30px; }
  .tabbar { position: static; justify-content: center; border-top: none; padding: 4px 0 10px; }
  .tab { flex: 0 0 auto; flex-direction: row; gap: 6px; padding: 8px 22px; font-size: 14px; border-radius: 999px; }
  .tab.active { background: var(--accent-soft); }
  .wk-table { min-width: 860px; }
  .course { font-size: 12px; }
  .wk-table thead th { font-size: 13px; padding: 6px 5px; }
}
