:root {
  --paper: #fbf8f3;
  --card: #fffefa;
  --ink: #28221e;
  --muted: #978b83;
  --line: #e9dfd7;
  --red: #a13f3b;
  --soft: #f2ece6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Yu Mincho", "Noto Serif JP", "Songti SC", serif; }
.top { max-width: 880px; margin: auto; padding: 68px 26px 26px; text-align: center; }
.eyebrow { color: var(--red); font: 700 11px/1.5 sans-serif; letter-spacing: .2em; }
.top h1 { margin: 10px 0 8px; font-size: 43px; font-weight: 400; }
.top p { margin: 0; color: var(--muted); font: 13px/1.8 "Microsoft YaHei", sans-serif; }
.directory { position: fixed; right: 0; top: 50%; z-index: 20; display: flex; align-items: center; transform: translateY(-50%) translateX(calc(100% - 34px)); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.directory:hover, .directory:focus-within { transform: translateY(-50%) translateX(0); }
.dir-handle { display: grid; place-items: center; width: 34px; height: 90px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; background: rgba(255,254,250,.95); color: var(--red); box-shadow: -8px 8px 22px rgba(50,36,28,.07); font: 700 11px/1.25 "Microsoft YaHei", sans-serif; writing-mode: vertical-rl; letter-spacing: .14em; }
.dir-panel { width: 235px; min-width: 235px; max-width: 235px; max-height: 72vh; overflow: auto; padding: 10px; background: rgba(255,254,250,.97); border: 1px solid var(--line); border-right: 0; box-shadow: -18px 18px 45px rgba(50,36,28,.12); backdrop-filter: blur(12px); }
.dir-panel a { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; padding: 8px 9px; border-radius: 8px; color: var(--ink); text-decoration: none; transition: .2s; }
.dir-panel a span { color: #b4a69e; font: 10px sans-serif; }
.dir-panel a b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.dir-panel a:hover { background: var(--soft); color: var(--red); transform: translateX(-3px); }
main { max-width: 820px; margin: auto; padding: 34px 26px 100px; }
.grammar-card { scroll-margin-top: 20px; padding: 38px 0 48px; border-bottom: 1px solid var(--line); }
.card-head { display: flex; align-items: baseline; gap: 16px; }
.num { color: #c7b9b0; font: 500 15px sans-serif; letter-spacing: .12em; }
.card-head h2 { margin: 0; color: var(--red); font-size: 32px; font-weight: 500; }
.hook { position: relative; margin: 12px 0 6px 40px; padding-left: 19px; color: #a39992; font: 12px/1.8 "Microsoft YaHei", sans-serif; }
.hook::before { content: "?"; position: absolute; left: 0; top: 0; color: #c2b5ad; font: 700 12px/1.8 sans-serif; }
.answer { position: relative; margin: 4px 0 22px 40px; padding: 7px 12px 7px 18px; border-left: 2px solid rgba(161,63,59,.46); color: #574d47; background: linear-gradient(90deg,rgba(161,63,59,.045),transparent 72%); font: 13px/1.8 "Microsoft YaHei", sans-serif; }
.answer::before { content: "→"; position: absolute; left: 5px; color: var(--red); font-weight: 700; }
.example { margin-left: 40px; padding: 22px 24px; background: var(--card); border-left: 3px solid var(--red); box-shadow: 0 8px 24px rgba(50,36,28,.035); }
.jp { font-size: 21px; line-height: 2.45; }
.jp strong { color: var(--red); font-weight: 800; }
.zh { margin-top: 5px; color: #796e67; font: 13px/1.9 "Microsoft YaHei", sans-serif; }
.zh strong { color: var(--ink); font-weight: 800; }
ruby rt { font-size: .46em; color: var(--muted); font-weight: 400; }
.facts { margin: 20px 0 0 40px; border-top: 1px solid var(--ink); }
.facts > div { display: grid; grid-template-columns: 130px 1fr; gap: 17px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font: 11px/1.8 "Microsoft YaHei", sans-serif; }
dd { margin: 0; font: 12px/1.8 "Microsoft YaHei", sans-serif; }
.form { color: var(--red); font-weight: 800; }
.codes { display: flex; flex-wrap: wrap; gap: 7px; }
code { padding: 2px 7px; border-radius: 5px; background: var(--soft); color: #574d47; font: 12px/1.7 "Yu Gothic", sans-serif; }

@media (max-width: 620px) {
  .top h1 { font-size: 34px; }
  .directory { top: auto; bottom: 18px; transform: translateX(calc(100% - 34px)); }
  .directory:hover, .directory:focus-within { transform: translateX(0); }
  .dir-panel { max-height: 55vh; }
  .grammar-card { padding-top: 28px; }
  .hook, .answer, .example, .facts { margin-left: 0; }
  .facts > div { grid-template-columns: 105px 1fr; }
  .jp { font-size: 19px; }
}
