:root {
  color-scheme: light;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --canvas: #fff;
  --panel: #f5f8f5;
  --line: #d5dfd5;
  --text: #17251b;
  --muted: #475b4d;
  --accent: #245f39;
  --action: #286442;
  --display-accent: #b3f58b;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 96px; }
body { margin: 0; color: var(--text); background: var(--canvas); line-height: 1.6; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip { position: absolute; top: -100px; left: 12px; z-index: 5; background: var(--panel); padding: 8px 14px; }
.skip:focus { top: 10px; }
.wrap { width: min(1180px, 100% - 72px); margin-inline: auto; }

.top { border-bottom: 1px solid var(--line); background: var(--canvas); }
.top-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.top-inner { min-height: 72px; }
.top nav, .footer nav { display: flex; align-items: center; gap: 24px; }
.top a, .footer a { text-decoration: none; }
.top nav a, .footer nav a { color: var(--muted); font-size: .91rem; white-space: nowrap; }
.top nav a:hover, .top nav a[aria-current], .footer nav a:hover { color: var(--accent); }
.brand { display: flex; gap: 9px; align-items: center; white-space: nowrap; font-weight: 760; }
.brand-icon { width: 15px; height: 15px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px #245f3920; margin-right: 3px; }
.edition { color: var(--muted); font-size: .76rem; font-weight: 500; }
.top-download { color: var(--accent); font-size: .9rem; white-space: nowrap; }

h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.22; }
h1 { font-size: clamp(2.4rem, 6vw, 5.6rem); letter-spacing: -.085em; font-weight: 780; }
h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); font-weight: 700; letter-spacing: -.055em; }
h3 { font-size: 1.17rem; font-weight: 720; }
.eyebrow { font-size: .77rem; letter-spacing: .11em; font-weight: 650; color: var(--accent); margin-bottom: 18px; }
.intro { margin-top: 22px; font-size: clamp(1rem, 2.3vw, 1.19rem); max-width: 38ch; color: var(--muted); }
.meta { margin-top: 20px; font-size: .82rem; color: var(--muted); }
.meta span { margin-inline: 4px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 27px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 11px 16px; border: 1px solid transparent; border-radius: 7px;
  font: inherit; font-size: .91rem; font-weight: 690; text-decoration: none; cursor: pointer;
}
.primary { background: var(--action); color: #fff; }
.primary:hover { background: #194c30; }
.secondary { background: transparent; border-color: #768b78; color: var(--text); }
.secondary:hover { color: var(--accent); border-color: var(--accent); }
.button:disabled { cursor: wait; opacity: .55; }

.hero { display: grid; grid-template-columns: .92fr 1.08fr; gap: clamp(20px, 5vw, 70px); align-items: center; padding: clamp(44px, 8vw, 116px) 0; }
.hero h1 span { display: block; color: var(--accent); }
.hero-figure { min-width: 0; }
.image-frame { border: 1px solid #3e4b3c; border-radius: 14px; background: #000; overflow: hidden; }
.image-frame img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
figcaption { margin-top: 8px; font-size: .76rem; color: var(--muted); text-align: right; }
.section { border-top: 1px solid var(--line); padding: clamp(32px, 5vw, 65px) 0; }
.feature-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 26px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; }
.feature-list article { display: flex; flex-direction: column; padding: 24px; }
.feature-list article + article { border-left: 1px solid var(--line); }
.feature-list p { color: var(--muted); margin: 12px 0 17px; }
.feature-list a { color: var(--accent); font-size: .86rem; margin-top: auto; }
.setup { display: grid; grid-template-columns: .7fr 1.3fr; column-gap: 30px; row-gap: 20px; align-items: start; }
.setup ol { margin: 0; padding-left: 26px; grid-row: span 2; }
.setup li + li { margin-top: 13px; }
.setup li span { display: block; color: var(--muted); }
.setup .button { justify-self: start; }

.page-intro { margin: clamp(35px, 7vw, 82px) 0 clamp(30px, 5vw, 55px); }
.page-intro h1 { font-size: clamp(2.25rem, 5vw, 4.3rem); }
.app-demo { max-width: 710px; margin-bottom: clamp(26px, 5vw, 48px); }
.app-demo h2 { margin-bottom: 14px; }
.app-screen {
  display: grid; grid-template-columns: minmax(94px, 1fr) minmax(0, 3.25fr) minmax(94px, 1fr);
  background: #050705; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.app-rail { display: grid; align-items: center; align-content: space-evenly; gap: 3px; padding: 8px 3px; }
.app-rail a { display: flex; align-items: center; flex-direction: column; justify-content: center; justify-self: center; gap: 2px; color: #8fe39a; font-size: .74rem; line-height: 1.1; padding: 3px 4px; text-decoration: none; white-space: nowrap; min-height: 29px; }
.app-rail a:hover { background: #213b24; border-radius: 5px; }
.app-rail a.app-text-button { border: 1px solid #426346; border-radius: 5px; padding-inline: 7px; }
.app-rail img { width: clamp(16px, 2.8vw, 31px); height: auto; }
.app-display { display: grid; place-items: center; }
.app-display > img { width: 100%; height: auto; display: block; }
.inline-icon { width: 18px; height: 18px; vertical-align: middle; }
.button-location {
  display: flex; align-items: center; gap: 9px; width: max-content; max-width: 100%;
  margin: 12px 0 8px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--panel); color: var(--text); line-height: 1.18;
}
.button-map {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) 12px; gap: 3px;
  width: 90px; height: 48px; border: 1px solid #57675a; border-radius: 5px;
  padding: 3px; background: #080b09; flex: 0 0 auto;
}
.button-map-rail { display: grid; align-content: space-around; justify-content: center; }
.button-map-rail > span { width: 7px; height: 4px; border-radius: 2px; background: #617067; }
.button-map-rail > span.is-highlighted { background: var(--display-accent); outline: 1px solid #efffe4; }
.button-map-display { border-radius: 2px; background: linear-gradient(145deg, #68746c, #3b4840 66%, #66746d); opacity: .75; }
.button-location-label { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.button-location-label img { width: 20px; height: 20px; padding: 2px; background: #080b09; border-radius: 4px; }
.button-location strong { display: block; font-size: .8rem; font-weight: 700; }
.button-location small { display: block; margin-top: 3px; color: var(--muted); font-size: .69rem; font-weight: 500; }
.detail-body dl > div.with-button { grid-template-columns: minmax(185px, .37fr) minmax(0, 1fr); }
.with-button .button-location { margin-top: 0; }
.details-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); align-items: start; gap: clamp(20px, 5vw, 56px); }
.toc { position: sticky; top: 24px; display: grid; border-left: 1px solid var(--line); padding: 5px 0 5px 16px; gap: 11px; }
.toc a { font-size: .9rem; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.detail-body section { border-top: 1px solid var(--line); padding: 27px 0 35px; }
.detail-body section:target h2 { color: var(--accent); }
.feature-visual { margin: 18px 0 20px; }
.feature-visual img { display: block; width: 100%; height: auto; }
.preview-trigger { display: block; padding: 0; width: 100%; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: #080b09; cursor: zoom-in; }
.sample-figure img { aspect-ratio: 16 / 9; object-fit: cover; }
.white-hot-sample { filter: grayscale(1) invert(1); }
.feature-visual figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 14px; text-align: left; }
.text-action { padding: 0; border: 0; background: transparent; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.sample-dialog { position: fixed; width: min(1120px, 100% - 22px); max-width: none; max-height: calc(100dvh - 20px); padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--text); }
.sample-dialog::backdrop { background: #000d; }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 10px; }
.dialog-toolbar .button { font-size: .78rem; padding: 6px; white-space: nowrap; }
.dialog-toolbar h3 { font-size: .95rem; }
.sample-dialog > img { display: block; width: 100%; height: min(75dvh, 810px); object-fit: contain; }
.palette-preview { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.palette-preview legend { padding-inline: 7px; font-size: .92rem; font-weight: 690; }
.image-options { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.image-options label { position: relative; cursor: pointer; }
.image-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.image-options span { display: block; padding: 5px 11px; font-size: .83rem; border: 1px solid #768b78; border-radius: 6px; }
.image-options input:checked + span { background: var(--action); border-color: var(--action); color: #fff; }
.image-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.palette-image > :is(img, canvas) { display: block; width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; border-radius: 6px; }
.palette-preview p { color: var(--muted); font-size: .8rem; margin: 8px 0 0; }
.reticle-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.reticle-options canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(ellipse at center, #39423d, #18201a); }
.reticle-options figcaption { text-align: center; }
.zoom-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.zoom-frame { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.zoom-frame.zoomed img { transform: scale(3); }
.zoom-selection { position: absolute; inset: 33.333%; border: 2px solid var(--display-accent); box-shadow: 0 0 0 1px #111512; }
.detail-body dl { margin-top: 17px; }
.detail-body dl > div { display: grid; grid-template-columns: minmax(115px, .32fr) minmax(0, 1fr); align-items: baseline; gap: 10px 22px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-body dl > div:last-child { border-bottom: 0; }
dt { font-weight: 680; }
dd { color: var(--muted); }
.callout { padding: 11px 15px; border-left: 2px solid var(--accent); background: var(--panel); color: var(--muted); margin-top: 12px; }
.detail-body .button { margin-top: 18px; }
.palette-detail { margin-top: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 7px; }
.palette-detail summary { color: var(--accent); cursor: pointer; }
.palette-detail p { margin-top: 8px; color: var(--muted); }
code { font-size: .88em; color: var(--text); }

.activate-page { max-width: 920px; padding-bottom: 55px; min-height: 70vh; }
.activate-grid { display: grid; grid-template-columns: 1.2fr .8fr; align-items: start; gap: 24px; }
.activation-card { padding: clamp(18px, 4vw, 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.activation-card h2, .activate-help h2 { font-size: 1.24rem; }
.activation-card form { margin-top: 15px; }
.activation-card label { display: block; margin: 13px 0 6px; font-size: .9rem; }
.activation-card input { display: block; width: 100%; border: 1px solid #566352; border-radius: 6px; background: var(--canvas); color: var(--text); padding: 10px 12px; font: inherit; }
.activation-card input::placeholder { color: #596c60; }
.activation-card .button { margin-top: 15px; }
#activation-status { margin-top: 10px; font-size: .88rem; color: var(--accent); }
#activation-result output { display: block; overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: .87rem; padding: 8px 0 0; }
#activation-result p, .activate-help p { margin: 8px 0 18px; color: var(--muted); }
.activate-help { padding: 20px 0; }
.activate-help a { color: var(--accent); }
.footer { border-top: 1px solid var(--line); margin-top: clamp(28px, 5vw, 58px); }
.footer-inner { min-height: 104px; padding: 18px 0; }
.footer-inner p { font-size: .82rem; color: var(--muted); }
.downloads-page { min-height: 62vh; }
.download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.download-card { display: flex; flex-direction: column; gap: 10px; padding: clamp(18px, 4vw, 32px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.download-card > p { color: var(--muted); }
.download-card .download-version { color: var(--accent); font-size: .87rem; font-weight: 700; }
.download-card .actions { margin-top: auto; padding-top: 8px; }
.download-card .actions > a:not(.button), .download-help a, .guide-page .detail-body a, .detail-body dd a { color: var(--accent); }
.download-help { margin-top: 14px; }
.settings-heading { margin-top: 24px; }
.guide-page .detail-body section > p, .guide-page .detail-body ol { margin: 12px 0; color: var(--muted); }
.guide-page .detail-body ol { padding-left: 1.4em; }
.guide-page .detail-body li + li { margin-top: 8px; }

@media (max-width: 820px) {
  .wrap { width: min(100% - 36px, 1180px); }
  .hero { grid-template-columns: 1fr; }
  .hero h1 span { display: inline; margin-left: .11em; }
  .hero-figure { width: min(100%, 620px); }
  .image-frame img { aspect-ratio: 2 / 1; object-fit: contain; }
  .feature-list { grid-template-columns: 1fr; }
  .feature-list article + article { border-left: 0; border-top: 1px solid var(--line); }
  .details-layout { grid-template-columns: 1fr; gap: 20px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px 13px; }
}
@media (max-width: 570px) {
  .top-inner { display: grid; grid-template-columns: 1fr auto; min-height: auto; padding: 12px 0; gap: 10px; }
  .top nav { grid-row: 2; grid-column: 1 / -1; gap: 18px; }
  .top-download { grid-row: 1; grid-column: 2; }
  .edition { font-size: .7rem; }
  .setup, .activate-grid, .download-grid { display: grid; grid-template-columns: 1fr; }
  .setup ol { grid-row: auto; }
  .detail-body dl > :is(div, div.with-button) { grid-template-columns: 1fr; gap: 3px; }
  .app-screen { grid-template-columns: minmax(61px, 1fr) minmax(0, 3.25fr) minmax(61px, 1fr); }
  .app-rail a { min-height: 22px; padding: 2px 3px; font-size: .66rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 14px; }
  .footer nav { flex-wrap: wrap; gap: 10px 16px; }
}
