:root {
  --bg: #efece6;
  --paper: #fffcf8;
  --ink: #1c1915;
  --muted: #6f6a62;
  --faint: #8a847b;
  --line: rgba(28, 25, 22, 0.1);
  --line-strong: rgba(28, 25, 22, 0.18);
  --inset: #f7f4ee;
  --pine: #1f3a34;
  --bronze: #8d7350;
  --up: #9f2d2d;
  --down: #1d6b45;
  --up-dim: rgba(159, 45, 45, 0.08);
  --down-dim: rgba(29, 107, 69, 0.1);
  --bronze-dim: rgba(141, 115, 80, 0.12);
  --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Palatino Linotype", "Songti SC", "STSong", "Noto Serif SC", serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(900px 280px at 50% -40px, rgba(141, 115, 80, 0.08), transparent 70%),
    var(--bg);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.top, .search, .quote, .section, .toc, .doc-end {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 22px 24px 18px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.mark {
  width: 36px;
  height: 36px;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
}
.brand-name, .brand-sub, .brand-en { margin: 0; }
.name-row { display: flex; align-items: center; gap: 8px; }
.brand-name { font-family: var(--serif); font-size: 28px; letter-spacing: 0.18em; line-height: 1; }
.tip { position: relative; display: inline-flex; }
.tip-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--bronze);
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1;
}
.tip-btn:hover, .tip-btn:focus-visible { border-color: var(--ink); color: var(--ink); outline: none; }
.tip-bubble {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(320px, 72vw);
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #f7f4ee;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: 0;
  z-index: 8;
  box-shadow: 0 12px 28px rgba(28, 25, 22, 0.16);
}
.tip:hover .tip-bubble, .tip:focus-within .tip-bubble { display: block; }
.brand-sub { margin-top: 6px; color: var(--muted); font-size: 12px; letter-spacing: 0.22em; }
.brand-en {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.search { margin-top: 16px; padding: 16px; }
.search-row { display: flex; gap: 10px; align-items: end; }
.field { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.field span, .kv-label, .claim-label, .quote-label {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.16em;
}
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.08em;
}
.field input:focus { outline: 2px solid rgba(31, 58, 52, 0.25); border-color: var(--pine); }
.go, .ghost { height: 48px; border-radius: 12px; border: 1px solid transparent; }
.go {
  min-width: 160px;
  padding: 0 18px;
  background: var(--ink);
  color: #f7f4ee;
  letter-spacing: 0.08em;
}
.go:hover { background: #2a2622; }
.ghost {
  padding: 0 14px;
  background: transparent;
  border-color: var(--line-strong);
  color: var(--muted);
}
.ghost:hover { color: var(--ink); border-color: var(--ink); }
.search-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }

.status { min-height: 22px; margin: 14px 4px; color: var(--muted); font-size: 13px; }
.status.error { color: var(--up); }
.status.busy::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 8px;
  background: linear-gradient(90deg, transparent, var(--bronze), transparent);
  background-size: 40% 100%;
  animation: slide 1.4s linear infinite;
}
@keyframes slide {
  from { background-position: -40% 0; }
  to { background-position: 140% 0; }
}

.quote { margin-bottom: 14px; padding: 22px 22px 16px; }
.quote-main { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; }
.quote-name { margin: 0; font-family: var(--serif); font-size: 36px; font-weight: 500; letter-spacing: 0.04em; }
.quote-code { margin: 8px 0 0; color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; }
.quote-pricebox { text-align: right; padding-left: 16px; border-left: 2px solid var(--line-strong); }
.quote-pricebox.up { border-left-color: var(--up); }
.quote-pricebox.down { border-left-color: var(--down); }
.quote-price { font-family: var(--serif); font-size: 40px; font-variant-numeric: tabular-nums; line-height: 0.9; }
.quote-change { margin-top: 8px; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.quote-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 18px; }
.quote-cell, .kv-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--inset);
}
.quote-label { display: block; }
.quote-value, .kv-value, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.quote-value { display: block; margin-top: 6px; font-size: 15px; font-weight: 600; }
.quote-meta, .note, .table-foot, .chart-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.range { margin-top: 16px; }
.bar-svg { display: block; width: 100%; height: auto; }
.range-read { margin: 8px 0 0; font-size: 14px; line-height: 1.65; }
.range-track {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: #e6e0d6;
  overflow: hidden;
}
.range-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--pine);
}
.range-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}
.range-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.toc {
  position: sticky;
  top: 10px;
  z-index: 4;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px;
  backdrop-filter: blur(16px);
}
.toc a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
}
.toc a:hover { color: var(--ink); background: var(--inset); }

