:root {
  --bg: #e7dece;
  --bg-2: #f7f1e6;
  --card: #fbf7ef;
  --ink: #241c15;
  --muted: #6d6256;
  --line: #ddd2c0;
  --seal: #9c2f2a;
  --pine: #24382c;
  --pine-2: #1b2b22;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #f8f3ea, transparent 55%),
    var(--bg);
  font-family: "WenQuanYi Micro Hei", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans", "Noto Sans JP", "DejaVu Sans", sans-serif;
  line-height: 1.65;
  font-size: 16px;
}
h1, h2, .brand-en, .card-title {
  font-family: Tinos, "Times New Roman", "WenQuanYi Micro Hei", serif;
  font-weight: 400;
  line-height: 1.2;
}
a { color: var(--pine); }
a:hover { color: var(--seal); }
code {
  font-family: "JetBrains Mono", "DejaVu Sans Mono", ui-monospace, monospace;
  font-size: 0.92em;
}
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: white;
  padding: 6px 10px;
}
.skip:focus { top: 8px; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.top { background: rgba(251, 247, 239, 0.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; text-decoration: none; color: inherit; }
.wordmark { display: flex; gap: 8px; align-items: baseline; }
.mark {
  font-family: Tinos, "Times New Roman", "WenQuanYi Micro Hei", serif;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--seal);
  letter-spacing: 0.02em;
}
.brand-en { font-size: 1.35rem; letter-spacing: 0.01em; }
.brand-ja { color: var(--muted); font-size: 13px; letter-spacing: 0.14em; }
.nav, .langs { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }
.nav a, .langs a { text-decoration: none; color: var(--ink); }
.nav a[aria-current="page"], .langs a[aria-current="true"] { border-bottom: 2px solid var(--seal); }
.banner { background: var(--seal); color: #fff8f2; text-align: center; padding: 10px 16px; }
.hero { padding: 56px 0 12px; }
.kicker { letter-spacing: 0.14em; text-transform: none; color: var(--seal); margin: 0 0 8px; font-size: 14px; }
.hero h1, .page-head h1, .record h1, .prose h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); margin: 0 0 12px; }
.lede { max-width: 42rem; font-size: 1.08rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button, button, .do-actions .button {
  display: inline-block; background: var(--pine); color: #f6f1e6; text-decoration: none;
  border: 1px solid var(--pine); padding: 0.55rem 0.95rem; border-radius: 2px; cursor: pointer; font: inherit;
}
.button.secondary, a.secondary { background: transparent; color: var(--pine); }
button:hover, .button:hover { background: var(--pine-2); color: white; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 36px; padding-bottom: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding-bottom: 40px; }
.card {
  display: flex; flex-direction: column; gap: 6px; background: var(--card); color: inherit; text-decoration: none;
  border: 1px solid var(--line); padding: 16px; min-height: 150px;
}
.card:hover { border-color: var(--seal); }
.card-title { font-size: 1.45rem; }
.card-original, .card-meta, .row-meta, .count, .note, .stable { color: var(--muted); }
.tag { display: inline-block; border: 1px solid var(--seal); color: var(--seal); font-size: 12px; letter-spacing: 0.08em; padding: 0 6px; }
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { border-top: 1px solid var(--line); padding: 10px 0; }
.rows a { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.row-title { font-size: 1.05rem; }
.steps { margin: 0; padding-left: 1.1rem; }
.steps li { margin: 0 0 12px; }
.steps span { display: block; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filters label, .sheet label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
input, select, textarea {
  font: inherit; color: inherit; background: white; border: 1px solid #cbbfaa; padding: 8px 10px; min-width: 0;
}
.filters input[type="search"] { min-width: min(100%, 280px); }
.page-head { padding-top: 32px; }
.record { display: grid; grid-template-columns: 1.45fr 0.8fr; gap: 36px; padding: 32px 0 56px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 18px 0; }
.facts div { border-top: 1px solid var(--line); padding-top: 6px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
th { background: #f3ebdd; font-weight: 500; }
.table-wrap { overflow-x: auto; }
.channel { border-left: 3px solid var(--pine); padding-left: 12px; margin: 12px 0; }
figure { margin: 0 0 16px; background: var(--card); border: 1px solid var(--line); }
img { width: 100%; height: auto; display: block; }
figcaption { padding: 8px 10px; color: var(--muted); font-size: 14px; }
.sources { list-style: none; padding: 0; }
.sources li { margin: 0 0 10px; display: flex; flex-direction: column; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cal-layout { display: grid; grid-template-columns: 1.6fr 0.7fr; gap: 22px; padding-bottom: 48px; }
.cal td { height: 96px; width: 14.2%; background: var(--card); }
.cal td.out { background: #f0e7d8; }
.daynum { font-family: Tinos, serif; }
.event { display: block; font-size: 12px; line-height: 1.35; margin-top: 4px; text-decoration: none; }
.cal-side h2 { font-size: 1.15rem; }
.prose { padding: 32px 0 64px; max-width: 760px; }
.glossary { list-style: none; padding: 0; }
.glossary li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.sheet { display: grid; gap: 12px; max-width: 36rem; }
.sheet input, .sheet textarea, .sheet select { width: 100%; }
.hp { position: absolute; left: -10000px; height: 0; overflow: hidden; }
.messages { background: #e7f0e4; border: 1px solid #24523a; padding: 8px 12px; }
.empty { color: var(--muted); }
.foot { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
@media (max-width: 800px) {
  .split, .record, .cal-layout, .facts { grid-template-columns: 1fr; }
  .cal td { height: auto; min-height: 64px; }
  .hero { padding-top: 28px; }
}
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 24px 0; font-size: 14px; }
