:root {
  color-scheme: dark;
  --bg: #10161e;
  --header: #0c1118;
  --surface: #171f2a;
  --surface-deep: #121a23;
  --line: #313741;
  --gold-line: #74614a;
  --text: #f2eee7;
  --muted: #b4bcc7;
  --gold: #e7c893;
  --error: #ffc0b5;
  --success: #b5e1c6;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "Noto Serif CJK SC", "Songti SC", "STSong", SimSun, Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.65 var(--sans); }
h1, h2, h3, p, ol, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, fieldset:disabled select { cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.skip-link { position: absolute; z-index: 5; left: 20px; top: 8px; padding: 8px 16px; background: var(--gold); color: var(--header); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.shell { width: min(1240px, calc(100% - 112px)); margin-inline: auto; }

.site-header { position: relative; z-index: 2; background: var(--header); border-bottom: 1px solid #ad875836; }
.header-inner { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 15px; min-height: 48px; color: #f0dfc4; flex: 0 0 auto; }
.crest { position: relative; display: block; width: 32px; height: 32px; transform: rotate(45deg); border: 1px solid var(--gold-line); }
.crest::before, .crest::after { content: ""; position: absolute; background: var(--gold); }
.crest::before { inset: 5px; transform: rotate(-45deg); clip-path: polygon(50% 0, 60% 35%, 100% 50%, 60% 61%, 50% 100%, 39% 61%, 0 50%, 39% 35%); }
.crest::after { width: 4px; height: 4px; top: -2px; left: -2px; box-shadow: 29px 29px var(--gold); }
.brand-name { display: inline-flex; align-items: baseline; gap: 10px; font: 700 1.87rem/1 Georgia, serif; letter-spacing: .06em; }
.brand-name small { font: 700 .91rem/1 var(--serif); letter-spacing: .17em; }
.site-header nav { align-self: stretch; display: flex; align-items: stretch; gap: clamp(12px, 2.8vw, 38px); }
.site-header nav a { display: grid; place-items: center; min-height: 46px; padding: 0 3px; color: var(--muted); font-size: .94rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.site-header nav a:hover, .site-header nav a.current { color: var(--gold); border-bottom-color: var(--gold-line); }

.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: .6em 1.34em; border: 1px solid transparent; border-radius: 3px; font-weight: 700; font-size: .95rem; line-height: 1.45; text-align: center; transition: background .18s, border-color .18s, color .18s; }
.button.primary { background: linear-gradient(104deg, #edd3a5, #cda56c); color: #1a150f; border-color: #eac994; box-shadow: inset 0 0 0 2px #2f24151c; }
.button.primary:hover:not(:disabled) { background: #f4deb6; border-color: #f4deb6; }
.button.outline { color: var(--gold); background: #131924b5; border-color: var(--gold-line); }
.button.outline:hover:not(:disabled), .button[aria-current="page"] { color: #fff0d5; background: #2a3039; border-color: var(--gold); }
.button:disabled { opacity: .65; }
.button.full { width: 100%; }
.header-action { min-height: 44px; white-space: nowrap; }

.hero { position: relative; isolation: isolate; overflow: clip; background: #101b27; border-bottom: 1px solid #a1845270; }
.hero-image, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-image { object-fit: cover; object-position: center 41%; }
.hero::after { content: ""; background: linear-gradient(90deg, #0b121c98, #0b121c4d 43%, transparent 71%), linear-gradient(0deg, #0b121cea, transparent 34%); }
.hero-inner { position: relative; display: grid; align-items: center; min-height: clamp(485px, 43.5vw, 680px); }
.hero-copy { max-width: 600px; padding-block: 70px 90px; }
.hero-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--gold); font-size: .88rem; font-weight: 700; letter-spacing: .2em; }
.hero-kicker span { display: inline-block; width: 25px; height: 1px; background: #d3ad70; }
.hero-kicker b { font-weight: 400; opacity: .7; }
.hero h1 { margin-top: .17em; color: #f7efe3; font: 700 clamp(3.35rem, 6vw, 6rem)/1.16 var(--serif); letter-spacing: .08em; text-shadow: 0 3px 32px #000a; }
.hero-description { margin: 22px 0 30px; color: #e1e0db; font-size: clamp(1rem, 1.45vw, 1.17rem); line-height: 1.85; text-shadow: 0 2px 10px #000c; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; }
.hero-actions .button { min-height: 52px; padding-inline: 25px; }
.hero-caption { position: absolute; right: 0; bottom: 25px; display: flex; align-items: center; gap: 12px; font-size: .875rem; color: #ede2d0; letter-spacing: .12em; }
.hero-caption span { width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }

.news-layout { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr); gap: clamp(28px, 5vw, 76px); align-items: start; padding-block: 54px 55px; }
.section-title { display: flex; align-items: center; gap: 14px; }
.section-title h2 { color: var(--text); font: 700 clamp(1.56rem, 2.4vw, 2rem)/1.3 var(--serif); letter-spacing: .075em; }
.section-mark { display: block; width: 9px; height: 9px; margin-inline: 2px; background: var(--gold); outline: 1px solid #807054; outline-offset: 3px; transform: rotate(45deg); }
.notice-filters { display: flex; flex-wrap: wrap; gap: 3px clamp(2px, 1vw, 10px); margin-top: 16px; border-bottom: 1px solid var(--line); }
.notice-filters button { min-width: 51px; min-height: 44px; padding-inline: 10px; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; font-size: .94rem; }
.notice-filters button:hover, .notice-filters button[aria-pressed="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.notice-list, .admin-list, .class-list { list-style: none; padding: 0; }
.notice-list a { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 13px; align-items: center; min-height: 59px; padding: 10px 6px; border-bottom: 1px solid var(--line); transition: background .18s, color .18s; }
.notice-list a:hover { color: var(--gold); background: #1a2231; }
.notice-name { min-width: 0; overflow-wrap: anywhere; }
.tag { display: inline-flex; width: max-content; align-items: center; padding: 2px 9px; color: var(--gold); background: #e3af581a; border: 1px solid #a1804b5c; border-radius: 2px; font-size: .875rem; line-height: 1.5; }
.tag[data-category="指南"] { color: #bfdbef; background: #789abe1c; border-color: #7e96ac5c; }
.tag[data-category="活动"] { color: #ddc5f2; background: #947bbb25; border-color: #947bbb70; }
.tag[data-category="更新"] { color: #b5e1c6; background: #78bb9821; border-color: #78bb986b; }
.notice-pin { margin-inline-start: 8px; color: var(--gold); font-size: .8125rem; white-space: nowrap; }
.notice-list time, .article-meta time { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-status { color: var(--muted); padding: 19px 0; }
#more-notices { margin-top: 18px; }
.field-guide { position: relative; overflow: clip; padding: 27px clamp(23px, 3vw, 36px) 28px; background: linear-gradient(133deg, #222936, #141b25 70%); border: 1px solid #534837; border-top-color: var(--gold-line); }
.field-guide > p { position: relative; margin-top: 8px; color: var(--muted); }
.guide-steps { position: relative; list-style: none; padding: 0; margin: 20px 0 21px; display: grid; gap: 12px; }
.guide-steps li { position: relative; padding-left: 20px; }
.guide-steps li::before { content: ""; position: absolute; width: 6px; height: 6px; left: 1px; top: .62em; background: var(--gold); transform: rotate(45deg); }
.guide-steps b, .guide-steps small { display: block; }
.guide-steps b { font-size: .94rem; }
.guide-steps small { color: var(--muted); font-size: .875rem; }
.card-glyph { position: absolute; right: -16px; top: -21px; width: 135px; height: 135px; border: 1px solid #e8c68d28; transform: rotate(45deg); }
.card-glyph::before, .card-glyph::after { content: ""; position: absolute; border: 1px solid #e8c68d28; inset: 9px; }
.card-glyph::after { inset: 25px; transform: rotate(45deg); }
.card-glyph i { position: absolute; inset: 36px; background: #e8c68d23; clip-path: polygon(50% 0, 58% 43%, 100% 50%, 58% 57%, 50% 100%, 42% 57%, 0 50%, 42% 43%); }

.game { padding-block: 36px 64px; border-top: 1px solid var(--line); }
.game-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 18px; margin-top: 25px; }
.game-grid article { padding: 24px; background: var(--surface); border: 1px solid var(--line); }
.game-tag { color: var(--gold); font-size: .875rem; letter-spacing: .13em; }
.game-grid h3 { margin: 4px 0 9px; font: 700 1.27rem/1.4 var(--serif); }
.game-grid article > p:not(.game-tag) { color: var(--muted); }
.class-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.class-list li { padding: 2px 7px; color: #e2dccf; background: #0d141c; border: 1px solid var(--line); font-size: .875rem; }
.site-footer { background: var(--header); border-top: 1px solid var(--line); }
.footer-inner { display: flex; min-height: 85px; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 24px; color: var(--muted); font-size: .875rem; }
.footer-inner strong { color: var(--gold); margin-inline-end: 15px; }
.footer-inner a { display: inline-flex; min-height: 44px; align-items: center; }
.footer-inner a:hover { color: var(--gold); }

dialog { width: min(690px, calc(100% - 32px)); max-height: min(78vh, 760px); padding: 32px clamp(22px, 5vw, 42px); color: var(--text); background: #1a222e; border: 1px solid var(--gold-line); border-top: 2px solid var(--gold); box-shadow: 0 22px 85px #000a; }
dialog::backdrop { background: #080b13cc; }
dialog h2 { font: 700 1.85rem/1.35 var(--serif); margin: 10px 0 17px; overflow-wrap: anywhere; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--gold); background: none; border: 1px solid transparent; font-size: 1.65rem; line-height: 1; }
.icon-button:hover { border-color: var(--gold-line); }
.close-dialog { position: absolute; right: 9px; top: 8px; }
.article-meta { display: flex; gap: 12px; align-items: center; padding-right: 30px; }
.article-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #e0e3e7; }

.inner-page { min-height: 100vh; display: flex; flex-direction: column; }
.inner-page > main { flex: 1 0 auto; }
.inner-page h1 { font: 700 clamp(2.45rem, 5vw, 4.15rem)/1.15 var(--serif); letter-spacing: .065em; }
.inner-page h2 { font: 700 clamp(1.27rem, 2.8vw, 1.6rem)/1.4 var(--serif); }
.register-layout { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 560px); gap: clamp(35px, 7vw, 105px); align-items: start; padding-block: clamp(40px, 6vw, 90px); }
.register-intro { padding-top: 28px; }
.register-intro h1 { margin: 9px 0 17px; }
.register-intro > p:not(.hero-kicker), .register-note p { color: var(--muted); }
.register-note { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 19px; max-width: 440px; }
.register-note h2 { font-size: 1.24rem; }
.register-note p { margin: 9px 0; }
.register-note a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gold); text-decoration: underline; text-underline-offset: .27em; }
.surface { min-width: 0; padding: clamp(20px, 3vw, 36px); background: var(--surface); border: 1px solid var(--line); border-top-color: var(--gold-line); }
.register-panel form, .login-panel form, .editor form { margin-top: 18px; }
.field, .field-pair { display: grid; gap: 5px; }
.field { margin-bottom: 16px; font-size: .94rem; font-weight: 700; }
.field-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field-pair .field { margin-bottom: 0; }
.field-hint, .field small { font-size: .875rem; color: var(--muted); font-weight: 400; }
.field small[data-kind="error"] { color: var(--error); }
.field-hint { margin: 6px 0 15px; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #505b69; border-radius: 3px; padding: 9px 12px; background: var(--surface-deep); color: var(--text); font-size: 1rem; font-weight: 400; }
.field select { appearance: none; padding-right: 38px; background: linear-gradient(45deg, transparent 50%, #bfc5ce 50%) right 18px center / 6px 6px no-repeat, linear-gradient(-45deg, transparent 50%, #bfc5ce 50%) right 12px center / 6px 6px no-repeat, var(--surface-deep); }
.nation-control { position: relative; }
.nation-flag, .nation-legacy-flag {
  flex: none;
  width: 30px;
  height: 20px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #e7c89344;
}
.nation-legacy-flag {
  display: none;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: center / cover no-repeat var(--nation-flag);
  pointer-events: none;
}

/* 传统选择器的弹层由系统绘制，在闭合控件中保留已选徽记。 */
@supports not (appearance: base-select) {
  .nation-control:has(option[value="1"]:checked) { --nation-flag: url('/assets/nation-water.png'); }
  .nation-control:has(option[value="2"]:checked) { --nation-flag: url('/assets/nation-fire.png'); }
  .nation-control:has(option[value="3"]:checked) { --nation-flag: url('/assets/nation-earth.png'); }
  .nation-select:has(option:not([value=""]):checked) { padding-inline-start: 52px; }
  .nation-select:has(option:not([value=""]):checked) + .nation-legacy-flag { display: block; }
}

@supports (appearance: base-select) {
  .field .nation-select, .nation-select::picker(select) { appearance: base-select; }
  .field .nation-select { padding-inline: 12px; background: var(--surface-deep); }
  .nation-select selectedcontent, .nation-select option { display: flex; align-items: center; gap: 11px; }
  .nation-select::picker-icon {
    content: "";
    width: 8px;
    height: 8px;
    margin: 3px 5px 0 auto;
    border: solid var(--muted);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .nation-select:open::picker-icon { transform: rotate(225deg); margin-top: 8px; }
  .nation-select::picker(select) {
    margin-block: 5px;
    padding: 4px;
    border: 1px solid var(--gold-line);
    border-radius: 3px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 14px 30px #080b1388;
  }
  .nation-select option { min-height: 44px; padding: 7px 10px; cursor: pointer; }
  .nation-select option[value=""] { color: var(--muted); }
  .nation-select option:checked { background: #282e37; color: var(--gold); }
  .nation-select option:hover, .nation-select option:focus-visible { background: #303948; }
  .nation-select option::checkmark { order: 1; margin-inline-start: auto; color: var(--gold); }
}
.field textarea { resize: vertical; }
.field ::placeholder { color: #a0aab8; }
fieldset:disabled .field input, fieldset:disabled .field select { opacity: .6; }
.form-status, .form-feedback { margin: 14px 0; padding: 10px 13px; border-left: 2px solid var(--gold-line); background: #e7c8930d; color: var(--gold); font-size: .9375rem; overflow-wrap: anywhere; }
[data-kind="error"] { color: var(--error); border-color: var(--error); }
[data-kind="success"] { color: var(--success); border-color: var(--success); }
.completion { margin-top: 18px; padding: 20px; background: var(--surface-deep); border: 1px solid #66997e; }
.completion h3 { color: var(--success); }
.completion p { margin: 5px 0 16px; }

.admin-main { padding-block: 44px 64px; }
.admin-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-main h1 { font-size: clamp(2.25rem, 4vw, 3.25rem); }
.login-panel, .admin-grid { margin-top: 24px; }
.login-panel { max-width: 460px; }
.admin-grid { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(0, 1.6fr); gap: 22px; align-items: start; }
.admin-list { margin-top: 14px; }
.admin-list button { width: 100%; display: grid; gap: 2px; min-height: 58px; padding: 10px 9px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: var(--text); overflow-wrap: anywhere; }
.admin-list button:hover, .admin-list button[aria-pressed="true"] { background: #282e37; color: var(--gold); }
.admin-list small { color: var(--muted); font-size: .875rem; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; cursor: pointer; font-size: .94rem; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--gold); }
.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.download-banner {
  padding-block: clamp(44px, 7vw, 92px);
  background: linear-gradient(90deg, #111a26 17%, #111a26eb 48%, #111a2655),
    url("/assets/lakia-hero-game-reference.webp") center top / cover;
  border-bottom: 1px solid var(--gold-line);
}
.download-banner h1 { margin: 8px 0 16px; }
.download-banner p:last-child { color: #dedce0; max-width: 32rem; }
.downloads { padding-block: 36px 60px; }
.download-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; padding: 0; list-style: none; }
.download-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 102px; padding: 20px 24px; }
.download-card h3 { color: var(--text); font: 700 1.22rem/1.4 var(--serif); overflow-wrap: anywhere; }
.download-card p { margin-top: 5px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.download-card code { margin-left: 4px; color: var(--gold); font-size: 1rem; }
.download-card .button { flex-shrink: 0; }

@media (max-width: 1000px) {
  .shell { width: calc(100% - 72px); }
  .hero-image { object-position: 60% center; }
  .news-layout { gap: 26px; }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 40px); }
  .header-inner { min-height: 66px; flex-wrap: wrap; gap: 0 12px; padding-top: 8px; }
  .brand { min-height: 48px; gap: 12px; }
  .brand-name { font-size: 1.56rem; gap: 7px; }
  .brand-name small { font-size: .84rem; }
  .crest { width: 24px; height: 24px; margin-inline: 2px; }
  .crest::after { box-shadow: 22px 22px var(--gold); }
  .site-header nav { order: 3; width: 100%; flex-wrap: wrap; gap: 0 clamp(6px, 2vw, 18px); }
  .site-header nav a { min-height: 44px; font-size: .88rem; }
  .header-action { font-size: .875rem; min-height: 44px; }
  .hero-inner { min-height: 540px; align-items: end; }
  .hero-image { object-position: 80% center; }
  .hero::after { background: linear-gradient(0deg, #0b121cfa, #0b121ca6 51%, #0b121c13 86%), linear-gradient(90deg, #0a111878, transparent 82%); }
  .hero-copy { padding: 170px 0 83px; }
  .hero h1 { font-size: clamp(2.75rem, 9.5vw, 4.25rem); }
  .hero-description { margin-block: 16px 21px; }
  .hero-actions .button { padding-inline: 15px; }
  .news-layout, .register-layout, .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .download-list { grid-template-columns: minmax(0, 1fr); }
  .admin-heading { align-items: flex-start; flex-wrap: wrap; }
  .news-layout { padding-block: 37px; }
  .game-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .register-intro { padding-top: 0; }
  .register-note { margin-top: 18px; }
}

@media (max-width: 390px) {
  .shell { width: calc(100% - 32px); }
  .hero-actions { gap: 8px; }
  .hero-actions .button { padding-inline: 11px; }
  .notice-list a { gap: 8px; }
  .notice-list time { font-size: .8125rem; }
  .field-pair { grid-template-columns: 1fr; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
