:root {
  color-scheme: dark;
  --ink: #e9eef8;
  --muted: #9aa8bd;
  --line: #2b3547;
  --bg: #0d131e;
  --paper: #161f2e;
  --brand: #8ab0ff;
  --brand-dark: #a9c6ff;
  --good: #4ade80;
  --warn: #fbbf24;
  --on-brand: #0b1220;
  --header-bg: rgba(13, 19, 30, .92);
  --hero-top: #131f33;
  --accent-soft: #1b2a44;
  --accent-soft-2: rgba(74, 222, 128, .10);
  --notice-ink: #b9f5d0;
  --input-border: #3a465c;
  --focus-ring: #4d6fa8;
  --mini-border: #3a465c;
  --mini-line: #2b3547;
  --ad-bg: #1b2434;
  --toast-bg: #2a3a55;
  --card-shadow: 0 3px 14px rgba(0, 0, 0, .25);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .40);
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9eef8;
  --muted: #9aa8bd;
  --line: #2b3547;
  --bg: #0d131e;
  --paper: #161f2e;
  --brand: #8ab0ff;
  --brand-dark: #a9c6ff;
  --good: #4ade80;
  --warn: #fbbf24;
  --on-brand: #0b1220;
  --header-bg: rgba(13, 19, 30, .92);
  --hero-top: #131f33;
  --accent-soft: #1b2a44;
  --accent-soft-2: rgba(74, 222, 128, .10);
  --notice-ink: #b9f5d0;
  --input-border: #3a465c;
  --focus-ring: #4d6fa8;
  --mini-border: #3a465c;
  --mini-line: #2b3547;
  --ad-bg: #1b2434;
  --toast-bg: #2a3a55;
  --card-shadow: 0 3px 14px rgba(0, 0, 0, .25);
  --shadow: 0 10px 30px rgba(0, 0, 0, .40);
}

[data-theme="light"] {
  color-scheme: light;
  --ink: #182132;
  --muted: #5b677c;
  --line: #e3e8f0;
  --bg: #f6f8fc;
  --paper: #ffffff;
  --brand: #2457d6;
  --brand-dark: #1740a6;
  --good: #187a53;
  --warn: #b45309;
  --on-brand: #ffffff;
  --header-bg: rgba(255, 255, 255, .94);
  --hero-top: #eef3ff;
  --accent-soft: #eef3ff;
  --accent-soft-2: #eef7f2;
  --notice-ink: #1c4e3b;
  --input-border: #cfd8e6;
  --focus-ring: #b9cdf8;
  --mini-border: #c9d3e3;
  --mini-line: #eef1f6;
  --ad-bg: #f2f5fa;
  --toast-bg: #182132;
  --card-shadow: 0 3px 14px rgba(24, 33, 50, .04);
  --shadow: 0 10px 30px rgba(24, 33, 50, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.22; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }

.wrap { width: min(1140px, calc(100% - 40px)); margin-inline: auto; }
.wrap-narrow { width: min(760px, calc(100% - 40px)); margin-inline: auto; }
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 720px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--brand); margin-bottom: .8em; }
.section-sub { color: var(--muted); max-width: 720px; }

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 66px; }
.brand { font-size: 1.3rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em; }
.brand span { color: var(--brand); }
.nav { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: .93rem; font-weight: 600; }
.nav a:hover { color: var(--brand); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); background: var(--paper); }
.theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); color: var(--on-brand); }
.btn-outline { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-ghost { border-color: var(--line); background: var(--paper); color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: .88rem; }
.btn-block { width: 100%; }

.hero { padding: 76px 0 60px; background: linear-gradient(180deg, var(--hero-top) 0%, var(--bg) 100%); }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.hero-note { color: var(--muted); font-size: .9rem; }

.hero-visual { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.hero-visual .mini-sheet { border: 1px dashed var(--mini-border); border-radius: 8px; padding: 18px; background: var(--paper); }
.mini-sheet h3 { font-size: .95rem; margin-bottom: 14px; }
.mini-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--mini-line); padding: 7px 4px; font-size: .9rem; color: var(--muted); }
.mini-row b { color: var(--ink); }
.mini-note { font-size: .82rem; color: var(--muted); margin: 14px 0 0; }
.mini-tag { display: inline-block; background: var(--accent-soft); color: var(--brand); font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; margin-bottom: 12px; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .93rem; flex: 1; }
.card .card-link { font-weight: 700; font-size: .9rem; margin-top: 8px; }
.card-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft);
  color: var(--brand); font-weight: 800; display: grid; place-items: center;
  margin-bottom: 14px; font-size: 1.05rem;
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 700; margin-bottom: 12px; }
.step p { color: var(--muted); font-size: .93rem; margin: 0; }

.link-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 24px; margin-top: 22px; padding-left: 0; list-style: none; }
.link-list li { border-bottom: 1px solid var(--line); padding: 9px 0; font-size: .94rem; }

.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { color: var(--muted); margin: 10px 0 0; font-size: .94rem; }

.cta { background: var(--accent-soft); padding: 56px 0; text-align: center; }
.cta p { color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); background: var(--paper); padding: 28px 0; font-size: .9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.footer-inner .brand { font-size: 1.05rem; }
.footer-inner a:last-child { margin-left: auto; }

