/* ============================================================
   AdXpand ヘルプセンター / リーガル
   ui/advertiser のトンマナ（Noto Sans JP + JetBrains Mono・チャコール/グレージュ・
   小さめ角丸）に準拠。LP（style.css / Orbitron）とは独立。
   ============================================================ */

:root {
  /* ダークは ui/advertiser のダークトークン（ニュートラルなチャコール）に準拠 */
  --bg: #161616;
  --bg2: #1d1d1d;
  --panel: #232323;            /* カード面（advertiser bg-2） */
  --panel-bd: #40523e;         /* 枠線（advertiser border：緑がかったグレー） */
  --ink: #f5f7f8;             /* fg-0 */
  --ink-soft: #d4d8dc;        /* fg-1 */
  --muted: #a6adb5;           /* fg-2 */
  --faint: #767c84;           /* fg-3 */
  --accent: #c8ff00;
  --accent2: #d4ff4d;         /* hover lift */
  --accent-fill: #c8ff00;     /* 塗り用アクセント（CTA 等）。light では vivid lime に切替 */
  --line: #2c2c2c;            /* 内側ディバイダ（控えめ） */
  --sidebar: #1e1e1e;         /* サイドナビ面（advertiser 準拠：ニュートラル・lime は使わない） */
  --sidebar-hover: #2a2a2a;   /* 項目ホバー面 */
  --sidebar-active: #323232;  /* 現在記事の面 */
  --grad: linear-gradient(110deg, #d4ff4d 0%, #c8ff00 52%, #a6d600 100%);
  --font: "Noto Sans JP", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: var(--font);
  background:
    radial-gradient(70% 45% at 50% -8%, rgba(200, 255, 0, 0.04), transparent 62%),
    #161616;
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-fill); color: #161616; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #161616; }
::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }

