/* 极简课表 —— 样式。整体照着 Excel 课表的样子：细黑线、加粗表头、有课的格子涂黄 */
:root {
  --line: #7f7f7f;
  --text: #000;
  --muted: #666;
  --bg: #fff;
  --hi: #ff0;            /* 有课的格子 */
  --hover: #fffbd6;      /* 可编辑的空格，鼠标悬停 */
  --bar: #f3f3f3;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.45 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex; flex-direction: column;   /* 让页脚始终贴在页面最底部 */
}
a { color: #0645ad; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 页脚 ---------- */
.foot {
  margin-top: auto; padding: 10px 16px; border-top: 1px solid var(--line);
  text-align: center; font-size: 12px; color: var(--muted); background: var(--bar);
}

/* ---------- Cookie 同意提示（固定在页面最底部，页脚上方） ---------- */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .12);
}
.consent[hidden] { display: none; }
.consent-text { flex: 1 1 320px; }
.consent-text b { display: block; }
.consent-btns { display: flex; gap: 8px; }

/* ---------- 顶栏 ---------- */
.bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--bar);
}
.bar-left, .bar-right { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 16px; }
.who { color: var(--muted); }
.page { padding: 12px 16px 24px; flex: 1; }
.hint { color: var(--muted); margin: 8px 0 0; }

/* ---------- 课表 ---------- */
.scroll { overflow-x: auto; }
table.grid {
  border-collapse: collapse; width: 100%; min-width: 720px; table-layout: fixed;
}
.grid th, .grid td { border: 1px solid var(--line); padding: 0; }
.grid thead th { text-align: center; padding: 6px 4px; font-weight: 600; }
.grid thead th small { display: block; font-weight: 400; color: var(--muted); }
.grid thead th.today { background: var(--hover); }
.grid th.corner { width: 96px; font-weight: 600; }
.grid th.time { width: 96px; text-align: center; vertical-align: middle; padding: 6px; }
.grid th.time .no { display: block; font-size: 13px; color: var(--muted); }
.grid th.time .range { display: block; }
.grid td.slot { height: 56px; vertical-align: middle; text-align: center; padding: 4px; }
.grid td.course { background: var(--hi); cursor: default; }
.grid td.course .c-name { font-weight: 600; }
.grid td.course .c-sub { color: #222; }
table.grid[data-edit="1"] td.slot { cursor: pointer; }
table.grid[data-edit="1"] td.empty:hover { background: var(--hover); }
table.grid[data-edit="1"] td.course:hover { outline: 2px solid #c8a200; outline-offset: -2px; }
.grid td.notes { padding: 6px 8px; text-align: left; white-space: pre-wrap; min-height: 28px; }
table.grid[data-edit="1"] td.notes { cursor: pointer; }
table.grid[data-edit="1"] td.notes:hover { background: var(--hover); }

/* ---------- 弹窗 ---------- */
dialog {
  border: 1px solid var(--line); padding: 16px 20px; width: 340px; max-width: 94vw;
  background: var(--bg); color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, .3); }
dialog h2 { margin: 0 0 12px; font-size: 16px; }
dialog label { display: block; margin: 8px 0; }
dialog .row { display: flex; gap: 8px; }
dialog .row label { flex: 1; }
input, select, textarea, button {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid #999; border-radius: 3px; padding: 5px 8px;
}
dialog label input, dialog label select { display: block; width: 100%; margin-top: 3px; }
dialog .pair { display: flex; gap: 4px; }          /* "从第几节到第几节"两个下拉框并排 */
dialog .pair select { min-width: 0; }
dialog textarea { display: block; width: 100%; resize: vertical; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button.primary { background: #1a73e8; border-color: #1a73e8; color: #fff; }
button.danger, button.op.danger { color: var(--danger); }
.err { color: var(--danger); min-height: 1.2em; margin: 6px 0; }
.status { color: var(--muted); }
.btns { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.spacer { flex: 1; }
.wide { width: 100%; }

/* ---------- 登录 ---------- */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.login-card {
  width: 300px; max-width: 92vw; border: 1px solid var(--line); padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.login-card h1 { margin: 0 0 16px; font-size: 20px; text-align: center; }
.login-card label { display: block; margin: 10px 0; }
.login-card input { display: block; width: 100%; margin-top: 3px; }

/* ---------- 管理后台 ---------- */
.card { border: 1px solid var(--line); padding: 12px 16px 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 10px; font-size: 16px; }
table.list { border-collapse: collapse; width: 100%; }
.list th, .list td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.list th { background: var(--bar); font-weight: 600; }
.list td.idx { width: 80px; }
.list input[type="time"] { width: 140px; }
.list td.ops { white-space: nowrap; }
button.op { border: 0; background: none; padding: 0 4px; color: #0645ad; }
button.op.danger { color: var(--danger); }
button.op:hover { text-decoration: underline; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.chk { display: inline-flex; align-items: center; gap: 4px; }
.chk input { padding: 0; }
