/* APIS — スタンドアロン版スタイル（外部フォント・CDNなし、システムフォントのみ）
   テーマ: 既定はダーク。data-theme="light" でライトに切り替わる。
   色はすべて CSS 変数経由で指定する。 */
:root {
  /* ライトテーマ（従来の見た目） */
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-hover: #4338ca;
  --accent-text: #4f46e5;
  --accent-strong: #4338ca;
  --ink: #1e2433;
  --text-2: #3c465c;
  --muted: #64748b;
  --line: #e5e7f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.92);
  --surface-hover: #eef2ff;
  --surface-2: #f8fafc;
  --input-bg: #ffffff;
  --input-border: #cbd2e1;
  --focus-ring: rgba(79, 70, 229, 0.18);
  --green-bg: #e8f7ee;
  --green: #15803d;
  --amber-bg: #fef3c7;
  --amber: #92400e;
  --notice-bg: #fffbeb;
  --notice-border: #fde68a;
  --notice-text: #92400e;
  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-text: #dc2626;
  --ep-remove-border: #fecaca;
  --ep-remove-hover: #fef2f2;
  --empty-border: #c7cbe0;
  --chip-static-bg: #f1f5f9;
  --chip-static: #475569;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-border: #c7cdf5;
  --ghost-hover: #f1f5f9;
  --disabled-bg: #cbd5e1;
  --thead-bg: #f8fafc;
  --thead-text: #475569;
  --method-post-bg: #ecfdf5;
  --method-post: #047857;
  --method-put-bg: #fffbeb;
  --method-put: #b45309;
  --method-patch-bg: #fdf4ff;
  --method-patch: #a21caf;
  --method-delete-bg: #fef2f2;
  --method-delete: #b91c1c;
  --code-bg: #171c2e;
  --code-text: #e6e9f5;
  --inline-code-bg: #eef0f7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.06), 0 10px 28px rgba(79, 70, 229, 0.14);
}
:root[data-theme="dark"] {
  /* ダークテーマ（既定）: 深いスレート/ネイビー基調、純黒は使わない */
  --accent: #6366f1;
  --accent-2: #7c3aed;
  --accent-hover: #818cf8;
  --accent-text: #a5b4fc;
  --accent-strong: #a5b4fc;
  --ink: #e8ecf6;
  --text-2: #c3cadb;
  --muted: #9aa7c2;
  --line: #2a3350;
  --bg: #0f1420;
  --card: #171e2e;
  --header-bg: rgba(15, 20, 32, 0.88);
  --surface-hover: #232c47;
  --surface-2: #1c2539;
  --input-bg: #121828;
  --input-border: #33405f;
  --focus-ring: rgba(129, 140, 248, 0.35);
  --green-bg: #0d2b1e;
  --green: #4ade80;
  --amber-bg: #33270e;
  --amber: #fbbf24;
  --notice-bg: #2a2113;
  --notice-border: #7c5e14;
  --notice-text: #fbbf24;
  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-text: #f87171;
  --ep-remove-border: #5b2b33;
  --ep-remove-hover: #2e1a20;
  --empty-border: #3a4568;
  --chip-static-bg: #232c47;
  --chip-static: #9aa7c2;
  --btn-secondary-bg: #171e2e;
  --btn-secondary-border: #3a4568;
  --ghost-hover: #232c47;
  --disabled-bg: #3a4568;
  --thead-bg: #1c2539;
  --thead-text: #9aa7c2;
  --method-post-bg: #0d2b21;
  --method-post: #34d399;
  --method-put-bg: #2e2410;
  --method-put: #fbbf24;
  --method-patch-bg: #2b1030;
  --method-patch: #e879f9;
  --method-delete-bg: #2f1518;
  --method-delete: #f87171;
  --code-bg: #0a0e18;
  --code-text: #e6e9f5;
  --inline-code-bg: #232c47;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(99, 102, 241, 0.25);
}
* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}
a { color: var(--accent-text); }
a:hover { color: var(--accent-strong); }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
.logo { font-size: 24px; font-weight: 800; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--ink); }
.logo-dot { color: var(--accent-text); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.site-header nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.site-header nav a:hover { background: var(--surface-hover); color: var(--accent-strong); }
.who { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.who-name { font-weight: 600; color: var(--ink); }

/* ---------- レイアウト ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 8px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; background: var(--card); }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 24px 20px 32px; color: var(--muted); font-size: 14px; }
.footer-brand { font-size: 20px; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.footer-inner p { margin: 6px 0; }
.copyright { margin-top: 14px; }
h1 { font-size: 27px; line-height: 1.35; margin: 8px 0 12px; }
h2 { font-size: 19px; margin: 26px 0 10px; }
h3 { font-size: 16px; }
.lead { font-size: 15px; color: var(--text-2); max-width: 46em; }
.small { font-size: 13px; color: var(--muted); }
.meta { color: var(--muted); font-size: 14px; }
.warn { color: var(--amber); font-weight: 600; font-size: 14px; }
.notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  color: var(--notice-text);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 14px;
}
.notice-inline {
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  color: var(--notice-text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
}

/* ---------- ヒーロー ---------- */
.hero {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  border-radius: 18px;
  padding: 38px 34px 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.hero-eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; opacity: 0.85; }
.hero h1 { margin: 0 0 10px; font-size: 32px; color: #fff; }
.hero-lead { margin: 0 0 20px; max-width: 44em; font-size: 15px; opacity: 0.95; }
.hero-search { background: rgba(255, 255, 255, 0.14); padding: 12px; border-radius: 12px; }

/* ---------- 検索・絞り込み ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters input[type="search"] { flex: 1 1 220px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.chips-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.chip {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-hover);
  color: var(--accent-strong);
  text-decoration: none;
  border: 1px solid transparent;
}
a.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; }
.chip-static { background: var(--chip-static-bg); color: var(--chip-static); }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.section-head h2 { margin: 0 0 12px; }

/* ---------- カード ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card h3 { margin: 2px 0 0; font-size: 17px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent-strong); }
.card p { margin: 0; }
.card-desc { color: var(--text-2); font-size: 14px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.free { background: var(--green-bg); color: var(--green); }
.badge.paid { background: var(--amber-bg); color: var(--amber); }
.empty {
  grid-column: 1 / -1;
  background: var(--card);
  border: 1px dashed var(--empty-border);
  border-radius: var(--radius);
  padding: 34px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.empty p { margin: 6px 0; }

/* ---------- パネル・詳細 ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 18px 0;
}
.panel h2 { margin-top: 0; }
.ep-list { list-style: none; margin: 0; padding: 0; }
.ep-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ep-list li:last-child { border-bottom: 0; }
.method {
  display: inline-block;
  min-width: 58px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-hover);
  color: var(--accent-strong);
}
.method-POST { background: var(--method-post-bg); color: var(--method-post); }
.method-PUT { background: var(--method-put-bg); color: var(--method-put); }
.method-PATCH { background: var(--method-patch-bg); color: var(--method-patch); }
.method-DELETE { background: var(--method-delete-bg); color: var(--method-delete); }
.ep-summary { color: var(--muted); font-size: 14px; }
.console-form { display: flex; flex-wrap: wrap; gap: 8px; }
.console-form select { flex: 1 1 260px; }

/* ---------- ボタン ---------- */
button, .btn {
  font: inherit;
  font-weight: 700;
  padding: 9px 18px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.12s ease;
}
button:hover, .btn:hover { background: var(--accent-hover); color: #fff; }
button:disabled { background: var(--disabled-bg); cursor: not-allowed; }
button.danger { background: var(--red); }
button.danger:hover { background: var(--red-dark); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: var(--red-dark); color: #fff; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.btn-secondary, button.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--accent-strong);
  border: 1px solid var(--btn-secondary-border);
}
.btn-secondary:hover, button.btn-secondary:hover { background: var(--surface-hover); color: var(--accent-strong); }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 12px;
  font-size: 13px;
}
button.ghost:hover { background: var(--ghost-hover); color: var(--ink); }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.btn-large { padding: 12px 26px; font-size: 16px; }
form.inline { display: inline; }

/* ---------- フォーム ---------- */
input, select, textarea {
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--input-border);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.form { max-width: 720px; }
.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.form input, .form textarea, .form select { display: block; width: 100%; margin-top: 5px; font-weight: 400; }
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 18px;
  margin: 0 0 18px;
}
legend { font-weight: 800; font-size: 15px; padding: 0 6px; }

/* エンドポイント行（メソッド／パス／説明を分けた入力欄） */
.ep-row {
  display: grid;
  grid-template-columns: 118px 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.ep-row input, .ep-row select { width: 100%; }
.ep-remove {
  background: var(--card);
  color: var(--red-text);
  border: 1px solid var(--ep-remove-border);
  padding: 8px 12px;
  font-size: 13px;
}
.ep-remove:hover { background: var(--ep-remove-hover); color: var(--red-text); }
#ep-add { margin-top: 4px; }

/* ---------- テーブル・統計 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; font-size: 14px; }
thead th { background: var(--thead-bg); font-size: 13px; color: var(--thead-text); border-bottom: 2px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  min-width: 160px;
  flex: 1 1 160px;
}
.stat span { display: block; font-size: 13px; color: var(--muted); }
.stat strong { font-size: 22px; }

/* ---------- コード表示 ---------- */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px;
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 13px;
}
code {
  background: var(--inline-code-bg);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.92em;
  word-break: break-all;
}

/* ---------- 言語・テーマ切替 ---------- */
.lang-toggle { font-size: 12px; color: var(--muted); white-space: nowrap; }
.lang-toggle a { color: var(--muted); text-decoration: none; padding: 2px 2px; }
.lang-toggle a:hover { color: var(--ink); }
.lang-toggle a.active { color: var(--ink); font-weight: 700; text-decoration: underline; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.theme-toggle:hover { color: var(--ink); background: var(--surface-hover); }

/* ---------- レスポンシブ ---------- */
@media (max-width: 640px) {
  .hero { padding: 26px 20px 20px; }
  .hero h1 { font-size: 25px; }
  h1 { font-size: 23px; }
  .header-inner { padding: 10px 14px; }
  main { padding: 18px 14px 4px; }
  .who { margin-left: 0; }
  .ep-row { grid-template-columns: 1fr; }
  .filters { flex-direction: column; }
  .filters input, .filters select, .filters button { width: 100%; }
  .hero-search { padding: 10px; }
  .stat { min-width: 130px; }
}

.footer-motto { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; color: var(--accent-text, #a5b4fc); margin: 2px 0 10px; }