/* ============ HEADER ============ */
.hc-hud {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(22, 22, 22, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hc-logo img { height: 26px; width: auto; display: block; }
.hc-logo .hc-logo-on-light { display: none; }
.hc-hud-nav { display: flex; gap: 22px; }
/* CTA (.hc-cta) は除外。含めると nav リンクの色(muted)が CTA の暗文字を上書きしてしまう。 */
.hc-hud-nav a:not(.hc-cta) {
  font-family: var(--font); font-size: 14px; letter-spacing: 0.2px;
  color: var(--muted); transition: color 0.25s;
}
.hc-hud-nav a:not(.hc-cta):hover { color: var(--ink); }

/* テーマ切替ボタン */
.hc-theme {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.3px;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--panel-bd); border-radius: 8px;
  cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.hc-theme:hover { color: var(--ink); border-color: rgba(170, 255, 0, 0.4); }
.hc-theme .hc-ico { width: 14px; height: 14px; display: block; }
.hc-theme .hc-ico-moon { display: none; }
html[data-theme="light"] .hc-theme .hc-ico-sun { display: none; }
html[data-theme="light"] .hc-theme .hc-ico-moon { display: block; }

/* 無料アカウント作成 CTA（塗りは accent-fill：light でも視認できる vivid lime）。
   明るいライム地で暗文字が読みづらくならないよう、純黒・14px で可読性を確保する。 */
.hc-cta {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px;
  font-family: var(--font); font-size: 14px; font-weight: 700; letter-spacing: 0.2px;
  color: #0a0a0a; background: var(--accent-fill);
  border-radius: 8px; white-space: nowrap;
  transition: filter 0.2s, transform 0.2s;
}
.hc-cta:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* スマホ: ラベル/テキストnav を隠してヘッダーを「ロゴ＋トグル＋CTA」に圧縮（横はみ出し防止） */
@media (max-width: 560px) {
  .hc-theme-label { display: none; }
  .hc-theme { padding: 0 7px; }
  .hc-hud-nav { gap: 10px; }
  .hc-hud-nav a:not(.hc-cta) { display: none; }
  .hc-cta { padding: 0 11px; }
}

/* ============ HERO（index） ============ */
.hc-hero {
  padding: clamp(56px, 9vw, 110px) clamp(20px, 6vw, 64px) clamp(40px, 6vw, 64px);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.hc-hero-inner { max-width: 760px; margin: 0 auto; }
.hc-tag {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  letter-spacing: 2px; color: var(--accent);
  padding: 6px 12px; border: 1px solid var(--panel-bd); border-radius: 6px;
  background: rgba(200, 255, 0, 0.06); margin-bottom: 22px;
}
.hc-hero h1 {
  font-size: clamp(28px, 4.6vw, 44px); font-weight: 700; line-height: 1.3;
  letter-spacing: 0.2px;
}
.hc-hero p { margin-top: 18px; color: var(--muted); font-weight: 400; font-size: clamp(14px, 1.6vw, 17px); }
.hc-search { margin-top: 30px; }
.hc-search input {
  width: 100%; max-width: 560px;
  font-family: var(--font); font-size: 15px; color: var(--ink);
  padding: 15px 20px;
  background: var(--panel); border: 1px solid var(--panel-bd);
  border-radius: 8px; outline: none; transition: border-color 0.25s, box-shadow 0.25s;
}
.hc-search input::placeholder { color: var(--faint); }
.hc-search input:focus { border-color: rgba(200, 255, 0, 0.55); box-shadow: 0 0 0 3px rgba(200, 255, 0, 0.14); }

/* ============ INDEX グリッド ============ */
.hc-index { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 48px); }
.hc-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.hc-cat {
  background: var(--panel); border: 1px solid var(--panel-bd);
  border-radius: var(--radius); padding: 26px 26px 22px;
  transition: border-color 0.25s, transform 0.25s;
}
.hc-cat:hover { border-color: #52644c; transform: translateY(-2px); }
.hc-cat h2 {
  font-size: 18px; font-weight: 700;
  padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.hc-cat-desc { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-bottom: 14px; }
.hc-cat ul { list-style: none; }
.hc-cat li { margin: 0; }
.hc-cat li a {
  display: block; color: var(--ink-soft); font-size: 14px; font-weight: 500;
  padding: 7px 0 7px 16px; position: relative; transition: color 0.2s;
}
.hc-cat li a::before {
  content: "▸"; position: absolute; left: 0; color: var(--accent);
  opacity: 0.6; font-size: 11px; top: 9px;
}
.hc-cat li a:hover { color: var(--accent); }
/* 本文一致時のスニペット（検索） */
.hc-cat li .hc-hit {
  display: block; margin: 0 0 4px 16px;
  font-size: 12px; line-height: 1.5; color: var(--muted);
}
.hc-cat li .hc-hit mark {
  background: rgba(200, 255, 0, 0.18); color: var(--ink);
  border-radius: 3px; padding: 0 2px;
}
.hc-noresult { text-align: center; color: var(--muted); margin-top: 40px; }

/* ============ 記事レイアウト ============ */
.hc-layout { display: flex; max-width: 1240px; margin: 0 auto; align-items: flex-start; }

/* サイドナビ */
.hc-side {
  flex: 0 0 270px; width: 270px;
  position: sticky; top: 56px; align-self: flex-start;
  height: calc(100vh - 56px); overflow-y: auto;
  padding: 24px 12px 40px 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.hc-side-home {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.5px;
  color: var(--muted); margin: 0 0 14px 4px; transition: color 0.2s;
}
.hc-side-home:hover { color: var(--ink); }
.hc-side details { border-top: 1px solid var(--line); padding: 6px 0; }
.hc-side summary {
  cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 700;
  color: var(--ink); padding: 6px 4px; user-select: none;
}
.hc-side summary::-webkit-details-marker { display: none; }
.hc-side summary::before { content: "+ "; color: var(--faint); font-family: var(--mono); }
.hc-side details[open] summary::before { content: "− "; }
.hc-side ul { list-style: none; padding: 4px 0 8px; }
.hc-side li a {
  display: block; font-size: 13px; color: var(--muted);
  padding: 6px 10px; border-radius: 7px; line-height: 1.5;
  transition: color 0.2s, background 0.2s;
}
.hc-side li a:hover { color: var(--ink); background: var(--sidebar-hover); }
.hc-side li.active a { color: var(--ink); background: var(--sidebar-active); font-weight: 600; }

/* 本文 */
.hc-main { flex: 1 1 auto; min-width: 0; padding: 36px clamp(20px, 4vw, 56px) 60px; }
.hc-article { max-width: 760px; }
.hc-breadcrumb { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--faint); margin-bottom: 16px; }
.hc-breadcrumb a { color: var(--muted); }
.hc-breadcrumb a:hover { color: var(--accent); }
.hc-breadcrumb span { margin: 0 6px; }

.hc-article h1 {
  font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; line-height: 1.4;
  margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.hc-article h2 {
  font-size: clamp(18px, 2.2vw, 22px); font-weight: 700;
  margin: 40px 0 14px; padding-left: 14px; position: relative; line-height: 1.5;
}
.hc-article h2::before {
  content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em;
  width: 4px; border-radius: 4px; background: var(--grad);
}
.hc-article h3 { font-size: 16px; font-weight: 700; margin: 26px 0 10px; color: var(--ink); }
.hc-article p { margin: 14px 0; color: var(--ink-soft); }
.hc-article strong { color: var(--ink); font-weight: 700; }
.hc-article a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.hc-article a:hover { color: var(--accent2); }

.hc-article ul, .hc-article ol { margin: 14px 0 14px 1.3em; color: var(--ink-soft); }
.hc-article li { margin: 7px 0; }
.hc-article ul li::marker { color: var(--accent); }

/* リード／関連記事のコールアウト */
.hc-article blockquote {
  margin: 20px 0; padding: 16px 20px;
  background: rgba(170, 255, 0, 0.05);
  border: 1px solid var(--panel-bd); border-left: 3px solid var(--accent);
  border-radius: 10px; color: var(--ink-soft);
}
.hc-article blockquote p { margin: 4px 0; }
.hc-article blockquote strong { color: var(--accent); }

/* テーブル */
.hc-article table {
  width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px;
  background: var(--panel); border: 1px solid var(--panel-bd);
  border-radius: 10px; overflow: hidden;
}
.hc-article th, .hc-article td {
  padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.hc-article th { background: rgba(255, 255, 255, 0.045); color: var(--ink); font-weight: 700; }
.hc-article tr:last-child td { border-bottom: none; }
.hc-article td { color: var(--ink-soft); }

.hc-article code {
  font-family: var(--mono); font-size: 0.88em;
  background: rgba(255, 255, 255, 0.07); padding: 2px 6px; border-radius: 5px; color: var(--accent);
}
.hc-article hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }

/* 前後ナビ */
.hc-prevnext {
  display: flex; gap: 16px; max-width: 760px; margin: 48px 0 0;
}
.hc-prevnext > * { flex: 1 1 0; min-width: 0; }
.hc-prevnext a {
  display: block; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--panel-bd); border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s;
}
.hc-prevnext a:hover { border-color: #52644c; transform: translateY(-2px); }
.hc-prevnext a.next { text-align: right; }
.hc-prevnext span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; }
.hc-prevnext b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 500; line-height: 1.5; }

/* ============ リーガル（規約・プライバシー：hc-article を中央寄せで表示） ============ */
.hc-doc { max-width: 820px; margin: 0 auto; padding: clamp(32px, 5vw, 52px) clamp(20px, 5vw, 48px) 24px; }
.hc-doc .hc-article { max-width: none; }
.hc-article .label { display: block; font-weight: 700; color: var(--ink); margin: 12px 0 2px; }
.hc-article .sub { display: block; margin: 4px 0 6px 1.2em; color: var(--ink-soft); }
.hc-article .legal-contact {
  margin: 18px 0; padding: 16px 20px;
  background: var(--panel); border: 1px solid var(--panel-bd); border-radius: 10px;
}
.hc-article .legal-contact p { margin: 0; color: var(--ink-soft); }
.hc-article .legal-contact span { color: var(--muted); }

/* ============ FOOTER ============ */
.hc-foot {
  max-width: 760px; margin: 56px auto 0; padding: 28px 0 8px;
  border-top: 1px solid var(--line); text-align: center;
}
.hc-index + .hc-foot, .hc-hero ~ .hc-foot { max-width: 1120px; }
.hc-foot-links { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-bottom: 12px; }
.hc-foot-links a { font-size: 12.5px; color: var(--muted); transition: color 0.2s; }
.hc-foot-links a:hover { color: var(--accent); }
.hc-foot small { color: var(--faint); font-size: 11px; font-family: var(--mono); letter-spacing: 1px; }

/* ============ ライトテーマ（ui/advertiser のライトトークンに準拠） ============ */
html[data-theme="light"] {
  --bg: #f6f5f1;
  --bg2: #ecebe4;
  --panel: #fcfbf7;            /* 面: 不透明オフホワイト（半透明をやめて締まりを出す） */
  --panel-bd: #d8d6cb;         /* 枠線: ニュートラルなグレージュ（緑半透明だと埋もれる） */
  --ink: #14120d;
  --ink-soft: #2d2b25;
  --muted: #54514a;
  --faint: #7c7870;
  --accent: #395800;          /* テキスト/リンク/マーカー: 濃いオリーブで可読性確保 */
  --accent2: #3d8013;         /* hover */
  --accent-fill: #a9dd00;     /* 塗り用: 明背景でも視認できる vivid lime */
  --line: #e4e2da;            /* ディバイダ: 控えめなニュートラル */
  --sidebar: #edebe7;         /* advertiser のライト sidebar 相当 */
  --sidebar-hover: #e2dfd5;
  --sidebar-active: #d9d6cb;
}
html[data-theme="light"] body {
  background:
    radial-gradient(60% 50% at 18% -5%, rgba(150, 200, 0, 0.07), transparent 60%),
    radial-gradient(60% 50% at 95% 0%, rgba(150, 200, 0, 0.05), transparent 60%),
    linear-gradient(180deg, #f6f5f1, #efeee7 60%, #f6f5f1);
  background-attachment: fixed;
}
html[data-theme="light"] .hc-hud { background: rgba(252, 251, 247, 0.82); }
html[data-theme="light"] ::-webkit-scrollbar-track { background: #ecebe4; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: linear-gradient(#a9dd00, #84b400); }
/* ロゴ: ライトは黒字版に差し替え */
html[data-theme="light"] .hc-logo .hc-logo-on-dark { display: none; }
html[data-theme="light"] .hc-logo .hc-logo-on-light { display: block; }
/* 緑がかった半透明の面/枠を、明るい面でも視認できるニュートラル/accent-soft に置換 */
html[data-theme="light"] .hc-tag { background: rgba(150, 200, 0, 0.14); }
html[data-theme="light"] .hc-search input:focus { border-color: #6f9e00; box-shadow: 0 0 0 3px rgba(150, 200, 0, 0.18); }
html[data-theme="light"] .hc-cat:hover { border-color: #aeaa9e; }
html[data-theme="light"] .hc-article blockquote { background: rgba(150, 200, 0, 0.12); }
html[data-theme="light"] .hc-article th { background: #ecebe4; }
html[data-theme="light"] .hc-article code { background: rgba(150, 200, 0, 0.20); color: #2f4a00; }
html[data-theme="light"] .hc-prevnext a:hover { border-color: #aeaa9e; }

/* ============ レスポンシブ ============ */
@media (max-width: 860px) {
  .hc-side {
    position: static; width: 100%; flex-basis: auto; max-height: none;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .hc-layout { flex-direction: column; }
  .hc-prevnext { flex-direction: column; }
  .hc-prevnext a.next { text-align: left; }
}
