/* 名づけラボ — a phonetics notebook: cool paper, ink, one teal accent, dictionary-entry typography. */
:root {
  color-scheme: light;
  --paper: #f2f4f0;
  --surface: #ffffff;
  --surface-2: #f7f8f5;
  --ink: #16201c;
  --ink-2: #46524d;
  --muted: #76827c;
  --line: #d9dfd9;
  --line-2: #e8ece7;
  --accent: #0b6b66;
  --accent-ink: #ffffff;
  --accent-soft: #e0efec;
  --track: #e6ebe6;
  --good: #1d7f48;
  --ok: #4f7a2a;
  --warn: #a66708;
  --bad: #b8352b;
  --good-soft: #e3f2e8;
  --warn-soft: #fbf0dc;
  --bad-soft: #f9e4e1;
  --target: #16201c;
  --shadow: 0 1px 2px rgba(22, 32, 28, 0.06), 0 4px 16px rgba(22, 32, 28, 0.05);
  --radius: 10px;
  --font-body: "IBM Plex Sans JP", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  --font-display: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0f1412;
    --surface: #171e1b;
    --surface-2: #1c2421;
    --ink: #e6ece9;
    --ink-2: #b3bfb9;
    --muted: #84918b;
    --line: #2b3632;
    --line-2: #222b28;
    --accent: #43b8ad;
    --accent-ink: #0f1412;
    --accent-soft: #19302d;
    --track: #25302c;
    --good: #4cc27d;
    --ok: #9ccf62;
    --warn: #e6a83d;
    --bad: #f07a6f;
    --good-soft: #17301f;
    --warn-soft: #33280f;
    --bad-soft: #3a1c19;
    --target: #e6ece9;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1412;
  --surface: #171e1b;
  --surface-2: #1c2421;
  --ink: #e6ece9;
  --ink-2: #b3bfb9;
  --muted: #84918b;
  --line: #2b3632;
  --line-2: #222b28;
  --accent: #43b8ad;
  --accent-ink: #0f1412;
  --accent-soft: #19302d;
  --track: #25302c;
  --good: #4cc27d;
  --ok: #9ccf62;
  --warn: #e6a83d;
  --bad: #f07a6f;
  --good-soft: #17301f;
  --warn-soft: #33280f;
  --bad-soft: #3a1c19;
  --target: #e6ece9;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.7 var(--font-body);
  font-feature-settings: "palt" 0;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.35; text-wrap: balance; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.opt { color: var(--muted); font-weight: 400; font-size: 0.8rem; margin-left: 0.3em; }
.hint { color: var(--muted); font-size: 0.82rem; }
.lead { color: var(--ink-2); font-size: 0.9rem; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.masthead-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  align-self: center;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.04em; }
.brand-sub { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-left: auto; }
.tabs button {
  border: 0;
  background: none;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
}
.tabs button:hover { background: var(--line-2); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tabs .count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-left: 2px;
}
.tabs button[aria-selected="true"] .count { background: var(--accent); color: var(--accent-ink); }

main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; }
.page-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.page-title span { font-size: 0.82rem; font-weight: 400; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 980px) {
  .split { grid-template-columns: 360px minmax(0, 1fr); align-items: start; }
  .split > .inputs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); max-height: calc(100vh - 90px); overflow-y: auto; }
}

