:root {
  color-scheme: light dark;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --surface-raised: #ffffff;
  --ink: #17212b;
  --muted: #53606a;
  --line: #cec8ba;
  --line-soft: #e4dfd4;
  --accent: #b8402d;
  --accent-ink: #ffffff;
  --success: #2f6b4f;
  --warning: #8a5a16;
  --code: #17212b;
  --code-ink: #f3efe5;
  --focus: #b8402d;
  --shadow: 0 1px 2px rgb(23 33 43 / 8%), 0 12px 32px rgb(23 33 43 / 6%);
  --radius-sm: 6px;
  --radius: 12px;
  --max: 1120px;
  --reading: 40em;
  --font-display: "Hiragino Kaku Gothic StdN", "Hiragino Sans", sans-serif;
  --font-body: "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10171d;
    --surface: #18232b;
    --surface-raised: #1d2a33;
    --ink: #f3efe5;
    --muted: #b7c0c5;
    --line: #46535b;
    --line-soft: #2c3942;
    --accent: #ff8b73;
    --accent-ink: #17110f;
    --success: #78c29b;
    --warning: #e8b96f;
    --code: #0b1116;
    --code-ink: #f3efe5;
    --focus: #ff8b73;
    --shadow: 0 1px 2px rgb(0 0 0 / 32%), 0 12px 32px rgb(0 0 0 / 20%);
  }
}

:root[data-theme="dark"] {
  --paper: #10171d;
  --surface: #18232b;
  --surface-raised: #1d2a33;
  --ink: #f3efe5;
  --muted: #b7c0c5;
  --line: #46535b;
  --line-soft: #2c3942;
  --accent: #ff8b73;
  --accent-ink: #17110f;
  --success: #78c29b;
  --warning: #e8b96f;
  --code: #0b1116;
  --code-ink: #f3efe5;
  --focus: #ff8b73;
  --shadow: 0 1px 2px rgb(0 0 0 / 32%), 0 12px 32px rgb(0 0 0 / 20%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .012em;
  line-break: strict;
  overflow-wrap: break-word;
}
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
img, svg { max-width: 100%; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-140%); background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip-link:focus { transform: translateY(0); }
.top-rule { height: 6px; background: var(--accent); }
.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.header-row { min-height: 72px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; border: 2px solid var(--accent); border-radius: 50%; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--accent); }
.brand-mark::before { width: 2px; height: 10px; left: 8px; top: 4px; transform: rotate(38deg); }
.brand-mark::after { width: 8px; height: 2px; left: 5px; top: 9px; transform: rotate(-30deg); }
.primary-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.primary-nav a { color: var(--muted); text-decoration: none; padding: 10px 11px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; }
.primary-nav a[aria-current="page"] { background: var(--surface); color: var(--accent); }
.theme-toggle, .nav-toggle, .copy-button { appearance: none; border: 0; font: inherit; cursor: pointer; }
.theme-toggle, .nav-toggle { min-width: 44px; min-height: 44px; background: transparent; color: var(--ink); border-radius: var(--radius-sm); font-weight: 700; }
.theme-toggle:hover, .nav-toggle:hover { background: var(--surface); }
.nav-toggle { display: none; }

.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 80px; align-items: center; padding-block: 88px 72px; }
.hero-copy { align-self: start; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 13px; font-weight: 800; }
h1, h2, h3 { font-family: var(--font-display); font-feature-settings: "palt"; letter-spacing: .01em; }
h1 { margin: 0 0 24px; max-width: 12em; font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.25; }
.page-hero { padding-block: 72px 48px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); max-width: 16em; }
.lead { margin: 0; max-width: 34em; color: var(--muted); font-size: 18px; line-height: 1.85; }
.time-badge, .status-badge, .tier-badge { display: inline-flex; align-items: center; gap: 7px; margin-top: 24px; border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 800; }
.time-badge { background: var(--ink); color: var(--paper); }
.status-badge { margin: 0; background: color-mix(in srgb, var(--success) 15%, var(--surface)); color: var(--success); }
.tier-badge { margin: 0; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }

.guide-steps { position: relative; padding-left: 40px; }
.guide-steps::before { content: ""; position: absolute; left: 11px; top: 32px; bottom: 32px; width: 2px; background: var(--accent); }
.step { position: relative; margin-bottom: 16px; padding: 24px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.step-number { position: absolute; left: -40px; top: 26px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 800 12px/1 var(--font-mono); }
.step h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.45; }
.step p { margin: 0; color: var(--muted); }

.quick-code { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--code); color: var(--code-ink); font: 13px/1.6 var(--font-mono); overflow-x: auto; }
.quick-code code { white-space: nowrap; }
.quick-code .copy-button { margin-left: auto; }
.copy-button { min-height: 38px; flex: 0 0 auto; padding: 8px 12px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800; box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 68%, black); transform: translateY(-1px); transition: transform 120ms ease-out, box-shadow 120ms ease-out; }
.copy-button:active { transform: translateY(2px); box-shadow: 0 0 0 transparent; }
.copy-button[data-state="copied"] { background: var(--success); color: white; }

