:root {
  --p: #1f4e79;
  --p2: #2e7d9a;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #263238;
  --muted: #78909c;
  --line: #e3ecf5;
  --ok: #2e7d32;
  --bad: #c62828;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eaf2fb, #f7fbff 50%, #eef6f8);
  padding: 20px;
}
.login-card {
  width: 390px;
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 34px 36px 28px;
  box-shadow: 0 18px 60px rgba(31, 78, 121, .16);
}
.brand-mark { color: var(--p); font-weight: 700; font-size: 14px; letter-spacing: .5px; }
.login-card h1 { margin: 14px 0 6px; color: var(--p); font-size: 28px; }
.login-card form { margin-top: 24px; }
.login-card label { display: block; font-size: 13px; color: #546e7a; margin: 14px 0 7px; }
input, textarea {
  width: 100%;
  border: 1px solid #d7e3ef;
  border-radius: 9px;
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
  background: #fff;
}
input:focus, textarea:focus { border-color: #2e7d9a; box-shadow: 0 0 0 3px rgba(46,125,154,.12); }
button { cursor: pointer; border: 0; border-radius: 9px; font-size: 14px; padding: 10px 16px; }
button.primary { background: var(--p); color: #fff; width: 100%; margin-top: 20px; padding: 12px; font-size: 15px; }
button.primary:hover { background: #173e5f; }
button.ghost { background: #edf4fb; color: var(--p); }
button:disabled { opacity: .6; cursor: not-allowed; }
.error { color: var(--bad); font-size: 13px; margin-top: 12px; min-height: 18px; }
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; color: var(--p); font-size: 18px; }
.brand span { font-weight: 400; color: var(--muted); font-size: 14px; margin-left: 6px; }
.who { color: var(--muted); font-size: 13px; margin-top: 4px; }
.main { max-width: 980px; margin: 22px auto 60px; padding: 0 18px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 16px; }
.page-title h2 { margin: 0; font-size: 22px; color: var(--p); }
.card {
  background: #fff;
  border-radius: 13px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 4px 18px rgba(31, 78, 121, .07);
}
.hw-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.hw-row h3 { margin: 0 0 6px; font-size: 17px; }
.hw-meta { color: var(--muted); font-size: 13px; line-height: 1.7; }
.hw-stats { color: var(--p2); font-size: 13px; white-space: nowrap; text-align: right; }
.hw-stats b { display: block; font-size: 20px; color: var(--p); }
.btn-start { background: #eaf2fb; color: var(--p); font-weight: 600; white-space: nowrap; }
.btn-start:hover { background: #dceaf8; }
.btn-back { background: transparent; color: var(--p); padding-left: 0; }
.question { border-top: 1px solid var(--line); padding: 20px 0; }
.question:first-child { border-top: 0; padding-top: 0; }
.q-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 10px; }
.q-no { color: var(--p); font-weight: 700; }
.q-type { color: var(--muted); font-size: 12px; border: 1px solid var(--line); padding: 2px 7px; border-radius: 10px; }
.q-stem { white-space: pre-wrap; line-height: 1.75; font-size: 16px; }
.q-images { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.q-images img { max-width: 100%; max-height: 320px; border-radius: 8px; border: 1px solid var(--line); }
.options { display: grid; gap: 9px; margin: 12px 0 0; }
.option {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 9px; cursor: pointer; line-height: 1.6;
}
.option:hover { background: #f7fbff; }
.option input { width: auto; margin-top: 2px; accent-color: var(--p); }
.option.selected { border-color: #2e7d9a; background: #f1f9fd; }
.answer-input { margin-top: 12px; }
.essay-input { min-height: 130px; resize: vertical; }
.submit-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0; border-top: 1px solid var(--line); margin-top: 8px;
}
.submit-bar .hint { color: var(--muted); font-size: 13px; }
.submit-bar button.primary { width: auto; margin: 0; padding: 11px 26px; }
.result-summary {
  background: linear-gradient(135deg,#eaf4fb,#f6fbff);
  border: 1px solid #d8ebf7; border-radius: 13px; padding: 22px; text-align: center; margin-bottom: 16px;
}
.result-summary .score { font-size: 38px; color: var(--p); font-weight: 800; }
.result-summary .score small { font-size: 16px; color: var(--muted); font-weight: 400; }
.result-summary p { color: var(--muted); margin: 6px 0 0; }
.q-result { border-left: 4px solid #90a4ae; padding: 10px 14px; margin-top: 14px; background: #fafcff; border-radius: 0 9px 9px 0; }
.q-result.ok { border-left-color: var(--ok); }
.q-result.bad { border-left-color: var(--bad); }
.q-result .line { font-size: 14px; line-height: 1.8; }
.q-result .line b { color: #455a64; }
.correct-text { color: var(--ok); }
.bad-text { color: var(--bad); }
.history { margin-top: 14px; }
.history h3 { font-size: 15px; color: var(--p); margin: 0 0 8px; }
.history-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }
@media (max-width: 640px) {
  .main { margin-top: 14px; padding: 0 12px; }
  .topbar { padding: 12px 14px; }
  .hw-row { display: block; }
  .hw-stats { text-align: left; margin-top: 10px; display: flex; gap: 16px; }
  .hw-stats b { display: inline; font-size: 16px; }
  .card { padding: 16px; }
  .submit-bar { position: sticky; bottom: 0; background: var(--bg); }
}
