/* ===== 我的课表 ===== */
:root {
  --bg: #f4f3ef;
  --bg-blur: rgba(244, 243, 239, .88);
  --card: #ffffff;
  --ink: #17181c;
  --ink2: #5b6070;
  --ink3: #8b90a0;
  --line: #e6e4de;
  --brand: #0f766e;
  --brand-soft: #e3f1ef;
  --on-brand: #ffffff;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 6px 18px rgba(20, 22, 26, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --bg-blur: rgba(17, 19, 21, .88);
    --card: #1b1e22;
    --ink: #f2f3f5;
    --ink2: #a8adba;
    --ink3: #767c8c;
    --line: #2b2f36;
    --brand: #35c9ba;
    --brand-soft: #12302e;
    --on-brand: #06201d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* ===== 顶部 ===== */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg-blur);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.top-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; max-width: 760px; margin: 0 auto; }
.top-row h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.today-chip { font-size: 13px; color: var(--ink2); font-weight: 600; font-variant-numeric: tabular-nums; }

.next-bar {
  max-width: 760px; margin: 10px auto 0;
  background: var(--brand-soft); color: var(--brand);
  border-radius: 12px; padding: 9px 13px;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.next-bar .cd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.next-bar.none { background: var(--card); color: var(--ink3); font-weight: 600; border: 1px solid var(--line); }

/* ===== 标签 ===== */
.tabs { display: flex; gap: 8px; max-width: 760px; margin: 0 auto; padding: 12px 16px 2px; }
.tabs button {
  flex: 1; font-family: inherit; font-size: 15px; font-weight: 700;
  padding: 9px 0; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink2);
  transition: background .12s, color .12s, border-color .12s;
}
.tabs button.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ===== 主体 ===== */
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 8px; }

.day-label { display: flex; align-items: center; gap: 8px; margin: 20px 0 8px; }
.day-label:first-child { margin-top: 6px; }
.day-label .d { font-size: 15px; font-weight: 800; }
.day-label .dt { font-size: 13px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.badge-now {
  font-size: 11px; font-weight: 800; letter-spacing: .5px;
  background: var(--brand); color: var(--on-brand);
  padding: 2px 8px; border-radius: 999px;
}

/* ===== 课程卡 ===== */
.item {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px 12px 18px; margin-bottom: 8px;
  box-shadow: var(--shadow); overflow: hidden;
}
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, #64748b); }
.item .t {
  font-size: 19px; font-weight: 800; line-height: 1.25;
  font-variant-numeric: tabular-nums; letter-spacing: .3px;
  min-width: 62px; flex: none;
}
.item .t i { display: block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--ink3); letter-spacing: 0; margin-top: 1px; }
.item .mid { flex: 1; min-width: 0; padding-top: 1px; }
.item .nm { font-size: 16px; font-weight: 700; word-break: break-word; }
.item .note { font-size: 13px; color: var(--ink2); margin-top: 2px; }
.item .tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: var(--ink3); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 7px; margin-left: 7px; vertical-align: 1px;
}
.item.past { opacity: .45; box-shadow: none; }
.item.live { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.item.live .t { color: var(--brand); }

.empty { text-align: center; color: var(--ink3); font-size: 15px; padding: 46px 0; }

/* 今天页底部：下一个有安排的日子 */
.hint {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 14px; margin-top: 18px; box-shadow: var(--shadow);
}
.hint .hl { font-size: 14px; font-weight: 700; white-space: nowrap; }
.hint .hn {
  flex: 1; min-width: 0; font-size: 13px; color: var(--ink2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hint .ha { color: var(--ink3); font-size: 18px; line-height: 1; }

/* ===== 翻周 ===== */
.weeknav {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 6px 8px; margin: 4px 0 2px; box-shadow: var(--shadow);
}
.weeknav .arw {
  width: 46px; height: 46px; flex: none; padding: 0; line-height: 1;
  font-family: inherit; font-size: 24px; font-weight: 700; color: var(--ink2);
  background: transparent; border: 0; border-radius: 12px; cursor: pointer;
}
.weeknav .arw:active { background: var(--bg); }
.weeknav .rng { flex: 1; min-width: 0; text-align: center; }
.weeknav .rng[data-wk] { cursor: pointer; }
.weeknav .rng .dt { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.weeknav .rng i { display: block; font-style: normal; font-size: 12px; font-weight: 600; color: var(--ink3); margin-top: 1px; }
.weeknav .rng[data-wk] i { color: var(--brand); }

/* 当天没有课时的淡提示 */
.off {
  font-size: 13px; color: var(--ink3);
  padding: 7px 6px 7px 16px; margin-bottom: 8px;
  border-left: 2px dashed var(--line);
}

/* ===== 学生页 ===== */
.sum { display: flex; gap: 8px; margin: 6px 0 14px; }
.sum > div {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 8px; text-align: center; box-shadow: var(--shadow);
}
.sum b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sum span { font-size: 12px; color: var(--ink3); }

.person {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px; margin-bottom: 9px; box-shadow: var(--shadow);
}
.person h3 { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.person h3 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #64748b); flex: none; }
.person h3 .cnt { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink3); }
.slot {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 14px; padding: 6px 0; border-top: 1px dashed var(--line); margin-top: 6px;
}
.slot .wd { color: var(--ink2); width: 52px; flex: none; }
.slot .tm { font-weight: 700; font-variant-numeric: tabular-nums; width: 100px; flex: none; }
.slot .ex { color: var(--ink3); font-size: 13px; }
.slot.once .tm { color: var(--ink3); font-weight: 600; }

/* ===== 打印：出一张纸的表 ===== */
@media print {
  .tabs, .next-bar, .weeknav button { display: none !important; }
  body { background: #fff; padding: 0; font-size: 12px; }
  .top { position: static; border: 0; padding: 0 0 8px; background: #fff; }
  main { padding: 0; max-width: none; }
  .item, .person { break-inside: avoid; box-shadow: none; margin-bottom: 4px; padding: 6px 10px 6px 14px; }
  .item .t { font-size: 14px; }
  .item .nm { font-size: 13px; }
  .day-label { margin: 10px 0 4px; }
  .sum { display: none; }
}
