* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #23282d; background: #f5f7fa; line-height: 1.7;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.topbar { background: #1f5fbf; color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .5px; }
.topbar nav a { color: #dce8ff; text-decoration: none; margin-left: 16px; font-size: 14px; }
.topbar nav a:hover { color: #fff; }
main { padding: 22px 16px 40px; }
.page-title { font-size: 22px; margin: 6px 0 8px; }
.muted { color: #7a8290; font-size: 13px; }
.err { color: #c0392b; }
.ok { color: #1e7d4f; }

.grade-block { margin-top: 22px; }
.grade-title { font-size: 17px; border-left: 4px solid #1f5fbf; padding-left: 8px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.unit-card {
  display: block; background: #fff; border: 1px solid #e3e8ef; border-radius: 10px;
  padding: 12px 14px; text-decoration: none; color: inherit; transition: .15s;
}
.unit-card:hover { border-color: #1f5fbf; box-shadow: 0 2px 10px rgba(31,95,191,.12); }
.unit-no { font-size: 12px; color: #1f5fbf; font-weight: 700; }
.unit-title { font-size: 15px; font-weight: 600; margin: 2px 0 6px; }
.unit-meta { font-size: 12px; color: #7a8290; display: flex; gap: 10px; }

.unit-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.crumb a { color: #1f5fbf; text-decoration: none; font-size: 13px; }
.pm { font-size: 13px; color: #1e7d4f; }

.tabs { display: flex; gap: 6px; margin: 16px 0; flex-wrap: wrap; }
.tab {
  border: 1px solid #d7dee8; background: #fff; border-radius: 20px; padding: 6px 16px;
  cursor: pointer; font-size: 14px; color: #465;
}
.tab.active { background: #1f5fbf; border-color: #1f5fbf; color: #fff; }
.panel { display: none; }
.panel.active { display: block; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; }
.panel-head h2 { font-size: 16px; margin: 0; }

.card { background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: 14px 16px; margin: 10px 0; }
.card h3 { margin: 2px 0 8px; font-size: 15px; }
.card.warn { border-color: #f0d9b5; background: #fffdf6; }
.explain { margin: 4px 0 8px; }
.examples, .card ol, .card ul { margin: 6px 0 6px 20px; }
.examples li { margin: 2px 0; }
.passage { white-space: pre-wrap; line-height: 1.9; }

.vocab-table, .wrong-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.vocab-table th, .vocab-table td, .wrong-table th, .wrong-table td {
  border: 1px solid #e6ebf2; padding: 7px 9px; text-align: left; vertical-align: top;
}
.vocab-table th, .wrong-table th { background: #eef4ff; font-weight: 600; }
.vocab-table td.en { font-weight: 600; color: #1f5fbf; }
.wrong-table td.q { max-width: 260px; }

.btn { border: 1px solid #d7dee8; background: #fff; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 14px; }
.btn.primary { background: #1f5fbf; border-color: #1f5fbf; color: #fff; }
.btn.primary:hover { background: #1a52a6; }
.mini { border: 1px solid #d7dee8; background: #fff; border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 12px; }

.quiz-area { background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: 8px 14px 14px; margin: 10px 0 18px; }
.qcard { border-bottom: 1px dashed #e6ebf2; padding: 12px 0; }
.qcard:last-of-type { border-bottom: 0; }
.qtitle { font-weight: 600; margin-bottom: 6px; }
.opts label { display: block; padding: 3px 0; cursor: pointer; font-size: 14px; }
.opts input[type=text] { border: 1px solid #d7dee8; border-radius: 6px; padding: 6px 10px; width: 220px; }
.tip { margin-top: 6px; font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.tip.ok { background: #eefaf3; color: #1e7d4f; }
.tip.err { background: #fdf1ef; color: #c0392b; }
.submit-bar { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.result { font-size: 14px; }
.hidden { display: none; }

.login-card { max-width: 380px; margin: 60px auto; text-align: center; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid #d7dee8; border-radius: 8px; margin: 10px 0; font-size: 15px; }
.login-card .btn { width: 100%; }

.footer { padding: 18px 16px 30px; color: #98a1ae; font-size: 12px; }
@media (max-width: 560px) {
  .unit-grid { grid-template-columns: 1fr 1fr; }
  .unit-title { font-size: 13px; }
  .vocab-table, .wrong-table { font-size: 13px; }
  .wrong-table td.q { max-width: 140px; }
}
