/* ==========================================================================
   Zormeki 本体スタイル（2026-07-30 全面設計）

   設計の柱
   1. 日本語の組版を最優先する。辞典は文字が主役なので、字送り（palt）・行間・
      1行の文字数を数値で決める。ここが見た目の8割を決める
   2. 定義の一文を「囲み」から出す。あれは注意書きの見た目で、本文の主役を
      注釈のように見せていた。囲みを外して大きな文字にする
   3. 強調色は1画面に1つまで。塗りを減らし、罫線を細くする
   4. 明暗2モードは色の置き換えだけで成立させる（要素ごとの分岐を作らない）
   ========================================================================== */

:root {
  /* ---- 色（観測所の緑・明るいモード） ---- */
  --bg: #FBFDFC;
  --surface: #F2F7F5;
  --surface-2: #E7F0EC;
  --line: #DCE7E2;
  --line-strong: #C4D5CE;
  --text: #101A17;
  --text-sub: #566661;
  --accent: #0A6A56;
  --accent-2: #0E8F86;
  --accent-soft: #E3F1EB;
  --ng: #B4231D;
  --ng-soft: #FBEEEC;
  --warn: #8A5A00;
  --warn-bg: #FBF4E4;
  --warn-line: #E6D5AC;
  --on-accent: #FFFFFF;

  /* ---- 寸法 ---- */
  --measure: 40em;          /* 本文の幅。全角で約40字＝日本語で読みやすい上限 */
  --measure-wide: 46em;     /* 図・表はここまで広げる */
  --radius: 14px;
  --radius-sm: 9px;

  /* ---- 余白（4の倍数で統一する） ---- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1512;
    --surface: #16201C;
    --surface-2: #1D2A25;
    --line: #283630;
    --line-strong: #3A4C45;
    --text: #E8F1ED;
    --text-sub: #9FB2AB;
    --accent: #4FD1AE;       /* #63E6BE より彩度を落とす。ネオンにしない */
    --accent-2: #46C9C4;
    --accent-soft: #17302A;
    --ng: #FF9A8F;
    --ng-soft: #2A1A18;
    --warn: #E3C176;
    --warn-bg: #241E12;
    --warn-line: #4A3D22;
    --on-accent: #062019;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
               "Yu Gothic Medium", system-ui, -apple-system, sans-serif;
  /* palt = 仮名の字送りを詰める。日本語の見た目が最も変わる1行 */
  font-feature-settings: "palt" 1;
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: 0.01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
strong, b { font-weight: 700; }

/* ── 全体の器 ───────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0 var(--s4) var(--s8);
}
.wrap > * { max-width: var(--measure); }
.wrap > .secfig,
.wrap > .figure,
.wrap > .adslot,
.wrap > figure,
.wrap > table,
.wrap > .facts-wrap { max-width: var(--measure-wide); }

/* ── ヘッダー ───────────────────────────────────────────── */

.site {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.site-inner {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: var(--s3) var(--s4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logomark { width: 28px; height: 28px; flex: 0 0 auto; display: block; }
.logomark.big { width: 60px; height: 60px; margin: 0 auto var(--s4); }
.logotext { display: flex; flex-direction: column; line-height: 1.3; }
.logotext .name { font-size: 18px; font-weight: 700; letter-spacing: -0.005em; }
.logotext small { font-size: 11px; font-weight: 400; color: var(--text-sub); letter-spacing: 0.02em; }

/* ── 語ページの冒頭 ─────────────────────────────────────── */

.crumb {
  font-size: 12.5px; color: var(--text-sub);
  padding-top: var(--s5); margin-bottom: var(--s4);
  letter-spacing: 0.02em;
}
.crumb a { color: var(--text-sub); }

.genrechip {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 3px 12px;
  margin-bottom: var(--s3);
}

h1 {
  font-size: clamp(31px, 8.4vw, 44px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.022em;
  margin: 0;
}
h1 .yomi {
  display: block;
  font-size: clamp(13px, 3.4vw, 15px);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--text-sub);
  margin-top: var(--s2);
}

/* 何の略か。字ごとに枠を置き、拾った字だけ強調する */
.abbr-box {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px;
  margin: var(--s5) 0 0;
}
.abbr-box .seg {
  font-size: clamp(15px, 4.2vw, 18px); font-weight: 600;
  padding: 4px 7px; border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--text-sub);
}
.abbr-box .seg.hit {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-soft); font-weight: 700;
}
.abbr-box .eq { font-size: 13px; color: var(--text-sub); margin-left: var(--s1); }

/* 定義の一文。囲みを外し、本文より大きくする＝ここが主役 */
.lead {
  font-size: clamp(17px, 4.6vw, 20px);
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: 0.005em;
  margin: var(--s5) 0 0;
}
.lead::before {
  content: "";
  display: block; width: 38px; height: 3px;
  background: var(--accent); border-radius: 2px;
  margin-bottom: var(--s4);
}
.readtime {
  font-size: 12.5px; color: var(--text-sub);
  margin: var(--s4) 0 var(--s6);
  letter-spacing: 0.02em;
}

/* ── 見出しと本文 ───────────────────────────────────────── */

h2 {
  font-size: clamp(19px, 5vw, 23px);
  font-weight: 700; line-height: 1.45; letter-spacing: -0.012em;
  margin: var(--s7) 0 var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}
h3 {
  font-size: 16.5px; font-weight: 700; line-height: 1.6;
  letter-spacing: -0.005em;
  margin: var(--s6) 0 var(--s3);
}
p { margin: 0 0 var(--s4); }
ul, ol { margin: 0 0 var(--s4); padding-left: 1.35em; }
li { margin-bottom: var(--s2); }
li::marker { color: var(--accent); }

.rule {
  font-size: 13.5px; color: var(--text-sub); line-height: 1.85;
}
.src { font-size: 13px; color: var(--text-sub); }

/* ── 目次 ─────────────────────────────────────────────── */

.toc {
  margin: var(--s6) 0;
  padding: var(--s4) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.toc > b {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; color: var(--text-sub);
  margin-bottom: var(--s3);
}
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0; }
.toc a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 5px 0; font-size: 14.5px; line-height: 1.6;
  text-decoration: none; color: var(--text);
}
.toc a::before {
  content: counter(toc);
  flex: 0 0 1.6em; text-align: right;
  font-size: 12px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--accent); }
