:root {
  --ink: #18201d;
  --muted: #58625e;
  --paper: #f5f2e9;
  --card: #fffefa;
  --line: #d7d2c5;
  --accent: #285143;
  --accent-soft: #dfe9e2;
  --answer: #eef4ef;
  font-size: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.page { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 30px 0 72px; }
.site-header { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 0 4px 28px; border-bottom: 1px solid var(--line); }
.brand { margin: 0; color: var(--accent); font-weight: 800; letter-spacing: .04em; }
.brand-note { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }
.set-picker { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .9rem; font-weight: 700; white-space: nowrap; }
select { min-height: 46px; padding: 7px 34px 7px 12px; border: 2px solid var(--accent); border-radius: 6px; color: var(--accent); background: var(--card); font: inherit; font-weight: 700; }
select:focus-visible, summary:focus-visible { outline: 3px solid #bf7a18; outline-offset: 3px; }

.intro { padding: 42px 4px 30px; border-bottom: 2px solid var(--ink); }
.eyebrow { display: inline-block; margin: 0 0 14px; padding: 3px 10px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: .82rem; font-weight: 800; letter-spacing: .08em; }
h1 { margin: 0; font-family: "Songti SC", STSong, Georgia, serif; font-size: clamp(2rem, 7vw, 3.6rem); line-height: 1.16; letter-spacing: -.035em; }
.lede { max-width: 720px; margin: 18px 0 0; color: var(--muted); font-size: 1.08rem; }
.note { margin: 28px 0 36px; padding: 18px 20px; border: 1px solid #c9d6cd; border-left: 5px solid var(--accent); border-radius: 8px; background: var(--card); }
.note strong { color: var(--accent); }
.note p { margin: 0; }

.questions { display: grid; gap: 18px; }
article { padding: 28px 30px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.question-head { display: flex; gap: 16px; align-items: baseline; margin-bottom: 12px; }
.number { flex: 0 0 auto; min-width: 2.25rem; color: var(--accent); font-family: Georgia, serif; font-size: 1.55rem; font-weight: 800; }
h2 { margin: 0; font-size: 1rem; line-height: 1.4; letter-spacing: .05em; }
.problem { margin: 0 0 22px 3.15rem; font-family: "Songti SC", STSong, Georgia, serif; font-size: 1.3rem; line-height: 1.85; }
.formula { display: block; margin: 10px 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.42em; line-height: 1.5; font-variant-numeric: lining-nums tabular-nums; letter-spacing: .015em; }
.exponent { position: relative; top: -.1em; margin-left: .04em; color: var(--accent); font-family: "SF Pro Text", "PingFang SC", sans-serif; font-size: .55em; font-weight: 900; line-height: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }

details { margin-left: 3.15rem; padding-top: 15px; border-top: 1px solid var(--line); }
summary { display: inline-flex; align-items: center; min-height: 48px; padding: 7px 14px; border: 2px solid var(--accent); border-radius: 6px; color: var(--accent); background: #fff; font-weight: 800; cursor: pointer; list-style: none; user-select: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "＋"; margin-right: 8px; font-size: 1.2em; }
details[open] summary::before { content: "－"; }
summary:hover { background: var(--accent-soft); }
.answer { margin-top: 14px; padding: 18px 20px; border-radius: 6px; background: var(--answer); font-size: 1.05rem; }
.answer p { margin: 0 0 9px; }
.answer p:last-child { margin-bottom: 0; }
.feedback { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 20px 0 0 3.15rem; padding-top: 18px; border-top: 1px solid var(--line); }
.feedback-label { color: var(--muted); font-size: .9rem; font-weight: 700; }
.feedback-actions { display: flex; gap: 8px; }
.feedback-button { min-height: 44px; padding: 7px 13px; border: 1px solid #a9b2ad; border-radius: 6px; color: var(--accent); background: #fff; font: inherit; font-size: .9rem; font-weight: 800; cursor: pointer; }
.feedback-button:hover { background: var(--accent-soft); }
.feedback-button:focus-visible { outline: 3px solid #bf7a18; outline-offset: 2px; }
.feedback-button.is-selected { border-color: var(--accent); color: #fff; background: var(--accent); }
.feedback-button:disabled { cursor: wait; opacity: .6; }
.feedback-status { min-height: 1.5em; color: var(--muted); font-size: .84rem; }
.conversation { margin-top: 38px; padding: 30px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.conversation-kicker { margin: 0 0 5px; color: var(--accent); font-size: .82rem; font-weight: 800; letter-spacing: .08em; }
.conversation h2 { margin: 0 0 22px; font-family: "Songti SC", STSong, Georgia, serif; font-size: 1.45rem; letter-spacing: 0; }
.conversation label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .92rem; font-weight: 700; }
.conversation textarea { display: block; width: 100%; min-height: 132px; resize: vertical; padding: 14px 16px; border: 2px solid #a9b2ad; border-radius: 6px; color: var(--ink); background: #fff; font: inherit; line-height: 1.65; }
.conversation textarea:focus { border-color: var(--accent); outline: 3px solid #bf7a18; outline-offset: 2px; }
.comment-submit-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 14px; }
.comment-submit { min-height: 48px; padding: 9px 20px; border: 0; border-radius: 6px; color: #fff; background: var(--accent); font: inherit; font-weight: 800; cursor: pointer; }
.comment-submit:hover { background: #183c31; }
.comment-submit:focus-visible { outline: 3px solid #bf7a18; outline-offset: 2px; }
.comment-submit:disabled { cursor: wait; opacity: .6; }
#comment-status { color: var(--muted); font-size: .9rem; }
footer { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; text-align: center; }

@media (max-width: 620px) {
  :root { font-size: 17px; }
  .page { width: min(100% - 20px, 920px); padding: 20px 0 48px; }
  .site-header { align-items: flex-end; padding-bottom: 20px; }
  .brand-note { display: none; }
  .set-picker { flex-direction: column; align-items: flex-start; gap: 2px; font-size: .78rem; }
  select { min-height: 44px; }
  .intro { padding: 30px 4px 24px; }
  article { padding: 22px 18px; }
  .question-head { gap: 10px; }
  .problem, details, .feedback { margin-left: 0; }
  .problem { margin-top: 16px; font-size: 1.2rem; }
  .formula { font-size: 1.5em; }
  .note { padding: 16px; }
  .feedback { align-items: flex-start; }
  .feedback-label, .feedback-status { width: 100%; }
  .conversation { padding: 22px 18px; }
  .conversation h2 { font-size: 1.3rem; }
  #comment-status { width: 100%; }
}

@media print {
  :root { font-size: 16px; }
  body { background: #fff; }
  .page { width: 100%; padding: 0; }
  .site-header { display: none; }
  article { break-inside: avoid; }
  details { display: none; }
  .feedback, .conversation { display: none; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
