:root {
  --ink: #0c3438;
  --muted: #688084;
  --line: #dce8e5;
  --paper: #fff;
  --wash: #f3f7f3;
  --brand: #087c7c;
  --accent: #f47b61;
  --shadow: 0 18px 54px rgba(16, 60, 61, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0, color-mix(in srgb, var(--brand) 11%, transparent), transparent 30rem),
    #f6f8f3;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 20; padding: .7rem 1rem; background: white; }
.topbar {
  min-height: 74px; padding: 0 clamp(18px, 5vw, 74px); display: flex; align-items: center;
  justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(8,70,74,.09);
  background: rgba(255,255,255,.82); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: white;
  display: grid; place-items: center; font-family: Georgia, serif; font-size: 18px;
}
.brand-copy strong { display: block; font-size: 1.05rem; }
.brand-copy small { color: var(--muted); letter-spacing: .12em; font-size: .67rem; }
.top-actions { display: flex; gap: 10px; }
.top-link {
  padding: .62rem .85rem; border-radius: 99px; text-decoration: none; color: var(--muted);
}
.top-link:hover, .top-link:focus-visible { background: #edf4f1; color: var(--ink); }
main { width: min(1500px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 72px; }
.exam-hero {
  padding: clamp(28px, 5vw, 58px); border-radius: 30px; color: white;
  background:
    radial-gradient(circle at 88% 14%, rgba(255,255,255,.17) 0 4rem, transparent 4.1rem),
    linear-gradient(120deg, color-mix(in srgb, var(--brand) 75%, #062f33), var(--brand));
  box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px; align-items: end; overflow: hidden;
}
.eyebrow { font-size: .75rem; letter-spacing: .17em; text-transform: uppercase; font-weight: 800; opacity: .8; }
.exam-hero h1 { margin: .45rem 0 .65rem; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2.2rem, 5vw, 5rem); line-height: .98; text-wrap: balance; word-break: keep-all; }
.exam-hero p { margin: 0; color: rgba(255,255,255,.8); max-width: 48rem; }
.hero-stat { text-align: right; min-width: 180px; }
.hero-stat strong { display: block; font: 700 clamp(2.6rem, 6vw, 5rem)/1 Georgia, serif; }
.hero-stat span { color: rgba(255,255,255,.75); }
.panel {
  margin-top: 24px; border: 1px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.93);
  box-shadow: 0 10px 34px rgba(25,71,70,.07); overflow: hidden;
}
.toolbar { padding: 22px; border-bottom: 1px solid var(--line); display: grid; gap: 14px; }
.search-row { display: grid; grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(150px, auto)) auto; gap: 10px; }
.field {
  min-height: 46px; border: 1px solid var(--line); border-radius: 13px; background: #f8faf8;
  color: var(--ink); padding: .7rem .85rem; outline: none;
}
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.reset {
  min-height: 46px; border: 0; border-radius: 13px; background: var(--ink); color: white; padding: .7rem 1rem;
}
.summary-row { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; color: var(--muted); font-size: .9rem; }
.summary-row strong { color: var(--ink); }
.progress-wrap { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.progress-track { width: 150px; height: 8px; border-radius: 99px; background: #e6efec; overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .2s ease; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1100px; }
th {
  padding: 13px 14px; background: #eef5f2;
  border-bottom: 1px solid var(--line); color: #49666a; text-align: left; font-size: .75rem; letter-spacing: .08em;
}
td { padding: 14px; border-bottom: 1px solid #edf2f0; vertical-align: top; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--brand) 5%, white); }
.row-number { color: #91a4a5; font-variant-numeric: tabular-nums; }
.word-cell strong { display: block; font-family: Georgia, serif; font-size: 1.18rem; }
.word-cell small { display: block; color: var(--muted); margin-top: 4px; }
.meaning { max-width: 32rem; line-height: 1.55; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { padding: .3rem .55rem; border-radius: 99px; background: #edf4f1; color: #466469; white-space: nowrap; font-size: .72rem; }
.pill.primary { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); font-weight: 800; }
.pill.warn { background: #fff0d5; color: #8c5a0c; }
.learn-check { width: 20px; height: 20px; accent-color: var(--brand); scroll-margin-top: 160px; }
.open-word {
  display: inline-flex; padding: .48rem .65rem; border: 1px solid var(--line); border-radius: 10px;
  color: var(--brand); text-decoration: none; white-space: nowrap; font-weight: 700; font-size: .82rem;
}
.open-word:hover { color: white; background: var(--brand); border-color: var(--brand); }
.empty { padding: 70px 24px; text-align: center; color: var(--muted); }
.pagination {
  padding: 18px 22px; display: flex; justify-content: space-between; align-items: center;
  gap: 14px; border-top: 1px solid var(--line); color: var(--muted);
}
.page-buttons { display: flex; gap: 7px; }
.page-buttons button {
  min-width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink);
}
.page-buttons button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.page-buttons button:disabled { opacity: .38; cursor: default; }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); }
.footer-note { margin-top: 16px; color: var(--muted); font-size: .82rem; text-align: center; }

.hub-hero { padding: 30px 0 18px; display: flex; justify-content: space-between; align-items: end; gap: 22px; }
.hub-hero h1 { margin: .45rem 0; font: 700 clamp(2.4rem, 6vw, 5rem)/1 Georgia, "Noto Serif SC", serif; }
.hub-hero p { color: var(--muted); max-width: 50rem; line-height: 1.65; }
.total-badge { flex: 0 0 auto; padding: 1rem 1.2rem; border-radius: 20px; background: var(--ink); color: white; text-align: center; }
.total-badge strong { display: block; font: 700 2rem Georgia, serif; }
.exam-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.exam-card {
  position: relative; min-height: 258px; padding: 25px; border: 1px solid var(--line); border-radius: 25px;
  background: white; text-decoration: none; box-shadow: 0 10px 34px rgba(25,71,70,.06);
  display: flex; flex-direction: column; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease;
}
.exam-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--card-color); }
.exam-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.exam-card .card-code { color: var(--card-color); font-weight: 900; letter-spacing: .14em; }
.exam-card h2 { margin: auto 0 .45rem; font: 700 2rem Georgia, "Noto Serif SC", serif; }
.exam-card p { color: var(--muted); margin: 0; min-height: 42px; }
.exam-count { position: absolute; right: 22px; top: 22px; text-align: right; }
.exam-count strong { display: block; font: 700 1.8rem Georgia, serif; }
.card-action { margin-top: 20px; color: var(--card-color); font-weight: 800; }
.rule-strip {
  margin-top: 24px; padding: 22px; border-radius: 22px; background: #e9f2ee;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.rule-strip strong { display: block; margin-bottom: 4px; }
.rule-strip span { color: var(--muted); font-size: .86rem; line-height: 1.5; }
@media (max-width: 980px) {
  .exam-grid { grid-template-columns: repeat(2, 1fr); }
  .search-row { grid-template-columns: 1fr 1fr; }
  .search-row .search-input { grid-column: 1 / -1; }
  .progress-wrap { width: 100%; margin-left: 0; }
}
@media (max-width: 680px) {
  .topbar { min-height: 62px; padding: 0 14px; }
  .brand-copy small, .top-link.secondary { display: none; }
  main { width: min(100% - 20px, 1500px); padding-top: 18px; }
  .exam-hero { grid-template-columns: 1fr; border-radius: 22px; }
  .exam-hero h1 { font-size: clamp(2rem, 10vw, 3rem); line-height: 1.04; }
  .hero-stat { text-align: left; }
  .exam-grid, .rule-strip { grid-template-columns: 1fr; }
  .hub-hero { display: block; }
  .total-badge { display: inline-block; margin-top: 12px; }
  .search-row { grid-template-columns: 1fr; }
  .search-row .search-input { grid-column: auto; }
  .panel { border-radius: 20px; }
  .table-scroll { overflow: visible; }
  table, thead, tbody, tr, th, td { display: block; min-width: 0; }
  thead { position: absolute; left: -9999px; }
  tbody { padding: 0 14px; }
  tbody tr { padding: 15px 0; border-bottom: 1px solid var(--line); }
  td { border: 0; padding: 5px 0 5px 116px; min-height: 30px; position: relative; }
  td::before { content: attr(data-label); position: absolute; left: 0; width: 104px; color: var(--muted); font-size: .75rem; }
  .meaning { max-width: none; }
  .pagination { align-items: flex-start; flex-direction: column; }
}