/* ---------- forms ---------- */
.inputs {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field.row2 > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
label, legend { font-size: 0.85rem; font-weight: 500; color: var(--ink-2); padding: 0; }
input[type="text"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
textarea { resize: vertical; line-height: 1.6; }
#name { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; padding: 6px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.lang-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-chips label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 400;
  background: var(--surface-2);
}
.lang-chips input { accent-color: var(--accent); margin: 0; }
.lang-chips label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
details.more { border-top: 1px solid var(--line-2); padding-top: 10px; }
details.more > summary { cursor: pointer; font-size: 0.88rem; font-weight: 500; color: var(--ink-2); list-style-position: outside; }
details.more[open] > summary { margin-bottom: 10px; }
.targets { display: flex; flex-direction: column; gap: 10px; }
.target-row { display: grid; grid-template-columns: 1fr; gap: 4px; }
.target-row .ends { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 3px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  text-align: center;
  padding: 3px 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}
.seg label.none span { padding: 3px 8px; font-family: var(--font-body); }
.seg input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.weights { display: flex; flex-direction: column; gap: 6px; }
.weights label { display: grid; grid-template-columns: 7.5em 1fr 2.5em; align-items: center; gap: 8px; font-weight: 400; }
.weights input { accent-color: var(--accent); width: 100%; }
.weights output { font-family: var(--font-mono); text-align: right; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 3px 9px; font-size: 0.8rem; }
.btn.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- results ---------- */
.results { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card > h2, .section-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card > h2 .sub, .section-title .sub { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; }
.error { color: var(--bad); background: var(--bad-soft); border-radius: 8px; padding: 10px 12px; }
.notice { color: var(--ink-2); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; }

/* specimen: the name set as a dictionary entry */
.specimen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 720px) { .specimen { grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); } }
.entry { min-width: 0; }
.headword { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.15; word-break: break-word; }
.headword .dot { color: var(--accent); padding: 0 0.04em; }
.pron { font-family: var(--font-mono); color: var(--ink-2); margin-top: 4px; font-size: 1rem; word-break: break-all; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 12px 0 0; font-size: 0.86rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; word-break: break-word; }
.facts .zh { font-family: "Noto Serif SC", "Songti SC", "SimSun", var(--font-display); }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 0.75rem; padding: 1px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.tag.switch { cursor: pointer; border: 1px solid var(--line); background: var(--surface); }
.scorebox { display: flex; flex-direction: column; gap: 10px; padding-left: 0; }
@media (min-width: 720px) { .scorebox { border-left: 1px solid var(--line-2); padding-left: 16px; } }
.total { display: flex; align-items: baseline; gap: 10px; }
.total .big { font-family: var(--font-mono); font-size: 3.2rem; font-weight: 500; line-height: 1; }
.total .of { color: var(--muted); font-family: var(--font-mono); }
.total .grade { font-weight: 700; }
.catmeters { display: flex; flex-direction: column; gap: 8px; }
.catmeter { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 0.82rem; }
.catmeter .name { color: var(--ink-2); }
.catmeter .val { font-family: var(--font-mono); }
.catmeter .meter { grid-column: 1 / -1; }

.meter { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter.good > span { background: var(--good); }
.meter.ok > span { background: var(--ok); }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }

