html, body { margin: 0; height: 100%; overflow: hidden; background: #22303f; font-family: "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif; touch-action: none; -webkit-user-select: none; user-select: none; color: #f2e9cf; }
canvas#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#labels .city { position: absolute; transform: translate(-50%, 0); font-weight: 800; font-size: 13px; color: #fff; white-space: nowrap;
  text-shadow: -1.5px -1.5px 0 #221e1a, 1.5px -1.5px 0 #221e1a, -1.5px 1.5px 0 #221e1a, 1.5px 1.5px 0 #221e1a, 0 2px 4px rgba(0,0,0,.7); }
#labels .city.cap { font-size: 15px; color: #fff4cf; }
#labels .country { position: absolute; transform: translate(-50%, -50%); font-family: "Noto Serif CJK SC", serif; font-weight: 900; color: rgba(55,48,40,.78);
  letter-spacing: .5em; white-space: nowrap; text-shadow: 0 0 3px rgba(240,232,210,.8); }
#labels .sea { position: absolute; transform: translate(-50%, -50%); font-family: "Noto Serif CJK SC", serif; color: rgba(225,236,244,.8); letter-spacing: .7em; white-space: nowrap; }
.topbar { position: absolute; z-index: 5; top: calc(env(safe-area-inset-top) + 6px); left: 6px; right: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topbar .title { font-weight: 800; font-size: 15px; padding: 0 6px; text-shadow: 0 1px 3px #000; }
.topbar .grp { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.btn { border: 1px solid #8a7a58; background: linear-gradient(#efe5c8, #cdbf98); color: #3a342e; font-weight: 700; padding: 6px 10px; border-radius: 6px; font-size: 13px;
  box-shadow: 0 2px 4px rgba(0,0,0,.35); text-decoration: none; display: inline-block; cursor: pointer; font-family: inherit; }
.btn:not(.on)[data-t] { background: #857c66; color: #e3d9bd; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.btn.wide { width: 100%; margin-top: 6px; }
.panel { position: absolute; z-index: 5; left: 8px; top: 60px; background: rgba(38,32,26,.88); border: 1px solid #8a7a58; border-radius: 8px; padding: 8px 10px; font-size: 13px; width: 150px; }
.panel .ph { font-weight: 800; margin-bottom: 6px; color: #e8d39a; }
.panel label { display: flex; justify-content: space-between; align-items: center; margin: 4px 0; gap: 6px; }
.panel select { max-width: 92px; font-size: 12px; }
#info { position: absolute; z-index: 5; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 160%); transition: transform .2s;
  background: rgba(40,34,28,.92); border: 1px solid #a08e6a; border-radius: 8px; padding: 8px 14px; font-size: 14px; text-align: center; line-height: 1.55; min-width: 230px; }
#info.show { transform: translate(-50%, 0); }
#info small { color: #b8a986; }
#stat { position: absolute; z-index: 5; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 4px); font: 11px monospace; color: rgba(255,255,255,.7); text-shadow: 0 1px 2px #000; }
#loading { position: absolute; inset: 0; z-index: 20; background: radial-gradient(#3a3128, #1e1a16); display: flex; flex-direction: column; align-items: center; justify-content: center; }
#loading h1 { font-family: "Noto Serif CJK SC", serif; letter-spacing: 8px; font-size: 28px; margin: 0 0 18px; color: #e9dcb6; }
#loading .bar { width: 60%; max-width: 320px; height: 6px; background: #4a4034; border-radius: 3px; overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 0; background: #d8c08a; transition: width .2s; }
#loading p { color: #a99a78; font-size: 13px; }
@media (max-width: 640px) { .panel { top: auto; bottom: 90px; width: 140px; font-size: 12px; } .btn { padding: 5px 8px; font-size: 12px; } }
/* ---- gallery modules ---- */
#side { position: absolute; z-index: 5; right: 8px; top: 56px; bottom: 70px; width: 196px; background: rgba(38,32,26,.88); border: 1px solid #8a7a58; border-radius: 8px; display: flex; flex-direction: column; }
#side .ph { font-weight: 800; color: #e8d39a; padding: 8px 10px 4px; font-size: 13px; }
#side .sw { display: flex; gap: 5px; padding: 2px 10px 8px; flex-wrap: wrap; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #3a3128; cursor: pointer; }
.swatch.on { border-color: #fff4cf; box-shadow: 0 0 0 2px #c9a24a; }
#list { overflow-y: auto; flex: 1; padding: 0 6px 6px; }
#list .grp { font-size: 11px; color: #b8a986; margin: 8px 4px 3px; letter-spacing: 2px; }
#list .item { padding: 5px 8px; border-radius: 5px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; gap: 6px; }
#list .item small { color: #a99a78; font-size: 11px; }
#list .item:hover { background: rgba(255,240,200,.08); }
#list .item.on { background: linear-gradient(#efe5c8, #cdbf98); color: #3a342e; }
#list .item.on small { color: #6a5d48; }
#info table { border-collapse: collapse; margin: 4px auto 0; font-size: 13px; }
#info td { padding: 1px 8px; } #info td:first-child { color: #b8a986; text-align: right; }
#info b { font-size: 16px; color: #fff4cf; }
@media (max-width: 640px) { #side { width: 150px; top: auto; height: 38%; bottom: 8px; } #info { left: 8px; transform: translate(0,160%); } #info.show { transform: none; } }
/* ---- hub ---- */
body.hub { overflow: auto; touch-action: auto; background: radial-gradient(ellipse at 50% 20%, #4a3e30, #1a1612 75%); }
.hub header { text-align: center; padding: 38px 16px 10px; }
.hub header h1 { font-family: "Noto Serif CJK SC", serif; font-size: 40px; letter-spacing: 12px; margin: 0; color: #f0e2b8; text-shadow: 0 3px 10px #000; }
.hub header p { color: #b8a986; margin: 8px 0 0; letter-spacing: 3px; }
.hub .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; max-width: 1080px; margin: 26px auto; padding: 0 18px 40px; }
.hub .card { display: block; text-decoration: none; color: inherit; background: linear-gradient(#3b3229, #2a241e); border: 1px solid #8a7a58; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.5); transition: transform .15s, box-shadow .15s; }
.hub .card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.6); }
.hub .card .pic { height: 150px; background-size: cover; background-position: center; border-bottom: 1px solid #8a7a58; }
.hub .card .tx { padding: 12px 14px 14px; }
.hub .card h2 { margin: 0 0 6px; font-size: 19px; color: #f0e2b8; } .hub .card h2 small { font-size: 12px; color: #a99a78; margin-left: 6px; font-weight: 400; }
.hub .card p { margin: 0; font-size: 13px; color: #c9bb98; line-height: 1.6; }
.hub .card.dim { opacity: .75; }
.hub footer { text-align: center; color: #7d705a; font-size: 12px; padding-bottom: 24px; }
/* ---- single-model viewer (units / cities) ---- */
.vw-top { position: absolute; z-index: 6; top: calc(env(safe-area-inset-top) + 6px); left: 6px; right: 6px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.vw-top > * { pointer-events: auto; }
.vw-head { display: flex; gap: 6px; align-items: center; }
.vw-head .title { font-weight: 800; font-size: 15px; padding: 0 6px; text-shadow: 0 1px 3px #000; }
.vw-head .grp { display: flex; gap: 4px; margin-left: auto; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 4px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid #8a7a58; background: rgba(38,32,26,.85); color: #e8dcb8; font: 700 13px inherit; font-family: inherit; padding: 6px 12px; border-radius: 18px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.chip small { font-weight: 400; color: #a99a78; font-size: 11px; }
.chip.on { background: linear-gradient(#efe5c8, #cdbf98); color: #3a342e; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.chip.on small { color: #6a5d48; }
.chip[style*="--dot"]::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); border: 1px solid rgba(0,0,0,.5); }
.chips.l1 .chip { font-size: 14px; padding: 7px 14px; }
.chips.l2 .chip { font-size: 12.5px; }
.chips.l3 .chip { font-size: 12px; padding: 5px 10px; }
.vw-bottom { position: absolute; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 10px); display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(560px, calc(100% - 16px)); }
.vw-card { background: rgba(40,34,28,.92); border: 1px solid #a08e6a; border-radius: 10px; padding: 8px 14px; font-size: 13px; line-height: 1.55; width: 100%; box-sizing: border-box; }
.vw-card b { font-size: 16px; color: #fff4cf; } .vw-card small { color: #b8a986; }
.vw-card .src { color: #a99a78; font-size: 11.5px; margin-top: 3px; }
.vw-card table { border-collapse: collapse; margin-top: 4px; font-size: 12.5px; } .vw-card td { padding: 0 10px 0 0; } .vw-card td:nth-child(odd) { color: #b8a986; }
.vw-anim { display: flex; gap: 6px; }
