:root {
  --bg: #f4eee2;
  --card: #fbf7ee;
  --ink: #2b2723;
  --muted: #7a6f63;
  --line: #e0d6c3;
  --brick: #a8412a;
  --brick-ink: #fff8ee;
  --steel: #4d6a7a;
  --good: #3f7a4f;
  --bad: #b3372b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1a17; --card: #26221e; --ink: #ece4d6; --muted: #a39887; --line: #3a342d;
    --brick: #d5694f; --brick-ink: #1d1a17; --steel: #8fb0c0; --good: #7fc08f; --bad: #e57d71;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.7 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
a { color: var(--steel); }
h1, h2, h3 { font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif; margin: 0 0 8px; line-height: 1.35; }
h2 { font-size: 18px; }
nav.top {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 2px solid var(--brick); margin-bottom: 16px;
}
nav.top .brand { font-family: "Songti SC", serif; font-weight: 700; font-size: 20px; color: var(--brick); margin-right: auto; text-decoration: none; }
nav.top a.l, nav.top button.l { color: var(--ink); text-decoration: none; padding: 4px 10px; border-radius: 6px; font-size: 15px; background: none; border: 0; cursor: pointer; font-family: inherit; }
nav.top a.l:hover, nav.top button.l:hover { background: var(--line); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--card); }
.flash.good { border-color: var(--good); }
.flash.bad { border-color: var(--bad); color: var(--bad); }
.hero { padding: 20px 0 8px; }
.hero .year { font-family: "Songti SC", serif; font-size: 44px; font-weight: 700; color: var(--brick); line-height: 1.1; }
.hero .who { font-size: 18px; margin-top: 4px; }
.hero .sub { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 14px 0; }
.card.sub-card { border-style: dashed; }
.muted { color: var(--muted); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.stat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 0; }
.bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 0 8px; }
.bar i { display: block; height: 100%; background: var(--steel); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .nm { font-weight: 600; }
.row .ds { color: var(--muted); font-size: 13px; line-height: 1.5; }
input[type=number] { width: 64px; padding: 8px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); text-align: center; }
input[type=text], input[type=password], select {
  width: 100%; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-family: inherit;
}
label.f { display: block; margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
button.primary, a.btn {
  display: inline-block; background: var(--brick); color: var(--brick-ink); border: 0; border-radius: 8px;
  padding: 10px 18px; font-size: 16px; cursor: pointer; text-decoration: none; font-family: inherit;
}
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-family: inherit; font-size: 15px; }
.energy { font-variant-numeric: tabular-nums; }
.energy b.over { color: var(--bad); }
.opt { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; cursor: pointer; }
.opt input { margin-right: 8px; }
.opt .ds { color: var(--muted); font-size: 13px; }
.note { white-space: pre-line; }
.bc { padding: 6px 0; border-top: 1px solid var(--line); }
.bc:first-child { border-top: 0; }
.bc .y { color: var(--brick); font-weight: 600; margin-right: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; }
footer a { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; }
@media (max-width: 480px) { .hero .year { font-size: 38px; } .grid2 { grid-template-columns: 1fr; } }

