:root {
    color-scheme: light;
    --ink: #202d43;
    --muted: #565e67;
    --blue: #25558e;
    --red: #ab382d;
    --page: #fbf6e9;
    --paper: #f0e7d0;
    --rule: #b2ac9e;
    --wash: #e5ebeb;
    font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
    color: var(--ink);
    background: #becbc4;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, .table-scroll:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}
img { display: block; width: 100%; height: auto; }
figure, p, h1, h2 { margin: 0; }
p + p { margin-top: 12px; }
code, kbd, pre, textarea {
    font-family: "IBM Plex Mono", Consolas, "Microsoft YaHei UI", monospace;
    font-size: .91em;
}
code { overflow-wrap: anywhere; }
kbd { padding: 2px 6px; background: var(--paper); border: 1px solid var(--rule); white-space: nowrap; }
pre { overflow: auto; padding: 12px 16px; background: var(--wash); }
h2 { margin: 28px 0 10px; font-size: clamp(21px, 3vw, 27px); line-height: 1.3; }
.visually-hidden, .skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}
.skip-link { position: fixed; z-index: 1; padding: 8px; background: var(--page); }
.sheet {
    width: min(1184px, calc(100% - 56px));
    margin: 26px auto 42px;
    padding: 28px clamp(18px, 4vw, 50px) 0;
    background: var(--page);
    box-shadow: 9px 10px 0 #202d432c;
}
.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 5px solid var(--ink);
}
.brand { display: flex; align-items: baseline; gap: 14px; text-decoration: none; color: var(--ink); font-weight: 750; }
.brand-name { font-size: 27px; font-weight: 900; letter-spacing: -.055em; }
.brand-name span { color: var(--red); }
.version { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 4px 10px; color: var(--blue); font-size: 12px; }
.version strong { border: 1px solid currentColor; padding: 3px 8px; }
.navigation { display: flex; gap: 6px; flex-wrap: wrap; margin: 15px 0 27px; }
.navigation a {
    padding: 7px 12px;
    border: 1px solid transparent;
    color: var(--ink);
    font-size: 14px;
    text-decoration: none;
}
.navigation a:hover { border-color: var(--ink); background: var(--paper); }
.navigation a[aria-current] { background: var(--ink); color: white; }
.navigation a[href="#config"] { margin-left: auto; border-color: var(--rule); }
.navigation a[href="#config"][aria-current] { border-color: var(--ink); }
.page { padding: 0 0 33px; }
.hero {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: clamp(16px, 3vw, 40px);
    border: 1px solid var(--rule);
    border-left: 6px solid var(--blue);
    padding: clamp(18px, 3.3vw, 42px);
    background-color: var(--wash);
    background-image: radial-gradient(#25558e1e .7px, transparent .7px);
    background-size: 7px 7px;
}
.eyebrow { width: fit-content; color: var(--red); font-weight: 800; font-size: 13px; letter-spacing: .1em; }
h1 { font-size: clamp(36px, 6vw, 68px); font-weight: 900; letter-spacing: -.065em; line-height: 1.08; }
.hero h1 { margin: 8px 0 16px; }
.hero-copy > p:not(.eyebrow) { max-width: 32em; color: #354658; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.hero .actions { margin-top: 23px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 41px;
    padding: 8px 13px;
    border: 1px solid var(--ink);
    color: var(--ink);
    background: var(--page);
    text-decoration: none;
    font-size: 14px;
    font-weight: 750;
    text-align: center;
}
.button:hover:not(:disabled) { background: var(--paper); }
.button.primary { color: white; background: var(--red); box-shadow: 3px 3px 0 var(--ink); }
.button.primary:hover:not(:disabled) { background: #8e2c25; }
.text-link { font-weight: 750; font-size: 14px; }
.hero-image { min-width: 0; padding: 7px; border: 1px solid var(--ink); background: var(--page); box-shadow: 5px 5px 0 #202d4333; }
.hero-image button, .photo button { display: block; width: 100%; border: 0; padding: 0; background: var(--ink); }
.hero-image img { aspect-ratio: 16 / 9; object-fit: contain; }
.hero-image figcaption { display: flex; justify-content: space-between; gap: 6px; padding: 6px 4px 0; font-size: 12px; }
.hero-image figcaption span { color: var(--muted); }
.facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 25px 0 20px;
    border-block: 1px solid var(--ink);
    background: var(--page);
}
.facts > div { display: grid; align-content: center; padding: 12px 15px; gap: 1px; }
.facts > div + div { border-left: 1px solid var(--rule); }
.facts strong { color: var(--blue); font-size: clamp(19px, 3vw, 28px); line-height: 1.2; font-variant-numeric: tabular-nums; }
.facts span { color: var(--muted); font-size: 13px; }
.home-sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.home-sections a { display: block; padding: 15px 17px; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); border-top: 3px solid var(--ink); background: var(--paper); }
.home-sections a:hover { border-color: var(--blue); background: var(--wash); }
.home-sections a span { display: block; font-size: 12px; color: var(--red); font-weight: 750; }
.home-sections a strong { display: block; font-size: 19px; margin: 3px 0; }
.home-sections a p { color: var(--muted); font-size: 14px; }
.page-heading { padding: 2px 0 17px; margin-bottom: 21px; border-bottom: 2px solid var(--ink); }
.page-heading h1 { margin: 3px 0 9px; font-size: clamp(32px, 5vw, 51px); }
.page-heading > p:last-child { color: var(--muted); }
.flow { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 0 0 16px; list-style: none; }
.flow li { position: relative; border: 1px solid var(--ink); padding: 4px 9px; background: var(--paper); }
.flow li:not(:last-child)::after { content: "›"; position: absolute; left: calc(100% + 6px); font-weight: 900; color: var(--blue); }
.table-scroll { max-width: 100%; overflow-x: auto; border-bottom: 1px solid var(--rule); margin: 0 0 18px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding: 7px 11px; color: var(--page); background: var(--blue); font-weight: 800; letter-spacing: .03em; }
td, th { padding: 8px 11px; border-top: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--paper); white-space: nowrap; }
tbody th { font-weight: 750; min-width: 80px; }
tbody tr:nth-child(even) { background: #f3eedf; }
.split-section { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: start; margin: 24px 0; }
.split-section h2 { margin-top: 0; }
.steps { padding-left: 24px; margin: 0; }
.steps li { margin-bottom: 8px; }
.steps li strong, .steps li span { display: block; }
.steps li span { color: var(--muted); font-size: 14px; }
.callout { padding: 12px 16px; margin-top: 18px; border-left: 4px solid var(--blue); background: var(--wash); }
.note, .raw-editor { margin: 18px 0 0; padding: 11px 14px; border: 1px solid var(--rule); background: var(--paper); }
summary { cursor: pointer; color: var(--blue); font-weight: 800; }
details > p { margin-top: 9px; font-size: 14px; }
.filter-bar, .tag-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 13px; margin-bottom: 13px; }
.filter-bar label { font-size: 14px; font-weight: 800; }
.filter-bar input { width: min(100%, 360px); }
.filter-bar span { font-size: 13px; color: var(--muted); }
.tag { border: 1px solid var(--rule); padding: 5px 13px; background: var(--page); font-size: 14px; }
.tag[aria-pressed="true"] { background: var(--blue); color: white; border-color: var(--blue); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.photo { min-width: 0; padding: 6px; background: var(--paper); border: 1px solid var(--rule); }
.photo button:hover, .hero-image button:hover { outline: 2px solid var(--blue); }
.photo img { aspect-ratio: 16 / 9; object-fit: contain; }
.photo figcaption { padding: 8px 5px 3px; }
.photo figcaption strong { display: inline-block; margin-right: 8px; }
.photo figcaption p, .photo figcaption small { color: var(--muted); font-size: 13px; }
.photo figcaption p { margin: 4px 0 0; }
dialog { width: min(1050px, 94vw); max-height: 94vh; border: 2px solid var(--ink); background: var(--page); padding: 10px; color: var(--ink); }
dialog::backdrop { background: #151e2bd9; }
dialog img { max-height: 72vh; object-fit: contain; background: var(--ink); }
.lightbox-head, .lightbox-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px 9px; }
.lightbox-foot { padding: 9px 2px 2px; font-size: 13px; flex-wrap: wrap; }
.config-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 13px 16px; border: 1px solid var(--rule); border-left: 4px solid var(--blue); background: var(--wash); }
.config-toolbar > div:first-child { min-width: 0; overflow-wrap: anywhere; }
#config-status { font-size: 13px; color: var(--muted); white-space: pre-wrap; }
#config-status.invalid { color: var(--red); }
.config-layout { display: grid; grid-template-columns: minmax(145px, .28fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 16px; }
.config-sidebar { background: var(--paper); border: 1px solid var(--rule); padding: 10px; }
.config-sidebar label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 4px; }
input, select, textarea { background: var(--page); border: 1px solid var(--rule); border-radius: 0; min-width: 0; padding: 6px 8px; }
.config-sidebar input, .field-value input, .field-value select, textarea { width: 100%; }
#config-groups { display: grid; gap: 4px; margin-top: 8px; }
#config-groups button { border: 1px solid transparent; background: transparent; text-align: left; padding: 5px 7px; font-size: 14px; }
#config-groups button:hover { border-color: var(--blue); }
#config-groups button[aria-pressed="true"] { color: white; background: var(--blue); }
#config-fields { border-top: 3px solid var(--ink); }
#config-fields header { padding: 9px 11px; background: var(--wash); }
#config-fields h2 { margin: 0; font-size: 19px; }
#config-fields header p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .55fr); gap: 11px; border-bottom: 1px solid var(--rule); padding: 9px 11px; }
.field.has-error { background: #f7e0d5; }
.field-description { display: grid; align-content: start; }
.field-description label { font-weight: 750; font-size: 14px; }
.field-description code { color: var(--blue); }
.field small { color: var(--muted); font-size: 12px; }
.field-default { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.text-button { border: 1px solid var(--rule); background: var(--page); color: var(--blue); text-align: left; padding: 6px 8px; font-size: 14px; }
.errors { padding: 8px 12px; color: #792721; background: #f7e0d5; border: 1px solid #bf756d; margin-bottom: 12px; font-size: 14px; }
.errors ul { margin: 5px 0 0; padding-left: 22px; }
.raw-editor textarea { display: block; margin: 8px 0 10px; resize: vertical; line-height: 1.5; white-space: pre; }
.config-help { margin-top: 17px; font-size: 13px; color: var(--muted); }
.footer { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0 14px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; }
.footer a { font-weight: 800; text-decoration: none; }
.empty { padding: 15px; background: var(--wash); }
@media (max-width: 820px) {
    .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .sheet { width: calc(100% - 20px); margin: 10px auto 22px; padding-inline: 13px; box-shadow: 3px 4px 0 #202d432c; }
    .masthead, .brand { align-items: flex-start; }
    .brand { gap: 0; flex-direction: column; }
    .brand > span:last-child, .version { font-size: 11px; }
    .navigation { margin-bottom: 17px; gap: 4px; }
    .navigation a { padding: 5px 7px; }
    .navigation a[href="#config"] { margin-left: 0; }
    .hero, .home-sections, .split-section, .config-layout { grid-template-columns: minmax(0, 1fr); }
    .hero { padding: 16px; }
    .hero h1 br { display: none; }
    .facts { grid-template-columns: repeat(2, 1fr); }
    .facts > div:nth-child(3) { border-left: 0; }
    .facts > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
    #config-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 425px) {
    .gallery, .field { grid-template-columns: minmax(0, 1fr); }
}