@media (min-width: 620px) {
  .toc ol { columns: 2; column-gap: var(--s6); }
}

/* 目次へ。見出しごとに13回置くと雑音になり、画面に浮かせると本文に重なる。
   すでに固定表示のヘッダーに1つだけ置く */
.tocjump {
  flex: 0 0 auto;
  font-size: 12.5px; font-weight: 700; text-decoration: none;
  color: var(--text-sub); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 6px 14px;
}
.tocjump:hover { color: var(--accent); border-color: var(--accent); }

/* ── 図 ───────────────────────────────────────────────── */

.secfig, .figure { margin: var(--s5) 0; }
.secfig svg, .figure svg {
  width: 100%; height: auto; display: block;
  max-width: 460px;
  border-radius: var(--radius);
}
.figcap {
  font-size: 12.5px; line-height: 1.75; color: var(--text-sub);
  margin-top: var(--s2); max-width: 460px;
}
.figcap .fignum { color: var(--accent); font-weight: 700; }

/* 図の中で使う色と線。細くして塗りを減らす */
.figure svg text, .secfig svg text {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
               system-ui, sans-serif;
  font-feature-settings: "palt" 1;
}
.dg-bg    { fill: var(--surface); }
.dg-box   { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1.25; }
.dg-chip  { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.25; }
.dg-fill  { fill: var(--accent); }
.dg-line  { stroke: var(--text-sub); stroke-width: 1.6; fill: none; }
.dg-thin  { stroke: var(--line-strong); stroke-width: 1.25; fill: none; }
.dg-t     { fill: var(--text); font-weight: 700; }
.dg-ts    { fill: var(--text-sub); font-weight: 500; }
.dg-on    { fill: var(--on-accent); font-weight: 700; }
.dg-ac    { fill: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums;
            letter-spacing: -0.02em; }
.dg-skin  { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.25; }
.dg-ng-box{ fill: var(--ng-soft); stroke: var(--ng); stroke-width: 1.25; }
.dg-ng-t  { fill: var(--ng); font-weight: 700; font-variant-numeric: tabular-nums; }
.dg-warn-box { fill: var(--warn-bg); stroke: var(--warn-line); stroke-width: 1.25; }

/* ── 表 ───────────────────────────────────────────────── */

.facts-wrap {
  overflow-x: auto;
  margin: var(--s4) 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
table.facts {
  width: max-content; min-width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 14.5px; line-height: 1.8;
  margin: 0;
}
table.facts th, table.facts td {
  padding: 11px 13px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
  /* 列を潰さず、はみ出す分は横スクロールさせる。潰すと日本語が1字ずつ折れる */
  min-width: 8.5em;
}
table.facts th:first-child, table.facts td:first-child { min-width: 10em; }
table.facts thead th {
  font-size: 13px; font-weight: 700; color: var(--text-sub);
  background: var(--surface); white-space: nowrap;
  letter-spacing: 0.02em;
}
table.facts tbody th {
  font-weight: 700; background: var(--surface);
  white-space: nowrap; color: var(--text);
}
table.facts tr:last-child th, table.facts tr:last-child td { border-bottom: 0; }

/* ── 広告枠 ───────────────────────────────────────────── */

.adslot.filled {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: var(--s4);
  margin: var(--s5) 0 var(--s6);
}
.adlabel {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; color: var(--text-sub);
  border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 1px 7px; margin-bottom: var(--s3);
}
.ad-body { display: flex; gap: var(--s4); align-items: flex-start; }
.ad-img {
  width: 76px; height: 76px; border-radius: 12px; flex: 0 0 auto;
  object-fit: cover; border: 1px solid var(--line);
}
.ad-text { min-width: 0; }
.ad-name { display: block; font-size: 16.5px; margin-bottom: var(--s1); }
.ad-text p { margin: 0 0 var(--s3); font-size: 14.5px; line-height: 1.8; }
.ad-link {
  display: inline-block; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 14.5px; text-decoration: none;
  border-radius: 10px; padding: 9px 18px;
}
@media (min-width: 560px) { .ad-img { width: 104px; height: 104px; } }

/* ── 関連する言葉 ───────────────────────────────────────── */

.related { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s4) 0; }
.related a {
  font-size: 14.5px; font-weight: 600; text-decoration: none;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px;
}
.related a:hover { border-color: var(--accent); color: var(--accent); }

