:root {
  --ink: #17243b;
  --muted: #6b7689;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --navy: #173a64;
  --blue: #2d6596;
  --teal: #167d76;
  --teal-soft: #e7f3f0;
  --gold: #c28a31;
  --gold-soft: #fff3dc;
  --line: #dde2e8;
  --shadow: 0 18px 50px rgba(31, 50, 75, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(22, 125, 118, .07), transparent 22rem),
    var(--paper);
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.72;
}

button, input { font: inherit; }
button { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid rgba(221, 226, 232, .88);
  background: rgba(251, 250, 247, .9);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, var(--navy), var(--teal));
  font: 700 15px/1 Georgia, serif;
  letter-spacing: .04em;
  box-shadow: 0 8px 20px rgba(23, 58, 100, .2);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .02em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; }

.top-actions { display: flex; align-items: center; gap: 10px; }

.search {
  width: min(32vw, 360px);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(31, 50, 75, .04);
}

.search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search kbd { color: var(--muted); font-size: 10px; white-space: nowrap; }

.ghost-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.ghost-button:hover { border-color: var(--teal); color: var(--teal); }

.layout { display: grid; grid-template-columns: 282px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 74px;
  height: calc(100vh - 74px);
  overflow: auto;
  padding: 28px 18px 24px 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .52);
}

.sidebar-label, .eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#unitNav { margin: 12px 0 26px; }

.nav-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 3px 0;
  padding: 10px 11px;
  border: 0;
  border-radius: 12px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover { background: #f0f3f4; }
.nav-item.active { color: var(--navy); background: var(--teal-soft); }
.nav-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--muted); background: #eef1f3; font: 700 12px Georgia, serif; }
.nav-item.active .nav-number { color: #fff; background: var(--teal); }
.nav-item strong { display: block; font: 600 13px/1.25 "Times New Roman", serif; }
.nav-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }

