:root {
  --ink: #172235;
  --muted: #64748b;
  --line: #dce4ee;
  --paper: #f5f8fc;
  --card: #ffffff;
  --navy: #0d203b;
  --cyan: #28b6d7;
  --cyan-dark: #0d829e;
  --orange: #f5a94b;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0, #dff7fb 0, transparent 34rem), var(--paper); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(22px, 6vw, 88px);
  border-bottom: 1px solid rgba(220, 228, 238, .8);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: .04em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: white; background: var(--navy); box-shadow: inset -8px -8px 18px rgba(40,182,215,.32); }
.quiet-link { color: var(--muted); font-size: 14px; }
.site-nav { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(245, 248, 252, .86); }
.nav-link { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 650; transition: background .18s ease, color .18s ease; }
.nav-link:hover, .nav-link.active { color: var(--navy); background: white; box-shadow: 0 4px 14px rgba(13, 32, 59, .08); }

main { width: min(1080px, calc(100% - 36px)); margin: 0 auto; padding: 72px 0; }
.hero { max-width: 780px; padding: 54px 0 44px; }
.hero h1 { margin: 10px 0 20px; max-width: 760px; font-family: ui-serif, "Songti SC", serif; font-size: clamp(40px, 7vw, 72px); line-height: 1.08; letter-spacing: -.04em; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.85; }
.eyebrow { margin: 0; color: var(--cyan-dark); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.release-meta { display: flex; gap: 14px; margin-top: 28px; color: var(--muted); font-size: 13px; }

.panel { margin-top: 26px; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 18px 60px rgba(13,32,59,.07); }
.panel.compact { padding-block: 30px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
h2 { margin: 0 0 16px; font-size: 24px; }
.section-heading h2 { margin: 6px 0 0; }
.status-pill { white-space: nowrap; border-radius: 999px; padding: 7px 12px; color: #8c4a06; background: #fff1dc; font-size: 12px; font-weight: 700; }
.muted { color: var(--muted); }

.download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.download-card { display: flex; flex-direction: column; min-height: 220px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #fbfdff; }
.download-card h3 { margin: 8px 0 6px; font-size: 20px; }
.download-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.6; }
.checksum { margin: auto 0 14px; color: var(--muted); font-family: ui-monospace, monospace; font-size: 11px; overflow-wrap: anywhere; }
.download-button, .primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 11px; padding: 11px 16px; cursor: pointer; font-weight: 700; }
.download-button, .primary-button { color: white; background: var(--navy); }
.download-button[aria-disabled="true"] { pointer-events: none; opacity: .45; }
.secondary-button { color: var(--navy); background: #e9f4f8; }
.danger-button { color: white; background: var(--danger); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.steps article { padding: 26px; border-radius: 20px; color: white; background: var(--navy); }
.steps article:nth-child(2) { background: #123b55; }
.steps article:nth-child(3) { background: #0d6f83; }
.steps span { color: #81dced; font: 700 12px ui-monospace, monospace; }
.steps h3 { margin: 32px 0 10px; }
.steps p { margin: 0; color: #d9ebf2; line-height: 1.65; font-size: 14px; }
.plain-list { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.8; }
.docs-callout { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 28px; padding: clamp(26px, 4vw, 42px); border-radius: 24px; color: white; background: linear-gradient(135deg, var(--navy), #0d6f83); }
.docs-callout h2 { margin: 6px 0 10px; }
.docs-callout p:not(.eyebrow) { margin: 0; color: #d9ebf2; line-height: 1.7; }
.docs-callout .eyebrow { color: #81dced; }
.callout-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.docs-callout .secondary-button { color: white; background: rgba(255,255,255,.14); }
.docs-callout .primary-button { color: var(--navy); background: white; }

.doc-main { width: min(1160px, calc(100% - 36px)); }
.doc-hero { max-width: 1040px; padding: 60px 0 36px; }
.doc-hero h1 { margin: 10px 0 18px; font-family: ui-serif, "Songti SC", serif; font-size: clamp(38px, 6vw, 68px); line-height: 1.1; letter-spacing: -.035em; }
.doc-hero .lead { max-width: 820px; }
.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 34px; }
.doc-toc { position: sticky; top: 92px; display: grid; gap: 5px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.9); }
.doc-toc strong { margin-bottom: 8px; font-size: 13px; }
.doc-toc a { padding: 8px 10px; border-radius: 9px; color: var(--muted); font-size: 13px; }
.doc-toc a:hover { color: var(--navy); background: #edf5f8; }
.doc-content { min-width: 0; }
.doc-section { scroll-margin-top: 100px; margin-bottom: 24px; padding: clamp(24px, 4vw, 40px); border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.95); box-shadow: 0 14px 45px rgba(13,32,59,.05); }
.doc-section > p { color: var(--muted); line-height: 1.8; }
.section-intro { max-width: 760px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.feature-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fbfdff; }
.feature-card h3 { margin: 12px 0 8px; font-size: 18px; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.72; font-size: 14px; }
.feature-card ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.7; font-size: 14px; }
.status-tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 750; }
.status-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-ready { color: #08755f; background: #e4f8f1; }
.status-config { color: #8c4a06; background: #fff1dc; }
.status-testing { color: #5b50a1; background: #f0edff; }
.loop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; counter-reset: loop-step; }
.loop-step { position: relative; min-height: 150px; padding: 22px; border-radius: 18px; color: white; background: var(--navy); counter-increment: loop-step; }
.loop-step:nth-child(2n) { background: #123b55; }
.loop-step:nth-child(3n) { background: #0d6f83; }
.loop-step::before { content: "0" counter(loop-step); display: block; margin-bottom: 26px; color: #81dced; font: 700 12px ui-monospace, monospace; }
.loop-step h3 { margin: 0 0 8px; font-size: 16px; }
.loop-step p { margin: 0; color: #d9ebf2; font-size: 13px; line-height: 1.65; }
.role-banner { display: flex; align-items: flex-start; gap: 16px; margin: 20px 0; padding: 18px; border-radius: 16px; background: #edf8f7; }
.role-banner strong { flex: 0 0 auto; color: #08755f; }
.role-banner p { margin: 0; color: var(--muted); line-height: 1.7; }
.platform-table { width: 100%; margin-top: 20px; }
.platform-table td { white-space: normal; line-height: 1.55; }
.platform-table td:first-child { font-weight: 700; color: var(--navy); }
.guide-steps { display: grid; gap: 14px; margin-top: 22px; counter-reset: guide-step; }
.guide-step { display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdff; counter-increment: guide-step; }
.guide-step::before { content: counter(guide-step); display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: white; background: var(--navy); font-weight: 800; }
.guide-step h3 { margin: 1px 0 7px; font-size: 17px; }
.guide-step p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 14px; }
.guide-step .path { display: inline-block; margin-top: 8px; color: var(--cyan-dark); font-weight: 700; }
.note-box, .warning-box { margin-top: 18px; padding: 17px 18px; border-radius: 14px; color: var(--muted); line-height: 1.7; }
.note-box { border: 1px solid #bce5dc; background: #edf9f7; }
.warning-box { border: 1px solid #f1d4a8; background: #fff8ed; }
.check-list { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 28px; color: var(--muted); line-height: 1.7; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #08755f; font-weight: 900; }
.faq-list { display: grid; gap: 12px; margin-top: 20px; }
.faq-list details { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fbfdff; }
.faq-list summary { cursor: pointer; color: var(--navy); font-weight: 700; }
.faq-list p { margin: 12px 0 0; color: var(--muted); line-height: 1.7; }
footer { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

.admin-main { width: min(1240px, calc(100% - 36px)); }
.admin-hero { padding-bottom: 20px; }
.admin-hero h1 { font-size: clamp(36px, 5vw, 58px); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.metrics article { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.metrics span { display: block; color: var(--muted); font-size: 13px; }
.metrics strong { display: block; margin-top: 10px; font-size: 34px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: white; }
.form-grid button { align-self: end; }
.issued-key { margin-top: 22px; padding: 18px; border-radius: 14px; background: #edf9f7; }
.issued-key div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; margin-bottom: 10px; }
.issued-key code, pre { overflow-wrap: anywhere; white-space: pre-wrap; }
.two-columns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.two-columns form { display: grid; gap: 14px; align-content: start; }
pre { min-height: 70px; margin: 0; padding: 14px; border-radius: 10px; color: #d9ebf2; background: var(--navy); font-size: 12px; }
.error-banner { margin: 16px 0; padding: 14px 16px; border-radius: 12px; color: var(--danger); background: #feeceb; }

.auth-main { display: grid; place-items: center; min-height: calc(100vh - 160px); }
.auth-card { width: min(480px, 100%); padding: clamp(26px, 5vw, 46px); border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: 0 18px 60px rgba(13,32,59,.08); }
.auth-card h1 { margin: 8px 0 12px; font-family: ui-serif, "Songti SC", serif; font-size: clamp(34px, 6vw, 48px); letter-spacing: -.03em; }
.auth-form { display: grid; gap: 10px; margin-top: 28px; }
.auth-form label { color: var(--ink); font-weight: 650; }
.auth-form input { margin-bottom: 8px; }
.auth-form button { width: 100%; margin-top: 8px; }
.auth-form button:disabled { cursor: wait; opacity: .55; }
.auth-feedback { min-height: 24px; margin: 4px 0 0; line-height: 1.6; }
.auth-feedback.error { color: var(--danger); }
.auth-feedback.success { color: #08755f; }
.auth-footer { margin: 24px 0 0; text-align: center; color: var(--cyan-dark); font-size: 14px; }

@media (max-width: 760px) {
  main { padding-top: 28px; }
  .topbar { flex-wrap: wrap; gap: 12px; padding-inline: 18px; }
  .site-nav { order: 3; width: 100%; justify-content: center; }
  .operator-link { display: none; }
  .download-grid, .steps, .metrics, .form-grid, .two-columns, .feature-grid, .loop-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; }
  .section-heading { align-items: flex-start; }
  .docs-callout { align-items: flex-start; flex-direction: column; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-toc strong { grid-column: 1 / -1; }
}
