:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #172033;
  --muted: #637083;
  --border: rgba(23, 32, 51, 0.12);
  --accent: #2563eb;
  --accent-2: #0f766e;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(23, 32, 51, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101522;
    --surface: #182033;
    --surface-2: #111827;
    --text: #eef2ff;
    --muted: #aab4c5;
    --border: rgba(238, 242, 255, 0.13);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
code {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 6px;
  padding: 0.08rem 0.32rem;
}
pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  overflow: auto;
  font-size: 0.86rem;
  line-height: 1.6;
}
pre code { background: transparent; padding: 0; }

a { color: var(--text); } a:visited { color: var(--text); }

.hero {
  background:
    radial-gradient(circle at 12% 10%, rgba(37, 99, 235, 0.30), transparent 36%),
    radial-gradient(circle at 86% 4%, rgba(15, 118, 110, 0.30), transparent 32%),
    linear-gradient(135deg, #111827, #1e293b);
  color: #fff;
  padding: 5rem 1.25rem 4rem;
}
.hero__inner { max-width: 1120px; margin: 0 auto; }
.hero h1 {
  margin: 0.4rem 0 1rem;
  font-size: clamp(2.2rem, 4.8vw, 4.8rem);
  line-height: 1.1;
  letter-spacing: -0.06em;
}
.lead { max-width: 760px; font-size: 1.08rem; color: rgba(255, 255, 255, 0.82); }
.hero__actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent-2);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #93c5fd; }

.toc {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1rem;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  overflow-x: auto;
}
.toc a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}
.toc a:hover { background: var(--surface-2); color: var(--text); }

main { max-width: 1120px; margin: 0 auto; padding: 1rem 1.25rem 4rem; }
.section { padding: 4rem 0 1rem; }
.section__header { margin-bottom: 1.5rem; max-width: 820px; }
.section__header h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.22;
  margin: 0 0 0.7rem;
  letter-spacing: -0.03em;
}
.section__header p { margin: 0; color: var(--muted); }
.section__header h2 { color: var(--text); }
.card h3, .panel h3, .callout h3 { color: var(--text); }

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card, .panel, .callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 1.2rem; }
.card h3, .panel h3, .callout h3 { margin-top: 0; line-height: 1.35; }
.card p, .panel p, .callout p { color: var(--muted); }

.step-card__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-weight: 900;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.62rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.button--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--small { min-height: 2rem; padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.button--tab { width: 100%; justify-content: flex-start; }
.button--tab.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

.callout { padding: 1.2rem; border-left: 5px solid var(--accent); margin-bottom: 1rem; }
.code-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: 0.65rem 0.4rem; text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: 0.8rem; }

.demo-grid { display: grid; grid-template-columns: 290px 1fr; gap: 1rem; align-items: start; }
.panel { padding: 1rem; }
.button-list { display: grid; gap: 0.5rem; margin-bottom: 1.4rem; }
.note { font-size: 0.88rem; }
.chart-card__head {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.chart-card__head h3 { margin: 0; }
.chart-shell {
  position: relative;
  width: 100%;
  height: min(52vh, 430px);
  min-height: 320px;
}

.list { padding-left: 1.2rem; }
.list li { margin-bottom: 0.55rem; }
.checklist {
  display: grid;
  gap: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.checklist label {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.7rem;
  border-radius: 12px;
  background: var(--surface-2);
}
.checklist input { margin-top: 0.35rem; }

.footer { padding: 2rem 1.25rem; text-align: center; color: var(--muted); border-top: 1px solid var(--border); }

@media (max-width: 920px) {
  .grid--4, .grid--3, .grid--2, .code-layout, .demo-grid { grid-template-columns: 1fr; }
  .toc { justify-content: flex-start; }
  .chart-card__head { flex-direction: column; }
}

.status-message {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.status-message[data-status-type="success"] {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.status-message[data-status-type="error"] {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}
.standard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.95rem;
}
.standard-table th,
.standard-table td {
  border: 1px solid #dbe3ef;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}
.standard-table th {
  background: #f8fafc;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0ecff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
}