.sidebar-card { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.sidebar-card strong { display: block; margin-top: 5px; font-size: 14px; }
.sidebar-card p { margin: 7px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.updated { color: var(--teal); font-size: 10px; }

.main { width: min(100%, 1040px); min-height: calc(100vh - 74px); padding: 48px 52px 90px; outline: none; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 38px 40px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(120deg, #173a64 0%, #225b78 58%, #167d76 120%);
  box-shadow: 0 24px 58px rgba(23, 58, 100, .2);
}

.hero::after { content: ""; position: absolute; right: -80px; top: -100px; width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.04), 0 0 0 80px rgba(255,255,255,.025); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #bde5df; }
.hero h1 { max-width: 700px; margin: 8px 0 10px; font: 700 clamp(29px, 4vw, 48px)/1.14 Georgia, "Noto Serif CJK SC", serif; letter-spacing: -.02em; }
.hero p { max-width: 700px; margin: 0; color: #dfeaf0; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 36px; }
.summary-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.summary-card strong { display: block; color: var(--navy); font: 700 27px/1 Georgia, serif; }
.summary-card span { color: var(--muted); font-size: 12px; }

.section-title { display: flex; align-items: center; gap: 10px; margin: 42px 0 14px; font-size: 21px; }
.section-title::before { content: ""; width: 5px; height: 23px; border-radius: 6px; background: var(--teal); }

.grammar-map { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.map-card { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; transition: .18s ease; }
.map-card:hover { transform: translateY(-2px); border-color: #9cc8c3; box-shadow: var(--shadow); }
.map-index { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #fff; background: var(--navy); font: 700 14px Georgia, serif; }
.map-card strong { display: block; font: 700 15px "Times New Roman", serif; }
.map-card span { color: var(--muted); font-size: 12px; }
.map-arrow { color: var(--teal); font-size: 20px; }

.unit-header { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.breadcrumb { color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.unit-header h1 { margin: 7px 0 8px; color: var(--navy); font: 700 clamp(30px, 4vw, 45px)/1.12 Georgia, "Noto Serif CJK SC", serif; }
.unit-topic { display: inline-flex; padding: 7px 11px; border-radius: 9px; color: var(--teal); background: var(--teal-soft); font-size: 13px; font-weight: 700; }

.goal-list, .teaching-list { margin: 0; padding: 0; list-style: none; counter-reset: item; }
.goal-list li, .teaching-list li { position: relative; margin: 8px 0; padding: 11px 14px 11px 42px; border-radius: 12px; background: #f3f5f6; }
.goal-list li::before, .teaching-list li::before { counter-increment: item; content: counter(item); position: absolute; left: 12px; top: 11px; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: #fff; background: var(--teal); font-size: 11px; font-weight: 700; }

.grammar-block { margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(31, 50, 75, .035); }
.grammar-block summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; color: var(--navy); font-weight: 700; cursor: pointer; list-style: none; }
.grammar-block summary::-webkit-details-marker { display: none; }
.grammar-block summary::after { content: "+"; color: var(--teal); font-size: 21px; font-weight: 400; }
.grammar-block[open] summary::after { content: "−"; }
.grammar-block[open] summary { border-bottom: 1px solid var(--line); }
.grammar-content { padding: 14px 22px 18px; }
.grammar-content ul { margin: 0; padding-left: 19px; }
.grammar-content li { margin: 8px 0; }
.grammar-content li::marker { color: var(--teal); }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 13px; }
.data-table th, .data-table td { padding: 11px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th:last-child, .data-table td:last-child { border-right: 0; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table th { color: var(--navy); background: #eef4f6; }
.data-table td { font-family: "Times New Roman", "Noto Sans CJK SC", serif; }

.board { position: relative; padding: 25px 28px; border: 8px solid #bc9364; border-radius: 6px; color: #f5f1df; background: #224d43; box-shadow: inset 0 0 28px rgba(0,0,0,.18), var(--shadow); }
.board::after { content: "板书建议"; position: absolute; right: 16px; top: 11px; color: rgba(255,255,255,.4); font-size: 10px; letter-spacing: .1em; }
.board pre { margin: 0; white-space: pre-wrap; font: 16px/1.8 "Times New Roman", "Noto Sans CJK SC", serif; }

.check-card { margin: 10px 0; padding: 16px 18px; border-left: 4px solid var(--gold); border-radius: 0 14px 14px 0; background: var(--gold-soft); }
.check-card strong { display: block; font-family: "Times New Roman", "Noto Sans CJK SC", serif; }
.check-card details { margin-top: 6px; color: #765521; }
.check-card summary { cursor: pointer; font-size: 12px; font-weight: 700; }

.search-panel { position: fixed; z-index: 60; top: 66px; right: 28px; width: min(560px, calc(100vw - 28px)); max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 28px 80px rgba(24, 42, 68, .2); }
.search-panel-head { position: sticky; top: 0; display: flex; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); font-weight: 700; }
.search-panel-head button { border: 0; background: transparent; cursor: pointer; font-size: 20px; }
.result { display: block; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; cursor: pointer; }
.result:hover { background: #f4f7f7; }
.result strong { display: block; color: var(--navy); }
.result span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.empty-result { padding: 28px; color: var(--muted); text-align: center; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pill { padding: 6px 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; color: #e5f3f1; background: rgba(255,255,255,.08); font-size: 11px; }

@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .brand small, .search kbd, .ghost-button { display: none; }
  .search { width: min(50vw, 320px); }
  .layout { display: block; }
  .sidebar { position: sticky; top: 74px; z-index: 20; width: 100%; height: auto; padding: 9px 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; background: rgba(251,250,247,.94); backdrop-filter: blur(12px); }
  .sidebar-label, .sidebar-card { display: none; }
  #unitNav { display: flex; width: max-content; margin: 0; }
  .nav-item { width: auto; grid-template-columns: 28px 1fr; margin: 0 2px; padding: 7px 9px; }
  .nav-item small { display: none; }
  .main { padding: 32px 20px 70px; }
  .hero { padding: 30px 24px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .grammar-map { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand strong { font-size: 13px; }
  .brand-mark { width: 36px; height: 36px; }
  .search { width: 45vw; }
  .hero h1 { font-size: 31px; }
  .main { padding-left: 15px; padding-right: 15px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .data-table { display: block; overflow-x: auto; white-space: normal; }
}

@media print {
  body { background: #fff; }
  .topbar, .sidebar, .search-panel, .ghost-button { display: none !important; }
  .layout { display: block; }
  .main { width: 100%; padding: 0; }
  .hero { color: #000; background: #fff; box-shadow: none; border: 1px solid #bbb; }
  .hero .eyebrow, .hero p { color: #333; }
  .grammar-block { break-inside: avoid; box-shadow: none; }
  .grammar-block:not([open]) .grammar-content { display: block; }
  .board { color: #000; background: #fff; border: 2px solid #555; box-shadow: none; }
  .board::after { color: #666; }
}
