:root {
    color-scheme: dark;
    --bg: #101113;
    --panel: #1a1b1e;
    --line: #303135;
    --text: #f3f1ec;
    --muted: #b8b6b7;
    --accent: #ff6756;
    --mono: "IBM Plex Mono", Consolas, "SFMono-Regular", monospace;
    --sans: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #ffe2b6; outline-offset: 4px; }
::selection { background: #914249; color: #fff; }
h1, h2, h3, p { margin: 0; }
.icon { display: inline-block; flex: none; width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.home { background: #000601; }
.landing {
    --screen-height: 100vh;
    --gutter: clamp(12px, 2.5vw, 32px);
    --vertical-padding: clamp(10px, 2.1vh, 28px);
    --art-height: min(calc((100vw - var(--gutter) - var(--gutter)) * 1204 / 1306), calc(var(--screen-height) * .72));
    display: flex; flex-direction: column; align-items: center; justify-content: center; justify-content: safe center;
    height: var(--screen-height); gap: clamp(8px, 1.6vh, 18px);
    padding: var(--vertical-padding) var(--gutter) max(var(--vertical-padding), env(safe-area-inset-bottom));
}
@supports (height: 100svh) { .landing { --screen-height: 100svh; } }
.scene { position: relative; width: 100%; min-height: 100px; flex: 0 1 var(--art-height); }
.scene img { position: absolute; inset: 0; display: block; margin: auto; width: auto; height: 100%; max-width: 100%; object-fit: contain; }
.portal {
    flex: none; width: min(100%, 960px); display: flex; align-items: center; flex-direction: column; text-align: center;
}
.portal h1 {
    margin: 0 0 8px; font: 400 clamp(2.2rem, 3.7vw, 3.75rem)/1.25 var(--sans);
    color: #ffedc5; letter-spacing: .035em; word-spacing: .1em; word-break: keep-all; text-wrap: balance;
}
.edition { display: flex; align-items: center; gap: 13px; color: #e3ca95; font: 600 .76rem/1.5 var(--mono); letter-spacing: .25em; text-indent: .25em; text-shadow: 0 1px 4px #020603; }
.edition img { display: block; width: 20px; height: auto; margin-right: -6px; }
.edition::before, .edition::after { content: ""; height: 1px; width: 28px; background: #c39851a6; }
.downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 560px); gap: 12px; margin-top: clamp(19px, 2.8vh, 32px); }
.download-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 53px; padding: 9px 13px;
    color: #ffebc4; background: linear-gradient(155deg, #253020f5, #0d1812fa 67%);
    border: 1px solid #b18c50; border-radius: 4px; box-shadow: inset 0 1px #f7dc9f2d, 0 4px 14px #02050377;
    font-size: 1.1rem; font-weight: 650; letter-spacing: .06em; transition: background .18s, box-shadow .18s, transform .18s;
}
.download-button .icon { width: 23px; height: 23px; }
.download-button:hover { transform: translateY(-2px); border-color: #f5cf88; background: linear-gradient(150deg, #3d4129, #18271a); box-shadow: 0 5px 18px #ae84352b; }
.download-button:active { transform: translateY(0); }
.utility-links { display: flex; align-items: center; justify-content: center; margin-top: 15px; }
.utility-links a { position: relative; display: flex; align-items: center; gap: 7px; min-height: 43px; padding: 0 18px; font-size: .92rem; font-weight: 550; color: #f6e5c6; text-shadow: 0 1px 4px #040a05, 0 1px 10px #040a05; }
.utility-links a + a::before { content: ""; position: absolute; left: 0; height: 13px; border-left: 1px solid #e4d7cb8c; }
.utility-links a:hover { color: #ffd4ad; text-decoration: underline; text-underline-offset: 5px; }
.utility-links .icon { width: 16px; height: 16px; }

.reader {
    color: #f1ede0; background: #121c16; border: 1px solid #64563b; border-top: 2px solid #c19c58; border-radius: 5px;
    width: min(540px, calc(100% - 32px)); max-height: min(80vh, 700px); max-height: min(80svh, 700px);
    padding: 0; overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 24px 90px #0508148c;
}
.reader::backdrop { background: #030b08c7; backdrop-filter: blur(5px); }
.reader[open]:not(:modal) { position: fixed; inset: 0; height: fit-content; margin: auto; z-index: 10; box-shadow: 0 0 0 100vmax #030b08c7; }
.reader-content { padding: clamp(21px, 3vw, 32px); }
.reader-tools { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.reader-heading { font-size: clamp(1.35rem, 2.4vw, 1.65rem); overflow-wrap: anywhere; font-weight: 700; line-height: 1.5; }
.reader-heading:focus { outline: none; }
.icon-button { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 4px; background: #ffffff09; border: 1px solid #ffffff22; color: #d7d2cf; }
.icon-button:hover { background: #ffffff17; }
.icon-button .icon { width: 17px; height: 17px; }
.reader-date { display: inline-flex; align-items: center; gap: 7px; margin-top: 6px; color: #bbb8bf; font: .83rem/1.5 var(--mono); }
.reader-date .icon { width: 14px; height: 14px; }
.reader-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; color: #e0dcd9; margin-top: 17px; padding-top: 15px; border-top: 1px solid #ffffff24; }
.reader-back { display: inline-flex; align-items: center; margin-top: 13px; min-height: 40px; color: #efcb86; font-size: .9rem; }
.reader-back:hover { text-decoration: underline; }
.notice-list { border-top: 1px solid #ffffff26; margin-top: 16px; }
.news-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #ffffff1a; }
.news-row:hover .notice-name { color: #ffe1a6; }
.notice-summary { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.notice-kind { flex: none; color: #d9ba80; font-size: .77rem; }
.notice-name { overflow-wrap: anywhere; }
.news-row time { flex: none; color: #b4b4bd; font: .77rem/1.6 var(--mono); }
.empty { padding: 20px 0; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 16px; color: #c2c0c2; font-size: .875rem; }
.pagination a { padding: 5px 10px; border: 1px solid #ffffff28; border-radius: 3px; color: var(--text); }
.copy-entry { margin-top: 18px; }
.copy-entry[hidden] { display: none; }
.copy-feedback { display: block; margin-top: 8px; color: #c8c5c4; font-size: .875rem; overflow-wrap: anywhere; }
.copy-feedback a { text-decoration: underline; color: #eacd95; }

.brand-link, .brand { display: inline-flex; align-items: center; }
.brand { gap: 10px; white-space: nowrap; }
.brand img { display: block; }
.brand-words { display: grid; gap: 3px; }
.brand-words b { font-size: 1.4rem; font-weight: 800; letter-spacing: .11em; line-height: 1.05; }
.brand-words small { font: 700 .61rem/1.1 var(--mono); color: #b6b4b4; letter-spacing: .12em; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 3px; min-height: 44px; padding: 0 22px; font-size: .97rem; font-weight: 650; }
.button.primary { color: #170d0c; background: var(--accent); }
.button.primary:hover { background: #ff8c78; }
.button.quiet { color: var(--text); background: #272930; border-color: #484850; }
.button.quiet:hover { background: #32353c; }
.button .icon { width: 18px; height: 18px; }
.service-error { max-width: 560px; padding: 14vh 24px; margin: auto; }
.service-error p { margin: 14px 0 22px; color: var(--muted); }

@media (max-width: 640px) {
    .portal h1 { font-size: clamp(1.5rem, 8vw, 2.8rem); margin-bottom: 6px; }
    .edition { gap: 8px; font-size: .65rem; letter-spacing: .21em; }
    .edition::before, .edition::after { width: 20px; }
    .edition img { width: 17px; margin-right: -3px; }
    .downloads { grid-template-columns: minmax(0, 1fr); width: min(62vw, 246px); gap: 9px; margin-top: 18px; }
    .download-button { min-height: 47px; font-size: 1.03rem; }
    .download-button .icon { width: 21px; height: 21px; }
    .utility-links { margin-top: 11px; }
    .utility-links a { padding: 0 12px; font-size: .85rem; }
    .brand { gap: 7px; }
    .brand img { width: 36px; height: 36px; }
    .brand-words b { font-size: 1.15rem; }
    .brand-words small { font-size: .55rem; }
    .news-row { display: grid; gap: 3px; }
    .news-row time { padding-left: 35px; }
}
@media (min-width: 641px) and (max-height: 680px) and (orientation: landscape) {
    .portal h1 { margin-bottom: 4px; font-size: clamp(2rem, 6.8vh, 2.75rem); }
    .downloads { margin-top: 12px; }
    .utility-links { margin-top: 7px; }
}
@media (max-height: 510px) and (orientation: landscape) {
    .portal h1 { font-size: clamp(1.55rem, 7.5vh, 2.25rem); margin-bottom: 3px; }
    .edition { font-size: .65rem; line-height: 1.3; }
    .downloads { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(85vw, 505px); margin-top: 9px; gap: 8px; }
    .download-button { min-height: 43px; }
    .utility-links { margin-top: 3px; }
    .utility-links a { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