.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 64px; align-items: start; padding-block: 56px 96px; }
.content { min-width: 0; }
.content section { padding-block: 8px 56px; scroll-margin-top: 88px; }
.content section + section { padding-top: 56px; border-top: 1px solid var(--line); }
.content h2 { margin: 0 0 20px; font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.4; }
.content h3 { margin: 32px 0 12px; font-size: 1.2rem; line-height: 1.5; }
.content p, .content ul, .content ol { max-width: var(--reading); }
.content li + li { margin-top: 8px; }
.toc { position: sticky; top: 104px; padding-left: 20px; border-left: 2px solid var(--line); }
.toc strong { display: block; margin-bottom: 10px; font-size: 13px; }
.toc a { display: block; min-height: 40px; padding: 7px 0; color: var(--muted); text-decoration: none; font-size: 14px; }

.callout { max-width: var(--reading); margin-block: 24px; padding: 20px 22px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.callout strong { display: block; margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }
.callout.warning { border-left: 4px solid var(--warning); }
.callout.success { border-left: 4px solid var(--success); }
.source-note { margin-top: 24px; color: var(--muted); font-size: 13px; }
.source-note::before { content: "出典  "; font-weight: 800; color: var(--ink); }

.file-card { margin-block: 32px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.file-head { padding: 20px 22px; border-bottom: 1px solid var(--line-soft); }
.file-head h3 { margin: 0 0 12px; font-size: 18px; }
.file-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.file-meta p { margin: 0; font-size: 14px; color: var(--muted); }
.file-meta strong { color: var(--ink); }
.code-wrap { position: relative; background: var(--code); color: var(--code-ink); }
.code-wrap pre { margin: 0; padding: 24px 88px 24px 24px; overflow-x: auto; font: 13px/1.75 var(--font-mono); tab-size: 2; }
.code-wrap .copy-button { position: absolute; top: 14px; right: 14px; }

.pattern { margin-block: 28px; padding-bottom: 32px; border-bottom: 1px solid var(--line-soft); }
.pattern:last-child { border-bottom: 0; }
.prompt-box { position: relative; max-width: var(--reading); background: var(--code); color: var(--code-ink); border-radius: var(--radius); overflow: hidden; }
.prompt-box pre { margin: 0; padding: 24px 88px 24px 24px; overflow-x: auto; white-space: pre-wrap; font: 14px/1.8 var(--font-mono); }
.prompt-box .copy-button { position: absolute; right: 14px; top: 14px; }

.news-list { display: grid; gap: 20px; }
.news-card { padding: 24px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: 13px; }
.news-card h2 { margin: 14px 0 12px; font-size: 24px; }
.news-card ul { padding-left: 1.25em; }
.news-empty { padding: 32px; background: var(--surface); border-radius: var(--radius); color: var(--muted); }

.policy-table { width: 100%; border-collapse: collapse; margin-block: 24px; background: var(--surface); }
.policy-table th, .policy-table td { padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.policy-table th { font-size: 13px; color: var(--muted); }
.checklist { padding-left: 0; list-style: none; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 900; }

.next-links { padding-block: 56px 80px; border-top: 1px solid var(--line); }
.next-links h2 { font-size: 22px; }
.link-row { display: flex; flex-wrap: wrap; gap: 12px; }
.button-link { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 16px; border-radius: var(--radius-sm); background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 800; }
.button-link.secondary { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.site-footer { padding-block: 48px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 32px; align-items: flex-start; }
.footer-row p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.footer-links a { color: var(--muted); }

@media (max-width: 900px) {
  .primary-nav { display: none; position: absolute; left: 20px; right: 20px; top: 66px; padding: 12px; flex-direction: column; align-items: stretch; background: var(--surface-raised); border-radius: var(--radius); box-shadow: var(--shadow); }
  .primary-nav[data-open="true"] { display: flex; }
  .primary-nav a { min-height: 44px; padding: 9px 12px; }
  .nav-toggle { display: inline-grid; place-items: center; margin-left: auto; }
  .theme-toggle { margin-left: 0; }
  .hero { grid-template-columns: 1fr; gap: 48px; padding-block: 64px; }
  .main-grid { grid-template-columns: 1fr; }
  .toc { display: none; }
}

@media (max-width: 560px) {
  .container { width: min(calc(100% - 40px), var(--max)); }
  .header-row { min-height: 64px; gap: 6px; }
  .brand { font-size: 14px; gap: 7px; }
  .brand-mark { width: 20px; height: 20px; }
  .hero { gap: 40px; padding-block: 48px 64px; }
  h1 { font-size: 2.5rem; }
  .page-hero { padding-block: 48px 36px; }
  .lead { font-size: 16px; }
  .guide-steps { padding-left: 36px; }
  .step { padding: 20px; }
  .step-number { left: -36px; }
  .main-grid { padding-block: 40px 72px; }
  .content section { padding-bottom: 40px; }
  .content section + section { padding-top: 40px; }
  .file-meta { grid-template-columns: 1fr; }
  .code-wrap pre, .prompt-box pre { padding: 64px 18px 22px; font-size: 12px; }
  .code-wrap .copy-button, .prompt-box .copy-button { left: 14px; right: auto; }
  .policy-table { display: block; overflow-x: auto; font-size: 14px; }
  .footer-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .site-header, .theme-toggle, .nav-toggle, .copy-button, .toc { display: none !important; }
  body { background: white; color: black; }
  .container { width: 100%; }
  a { color: black; }
}

