:root {
  color-scheme: light;
  --paper: #f4dfe0;
  --paper-light: #fff5f1;
  --ink: #181515;
  --red: #8f2836;
  --red-soft: #ddb0b5;
  --blue: #304e63;
  --muted: #665b5c;
  --line: rgba(24, 21, 21, .38);
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --body: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --utility: "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); line-height: 1.65; }
button, input { font: inherit; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 20; padding: .6rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }
.site-header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 clamp(1rem, 5vw, 5rem); border-bottom: 1px solid var(--ink); background: rgba(244,223,224,.96); position: sticky; top: 0; z-index: 10; }
.brand { font-family: var(--display); font-weight: 800; letter-spacing: .08em; text-decoration: none; }
nav { display: flex; gap: clamp(.75rem, 2vw, 2rem); font-size: .88rem; }
.hero { min-height: calc(100vh - 66px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); border-bottom: 1px solid var(--ink); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(3rem, 8vw, 8rem) clamp(1rem, 7vw, 7rem); }
.folio { margin: 0 0 .9rem; color: var(--red); font: 700 .78rem/1.4 var(--utility); letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; }
h1 { margin: 0; font-size: clamp(3rem, 7vw, 7.4rem); letter-spacing: -.05em; }
.selected-site-title { white-space: nowrap; font-size: clamp(2.3rem, 6vw, 6.5rem); }
.hero-lede { max-width: 43rem; margin: 1.6rem 0 0; font-size: clamp(1.05rem, 1.7vw, 1.3rem); color: var(--muted); }
.primary { align-self: flex-start; min-height: 54px; margin-top: 2rem; padding: .8rem 1.25rem; border: 1px solid var(--ink); background: var(--red); color: white; box-shadow: 5px 5px 0 var(--ink); font-weight: 750; cursor: pointer; }
.primary:hover { transform: translate(-1px,-1px); box-shadow: 6px 6px 0 var(--ink); }
.privacy-note { margin: 1rem 0 0; color: var(--muted); font-size: .86rem; }
.hero-figure { margin: 0; padding: clamp(1rem, 4vw, 3rem); border-left: 1px solid var(--ink); background: var(--paper-light); display: flex; flex-direction: column; justify-content: center; }
.hero-figure img { width: 100%; max-height: 70vh; object-fit: contain; border: 1px solid var(--ink); }
.hero-figure figcaption { max-width: 28rem; padding-top: 1rem; font: .82rem/1.5 var(--utility); color: var(--muted); }
.progress-section, .catalog-section, .about-section { padding: clamp(3.5rem, 8vw, 8rem) clamp(1rem, 6vw, 6rem); border-bottom: 1px solid var(--ink); }
.section-heading { max-width: 54rem; }
.section-heading.compact { max-width: 68rem; }
h2 { margin: 0; font-size: clamp(2.3rem, 5vw, 5rem); letter-spacing: -.035em; }
.section-heading > p:last-child { max-width: 47rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 2.4rem; border: 1px solid var(--ink); }
.stat { min-height: 140px; display: flex; flex-direction: column; justify-content: space-between; padding: 1rem; border-right: 1px solid var(--ink); background: rgba(255,255,255,.18); }
.stat:last-child { border-right: 0; }
.stat strong { font: 700 clamp(2rem, 4vw, 4rem)/1 var(--display); }
.stat span { color: var(--muted); font-size: .85rem; }
.session-note { margin-top: 1rem; padding: 1rem; border-left: 6px solid var(--red); background: var(--paper-light); }
.session-note.celebrate { animation: settle .5s cubic-bezier(.2,.9,.3,1.25); background: #f8eee6; }
@keyframes settle { 50% { transform: translateY(-5px); } }
.toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.5fr); gap: 1rem; align-items: end; margin-top: 2.5rem; }
.search-label { font-weight: 700; }
input[type="search"] { width: 100%; min-height: 50px; margin-top: .45rem; padding: .75rem 1rem; border: 1px solid var(--ink); border-radius: 0; background: var(--paper-light); color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: .55rem; }
.filter, .text-button { min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
.filter.is-active { background: var(--ink); color: var(--paper-light); }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: clamp(1rem, 3vw, 3rem); align-items: start; margin-top: 1.5rem; }
.result-count { color: var(--muted); font: .82rem/1.4 var(--utility); }
.concept-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; max-height: 920px; overflow: auto; padding-right: .4rem; }
.concept-card { width: 100%; min-height: 146px; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid var(--ink); background: rgba(255,255,255,.18); color: var(--ink); text-align: left; cursor: pointer; }
.concept-card:hover, .concept-card[aria-current="true"] { background: var(--paper-light); box-shadow: 4px 4px 0 var(--ink); transform: translate(-1px,-1px); }
.concept-card strong { display: block; font: 700 1.22rem/1.25 var(--display); }
.concept-card small { color: var(--muted); overflow-wrap: anywhere; }
.card-meta { display: flex; justify-content: space-between; gap: .5rem; font: .72rem/1.3 var(--utility); color: var(--red); }
.detail-panel { position: sticky; top: 86px; min-height: 520px; padding: clamp(1.2rem, 3vw, 2.2rem); border: 1px solid var(--ink); background: var(--paper-light); }
.detail-panel h3 { margin: .2rem 0 .8rem; font-size: clamp(2rem, 4vw, 3.7rem); letter-spacing: -.03em; }
.english-name { color: var(--blue); font: .88rem/1.4 var(--utility); overflow-wrap: anywhere; }
.alias-line, .category-line { color: var(--muted); font-size: .84rem; }
.scenario { margin: 1.4rem 0; padding: 1.1rem; border: 1px solid var(--ink); background: var(--paper); }
.quiz { display: grid; gap: .65rem; }
.quiz-option { width: 100%; min-height: 52px; padding: .75rem 1rem; border: 1px solid var(--ink); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.quiz-option:hover { background: #fff; }
.quiz-option.is-wrong { border-color: var(--red); background: #f3d5d6; }
.quiz-option.is-correct { border-color: #2f7057; background: #dbeadf; }
.answer-explanation { margin-top: 1rem; padding: 1rem; border-left: 5px solid var(--blue); background: #e9eef0; }
.source-list { margin: 1rem 0 0; padding-left: 1.2rem; font-size: .8rem; overflow-wrap: anywhere; }
.pending { padding: 1.2rem; border: 1px dashed var(--ink); background: var(--paper); }
.empty-state { padding: 2rem; border: 1px dashed var(--ink); }
.hidden { display: none !important; }
.about-section { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 7vw, 8rem); }
.about-copy { max-width: 48rem; }
.text-button { margin-top: 1rem; text-decoration: underline; text-underline-offset: 4px; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem clamp(1rem, 6vw, 6rem); background: var(--ink); color: var(--paper-light); font-size: .8rem; }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-right: 0; }
  .stat:nth-child(-n+3) { border-bottom: 1px solid var(--ink); }
  .toolbar, .catalog-layout { grid-template-columns: 1fr; }
  .detail-panel { position: static; min-height: 0; }
  .detail-panel { order: -1; }
}
@media (max-width: 680px) {
  .site-header { position: static; align-items: flex-start; padding-top: .8rem; padding-bottom: .8rem; }
  nav { display: none; }
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .hero-figure { border-left: 0; border-top: 1px solid var(--ink); }
  h1 { font-size: clamp(3rem, 15vw, 5rem); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 112px; border-bottom: 1px solid var(--ink); }
  .stat:nth-child(odd) { border-right: 1px solid var(--ink); }
  .stat:nth-child(even) { border-right: 0; }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
  .concept-list { grid-template-columns: 1fr; max-height: none; overflow: visible; }
  .about-section { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