.breadcrumb { font-size: .85rem; color: var(--muted); padding: 22px 0 0; }
.breadcrumb a { color: var(--muted); }
.tool-page { padding-bottom: 40px; }
.page-intro { max-width: 760px; margin: 14px 0 28px; }

.tool-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 26px; align-items: start; }
.tool-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: sticky; top: 86px; box-shadow: var(--shadow); }
.panel-head h2 { font-size: 1.15rem; margin-bottom: .2em; }
.panel-head p { color: var(--muted); font-size: .86rem; margin-bottom: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .86rem; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--input-border); border-radius: 8px;
  font: inherit; font-size: .92rem; background: var(--paper); color: var(--ink);
}
.field textarea { min-height: 86px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus-ring); border-color: var(--brand); }
.field .hint { font-size: .78rem; color: var(--muted); margin: 4px 0 0; }
.check-field { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; font-size: .9rem; font-weight: 600; }
.check-field input { width: 17px; height: 17px; accent-color: var(--brand); }
.tool-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.tool-actions .btn { padding: 10px 8px; font-size: .85rem; }
.tool-actions .span-2 { grid-column: span 2; }
.tool-actions #pk-batch-n { padding: 8px; font-size: .85rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }

.preview-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.preview-head h2 { font-size: 1.15rem; margin: 0; }
.preview-head span { color: var(--muted); font-size: .85rem; }
.print-root { display: flex; flex-direction: column; gap: 24px; }
.sheet { background: #ffffff; border: 1px solid var(--line); box-shadow: var(--shadow); width: 100%; overflow: hidden; }
.sheet svg { display: block; width: 100%; height: auto; }

.prose { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.prose h2 { font-size: 1.35rem; }
.prose p, .prose li { color: var(--muted); }
.notice { background: var(--accent-soft-2); border-left: 4px solid var(--good); padding: 14px 18px; border-radius: 8px; color: var(--notice-ink); }

.ad-slot { display: none; margin-top: 18px; min-height: 90px; background: var(--ad-bg); border: 1px dashed var(--line); border-radius: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: .82rem; }
.ad-slot.show { display: flex; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: var(--toast-bg); color: #fff; padding: 12px 20px; border-radius: 10px;
  font-size: .9rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.partner-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 7px 14px;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
  overflow: hidden;
}
.partner-bar-inner {
  position: relative;
  z-index: 1;
  width: min(1000px, 100%);
  margin-inline: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
}
.partner-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid #37e08c;
  background: #08140e;
  color: #eafff3;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
  box-shadow: 0 0 22px rgba(34, 197, 94, .55), 0 0 10px rgba(34, 197, 94, .4), inset 0 0 12px rgba(34, 197, 94, .15);
  transition: color .15s, border-color .15s, box-shadow .15s;
  animation: promoGlow 1.6s ease-in-out infinite alternate;
}
.partner-pill:hover {
  animation: none;
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(74, 222, 128, 1);
  box-shadow: 0 0 32px rgba(34, 197, 94, .85), 0 0 16px rgba(34, 197, 94, .6), inset 0 0 16px rgba(34, 197, 94, .22);
}
.partner-bar-inner .partner-pill:nth-of-type(2) { animation-delay: .8s; }
.partner-bar-inner .partner-pill:nth-of-type(3) { animation-delay: 1.6s; }
@keyframes promoGlow {
  from {
    border-color: rgba(34, 197, 94, .45);
    box-shadow: 0 0 10px rgba(34, 197, 94, .30), 0 0 5px rgba(34, 197, 94, .20), inset 0 0 8px rgba(34, 197, 94, .08);
  }
  to {
    border-color: rgba(74, 222, 128, 1);
    box-shadow: 0 0 28px rgba(34, 197, 94, .85), 0 0 14px rgba(34, 197, 94, .55), inset 0 0 16px rgba(34, 197, 94, .22);
  }
}
.partner-icon { font-size: 13px; line-height: 1; }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .card-grid, .steps, .link-list { grid-template-columns: repeat(2, 1fr); }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-panel { position: static; }
}
@media (max-width: 640px) {
  .wrap, .wrap-narrow { width: min(100% - 28px, 1140px); }
  .header-inner { min-height: 58px; gap: 12px; }
  .nav { display: none; }
  .card-grid, .steps, .link-list, .tool-actions { grid-template-columns: 1fr; }
  .tool-actions .span-2 { grid-column: auto; }
  .section { padding: 42px 0; }
  .hero { padding: 48px 0 36px; }
  .partner-bar { padding: 6px 10px; }
  .partner-bar-inner { gap: 6px 10px; }
  .partner-pill { padding: 4px 10px; font-size: 12px; }
}

@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff; margin: 0 !important; padding: 0 !important; }
  .site-header, .site-footer, .no-print, .theme-toggle, .breadcrumb, .page-intro, .lede, h1, .section, .cta, .toast, .preview-head, .partner-bar { display: none !important; }
  main.wrap { width: 100%; max-width: none; margin: 0; padding: 0; }
  .tool-layout { display: block; }
  .print-root { display: block; }
  .sheet { border: 0; box-shadow: none; margin: 0; padding: 0; width: 100%; background: #fff; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .sheet svg { display: block; width: 100%; height: auto; }
}
