:root {
  --accent: #667eea;
  --accent-dark: #764ba2;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #2d3436;
  --muted: #8a8f99;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --border: #e6e8ee;
  --radius: 14px;
  --fs: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: calc(15px * var(--fs));
  line-height: 1.6;
}
a { color: var(--accent); }
.container { max-width: 920px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1200px; }
h1, h2, h3 { margin: 0 0 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
label { display: block; font-size: .85em; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 1em; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 60px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; padding: 10px 16px; font-size: 1em;
  background: var(--accent); color: #fff; cursor: pointer; min-height: 44px;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 10px; font-size: .85em; min-height: 36px; }
table { width: 100%; border-collapse: collapse; font-size: .92em; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 10px 14px; cursor: pointer; border-bottom: 3px solid transparent; color: var(--muted); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78em; background: #eef; color: var(--accent); }
.badge.ok { background: #e7f8f0; color: var(--ok); }
.badge.warn { background: #fef3e2; color: var(--warn); }
.badge.gray { background: #f0f1f4; color: var(--muted); }
.muted { color: var(--muted); }
.toast {
  position: fixed; left: 50%; top: 20px; transform: translateX(-50%);
  background: #323a45; color: #fff; padding: 10px 18px; border-radius: 10px;
  z-index: 999; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }
.hidden { display: none !important; }
.grid { display: grid; gap: 12px; }
.grid.cols2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.stat-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-box .num { font-size: 1.8em; font-weight: 700; color: var(--accent); }
.subject-group { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.subject-group .head { background: #fafbff; padding: 10px 14px; font-weight: 600; }
.task-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.task-item .content { flex: 1; }
.task-item.done .content { text-decoration: line-through; color: var(--muted); }
.toggle { width: 56px; height: 32px; border-radius: 999px; background: #d8dbe2; position: relative; cursor: pointer; flex: none; }
.toggle.on { background: var(--ok); }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on .knob { left: 27px; }
.heat { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; }
.heat .cell { aspect-ratio: 1; border-radius: 3px; background: #ebedf0; }
.heat .cell.done { background: var(--ok); }
.heat .cell.partial { background: var(--warn); }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; background: #f0f1f6; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar .title { font-weight: 700; font-size: 1.1em; }
.qr-print { display: none; }
@media print {
  body * { visibility: hidden; }
  .qr-print, .qr-print * { visibility: visible; }
  .qr-print { display: block; position: absolute; left: 0; top: 0; width: 100%; }
  .qr-card { page-break-inside: avoid; width: 45%; display: inline-block; text-align: center; margin: 10px; }
}