/* 地图、地点、结果、事件、集市 */
h1 { font-size: 26px; }
h2.section { margin: 20px 0 8px; }
.seal {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px; background: var(--brick); color: var(--brick-ink);
  font-family: "Songti SC", "STSong", serif; font-size: 20px; font-weight: 700;
}
.seal.small { width: 24px; height: 24px; font-size: 13px; border-radius: 5px; margin-right: 8px; }
.seal.large { width: 56px; height: 56px; font-size: 28px; border-radius: 10px; }
.vitals { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 12px 0; }
.vitals.compact { padding: 10px 16px; }
.meter { display: flex; align-items: center; gap: 10px; }
.bar.big { height: 10px; border-radius: 5px; margin: 0; }
.bar.big i { background: var(--brick); transition: width .4s ease; }
.vital-row { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: 15px; }
.vitals.compact .vital-row { margin-top: 0; }
.map { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.place-card {
  display: flex; gap: 12px; align-items: center; padding: 12px; min-height: 72px; color: var(--ink); text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; transition: transform .12s ease, border-color .12s ease;
}
.place-card:hover { transform: translateY(-2px); border-color: var(--brick); }
.place-card.has-event { border-color: var(--brick); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brick) 25%, transparent); }
.pc-body { min-width: 0; display: block; }
.pc-name { display: block; font-weight: 600; }
.pc-sub { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.place-hero { display: flex; gap: 14px; align-items: flex-start; }
.place-hero h1 { margin-bottom: 2px; }
.scene { margin: 0; color: var(--muted); font-size: 15px; }
.result {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brick); border-radius: 8px;
  padding: 12px 14px; margin: 12px 0; animation: rise .28s ease;
}
.result p { margin: 4px 0 8px; }
.gains { display: flex; flex-wrap: wrap; gap: 6px; }
.gains span { font-size: 13px; padding: 1px 9px; border-radius: 10px; background: var(--line); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .result { animation: none; } .place-card, .bar.big i { transition: none; } }
.event { background: var(--card); border: 2px solid var(--brick); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.event-head { display: flex; align-items: center; gap: 2px; }
.event-head .muted { margin-left: 6px; }
.event p { margin: 8px 0; }
button.choice {
  display: block; width: 100%; text-align: left; padding: 10px 12px; margin: 8px 0 0; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
button.choice:hover { border-color: var(--brick); }
.event-banner {
  display: flex; align-items: center; padding: 10px 14px; margin: 12px 0; border-radius: 8px; color: var(--brick);
  border: 1px solid var(--brick); background: var(--card); text-decoration: none; font-weight: 600;
}
.action {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0;
}
.action-body { min-width: 0; }
.action .nm, .row .nm { font-weight: 600; }
.action .ds { color: var(--muted); font-size: 13px; line-height: 1.5; }
.action .ds.lack { color: var(--bad); }
.boost { display: block; font-size: 13px; margin-top: 4px; cursor: pointer; }
.boost.off { color: var(--muted); cursor: default; }
.back { margin-top: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two .card { margin: 14px 0 0; }
.card.accent { border-color: var(--brick); }
.tag.first { margin-left: 0; margin-right: 6px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row > div { flex: 1 1 140px; min-width: 0; }
.form-row > div.narrow { flex: 0 0 84px; }
.form-row input[type=number] { width: 100%; }
.shop-btns { display: flex; flex: none; gap: 6px; }
.shop-btns button { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
button.ghost:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 480px) {
  .map, .two { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
}
.event-banner.quiet { color: var(--ink); border-color: var(--line); font-weight: 500; }
.ds .lack, .ds.lack { color: var(--bad); }
.bar.project { margin: 4px 0; }
.give { display: flex; flex: none; gap: 6px; align-items: center; }
.give input[type=number] { width: 56px; padding: 6px; }
@media (max-width: 480px) { .map { grid-template-columns: 1fr 1fr; } .place-card { padding: 10px; gap: 8px; } }
.place-card.locked { opacity: .55; border-style: dashed; }
.opt.house { cursor: default; }
.seat { display: inline-block; margin: 6px 12px 0 0; font-size: 14px; cursor: pointer; }
.seat.off { color: var(--muted); cursor: default; }
.place-card.broken { border-color: var(--bad); border-style: dashed; }
.place-card.broken .seal { background: var(--muted); }
.seat { display: block; }
.seat .ds { display: block; margin-left: 22px; }
.locked-list { margin: 10px 0 0; }
.locked-list .tag { border-style: dashed; margin: 2px 4px 2px 0; }

/* 首轮方向：厂区门牌、街巷导览与家庭记事簿。 */
:root { --paper: #e9e6dc; --road: #c7cdc8; --roof: #7a4339; --map-ground: #dfe5dd; --shadow: #273d3d20; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #282c2a; --road: #46524c; --roof: #bc8070; --map-ground: #252f2b; --shadow: #00000035; }
}
.wrap { max-width: 1064px; }
nav.top { gap: 0; margin-bottom: 24px; border-bottom: 3px solid var(--brick); }
nav.top .brand { font-size: 27px; letter-spacing: .12em; }
nav.top a.l, nav.top button.l { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 0; padding: 8px 13px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--steel); outline-offset: 4px; }
.home-page .hero { border-bottom: 1px solid var(--line); padding: 8px 0 22px; }
.home-page .hero .year { font-size: 58px; }
.home-page .hero .who { margin: 12px 0 6px; }
.home-page .vitals, .place-page .vitals { border-radius: 0; border: 0; border-left: 4px solid var(--steel); background: var(--paper); }
.home-page .vitals:not(.compact) { padding: 18px 20px; }
.bar, .bar.big, .tag, .seal, .seal.small, .seal.large { border-radius: 1px; }
.seal { border: 3px double var(--brick-ink); outline: 1px solid var(--brick); }
.home-page .card, .place-page .card, .place-page .action, .place-page .event, .place-page .result { border-radius: 2px; }
.home-page .event-banner, .place-page .event-banner { border-radius: 0; min-height: 52px; }
.town-map { margin-top: 28px; background: var(--map-ground); border: 1px solid var(--road); padding: 24px; }
.map-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--steel); padding-bottom: 12px; }
.map-heading h2.section { margin: 0; font-size: 25px; color: var(--steel); }
.map-heading > span { font-size: 13px; color: var(--muted); }
.map { position: relative; grid-template-columns: 1fr 1fr 1fr; gap: 32px 26px; padding: 30px 0 12px; }
.map::before { content: ''; position: absolute; inset: 24px 12% 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent 106px, var(--road) 106px, var(--road) 122px); pointer-events: none; }
.place-card { position: relative; align-items: flex-start; min-height: 106px; padding: 16px 12px; gap: 12px; border-radius: 1px; border: 1px solid var(--road); border-top: 5px solid var(--roof); box-shadow: 4px 5px 0 var(--shadow); }
.place-card:nth-child(3n+2) { transform: translateY(12px); }
.place-card:hover { transform: translateY(-2px); border-color: var(--steel); }
.pc-name { font-family: "Songti SC", "STSong", serif; font-size: 19px; margin-bottom: 5px; }
.pc-sub { font-size: 12px; }
.place-card.locked { opacity: 1; background: var(--paper); }
.map-status { display: inline-block; color: var(--brick); font-size: 12px; font-weight: 700; border-bottom: 1px solid currentColor; margin-bottom: 4px; }
.place-card.broken .map-status { color: var(--bad); }
.notebook { margin-top: 20px; border-top: 2px solid var(--steel); border-bottom: 1px solid var(--line); }
.notebook summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; min-height: 64px; cursor: pointer; font-family: "Songti SC", serif; font-size: 21px; font-weight: 700; }
.notebook summary::after { content: '＋'; color: var(--steel); }
.notebook[open] summary::after { content: '－'; }
.notebook summary span { margin-left: auto; color: var(--muted); font: 13px/1.6 -apple-system, "PingFang SC", sans-serif; }
.notebook .card { border: 0; background: transparent; padding: 8px 0 18px; }
.notebook .two { gap: 32px; }
.place-wayfinding { font-size: 14px; color: var(--muted); }
.place-wayfinding a { display: inline-flex; min-height: 44px; align-items: center; }
.place-page .place-hero { padding: 26px; background: var(--paper); border-top: 5px solid var(--roof); gap: 22px; }
.place-hero h1 { font-size: 34px; margin-bottom: 12px; }
.scene { max-width: 44em; line-height: 1.9; color: var(--ink); }
.place-page .action { padding: 22px; margin: 12px 0; border-left: 3px solid var(--steel); }
.action .nm { font-family: "Songti SC", serif; font-size: 21px; margin-bottom: 8px; }
.action .ds { font-size: 14px; line-height: 1.8; }
.action > button { flex-shrink: 0; min-width: 88px; }
button.primary, button.ghost, button.choice, input[type=text], input[type=password], select { border-radius: 2px; min-height: 44px; }
.boost { padding: 10px 0; min-height: 44px; }
.arrival { display: grid; grid-template-columns: 1.25fr 1fr; border: 1px solid var(--line); margin-top: 44px; background: var(--card); }
.arrival-story { position: relative; padding: 36px; background: var(--map-ground); overflow: hidden; }
.town-sign { display: inline-block; padding: 8px 22px; color: var(--brick-ink); background: var(--steel); border: 4px double var(--brick-ink); font: 700 34px/1.4 "Songti SC", serif; letter-spacing: .18em; }
.town-sign span { display: block; font: 10px/1.8 sans-serif; letter-spacing: .24em; }
.arrival .year { margin-top: 40px; font-size: 82px; }
.arrival .year span { font-size: 24px; margin-left: 8px; }
.arrival .who { margin-top: 18px; font-family: "Songti SC", serif; font-size: 23px; }
.arrival .sub { margin-top: 10px; max-width: 24em; }
.arrival-form.card { align-self: center; border: 0; border-radius: 0; padding: 40px; margin: 0; }
.arrival-form h2 { font-size: 30px; margin-bottom: 26px; }
.arrival-form button { width: 100%; margin-top: 10px; }
.arrival-note { color: var(--steel); font-size: 13px; position: relative; margin-top: 16px; }
.factory { position: relative; height: 130px; margin-top: 28px; border-bottom: 5px solid var(--steel); }
.factory > i { position: absolute; width: 17px; height: 95px; bottom: 0; left: 14%; background: var(--roof); border-top: 5px solid var(--steel); }
.factory > i:nth-child(2) { left: 25%; height: 120px; }
.factory > i:nth-child(3) { left: 36%; height: 82px; }
.factory-roof { position: absolute; bottom: 0; width: 100%; height: 65px; background: var(--roof); clip-path: polygon(0 25%,25% 0,25% 25%,50% 0,50% 25%,75% 0,75% 25%,100% 0,100% 100%,0 100%); }
.factory-windows { position: absolute; bottom: 15px; left: 8%; right: 8%; height: 18px; background: repeating-linear-gradient(to right,var(--paper) 0,var(--paper) 14px,transparent 14px,transparent 25px); }
@media (max-width: 680px) {
 nav.top .brand { width: 100%; margin-bottom: 6px; }
 nav.top a.l, nav.top button.l { padding: 8px 0; font-size: 14px; width: 44px; }
 nav.top { justify-content: space-between; }
 .home-page .hero .year { font-size: 44px; }
 .town-map { padding: 16px 12px; margin-left: 0; margin-right: 0; }
 .map-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
 .map { grid-template-columns: 1fr 1fr; gap: 24px 20px; padding-top: 20px; }
 .map::before { inset: 0 auto 0 50%; width: 12px; transform: translateX(-50%); background: var(--road); }
 .place-card { flex-direction: column; min-height: 155px; padding: 12px 10px; gap: 10px; }
 .place-card:nth-child(3n+2) { transform: none; }
 .place-card:nth-child(even) { top: 12px; }
 .pc-name { font-size: 17px; }
 .pc-sub { overflow-wrap: anywhere; }
 .two { grid-template-columns: 1fr; }
 .notebook summary span { margin-left: 0; font-size: 12px; }
 .notebook summary { font-size: 19px; }
 .place-page .place-hero { padding: 20px 16px; gap: 16px; }
 .place-hero h1 { font-size: 28px; }
 .place-page .action { flex-wrap: wrap; padding: 18px 16px; }
 .action > button { width: 100%; }
 .arrival { grid-template-columns: 1fr; margin-top: 24px; }
 .arrival-story { padding: 24px; }
 .arrival .year { font-size: 60px; margin-top: 26px; }
 .arrival .who { font-size: 21px; }
 .factory { height: 100px; }
 .factory > i:nth-child(2) { height: 90px; }
 .arrival-form.card { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 680px) {
 .arrival .town-sign { font-size: 26px; padding: 4px 14px; }
 .arrival .year { margin-top: 16px; font-size: 46px; }
 .arrival .who { font-size: 18px; margin-top: 12px; }
 .arrival .sub { font-size: 13px; margin-top: 6px; }
 .arrival .factory { height: 62px; margin-top: 16px; }
 .arrival .factory > i { height: 52px; }
 .arrival .factory > i:nth-child(2) { height: 62px; }
 .arrival .factory > i:nth-child(3) { height: 48px; }
 .arrival .factory-roof { height: 38px; }
 .arrival .factory-windows { height: 10px; bottom: 10px; }
 .arrival-note { margin-bottom: 0; }
 .arrival-form h2 { margin-bottom: 16px; font-size: 26px; }
}

/* 地图是场景本身；建筑直接作为地点入口。 */
:root {
 --world-ground:#e3e7d5; --snow:#f5f4e8; --hill:#b8c6b1; --river:#9bbbc2; --river-bank:#cedad1;
 --path:#cbbfa3; --path-edge:#d9d1b8; --bridge:#8f8270; --rail:#777c70; --pine:#64816e; --tree-trunk:#81735b;
 --wall:#d8c9a7; --brick-wall:#ad7862; --tile:#687b7c; --window:#526f75; --window-warm:#eacb82; --wood:#796651;
 --fence:#a69d83; --awning:#a76653; --shop-sign:#557d77; --produce:#9eaf6e; --track:#ba9881; --grass:#aab996;
 --flag:#af4c3f; --bus:#afbb9e; --map-shadow:#64716029; --map-label:#f6f1de; --map-text:#384c43;
}
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) {
 --world-ground:#303d36; --snow:#89978b; --hill:#45594b; --river:#52777f; --river-bank:#40574f;
 --path:#776f59; --path-edge:#586051; --bridge:#a49578; --rail:#a3ac98; --pine:#557361; --tree-trunk:#ad9676;
 --wall:#a59876; --brick-wall:#875c4c; --tile:#465f61; --window:#344d53; --window-warm:#e4bc70; --wood:#554837;
 --fence:#8a8870; --awning:#975b49; --shop-sign:#52756a; --produce:#8b9c60; --track:#8f705b; --grass:#667952;
 --flag:#c16954; --bus:#83967b; --map-shadow:#0a211d50; --map-label:#d3cbb1; --map-text:#293e34;
} }
.home-page .wrap { max-width:1160px; }
.home-page nav.top { margin-bottom:12px; }
.home-page .player-hud { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 22px; padding:12px 0; border:0; }
.home-page .player-hud .year { font-size:32px; }
.home-page .player-hud .who { margin:0; font-size:16px; }
.home-page .player-hud .sub { width:100%; font-size:12px; }
.home-page .vitals:not(.compact) { display:flex; gap:16px; align-items:center; justify-content:space-between; padding:10px 14px; margin:0 0 12px; border:0; }
.home-page .vitals .meter { flex:1; max-width:400px; }
.home-page .vital-row { margin:0; }
.home-page .event-banner { margin:8px 0; padding:8px 12px; min-height:44px; font-size:14px; }
.home-page .flash { font-size:13px; padding:8px 12px; border-radius:0; }
.town-symbols { position:absolute; width:0; height:0; overflow:hidden; }
.world-map { position:relative; background:var(--world-ground); margin:18px 0 28px; border:1px solid var(--road); overflow:hidden; }
.world-map-heading { position:absolute; z-index:3; left:24px; top:20px; right:24px; display:flex; align-items:flex-start; justify-content:space-between; pointer-events:none; }
.world-map-heading h2 { font-size:30px; color:var(--steel); letter-spacing:.15em; text-shadow:0 2px var(--snow); }
.world-map-heading p { margin:2px 0; font-size:12px; color:var(--ink); }
.compass { font-family:"Songti SC",serif; font-size:18px; text-align:center; color:var(--steel); line-height:1.2; }
.world-scene { position:relative; aspect-ratio:900 / 1120; margin-top:90px; }
.town-terrain { position:absolute; width:100%; height:100%; inset:0; }
.terrain-label { fill:var(--steel); font:19px "Songti SC",serif; letter-spacing:8px; }
.district-label { fill:var(--steel); font:19px "Songti SC",serif; letter-spacing:4px; }
.map-place { position:absolute; left:var(--x); top:var(--y); transform:translate(-50%,-50%); display:flex; flex-direction:column; align-items:center; justify-content:flex-end; width:23%; min-height:44px; color:var(--map-text); text-decoration:none; z-index:2; }
.map-building { display:block; width:100%; overflow:visible; filter:drop-shadow(0 3px 0 var(--map-shadow)); transition:transform .16s ease; }
.map-place-name { position:relative; display:block; max-width:115%; padding:3px 9px; background:var(--map-label); border-bottom:2px solid var(--fence); font:700 17px/1.4 "Songti SC",serif; text-align:center; white-space:nowrap; box-shadow:2px 2px 0 var(--map-shadow); }
.map-place-hint { font-size:11px; line-height:1.5; margin-top:5px; color:var(--ink); text-align:center; text-shadow:0 1px var(--snow); }
.map-place:hover .map-building, .map-place:focus-visible .map-building { transform:translateY(-7px); }
.map-place:hover .map-place-name { color:var(--brick); }
.scene-marker { position:absolute; z-index:3; top:12%; right:10%; width:30px; height:34px; display:grid; place-items:center; background:var(--brick); color:var(--brick-ink); font-weight:bold; clip-path:polygon(0 0,100% 0,100% 83%,60% 83%,50% 100%,40% 83%,0 83%); }
.map-place.locked .map-building { filter:grayscale(.8); opacity:.7; }
.map-place.broken .map-building { opacity:.65; }
.future-town { position:relative; z-index:3; border-top:1px dashed var(--fence); background:var(--snow); padding:0 20px; color:var(--steel); }
.future-town summary { min-height:48px; display:flex; align-items:center; cursor:pointer; font-size:14px; }
.future-town div { display:flex; gap:12px; flex-wrap:wrap; padding-bottom:16px; font-size:13px; }
.world-scene.expanded { aspect-ratio:900 / 1800; }
.world-scene.expanded .town-terrain { height:62.222%; }
.world-scene.expanded .map-place { top:calc(var(--y) * .62222); width:23%; }
@media(min-width:900px) { .world-scene { max-width:920px; margin:90px auto 0; } .world-map-heading { top:28px; left:32px; right:32px; } }
@media(max-width:680px) {
 .home-page .player-hud .year { font-size:28px; }
 .home-page .player-hud { gap:4px 12px; }
 .home-page .player-hud .who { font-size:14px; }
 .home-page .vitals:not(.compact) { flex-wrap:wrap; gap:4px; }
 .home-page .vitals .meter { flex-basis:100%; max-width:none; }
 .home-page .vital-row { font-size:13px; gap:12px; }
 .world-map { margin-left:0; margin-right:0; }
 .world-map-heading { top:16px; left:14px; right:14px; }
 .world-map-heading h2 { font-size:25px; }
 .world-scene { margin-top:80px; aspect-ratio:900 / 1540; }
 .world-scene .town-terrain { height:100%; }
 .map-place { width:27%; }
 .map-place-name { font-size:12px; padding:3px 5px; white-space:normal; width:max-content; max-width:115%; }
 .map-place-hint { display:none; }
 .scene-marker { width:22px; height:26px; font-size:12px; top:0; right:0; }
 .world-scene.expanded { aspect-ratio:900 / 2300; }
 .world-scene.expanded .town-terrain { height:66.957%; }
 .world-scene.expanded .map-place { top:calc(var(--y) * .66957); width:27%; }
}
/* 手绘场景素材与真正可用的地点入口分开，名称和状态始终清晰。 */
.painted-town { display:block; position:absolute; inset:0; width:100%; height:100%; object-fit:fill; }
.illustrated .town-terrain { display:none; }
.illustrated .map-place { width:23%; height:16%; justify-content:flex-end; padding-bottom:0; top:calc(var(--y) + 6%); }
.illustrated .map-building { visibility:hidden; position:absolute; width:100%; height:100%; }
.illustrated .map-place-name { background:var(--map-label); font-size:15px; border:1px solid var(--fence); border-radius:2px; box-shadow:0 2px 5px var(--map-shadow); }
.illustrated .map-place-hint { display:none; }
.illustrated .map-place:hover .map-place-name, .illustrated .map-place:focus-visible .map-place-name { transform:translateY(-3px); background:var(--snow); }
.illustrated .scene-marker { top:12%; right:10%; }
.world-scene.illustrated { aspect-ratio:4 / 5; margin:0; max-width:none; }
.world-map:has(.illustrated) .world-map-heading { background:var(--map-label); border:1px solid var(--fence); left:16px; top:16px; right:auto; padding:10px 14px; gap:24px; box-shadow:2px 3px 0 var(--map-shadow); }
.world-map:has(.illustrated) .world-map-heading h2 { font-size:22px; margin:0; }
.world-map:has(.illustrated) .world-map-heading p { margin:2px 0 0; font-size:11px; }
.world-map:has(.illustrated) .compass { font-size:14px; }
.world-scene.illustrated.expanded { aspect-ratio:4 / 8; background:var(--world-ground); }
.illustrated.expanded .painted-town { height:62.5%; }
.world-scene.illustrated.expanded .map-place { top:calc((var(--y) + 6%) * .625); height:10%; }
.illustrated .new-quarter .map-building { visibility:visible; position:static; height:auto; }
.illustrated .new-quarter { height:auto; }
.place-scene { position:relative; min-height:290px; background-image:url('art/guanghua-winter-v2.webp'); background-size:220% auto; background-position:var(--scene-position); border:1px solid var(--road); }
.place-scene-caption { position:absolute; bottom:16px; left:16px; background:var(--map-label); color:var(--map-text); padding:10px 18px; font:700 24px/1.4 "Songti SC",serif; border:1px solid var(--fence); }
.place-scene-caption span { display:block; font:12px/1.5 -apple-system,"PingFang SC",sans-serif; }
.place-page .place-hero { border-top:0; }
.arrival-story { background-image:url('art/guanghua-winter-v2.webp'); background-size:cover; background-position:center; min-height:640px; }
.arrival-story .town-sign { position:relative; z-index:1; }
.arrival-story .year, .arrival-story .who, .arrival-story .sub, .arrival-story .arrival-note { position:relative; z-index:1; background:var(--map-label); color:var(--map-text); width:fit-content; padding:5px 10px; }
.arrival-story .factory { visibility:hidden; height:85px; }
@media(max-width:680px) {
 .world-map:has(.illustrated) .world-map-heading { left:8px; top:8px; padding:6px 9px; gap:12px; }
 .world-map:has(.illustrated) .world-map-heading h2 { font-size:18px; }
 .world-map:has(.illustrated) .world-map-heading p { display:none; }
 .illustrated .map-place { width:27%; min-height:44px; }
 .illustrated .map-place-name { font-size:11px; padding:3px 4px; line-height:1.3; }
 .illustrated .scene-marker { width:20px; height:24px; font-size:11px; }
 .place-scene { min-height:240px; background-size:280% auto; }
 .arrival-story { min-height:440px; }
 .arrival-story .factory { display:none; }
 .arrival-story .arrival-note { margin-top:72px; font-size:11px; }
}
.illustrated .map-place { top:min(96%,calc(var(--y) + 6%)); }
.world-scene.illustrated.expanded .map-place { top:calc(min(96%,calc(var(--y) + 6%)) * .625); }
.world-scene.illustrated.expanded .map-place.new-quarter { top:calc(var(--y) * .625); }
.tag.up { color: var(--bad); border-color: var(--bad); }
.tag.down { color: var(--good); border-color: var(--good); }
.illustrated .map-place { top:var(--y); }
.world-scene.illustrated.expanded .map-place { top:calc(var(--y) * .625); }
.world-scene.illustrated.expanded { aspect-ratio:4 / calc(5 * var(--scene-factor)); background:var(--world-ground); }
.illustrated.expanded .painted-town { height:calc(100% / var(--scene-factor)); }
.world-scene.illustrated.expanded .map-place, .world-scene.illustrated.expanded .map-place.new-quarter { top:calc(var(--y) / var(--scene-factor)); height:calc(16% / var(--scene-factor)); }
.illustrated.expanded .new-quarter .map-building { position:static; height:auto; width:76%; }