.section { margin-bottom: 14px; padding: 22px; scroll-margin-top: 72px; }
.section-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 16px; }
.section-index { font-family: var(--mono); color: var(--bronze); font-size: 12px; letter-spacing: 0.12em; }
.section-title { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 500; }
.section-en { margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; }
.headline { margin: 14px 0 0; font-family: var(--serif); font-size: 30px; line-height: 1.35; font-weight: 500; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  background: #fff;
}
.badge b { font-weight: 640; }
.badge.good { color: var(--down); background: var(--down-dim); border-color: transparent; }
.badge.mid { color: #6d5734; background: var(--bronze-dim); border-color: transparent; }
.badge.bad { color: var(--up); background: var(--up-dim); border-color: transparent; }
.badge.unknown { color: var(--muted); }
.prose { display: grid; gap: 12px; margin-top: 16px; }
.prose p, .claim p, .callout p, .risk p, .final p { margin: 0; line-height: 1.8; white-space: pre-wrap; }
.callout, .claim, .risk, .final, .method {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--inset);
}
.callout, .method, .final { padding: 14px 16px; margin-top: 14px; }
.callout { border-left: 3px solid var(--bronze); background: #fff; }
.flag { display: inline-block; margin-bottom: 8px; color: var(--bronze); font-size: 12px; letter-spacing: 0.04em; }

.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kv-value { display: block; margin-top: 6px; line-height: 1.55; }
.peer-list { display: grid; gap: 0; margin-top: 16px; }
.peer {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.peer:first-child { border-top: 0; }
.peer b { font-weight: 640; }
.peer span { color: var(--muted); font-family: var(--mono); font-size: 12px; margin-left: 8px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--pine);
  font-family: var(--mono);
  font-size: 12px;
}

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chart-card {
  padding: 12px 14px 8px;
  border-radius: 14px;
  background: var(--inset);
}
.chart-card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 640; }

.table-wrap { overflow-x: auto; margin-top: 16px; }
.data { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.data th, .data td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.data th { color: var(--faint); font-size: 12px; font-weight: 640; }
.data col.metric { width: 13%; }
.data col.explain { width: 15%; }
.data col.benchmark { width: 13%; }
.data col.company { width: 13%; }
.data col.peer { width: 10%; }
.data col.judge { width: 16%; }
.data td:first-child, .data th:first-child {
  position: sticky;
  left: 0;
  background: var(--paper);
  z-index: 1;
}
.data td:first-child { font-weight: 640; }
.source-line { display: block; margin-top: 4px; color: var(--faint); font-size: 11px; }
.missing { color: var(--faint); font-style: italic; font-weight: 450; white-space: nowrap; }

.block-list, .risk-list { display: grid; gap: 10px; }
.claim { padding: 14px; }
.claim h3, .risk h3 { margin: 0 0 8px; font-size: 16px; font-family: var(--serif); font-weight: 500; }
.claim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.claim-box { padding: 12px; border-radius: 12px; background: #fff; }
.claim-box.fact { box-shadow: inset 2px 0 0 var(--pine); }
.claim-box.inference { box-shadow: inset 2px 0 0 var(--bronze); }
.claim-box.mixed { box-shadow: inset 2px 0 0 var(--faint); }
.claim-label { display: block; margin-bottom: 6px; }
.absent { margin: 0; color: var(--faint); font-size: 13px; }

.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.col { padding: 14px; border-radius: 14px; background: var(--inset); }
.col h3 { margin: 0 0 8px; font-size: 14px; color: var(--pine); font-weight: 640; }
.col.weak h3 { color: var(--up); }
.col.track h3 { color: var(--bronze); }
.col ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.col li { line-height: 1.65; }
.risk { display: grid; grid-template-columns: 42px 1fr; gap: 8px; padding: 14px; }
.risk-no { font-family: var(--mono); color: var(--bronze); font-size: 13px; }

.doc-end { padding: 12px 16px; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.foot { margin-top: 18px; color: var(--faint); font-size: 12px; line-height: 1.7; }
.foot p { margin: 0; }

.empty { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.empty article {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.empty .idx { font-family: var(--mono); color: var(--bronze); font-size: 12px; }
.empty h2 { margin: 8px 0 6px; font-family: var(--serif); font-size: 20px; font-weight: 500; }
.empty p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.metric-preview { margin-top: 14px; color: var(--faint); font-size: 12px; line-height: 1.7; }

@media (max-width: 860px) {
  .quote-grid, .kv, .empty, .chart-grid { grid-template-columns: repeat(2, 1fr); }
  .claim-grid, .cols-3 { grid-template-columns: 1fr; }
  .peer { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .data { min-width: 880px; table-layout: auto; }
  .shell { width: min(100% - 20px, 1080px); }
  .top, .quote-main, .search-foot, .section-head { flex-direction: column; align-items: flex-start; }
  .section-en, .brand-en { margin-left: 0; }
  .search-row { flex-direction: column; align-items: stretch; }
  .go { width: 100%; }
  .quote-pricebox { text-align: left; border-left: 0; padding-left: 0; }
  .quote-grid, .kv, .empty, .chart-grid { grid-template-columns: 1fr 1fr; }
  .quote-name { font-size: 30px; }
  .headline { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
}
