:root {
  --brand: #185fa5;
  --brand-weak: #e6f1fb;
  --ink: #1c1e21;
  --muted: #6b7280;
  --line: #e2e4e8;
  --bg: #f5f6f8;
  --card: #ffffff;
  --good: #3b6d11;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* 关键：防止 display:flex 等规则覆盖 hidden 属性 */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--card); }
.screen { padding: 18px 16px 28px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.err { color: #a32d2d; font-size: 13px; min-height: 18px; margin: 6px 0; }
.link-center { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; cursor: pointer; }
.ai-note { text-align: center; color: var(--muted); font-size: 11.5px; padding: 10px 0 16px; }

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  margin: 4px 0 12px;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; line-height: 1.6; }
label { font-size: 13.5px; color: var(--ink); }

button.primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  cursor: pointer;
}
button.ghost {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
button.ghost.block { width: 100%; padding: 11px; }
button:disabled { opacity: 0.5; cursor: default; }

.gate-hero { text-align: center; padding: 42px 0 26px; }
.logo {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 14px; background: var(--brand-weak); color: var(--brand);
  font-size: 22px; display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.gate-hero h1 { font-size: 18px; margin: 0 0 4px; }
.gate-hero .sub { color: var(--muted); font-size: 13px; margin: 0; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; margin-bottom: 14px; flex-wrap: wrap;
}
.topbar-actions { display: flex; gap: 6px; }
.week-nav {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg); border-radius: 10px; padding: 8px 12px; margin-bottom: 14px;
}
.task-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; display: flex; gap: 12px; align-items: center;
  cursor: pointer;
}
.task-card .badge {
  width: 46px; height: 46px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.badge.tr { background: var(--brand-weak); color: var(--brand); }
.badge.wr { background: #eaf3de; color: var(--good); }
.task-card h3 { margin: 0; font-size: 15px; }
.task-card p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.task-card .done { color: var(--good); font-size: 12.5px; }
.task-card .todo { color: #ba7517; font-size: 12.5px; }

.material {
  background: var(--bg); border-radius: var(--radius); padding: 14px;
  font-size: 14.5px; margin: 8px 0 12px; white-space: pre-wrap;
}
.material.en { font-family: "Times New Roman", Georgia, serif; }
.kw { border-bottom: 2px solid var(--brand); }
.kw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  font-size: 12px; background: var(--brand-weak); color: var(--brand);
  border-radius: 6px; padding: 3px 8px;
}
.instr {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; font-size: 13.5px; margin: 8px 0 12px; white-space: pre-wrap;
}
.row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

.score-hero { text-align: center; margin: 10px 0 16px; }
.score-hero .num { font-size: 44px; color: var(--brand); font-weight: 600; line-height: 1.1; }
.score-hero .cap { color: var(--muted); font-size: 12.5px; }
.dim { margin-bottom: 8px; }
.dim .row-between { font-size: 13.5px; margin-bottom: 3px; }
.bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; background: var(--brand); border-radius: 4px; }
.fb {
  background: var(--bg); border-radius: 10px; padding: 12px; margin: 8px 0;
  font-size: 13.5px;
}
.fb.hl { background: #eaf3de; }
.fb .q { color: var(--brand); }
.section-title { font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
details.answer { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
details.answer summary { cursor: pointer; color: var(--brand); font-size: 13.5px; }
details.answer .body { font-size: 13.5px; white-space: pre-wrap; margin-top: 8px; }
.tag-demo {
  display: inline-block; background: #faeeda; color: #854f0b;
  border-radius: 6px; padding: 2px 8px; font-size: 12px; margin-left: 6px;
}

.hist-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  margin-bottom: 8px; font-size: 13.5px;
}
.hist-item .row-between { margin-bottom: 2px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.metric { background: var(--bg); border-radius: 10px; padding: 12px; }
.metric .k { color: var(--muted); font-size: 12px; }
.metric .v { font-size: 20px; font-weight: 600; margin-top: 2px; }
table.stu { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.stu th, table.stu td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: left; }
table.stu th { background: var(--bg); }

#rubric-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  display: flex; align-items: flex-end; justify-content: center; z-index: 10;
}
#rubric-panel {
  background: #fff; width: 100%; max-width: 520px; max-height: 80vh; overflow: auto;
  border-radius: 16px 16px 0 0; padding: 16px; font-size: 13.5px;
}
.rubric-band { margin-bottom: 8px; }
.rubric-band b { color: var(--brand); }
.teacher-entry { margin-top: 16px; }

/* --- 免服务器版新增 --- */
.file-input {
  width: 100%; padding: 10px 12px; margin-top: 6px; box-sizing: border-box;
  border: 1px dashed var(--line, #d8dee6); border-radius: 10px;
  background: #fbfcfe; font-size: 14px; color: var(--muted);
}
label { display: block; margin: 12px 0 6px; font-size: 13px; color: var(--muted); }

/* --- 限时倒计时 --- */
.timer {
  font-variant-numeric: tabular-nums;
  color: var(--primary, #1a3c6e);
  font-size: 14px;
}
.timer.time-warn { color: #b45309; }
.timer.time-up { color: #c0392b; }