/* 养成游戏外壳：搪瓷色功能栏、角色档案、资源槽与任务面板。 */
:root {
 --shell:#294b49; --shell-deep:#1e3b3a; --shell-ink:#f3e9c9; --shell-muted:#b7ccc0;
 --trim:#b5a47a; --trim-light:#eadfbc; --panel-shadow:#453d2926; --button-shade:#703d2d;
 --avatar-coat:#4d696c; --avatar-skin:#e5bd94; --avatar-hair:#3b3834;
 --bg:#e6e4d7; --card:#f6f0df; --line:#c8bfa4; --ink:#343e36; --muted:#697165; --brick:#a35639; --steel:#365f59;
}
@media(prefers-color-scheme:dark) { :root:not([data-theme="light"]) {
 --shell:#203c39; --shell-deep:#172c2c; --shell-ink:#eee4c6; --shell-muted:#a3bcae;
 --trim:#8d805e; --trim-light:#b6aa83; --panel-shadow:#00000038; --button-shade:#713e2d;
 --bg:#25342f; --card:#35453b; --line:#64715a; --ink:#e4e5d1; --muted:#b4c1ad; --brick:#d19869; --steel:#afc5a0;
} }
body.game-shell { background:var(--shell-deep); }
.game-shell .wrap { position:relative; max-width:1180px; min-height:100vh; padding:0 28px 40px; background:var(--bg); border-left:1px solid var(--trim); border-right:1px solid var(--trim); }
.game-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:0 -28px; padding:18px 28px; background:var(--shell); color:var(--shell-ink); border-bottom:3px double var(--trim); }
.game-header .brand { display:flex; align-items:center; gap:12px; color:var(--shell-ink); text-decoration:none; font:700 30px/1.2 "Songti SC",serif; letter-spacing:.12em; }
.game-header .brand small { display:block; margin-top:7px; color:var(--shell-muted); font:11px/1.4 -apple-system,"PingFang SC",sans-serif; letter-spacing:.12em; }
.brand-emblem { display:grid; place-items:center; width:48px; height:48px; border:3px double var(--trim); font-size:30px; background:var(--shell-deep); }
.game-header-note { font:15px "Songti SC",serif; color:var(--shell-muted); }
.game-shell nav.top { display:flex; justify-content:center; align-items:stretch; gap:8px; margin:0 -28px 20px; padding:7px 28px; background:var(--shell); border:0; border-bottom:1px solid var(--trim); box-shadow:0 4px 0 var(--panel-shadow); }
.game-shell nav.top a.l, .game-shell nav.top button.l { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:3px; width:84px; min-height:60px; padding:6px 10px; color:var(--shell-muted); background:transparent; font-size:12px; line-height:1.3; border:1px solid transparent; border-radius:3px; text-decoration:none; }
.game-shell nav.top svg { width:24px; height:24px; stroke:currentColor; fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.game-shell nav.top a.l:hover, .game-shell nav.top button.l:hover { background:var(--shell-deep); color:var(--shell-ink); }
.game-shell nav.top a.l.active { background:var(--shell-deep); color:var(--shell-ink); border-color:var(--trim); box-shadow:inset 0 0 0 2px var(--shell); }
.game-shell nav.top:has(> :only-child), .game-shell nav.top:not(:has(a,button)) { display:none; }
.game-shell .hero:not(.player-hud):not(.arrival-story) { padding:24px; margin:18px 0; border:1px solid var(--trim); background:var(--card); border-top:4px solid var(--steel); }
.game-shell .card { border:1px solid var(--line); border-radius:3px; box-shadow:0 3px 0 var(--panel-shadow); padding:22px; }
.game-shell .card h2 { display:flex; gap:10px; align-items:center; font-size:21px; color:var(--steel); padding-bottom:12px; border-bottom:1px solid var(--line); margin-bottom:12px; }
.game-shell .card h2::before { content:''; width:7px; height:17px; background:var(--steel); flex:none; border:1px solid var(--trim); }
.game-shell .card.accent { border-top:4px solid var(--brick); }
.game-shell button.primary, .game-shell a.btn { border:1px solid var(--button-shade); border-top-color:var(--trim-light); border-radius:3px; box-shadow:0 3px 0 var(--button-shade),inset 0 0 0 1px var(--trim); font-weight:600; min-height:46px; transition:transform .12s; }
.game-shell button.primary:active, .game-shell a.btn:active { transform:translateY(2px); box-shadow:0 1px 0 var(--button-shade); }
.game-shell button.ghost { min-height:44px; border:1px solid var(--trim); background:var(--card); box-shadow:0 2px 0 var(--panel-shadow); border-radius:3px; }
.game-shell button:disabled { box-shadow:none; }
.game-shell input[type=text], .game-shell input[type=password], .game-shell input[type=number], .game-shell select { border:1px solid var(--trim); background:var(--bg); box-shadow:inset 0 2px 3px var(--panel-shadow); border-radius:2px; min-height:44px; }
.game-shell .tag { background:var(--bg); border-color:var(--line); }
.game-shell .bar { border:1px solid var(--trim); background:var(--bg); height:9px; border-radius:2px; }
.game-shell .bar.big { height:15px; padding:2px; background:var(--shell-deep); border-color:var(--trim); }
.game-shell .bar.big i { background:var(--produce); border-top:1px solid var(--trim-light); }
.game-shell .event { border:2px solid var(--trim); background:var(--card); border-top:5px solid var(--brick); border-radius:3px; box-shadow:0 4px 0 var(--panel-shadow); }
.game-shell .event-head { flex-wrap:wrap; font-family:"Songti SC",serif; font-size:21px; }
.game-shell .result { background:var(--card); border-color:var(--trim); border-left:5px solid var(--good); box-shadow:0 3px 0 var(--panel-shadow); }
.game-shell .result-head { font-family:"Songti SC",serif; font-size:20px; }
.game-shell .flash { border:1px solid var(--trim); background:var(--card); border-radius:2px; }
.game-shell .player-hud { display:flex; align-items:center; gap:18px; padding:16px 20px; margin:0; background:var(--card); border:1px solid var(--trim); border-bottom:0; border-radius:4px 4px 0 0; }
.player-avatar { position:relative; flex:0 0 74px; width:74px; height:88px; border:3px double var(--trim); background:var(--world-ground); overflow:hidden; }
.player-avatar svg { width:100%; height:100%; }
.player-avatar > span { position:absolute; bottom:0; left:0; right:0; background:var(--shell); color:var(--shell-ink); text-align:center; font-size:10px; line-height:20px; }
.player-identity { min-width:0; flex:1; }
.game-shell .player-hud .year { font-size:29px; line-height:1.2; color:var(--brick); }
.game-shell .player-hud .who { font-family:"Songti SC",serif; font-size:21px; font-weight:600; margin:6px 0 4px; }
.game-shell .player-hud .sub { color:var(--muted); font-size:12px; max-width:65ch; }
.game-shell.home-page .vitals:not(.compact) { display:flex; flex-wrap:wrap; align-items:center; gap:12px 24px; margin:0 0 14px; padding:12px 20px; background:var(--shell); color:var(--shell-ink); border:1px solid var(--trim); border-radius:0 0 4px 4px; box-shadow:0 3px 0 var(--panel-shadow); }
.home-page .vitals:not(.compact) .muted { color:var(--shell-muted); }
.home-page .vitals:not(.compact) .vital-row { font-size:14px; }
.resource-name { font-size:13px; }
.resource-money b { color:var(--window-warm); font-size:21px; }
.resource-friendship b { color:var(--shell-ink); font-size:20px; }
.home-page .event-banner { border:1px solid var(--trim); background:var(--card); box-shadow:0 2px 0 var(--panel-shadow); font-size:13px; }
.home-page .world-map { border:3px double var(--trim); border-radius:4px; box-shadow:0 5px 0 var(--panel-shadow); margin-top:16px; }
.home-page .notebook { background:var(--card); border:1px solid var(--trim); border-left:5px solid var(--steel); border-radius:3px; padding:0 18px; box-shadow:0 3px 0 var(--panel-shadow); }
.home-page .notebook summary { min-height:60px; }
.home-page .notebook .card { box-shadow:none; padding-left:0; padding-right:0; }
.game-shell .action { border:1px solid var(--trim); border-left:4px solid var(--steel); background:var(--card); border-radius:3px; box-shadow:0 3px 0 var(--panel-shadow); }
.game-shell .action .nm { color:var(--steel); }
.game-shell .place-scene { border:3px double var(--trim); box-shadow:0 4px 0 var(--panel-shadow); border-radius:3px; }
.game-shell .place-wayfinding { margin:0; }
.game-shell footer { color:var(--muted); font-size:12px; margin-top:28px; }
.game-shell .arrival { margin-top:24px; border:3px double var(--trim); border-radius:4px; box-shadow:0 5px 0 var(--panel-shadow); }
.game-shell .arrival-form.card { box-shadow:none; border:0; }
@media(max-width:680px) {
 .game-shell .wrap { padding:0 16px 110px; border:0; }
 .game-header { margin:0 -16px 16px; padding:12px 16px; min-height:74px; }
 .game-header .brand { font-size:26px; gap:9px; }
 .game-header .brand small { margin-top:4px; font-size:10px; }
 .brand-emblem { width:42px; height:42px; font-size:26px; }
 .game-header-note { font-size:11px; max-width:6em; line-height:1.8; text-align:right; }
 .game-shell nav.top { position:fixed; z-index:20; bottom:0; left:0; right:0; margin:0; padding:5px 16px calc(7px + env(safe-area-inset-bottom)); gap:0; justify-content:space-between; border-top:3px double var(--trim); border-bottom:0; box-shadow:0 -3px 10px var(--panel-shadow); }
 .game-shell nav.top a.l, .game-shell nav.top button.l { width:44px; min-height:55px; padding:5px 0; font-size:10px; gap:4px; }
 .game-shell nav.top svg { width:23px; height:23px; }
 .game-shell .player-hud { gap:12px; padding:12px; flex-wrap:nowrap; }
 .player-avatar { flex-basis:61px; width:61px; height:78px; }
 .game-shell .player-hud .year { font-size:22px; }
 .game-shell .player-hud .who { font-size:17px; margin:4px 0; }
 .game-shell .player-hud .sub { font-size:11px; line-height:1.6; }
 .game-shell .player-hud .tag { font:10px/1.6 -apple-system,"PingFang SC",sans-serif; padding:0 4px; }
 .game-shell.home-page .vitals:not(.compact) { padding:10px 12px; gap:5px; }
 .home-page .vitals:not(.compact) .vital-row { font-size:12px; }
 .home-page .vitals:not(.compact) .meter { flex:1 1 100%; }
 .resource-money b, .resource-friendship b { font-size:17px; }
 .game-shell .card { padding:16px; }
 .game-shell .card h2 { font-size:20px; }
 .game-shell .hero:not(.player-hud):not(.arrival-story) { padding:18px 16px; margin:14px 0; }
 .game-shell .notebook summary { font-size:18px; }
 .game-shell .notebook summary span { font-size:11px; }
 .game-shell .arrival { margin-top:16px; }
 .game-shell .arrival-form.card { padding:24px; }
 .game-shell.login-page .wrap, .game-shell:not(:has(nav.top a)) .wrap { padding-bottom:40px; }
}
.town-play-layout { display:grid; grid-template-columns:280px minmax(0,1fr); align-items:start; gap:20px; }
.player-sidebar { min-width:0; }
.home-page .town-play-layout .world-map { margin-top:0; }
.game-shell .player-sidebar .player-hud { align-items:flex-start; padding:14px 12px; gap:10px; }
.player-sidebar .player-avatar { flex-basis:58px; width:58px; height:76px; }
.game-shell .player-sidebar .player-hud .year { font-size:26px; }
.game-shell .player-sidebar .player-hud .who { font-size:17px; }
.game-shell .player-sidebar .player-hud .sub { margin-top:8px; font-size:12px; }
.game-shell.home-page .player-sidebar .vitals:not(.compact) { padding:12px; gap:10px; }
.player-sidebar .vitals .meter { flex-basis:100%; }
.player-sidebar .vital-row { font-size:12px; gap:8px; }
.game-shell .player-sidebar .event-banner { line-height:1.8; }
.game-shell.route-market .hero, .game-shell.route-eat .hero, .game-shell.route-board .hero { position:relative; min-height:210px; align-items:flex-end; background-image:url('art/guanghua-winter-v2.webp'); background-size:150% auto; border:3px double var(--trim); }
.game-shell.route-market .hero { background-position:0 73%; }
.game-shell.route-eat .hero { background-position:0 5%; }
.game-shell.route-board .hero { background-position:85% 33%; }
.game-shell.route-market .hero > div, .game-shell.route-eat .hero > div, .game-shell.route-board .hero > div { background:var(--card); border:1px solid var(--trim); padding:12px 16px; }
.game-shell.route-market .hero h1, .game-shell.route-eat .hero h1, .game-shell.route-board .hero h1 { font-size:25px; }
.game-shell.route-market .hero .scene, .game-shell.route-eat .hero .scene, .game-shell.route-board .hero .scene { font-size:13px; }
.game-shell.route-market .hero > .seal, .game-shell.route-eat .hero > .seal, .game-shell.route-board .hero > .seal { display:none; }
.game-shell .vitals { border-radius:3px; border-color:var(--trim); }
@media(max-width:800px) {
 .town-play-layout { display:block; }
 .home-page .town-play-layout .world-map { margin-top:16px; }
 .game-shell .player-sidebar .player-hud { align-items:center; }
 .game-shell .player-sidebar .player-hud .year { font-size:22px; }
 .game-shell .player-sidebar .player-hud .sub { margin-top:4px; font-size:11px; }
}
@media(max-width:680px) {
 .game-shell.route-market .hero, .game-shell.route-eat .hero, .game-shell.route-board .hero { min-height:210px; padding:65px 10px 10px; background-size:220% auto; }
 .game-shell.route-market .hero > div, .game-shell.route-eat .hero > div, .game-shell.route-board .hero > div { padding:10px 12px; }
 .game-shell.route-market .hero h1, .game-shell.route-eat .hero h1, .game-shell.route-board .hero h1 { font-size:22px; }
}
.game-shell:is(.route-market,.route-eat,.route-board) .hero:not(.player-hud):not(.arrival-story) { background-image:url('art/guanghua-winter-v2.webp'); }
.route-market { --hero-position:0% 72%; }
.route-eat { --hero-position:0% 3%; }
.route-board { --hero-position:85% 31%; }
.game-shell:is(.route-market,.route-eat,.route-board) .hero:not(.player-hud):not(.arrival-story) { background-size:150% auto; background-position:var(--hero-position); }
@media(max-width:680px) {
 .game-shell:is(.route-market,.route-eat,.route-board) .hero:not(.player-hud):not(.arrival-story) { background-size:220% auto; }
}

/* 场景之上的游戏窗口，而不是文档页面。 */
:root { --window-edge:#77694b; --window-edge-dark:#414d40; --scene-wash:#173c3966; --frame-shadow:#10262288; }
@media(prefers-color-scheme:dark) { :root:not([data-theme="light"]) { --window-edge:#a79669; --window-edge-dark:#20392f; --scene-wash:#112a2766; --frame-shadow:#00000099; } }
body.game-shell { min-height:100svh; background:var(--shell-deep) url('art/guanghua-winter-v2.webp') center 42% / cover fixed; }
body.game-shell::before { content:''; position:fixed; inset:0; background:var(--scene-wash); pointer-events:none; }
.game-shell .wrap { max-width:1400px; background:none; border:0; padding:90px 34px 30px 112px; }
.game-header { position:absolute; z-index:12; left:20px; right:20px; top:12px; min-height:60px; padding:7px 18px; margin:0; border:3px double var(--trim); border-radius:3px; box-shadow:0 5px 0 var(--frame-shadow); }
.game-header .brand { font-size:26px; }
.game-header .brand small { font-size:10px; margin-top:3px; }
.brand-emblem { width:42px; height:42px; }
.game-shell nav.top { position:fixed; z-index:20; left:max(18px,calc((100vw - 1400px) / 2 + 20px)); top:105px; bottom:auto; right:auto; margin:0; padding:9px 5px; width:70px; flex-direction:column; gap:6px; background:var(--shell); border:3px double var(--trim); box-shadow:4px 5px 0 var(--frame-shadow); border-radius:4px; }
.game-shell nav.top a.l, .game-shell nav.top button.l { width:54px; min-height:59px; padding:6px 2px; }
.game-content { position:relative; padding:26px; border:6px double var(--trim); outline:2px solid var(--window-edge-dark); outline-offset:2px; background:var(--card); box-shadow:0 0 0 7px var(--window-edge),0 15px 35px var(--frame-shadow); border-radius:6px; min-height:calc(100svh - 135px); }
.window-rim { position:absolute; z-index:10; pointer-events:none; inset:0; }
.window-rim i { position:absolute; width:26px; height:26px; border:4px double var(--trim-light); background:var(--shell); box-shadow:0 0 0 2px var(--window-edge-dark); }
.window-rim i:nth-child(1) { top:-10px; left:-10px; border-radius:2px 2px 12px 2px; }
.window-rim i:nth-child(2) { top:-10px; right:-10px; border-radius:2px 2px 2px 12px; }
.window-rim i:nth-child(3) { bottom:-10px; left:-10px; border-radius:2px 12px 2px 2px; }
.window-rim i:nth-child(4) { bottom:-10px; right:-10px; border-radius:12px 2px 2px 2px; }
.game-shell .game-content > .hero:not(.player-hud):not(.arrival-story) { margin-top:0; border:0; border-bottom:3px double var(--trim); }
.game-shell .game-content > .card { border:0; box-shadow:none; background:transparent; border-bottom:1px solid var(--line); border-radius:0; padding:18px 0; }
.game-shell .game-content > .card h2 { display:inline-flex; min-width:170px; padding:7px 24px 7px 13px; background:var(--shell); border:3px double var(--trim); color:var(--shell-ink); margin-left:-10px; box-shadow:3px 3px 0 var(--panel-shadow); font-size:19px; }
.game-shell .game-content > .card h2::before { display:none; }
.game-shell .game-content > .card.accent { border-top:0; }
.game-shell .row { padding:14px 8px; }
.game-shell .row:nth-child(even) { background:var(--bg); }
.game-shell .row .nm { font-family:"Songti SC",serif; font-size:18px; }
.game-shell .action { position:relative; padding:20px 22px; border:3px double var(--trim); background:var(--bg); box-shadow:3px 4px 0 var(--panel-shadow); }
.game-shell .action::before { content:''; position:absolute; width:8px; height:8px; left:7px; top:7px; border:1px solid var(--trim); border-radius:50%; background:var(--steel); }
.game-shell .event { box-shadow:0 0 0 3px var(--window-edge),0 8px 16px var(--frame-shadow); margin:20px 0; }
.game-shell .place-scene { border:0; border-bottom:4px double var(--trim); margin:-26px -26px 18px; border-radius:0; }
.game-shell .place-wayfinding { position:relative; z-index:2; margin:0 0 8px; }
.game-shell.place-page .game-content { overflow:hidden; }
.game-shell.place-page .place-wayfinding { display:none; }
.game-shell.place-page .place-hero { margin:0; background:none; padding:8px 0 18px; }
.game-shell.home-page .game-content { background:var(--world-ground); padding:0; overflow:hidden; min-height:0; }
.home-page .town-play-layout { position:relative; display:block; min-height:calc(100svh - 155px); }
.home-page .world-map { position:relative; margin:0; min-height:calc(100svh - 155px); border:0; border-radius:0; box-shadow:none; background:var(--shell) url('art/guanghua-winter-v2.webp') center / cover; }
.home-page .world-map::before { content:''; position:absolute; inset:0; background:var(--scene-wash); box-shadow:inset 0 0 100px var(--shell-deep); }
.home-page .world-scene.illustrated { height:calc(100svh - 155px); width:calc((100svh - 155px) * .8); max-width:calc(100% - 285px); margin-left:auto; margin-right:10px; aspect-ratio:4/5; }
.home-page .painted-town { object-fit:fill; box-shadow:0 0 30px var(--frame-shadow); }
.home-page .player-sidebar { position:absolute; z-index:6; left:16px; top:16px; width:245px; max-height:calc(100% - 95px); overflow-y:auto; scrollbar-width:thin; }
.game-shell .player-sidebar .player-hud { border:3px double var(--trim); background:var(--card); border-radius:3px 3px 0 0; }
.game-shell.home-page .player-sidebar .vitals:not(.compact) { border:3px double var(--trim); border-top:0; border-radius:0 0 3px 3px; }
.home-page .world-map:has(.illustrated) .world-map-heading { left:285px; right:auto; top:12px; padding:5px 9px; }
.home-page .world-map-heading p, .home-page .compass { display:none; }
.home-page .world-map:has(.illustrated) .world-map-heading h2 { font-size:17px; }
.home-page .map-place-name { font-size:12px; }
.home-page .future-town { display:none; }
.home-page .game-content > .notebook { position:absolute; bottom:14px; z-index:8; left:16px; width:245px; padding:0 12px; margin:0; border:3px double var(--trim); background:var(--shell); color:var(--shell-ink); box-shadow:0 4px 8px var(--frame-shadow); }
.home-page .game-content > .notebook:last-of-type { bottom:74px; }
.home-page .game-content > .notebook summary { min-height:44px; font-size:16px; }
.home-page .game-content > .notebook summary span { display:none; }
.home-page .game-content > .notebook summary::after { color:var(--shell-ink); }
.home-page .game-content > .notebook[open] { width:min(560px,calc(100% - 32px)); max-height:75%; overflow-y:auto; background:var(--card); color:var(--ink); z-index:11; }
.home-page .game-content > .notebook[open] summary::after { color:var(--steel); }
.home-page .game-content > footer { position:relative; margin:0; padding:8px; font-size:10px; background:var(--shell); color:var(--shell-muted); border:0; }
.home-page .game-content > footer a { color:var(--shell-muted); }
.home-page .game-content > footer div:first-child { display:none; }
.game-shell.login-page .wrap, .game-shell.route-register .wrap { padding-left:34px; }
.game-shell.login-page .game-content { max-width:1040px; margin:auto; }
.game-shell.login-page .arrival { margin:0; box-shadow:none; border:0; }
@media(max-width:900px) and (min-width:681px) {
 .home-page .player-sidebar { width:200px; left:12px; }
 .home-page .world-scene.illustrated { max-width:calc(100% - 225px); }
 .home-page .world-map:has(.illustrated) .world-map-heading { left:230px; }
 .home-page .game-content > .notebook { width:200px; left:12px; }
}
@media(max-width:680px) {
 .game-shell .wrap, .game-shell.login-page .wrap, .game-shell.route-register .wrap { padding:84px 16px 95px; }
 .game-header { position:absolute; left:8px; right:8px; top:8px; margin:0; min-height:60px; padding:6px 10px; }
 .game-header .brand { font-size:23px; }
 .game-header .brand small { font-size:9px; }
 .game-header-note { font-size:10px; }
 .brand-emblem { width:38px; height:38px; font-size:24px; }
 .game-shell nav.top { left:0; right:0; top:auto; bottom:0; width:auto; flex-direction:row; padding:5px 16px calc(7px + env(safe-area-inset-bottom)); gap:0; margin:0; border:0; border-top:3px double var(--trim); border-radius:0; }
 .game-shell nav.top a.l, .game-shell nav.top button.l { width:44px; min-height:55px; }
 .game-content { padding:16px; min-height:calc(100svh - 185px); border-width:4px; box-shadow:0 0 0 4px var(--window-edge),0 8px 20px var(--frame-shadow); }
 .window-rim i { width:18px; height:18px; }
 .game-shell .place-scene { margin:-16px -16px 12px; min-height:210px; }
 .game-shell .game-content > .card h2 { font-size:17px; min-width:140px; }
 .game-shell .game-content > .hero:not(.player-hud):not(.arrival-story) { padding:14px 0; }
 .game-shell:is(.route-market,.route-eat,.route-board) .game-content > .hero { margin:-16px -16px 14px; padding:65px 10px 10px !important; }
 .home-page .town-play-layout { min-height:0; }
 .home-page .world-map { min-height:0; padding-top:150px; background-position:center; }
 .home-page .world-scene.illustrated { width:100%; height:auto; max-width:none; aspect-ratio:4/5; margin:0; }
 .home-page .player-sidebar { left:8px; right:8px; top:8px; width:auto; max-height:142px; overflow:auto; }
 .game-shell .player-sidebar .player-hud { padding:8px; gap:10px; }
 .game-shell .player-sidebar .player-hud .year { font-size:20px; }
 .game-shell .player-sidebar .player-hud .who { font-size:15px; }
 .game-shell .player-sidebar .player-hud .sub { font-size:10px; margin-top:2px; }
 .player-sidebar .player-avatar { width:49px; height:61px; flex-basis:49px; }
 .player-sidebar .player-avatar > span { font-size:8px; line-height:16px; }
 .game-shell.home-page .player-sidebar .vitals:not(.compact) { padding:6px 10px; flex-wrap:nowrap; gap:8px; margin-bottom:0; }
 .player-sidebar .vitals .meter { flex:1 1 45%; gap:5px; font-size:11px; }
 .player-sidebar .vitals .vital-row { font-size:10px; gap:5px; }
 .player-sidebar .vitals .vital-row .muted { display:none; }
 .player-sidebar .resource-money b, .player-sidebar .resource-friendship b { font-size:12px; }
 .player-sidebar .flash, .player-sidebar .event-banner { display:none; }
 .home-page .world-map:has(.illustrated) .world-map-heading { top:157px; left:8px; }
 .home-page .map-place-name { font-size:10px; }
 .home-page .game-content > .notebook { position:relative; left:auto; bottom:auto; width:auto; margin:8px; box-shadow:none; }
 .home-page .game-content > .notebook:last-of-type { bottom:auto; }
 .home-page .game-content > .notebook[open] { width:auto; max-height:60svh; }
 .game-shell.login-page .wrap { padding-bottom:30px; }
 .game-shell.login-page .game-content { padding:0; }
}
.home-page .world-scene.illustrated { height:auto; }
@media(max-width:680px) {
 .home-page .town-play-layout { display:flex; flex-direction:column; }
 .home-page .player-sidebar { position:relative; left:auto; right:auto; top:auto; width:auto; max-height:none; margin:8px; overflow:visible; }
 .home-page .world-map { padding-top:0; }
 .game-shell.home-page .player-sidebar .vitals:not(.compact) { flex-wrap:wrap; }
 .player-sidebar .vitals .meter { flex-basis:100%; }
 .player-sidebar .flash { display:block; font-size:10px; line-height:1.6; margin:6px 0; padding:5px 8px; }
 .player-sidebar .event-banner { display:flex; font-size:11px; line-height:1.5; margin:6px 0; min-height:44px; padding:5px 8px; }
 .home-page .world-map:has(.illustrated) .world-map-heading { top:8px; left:8px; }
}
.game-shell .player-sidebar .player-hud { gap:8px; padding:11px; }
.game-shell .player-sidebar .player-avatar { flex-basis:45px; width:45px; height:62px; }
.game-shell .player-sidebar .player-hud .year { font-size:23px; }
.game-shell .player-sidebar .player-hud .who { font-size:15px; line-height:1.6; }
.game-shell .player-sidebar .player-hud .sub { font-size:11px; line-height:1.7; margin-top:5px; }
.home-page .future-town { display:block; position:absolute; z-index:6; right:12px; top:12px; border:3px double var(--trim); background:var(--card); color:var(--ink); padding:0 10px; max-width:230px; box-shadow:0 3px 5px var(--frame-shadow); }
.home-page .future-town summary { font-size:12px; min-height:36px; }
.home-page .future-town div { font-size:12px; gap:8px; }
.home-page .game-content > .notebook[open] { left:50%; bottom:50%; width:min(650px,calc(100% - 48px)); transform:translate(-50%,50%); padding:0 20px 14px; border:6px double var(--trim); outline:3px solid var(--window-edge); box-shadow:0 10px 50px var(--frame-shadow); }
.home-page .game-content > .notebook[open] > summary { margin:0 -20px 10px; padding:10px 18px; background:var(--shell); color:var(--shell-ink); border-bottom:3px double var(--trim); }
.home-page .game-content > .notebook[open] > summary::after { content:'×'; color:var(--shell-ink); }
@media(max-width:680px) {
 .home-page .future-town { position:relative; top:auto; right:auto; max-width:none; margin:8px; padding:0 8px; }
 .home-page .game-content > .notebook[open] { left:auto; bottom:auto; transform:none; width:auto; margin:8px; padding:0 12px 12px; }
 .home-page .game-content > .notebook[open] > summary { margin:0 -12px 8px; }
 .game-shell .player-sidebar .player-hud .who { font-size:15px; }
 .game-shell .player-sidebar .player-hud .year { font-size:20px; }
 .game-shell .player-sidebar .player-hud .sub { font-size:10px; line-height:1.6; }
}
.game-shell .player-sidebar .player-avatar > span { font-size:8px; white-space:nowrap; line-height:16px; }
.game-shell.home-page .player-sidebar .vitals:not(.compact) { display:block; padding:9px 12px; }
.player-sidebar .vitals .meter { margin-bottom:6px; }
.player-sidebar .vitals .vital-row { font-size:12px; line-height:1.7; gap:0 9px; }
.player-sidebar .vitals .vital-row .muted { font-size:11px; }
.player-sidebar .flash { padding:7px 9px; font-size:11px; line-height:1.7; margin-bottom:8px; }
.game-shell .player-sidebar .event-banner { padding:7px 9px; font-size:11px; line-height:1.7; }
@media(max-width:680px) {
 .home-page .town-play-layout { gap:0; align-items:stretch; }
 .home-page .town-play-layout .world-map { width:100%; align-self:stretch; margin-top:0; }
 .home-page .world-map .world-scene.illustrated { width:100%; max-width:none; height:auto; margin:0; aspect-ratio:4/5; }
}

/* 记事簿：卡片有边框时内容要留边，数字宽度不同时进度条右端要对齐 */
.home-page .game-content > .notebook[open] .card { padding-left:18px; padding-right:18px; }
.notebook .stat b { min-width:2.2em; text-align:right; }
.notebook .stat .bar { flex:1 1 0; min-width:0; }
.repute-title { margin:0 0 8px; font-size:18px; font-weight:600; color:var(--steel); }
.repute-line { margin:4px 0; line-height:1.7; }
.ledger { margin-top:12px; }
.ledger summary { cursor:pointer; color:var(--muted); font-size:13px; }

/* 光华人民广播：顶部滚动。速度跟字数走，鼠标放上去暂停，减少动画时改成能换行的静态文字 */
.radio-bar { flex:1; min-width:0; max-width:680px; display:flex; align-items:center; gap:10px; }
.radio-name { flex:none; padding:2px 8px; border:1px solid var(--trim); color:var(--shell-ink); font-size:12px; white-space:nowrap; }
.radio-window { flex:1; min-width:0; overflow:hidden; white-space:nowrap; }
.radio-track { display:inline-block; padding-left:100%; color:var(--shell-muted); font-size:14px; animation:radio-scroll calc(var(--radio-len) * .5s + 12s) linear infinite; }
.radio-track span { margin-right:48px; }
.radio-bar:hover .radio-track { animation-play-state:paused; }
@keyframes radio-scroll { to { transform:translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
 .radio-window { white-space:normal; max-height:3em; overflow-y:auto; }
 .radio-track { animation:none; padding-left:0; }
}
@media (max-width:680px) {
 .radio-bar { gap:6px; }
 .radio-name { display:none; }
 .radio-track { font-size:12px; }
}

.illustrated .map-place.service-building { width:18%;min-width:44px; }
.map-place.planned { pointer-events:none; }
.planned-label { display:block;font:9px/1.5 -apple-system,"PingFang SC",sans-serif;color:var(--muted); }
.player-avatar canvas { display:block;width:100%;height:calc(100% - 16px);object-fit:contain;image-rendering:pixelated; }
.profile-avatar { display:flex;align-items:center;gap:18px;padding:12px 0;border-bottom:1px solid var(--line); }
.profile-avatar canvas { width:96px;height:120px;image-rendering:pixelated;object-fit:contain; }
.profile-avatar b { font:700 22px "Songti SC",serif;color:var(--steel); }
.scene-self { position:absolute;right:18px;bottom:12px;display:flex;flex-direction:column;align-items:center; }
.scene-self canvas { width:96px;height:120px;image-rendering:pixelated;object-fit:contain; }
.scene-self span { background:var(--map-label);color:var(--map-text);font-size:11px;padding:0 8px;border:1px solid var(--trim); }

/* 地图上走动的小人：比例按地图缩小，压在地名和建筑标签下面 */
.walkers { position:absolute; inset:0; pointer-events:none; z-index:1; overflow:hidden; }
.world-scene.illustrated .map-place { z-index:2; }
.walkers.in-place { z-index:1; }
.place-scene > :not(.walkers) { z-index:2; }
.walker { position:absolute; width:24px; height:30px; margin:-30px 0 0 -12px; padding:0; border:0; background:none; cursor:pointer; pointer-events:auto; transition:left linear, top linear; }
.walkers.in-place .walker { width:32px; height:40px; margin:-40px 0 0 -16px; }
.walker canvas { width:100%; height:100%; image-rendering:pixelated; display:block; filter:drop-shadow(0 1px 0 rgba(0,0,0,.3)); }
.walker.flip canvas { transform:scaleX(-1); }
.walker.walking canvas { animation:walker-step .36s steps(2) infinite; }
.walker span { display:none; position:absolute; left:50%; bottom:100%; transform:translateX(-50%); padding:1px 5px; background:var(--shell); color:var(--shell-ink); font-size:11px; white-space:nowrap; }
.walker.named span, .walker:hover span { display:block; }
@keyframes walker-step { 50% { translate:0 -1px; } }
@media (prefers-reduced-motion: reduce) { .walker { transition:none; } .walker.walking canvas { animation:none; } }

/* 点小人弹出的资料卡和头顶气泡 */
.walker-say { display:none; position:absolute; left:50%; bottom:calc(100% + 2px); transform:translateX(-50%); padding:1px 6px; background:#fff; color:#333; font:11px/1.5 sans-serif; font-style:normal; white-space:nowrap; border-radius:6px; }
.walker-say.on { display:block; }
.person-card { position:fixed; left:50%; bottom:88px; transform:translateX(-50%); z-index:50; width:min(360px,calc(100vw - 32px)); max-height:70vh; overflow-y:auto; padding:16px; background:var(--card); color:var(--ink); border:3px double var(--trim); box-shadow:0 4px 12px var(--frame-shadow); }
.person-close { position:absolute; right:6px; top:4px; border:0; background:none; font-size:20px; cursor:pointer; color:var(--ink); }
.person-top { display:flex; gap:12px; align-items:center; margin-bottom:8px; }
.person-top canvas { width:80px; height:88px; image-rendering:pixelated; flex:none; background:var(--bg); }
.person-top b { font-size:18px; } .person-top p, .person-say, .person-note { margin:2px 0; font-size:13px; }
.person-note { color:var(--brick); min-height:1.5em; }
.person-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:8px; font-size:13px; }
.person-shop { display:block; margin-top:10px; }

/* 点小人蹦出来的圆按钮 */
.walker-menu { position:fixed; width:0; height:0; z-index:40; }
.walker-menu-name { position:absolute; left:0; top:6px; transform:translateX(-50%); padding:1px 6px; background:var(--shell); color:var(--shell-ink); font-size:11px; white-space:nowrap; }
.menu-dot { position:absolute; left:-26px; top:-26px; width:52px; height:52px; border-radius:50%; border:2px solid var(--trim); background:var(--card); color:var(--ink); font:600 18px/1 "Songti SC",serif; cursor:pointer; box-shadow:0 2px 6px var(--frame-shadow); transform:translate(var(--dx),var(--dy)); animation:dot-pop .18s ease-out backwards; }
.menu-dot:disabled { opacity:.45; cursor:default; }
@keyframes dot-pop { from { transform:translate(0,0) scale(.3); opacity:0; } }
.walker-toast { position:fixed; left:50%; bottom:96px; transform:translateX(-50%); z-index:60; padding:6px 12px; background:var(--shell); color:var(--shell-ink); font-size:14px; }
@media (prefers-reduced-motion: reduce) { .menu-dot { animation:none; } }