.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 0.72rem; font-weight: 500; padding: 0 7px; border-radius: 999px; white-space: nowrap; line-height: 1.6; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.ok { background: var(--good-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.na { background: var(--line-2); color: var(--muted); }
.chip.cat { background: var(--ink); color: var(--paper); font-family: var(--font-mono); }
.chip.ev { background: var(--accent-soft); color: var(--accent); }

/* advice */
.headline { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; line-height: 1.55; }
.abstract { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.abstract article { border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.abstract h3 { font-size: 0.9rem; margin-bottom: 4px; }
.abstract p { font-size: 0.86rem; color: var(--ink-2); }
.strengths { margin-top: 12px; font-size: 0.86rem; color: var(--ink-2); }
.strengths b { color: var(--good); font-weight: 500; }

/* revision candidates */
.variants { display: flex; flex-direction: column; }
.variant { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.variant:first-child { border-top: 0; }
.variant .vname { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-align: left; }
.variant .vname:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.variant .vkana { color: var(--muted); font-size: 0.8rem; margin-left: 6px; }
.variant .why { font-size: 0.84rem; color: var(--ink-2); grid-column: 1 / 2; }
.variant .vscore { text-align: right; font-family: var(--font-mono); }
.variant .vscore .d { display: block; font-size: 0.8rem; }
.up { color: var(--good); }
.down { color: var(--bad); }
.variant .gains { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.variant .vact { grid-column: 2; grid-row: 2 / span 2; display: flex; gap: 4px; align-items: start; justify-content: end; }

.concrete { display: flex; flex-direction: column; gap: 12px; }
.concrete article { border-left: 3px solid var(--line); padding-left: 12px; }
.concrete article.bad { border-left-color: var(--bad); }
.concrete article.warn { border-left-color: var(--warn); }
.concrete h3 { font-size: 0.92rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.concrete h3 .num { color: var(--muted); font-weight: 400; font-size: 0.82rem; }
.concrete ol { margin: 4px 0 0; padding-left: 1.3em; font-size: 0.86rem; color: var(--ink-2); }
.concrete .ex { font-size: 0.84rem; margin-top: 4px; }

/* sound image */
.axes { display: flex; flex-direction: column; gap: 12px; }
.axis .labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-2); }
.axis .track { position: relative; height: 22px; margin: 2px 8px 0; }
.axis .track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--track); border-radius: 1px; }
.axis .tick { position: absolute; top: 6px; width: 1px; height: 10px; background: var(--line); }
.axis .tick.mid { background: var(--muted); height: 14px; top: 4px; }
.axis .dot { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); }
.axis .aim { position: absolute; top: 2px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; border: 2px dashed var(--target); background: transparent; }
.axis .desc { font-size: 0.78rem; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 0.78rem; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }
.legend .l-dot { background: var(--accent); }
.legend .l-aim { border: 2px dashed var(--target); }

/* item lists */
.catblock { display: flex; flex-direction: column; }
.cathead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cathead h2 { font-size: 1.02rem; }
.cathead .catscore { margin-left: auto; font-family: var(--font-mono); font-size: 1.3rem; }
.cathead p { width: 100%; font-size: 0.8rem; color: var(--muted); }
.item { border-bottom: 1px solid var(--line-2); }
.item > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) 90px 2.6em 5.6em; gap: 10px; align-items: center; padding: 9px 0; }
.item > summary::-webkit-details-marker { display: none; }
.item > summary .t { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.item > summary .t .id { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); flex: none; }
.item > summary .t .title { font-size: 0.9rem; }
.item > summary .t .title::after { content: " ＋"; color: var(--muted); font-size: 0.75rem; }
.item[open] > summary .t .title::after { content: " −"; }
.item > summary .s { font-family: var(--font-mono); text-align: right; }
.item > summary .c { text-align: right; }
.item.na > summary { color: var(--muted); }
.item .body { padding: 0 0 12px 0; font-size: 0.85rem; display: flex; flex-direction: column; gap: 8px; }
.item .desc { color: var(--ink-2); }
.findings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.findings li { display: grid; grid-template-columns: 1.2em minmax(0, 1fr); gap: 4px; }
.findings li::before { font-family: var(--font-mono); font-weight: 500; }
.findings li.good::before { content: "✓"; color: var(--good); }
.findings li.warn::before { content: "!"; color: var(--warn); }
.findings li.bad::before { content: "×"; color: var(--bad); }
.findings li.info::before { content: "·"; color: var(--muted); }
.findings .fix { display: block; color: var(--accent); font-size: 0.8rem; }
.method { color: var(--muted); font-size: 0.8rem; }
.refs { font-size: 0.76rem; color: var(--muted); margin: 0; padding-left: 1.1em; }
.rating { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.rating button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  min-width: 3.9em; padding: 4px 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; line-height: 1.25;
}
.rating button b { font-family: var(--font-mono); font-weight: 500; font-size: 0.95rem; }
.rating button small { font-size: 0.68rem; color: var(--muted); }
.rating button:hover { border-color: var(--accent); }
.rating button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rating button[aria-pressed="true"] small { color: inherit; opacity: 0.85; }
.rating .clear { min-width: 0; font-size: 0.78rem; color: var(--muted); border-style: dashed; }
.q-inline { color: var(--ink); font-weight: 500; }