/* ── 出典 ─────────────────────────────────────────────── */

.foot {
  margin-top: var(--s7); padding-top: var(--s5);
  border-top: 1px solid var(--line);
}
.foot h3 {
  margin-top: 0; font-size: 13px; letter-spacing: 0.08em;
  color: var(--text-sub);
}
.foot ul { padding-left: 1.2em; font-size: 13.5px; line-height: 1.85; }
.foot li { color: var(--text-sub); }

/* ── 一覧・トップ ───────────────────────────────────────── */

.hero { padding: var(--s7) 0 var(--s5); }
.hero h1 { font-size: clamp(27px, 7.4vw, 38px); }
.hero p { font-size: 16.5px; color: var(--text-sub); margin: var(--s4) 0 0; }

.wordlist { display: grid; gap: var(--s3); margin: var(--s4) 0; }
.wordcard {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: var(--s4);
}
.wordcard a { text-decoration: none; display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.wordcard b { font-size: 19px; color: var(--accent); letter-spacing: -0.01em; }
.wordcard .yomi { font-size: 12.5px; color: var(--text-sub); font-weight: 400; letter-spacing: 0.04em; }
.wordcard p { margin: var(--s2) 0 var(--s3); font-size: 14.5px; line-height: 1.8; color: var(--text); }
.wordcard .genre {
  display: inline-block; font-size: 11.5px; color: var(--text-sub);
  background: var(--surface-2); border-radius: 999px; padding: 2px 10px;
}
@media (min-width: 680px) { .wordlist { grid-template-columns: 1fr 1fr; } }

/* ── ルート（言語の入口） ─────────────────────────────────── */

.langpick { text-align: center; padding-top: var(--s8); }
.langpick h1 { font-size: clamp(32px, 9vw, 46px); }
.langpick .lead { text-align: left; max-width: 30em; margin-inline: auto; }
.langpick .lead::before { margin-inline: auto; }
.langlist { display: grid; gap: var(--s2); margin: var(--s6) auto; max-width: 30em; }
.langrow {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: var(--s4) var(--s5); text-decoration: none;
}
.langrow:hover { border-color: var(--accent); }
.langrow b { font-size: 16.5px; color: var(--accent); }
.langrow span { font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums; }

/* ── 静的ページ・フッター・見本の帯 ────────────────────────── */

.staticpage { padding-top: var(--s5); }
.staticpage h1 { font-size: clamp(25px, 6.6vw, 32px); margin-bottom: var(--s5); }

.sitefoot {
  border-top: 1px solid var(--line);
  margin-top: var(--s8); padding: var(--s5) var(--s4) var(--s8);
  text-align: center; font-size: 12.5px; line-height: 2;
  color: var(--text-sub);
}
.sitefoot p { margin: 0; }
.sitefoot a { color: var(--text-sub); }
.sitefoot a:hover { color: var(--accent); }

.samplebar {
  background: var(--warn-bg); border-bottom: 1px solid var(--warn-line);
  color: var(--warn);
  padding: var(--s3) var(--s4); font-size: 13px; line-height: 1.8;
  text-align: center;
}
.samplebar b { color: var(--warn); }

@media print {
  .site, .tocjump, .adslot, .sitefoot { display: none; }
}

/* ── 申込フォーム ─────────────────────────────────────── */

input[type="text"], input[type="url"], input:not([type]), textarea, select {
  width: 100%; max-width: 30em;
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-top: var(--s1);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
input[type="file"] { font-size: 14px; margin-top: var(--s1); }
label { display: inline-block; margin: var(--s1) 0; }

.btn {
  display: inline-block; background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 700; font-size: 15px;
  border: 0; border-radius: 10px; padding: 11px 20px; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn2 {
  display: inline-block; background: var(--surface); color: var(--accent);
  font: inherit; font-weight: 700; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; margin-top: var(--s1);
}
#m-apply, #m-link, #m-pay { font-weight: 700; }