/* self-rating: call to action in the score box, and the card right below the name */
.self-cta {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; text-align: left; width: 100%;
  border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-size: 0.82rem;
}
.self-cta .n { grid-row: span 2; font-family: var(--font-mono); font-size: 1.15rem; color: var(--accent); font-weight: 500; }
.self-cta .go { color: var(--accent); font-weight: 700; }
.self-cta:hover { filter: brightness(0.97); }
.self-status { font-size: 0.82rem; color: var(--good); }
.self-card { border: 1.5px solid var(--accent); }
.self-card.complete { border-color: var(--line); }
.self-card > summary { cursor: pointer; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.self-card > summary::-webkit-details-marker { display: none; }
.self-card > summary h2 { display: flex; align-items: baseline; gap: 10px; }
.self-card > summary .sub { font-size: 0.8rem; color: var(--muted); }
.self-card .progress { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 0 9px; }
.self-card.complete .progress { background: var(--good-soft); color: var(--good); }
.self-card > summary::after { content: "閉じる"; align-self: flex-end; font-size: 0.75rem; color: var(--muted); margin-top: -1.4em; }
.self-card:not([open]) > summary::after { content: "開く"; }
.self-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.self-list li { display: flex; flex-direction: column; gap: 6px; }
.self-list .q { font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.self-list .qn { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); font-weight: 500; }
.self-list .effect { font-size: 0.78rem; color: var(--good); }

/* trademark check */
.card h3 .sub { font-size: 0.76rem; color: var(--muted); font-weight: 400; margin-left: 6px; }
.tm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 14px; }
@media (min-width: 720px) { .tm-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.tm-grid h3 { margin-bottom: 8px; font-size: 0.92rem; }
.tm-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; align-items: start; margin-bottom: 8px; }
.tm-row .lbl { font-size: 0.8rem; color: var(--muted); padding-top: 3px; }
.pill.copy { font-family: var(--font-display); font-weight: 700; }
.pill.copy .m { font-family: var(--font-body); font-weight: 400; }
.classes { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.classes b { font-family: var(--font-mono); font-weight: 500; margin-right: 8px; color: var(--accent); }
.tm-dbs-h { font-size: 0.92rem; margin-bottom: 6px; }
.tm-dbs { margin: 0 0 10px; padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; font-size: 0.86rem; }
.tm-dbs .db { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.tm-dbs .db a:first-child { font-weight: 500; }
.tm-dbs .help { font-size: 0.78rem; }
.tm-dbs .steps { color: var(--ink-2); font-size: 0.8rem; }
.tm-sim { font-size: 0.84rem; background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.tm-sim b { font-weight: 500; }
.lang-issues { margin: 0; }

/* ---------- ideas ---------- */
#idea-fields { display: flex; flex-direction: column; gap: 12px; }
.example-note { font-size: 0.78rem; color: var(--warn); }
.layers { display: flex; flex-direction: column; gap: 10px; }
.layer { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; align-items: start; }
.layer .lname { font-size: 0.8rem; color: var(--muted); padding-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.84rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 1.6;
}
.pill:hover { border-color: var(--accent); }
.pill.concept { background: var(--accent-soft); border-color: transparent; color: var(--ink); font-weight: 500; text-decoration: none; }
.pill.word { border-style: dashed; }
.pill .m { color: var(--muted); font-size: 0.74rem; margin-left: 4px; }
.pill.added { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill.added .m { color: inherit; opacity: 0.75; }
.chain { font-size: 0.86rem; color: var(--ink-2); }
.chain .arrow { color: var(--muted); padding: 0 4px; }
.chain b { color: var(--ink); font-weight: 500; }
.essences { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.essence { border: 1px solid var(--ink); border-radius: 8px; padding: 4px 10px; font-weight: 500; }
.essence .n { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); margin-left: 4px; }
.concept-card { border-top: 1px solid var(--line-2); padding: 10px 0; }
.concept-card > summary { cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.concept-card > summary .layers-of { font-weight: 400; font-size: 0.76rem; color: var(--muted); }
.concept-card .rows { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.concept-card .row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 8px; font-size: 0.85rem; }
.concept-card .row > span:first-child { color: var(--muted); font-size: 0.8rem; padding-top: 3px; }
.prompts { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.prompts .hints { display: block; font-size: 0.8rem; color: var(--muted); }
.bin { display: flex; flex-direction: column; gap: 10px; }
.bin .chips { min-height: 34px; padding: 6px; border: 1px dashed var(--line); border-radius: 8px; }
.bin-add { display: flex; gap: 6px; }
.bin-add input { flex: 1; }
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.cand { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); }
.cand .top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.cand .cname { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-align: left; word-break: break-all; }
.cand .cname:hover { color: var(--accent); }
.cand .cscore { font-family: var(--font-mono); }
.cand .recipe { font-size: 0.76rem; color: var(--muted); }
.cand .cact { display: flex; gap: 4px; margin-top: 4px; }
.strategies { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.strategy { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font-size: 0.82rem; }
.strategy h3 { font-size: 0.9rem; }
.strategy .ex { color: var(--ink-2); }
.strategy .pc { color: var(--muted); }

/* ---------- compare ---------- */
.compare-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.bulk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; width: min(100%, 420px); }
.bulk label { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.compare { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 640px; }
table.compare th, table.compare td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
table.compare th { font-size: 0.78rem; color: var(--muted); font-weight: 500; cursor: pointer; user-select: none; }
table.compare th[aria-sort="descending"]::after { content: " ↓"; }
table.compare th[aria-sort="ascending"]::after { content: " ↑"; }
table.compare .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.compare td.nm { font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
table.compare td.nm button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--ink); }
table.compare td.nm button:hover { color: var(--accent); }
table.compare .bar { display: inline-block; width: 44px; height: 6px; border-radius: 3px; background: var(--track); vertical-align: middle; margin-right: 6px; overflow: hidden; }
table.compare .bar span { display: block; height: 100%; background: var(--accent); }
table.compare tr.best td.nm::after { content: "最高点"; font-family: var(--font-body); font-size: 0.68rem; font-weight: 500; color: var(--good); background: var(--good-soft); padding: 0 6px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
table.compare .ex-tag { font-family: var(--font-body); font-size: 0.68rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 6px; font-weight: 400; }
.empty { color: var(--muted); padding: 20px 0; }

/* ---------- criteria ---------- */
.criteria { display: flex; flex-direction: column; gap: 18px; max-width: 900px; }
.criteria .intro p { color: var(--ink-2); font-size: 0.9rem; margin-top: 6px; }
.crit { border-top: 1px solid var(--line-2); padding: 10px 0; display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 4px 10px; }
.crit .id { font-family: var(--font-mono); color: var(--muted); font-size: 0.8rem; padding-top: 2px; }
.crit h3 { font-size: 0.95rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.crit p { font-size: 0.85rem; color: var(--ink-2); grid-column: 2; }
.crit .method, .crit .refs { grid-column: 2; }
ol.biblio { font-size: 0.8rem; color: var(--ink-2); padding-left: 1.6em; display: flex; flex-direction: column; gap: 4px; }

/* ---------- misc ---------- */
.foot { max-width: 1240px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 0.78rem; }
.copy-panel { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); display: grid; place-items: center; z-index: 30; padding: 16px; }
.copy-box { background: var(--surface); border-radius: var(--radius); padding: 16px; width: min(640px, 100%); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  z-index: 40;
  box-shadow: var(--shadow);
}
@media (max-width: 520px) {
  .tm-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rating button { min-width: 0; flex: 1 1 0; }
  .item > summary { grid-template-columns: minmax(0, 1fr) 54px 2.4em; }
  .item > summary .c { display: none; }
  .layer { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .concept-card .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .field.row2 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .meter > span { transition: width 0.35s ease; }
  .axis .dot { transition: left 0.35s ease; }
}

/* ---------- public site: navigation, articles, PR and ads ---------- */
.tabs a {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.tabs a:hover { background: var(--line-2); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.site-nav ul { list-style: none; margin: 0 0 12px; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.84rem; }
.site-nav a { color: var(--ink-2); }
.foot p + p { margin-top: 4px; }
.article-main { max-width: 820px; }
.crumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 36px); line-height: 1.85; }
.article h1 { font-family: var(--font-display); font-size: clamp(1.45rem, 4vw, 1.9rem); line-height: 1.45; margin-bottom: 14px; }
.article h2 { font-size: 1.2rem; margin: 34px 0 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.article h3 { font-size: 1rem; margin: 20px 0 6px; }
.article p { margin: 0 0 12px; max-width: 42em; }
.article ul, .article ol { margin: 0 0 14px; padding-left: 1.4em; max-width: 42em; }
.article li { margin-bottom: 4px; }
.article .lead { font-size: 1rem; color: var(--ink-2); }
.article .refs { font-size: 0.76rem; color: var(--muted); }
.article .facts { max-width: 42em; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; line-height: 1.6; }
.doc-table th, .doc-table td { border-bottom: 1px solid var(--line-2); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc-table thead th { font-size: 0.78rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.doc-table tbody th { font-weight: 500; white-space: nowrap; }
.num-table td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.doc-table .nm { font-family: var(--font-display); font-weight: 700; }
.article .table-wrap { margin: 0 0 14px; border-radius: 8px; }
.guide-list { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 14px; }
.guide-list a { font-weight: 700; font-size: 1.02rem; }
.guide-list p { color: var(--ink-2); font-size: 0.88rem; margin: 2px 0 0; }
.cta { margin-top: 22px !important; }
.cta .btn { text-decoration: none; display: inline-block; padding: 10px 18px; font-size: 0.95rem; }
.crit-doc { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 12px; }
.crit-doc h3 { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.crit-doc .tip { font-size: 0.9rem; }
.crit-doc .tip b { color: var(--accent); font-weight: 500; margin-right: 6px; }
.todo { color: var(--bad); }
.pr { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 14px 0; background: var(--surface-2); font-size: 0.86rem; }
.pr-head { margin: 0 0 6px !important; color: var(--muted); font-size: 0.78rem; }
.pr-label { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; border: 1px solid var(--muted); border-radius: 4px; padding: 0 5px; margin-right: 6px; color: var(--ink-2); }
.pr ul { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 6px; }
.pr li span { display: block; color: var(--ink-2); font-size: 0.8rem; }
.pr img { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ad { margin: 18px 0; min-height: 100px; }
.ad-label { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; }
#tool-ad { margin-top: 20px; }
