/* 世界奇观图鉴 · 视觉系统
 * 取自微缩模型本身：宣纸底、墨线描边、朱红印章、琉璃金、青绿；卡片底下那道深色边是地块的“土层厚度”。
 * 先写手机布局，900px 以上是桌面布局。 */
:root {
  --paper: #f3ead8; --paper-deep: #eadfc8; --card: #fbf6ea; --card-hi: #fffaf0;
  --ink: #3a2a1e; --ink-soft: #5c4838; --sub: #8a745e; --faint: #b7a488; --ink-line: rgba(58, 42, 30, .8);
  --line: #dccbab; --line-strong: #bfa77f; --edge: #cdb68c;
  --seal: #b9452f; --seal-deep: #8f2c1d; --gold: #e2a634; --gold-deep: #b97f1f; --jade: #4f8a80; --jade-deep: #3b6d66; --sky: #93c3d2; --grass: #b9cc8f;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --latin: Georgia, "Times New Roman", serif;
  --rail: 76px; --tabbar: 58px; --sheet-w: 440px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --wob-a: 14px 17px 13px 16px / 16px 13px 17px 14px;   /* 手绘感：四个角各不相同的圆角 */
  --wob-b: 10px 12px 9px 11px / 11px 9px 12px 10px;
  --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --shadow: 0 3px 0 var(--edge), 0 14px 32px rgba(80, 55, 30, .16);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 15.5px; line-height: 1.75; overflow: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
#app { position: fixed; inset: 0; overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--jade-deep); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
.ico { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.grow { flex: 1; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; border: 2px solid var(--card); } ::-webkit-scrollbar-track { background: transparent; }

/* 纸纹和暗角盖在最上面，界面和地图像印在同一张纸上 */
#grain { position: absolute; inset: 0; z-index: 90; pointer-events: none; mix-blend-mode: multiply; background-size: 256px 256px; }
@media (max-width: 899px), (pointer: coarse) and (max-height: 599px) {
  #app[data-tab="explore"] #grain { opacity: .35; }
}
#app::after { content: ""; position: absolute; inset: 0; z-index: 89; pointer-events: none; mix-blend-mode: multiply;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0) 55%, rgba(200, 170, 130, .28) 100%); }

/* ------------------------------------------------------------ 基础部件 */
.card { background: var(--card); border: 1.5px solid var(--ink-line); border-radius: var(--wob-a); box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 14px; cursor: pointer; white-space: nowrap;
  background: var(--card-hi); border: 1.5px solid var(--ink-line); border-radius: var(--wob-b); box-shadow: 0 2.5px 0 var(--edge);
  font-size: 14px; letter-spacing: .08em; transition: transform .12s, box-shadow .12s, background .15s; user-select: none; -webkit-user-select: none; }
.btn:hover { background: #fff; }
.btn:active { transform: translateY(2px); box-shadow: 0 .5px 0 var(--edge); }
.btn.primary { background: var(--seal); color: #fff5e6; border-color: var(--seal-deep); box-shadow: 0 2.5px 0 var(--seal-deep); }
.btn.primary:hover { background: #c5503a; }
.btn.jade { background: var(--jade); color: #f4fbf7; border-color: var(--jade-deep); box-shadow: 0 2.5px 0 var(--jade-deep); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(58, 42, 30, .07); }
.btn.small { min-height: 30px; padding: 3px 10px; font-size: 13px; }
.btn.on { background: var(--ink); color: var(--card); border-color: var(--ink); box-shadow: 0 2.5px 0 #1e150e; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 40px; min-height: 40px; padding: 0; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px 5px 11px; cursor: pointer; white-space: nowrap;
  background: var(--card); border: 1.5px solid var(--ink-line); border-radius: 999px; box-shadow: 0 2px 0 var(--edge); font-size: 13.5px; letter-spacing: .06em; color: var(--ink-soft); }
.chip i { width: 8px; height: 8px; background: var(--chip, var(--gold)); transform: rotate(45deg); border-radius: 1.5px; box-shadow: 0 0 0 1px rgba(58, 42, 30, .55); }
.chip small { font: 11.5px var(--latin); color: var(--sub); }
.chip[aria-selected=true], .chip.on { background: var(--ink); color: var(--card); border-color: var(--ink); box-shadow: 0 2px 0 #1e150e; }
.chip[aria-selected=true] small, .chip.on small { color: #d9c8a8; }
/* 印章 */
.seal { display: inline-grid; place-items: center; padding: 1px 7px 1px 8px; background: var(--seal-color, var(--seal)); color: #fff3e2; font-size: 12px; letter-spacing: .18em; line-height: 1.6;
  border-radius: 5px 6px 5px 7px / 6px 5px 7px 5px; box-shadow: inset 0 0 0 1.2px rgba(255, 238, 216, .55); white-space: nowrap; }
.seal.jade { --seal-color: var(--jade); } .seal.gold { --seal-color: var(--gold-deep); } .seal.ink { --seal-color: var(--ink-soft); }
.brand-seal { display: grid; place-items: center; flex: none; width: 36px; height: 36px; background: var(--seal); color: #fff3e2; font-size: 14px; font-weight: 700; line-height: 1.02; writing-mode: vertical-rl; letter-spacing: .04em;
  border-radius: 6px 8px 6px 9px / 8px 6px 9px 6px; box-shadow: inset 0 0 0 1.5px rgba(255, 236, 214, .6), 0 2px 0 var(--seal-deep); }
/* 小标题：前面一粒等距小方块 */
.sec-title { display: flex; align-items: center; gap: 9px; margin: 26px 0 10px; font-size: 15px; font-weight: 600; letter-spacing: .22em; color: var(--ink); }
.sec-title i { flex: none; width: 9px; height: 9px; background: var(--gold); border: 1.5px solid var(--ink-line); transform: rotate(45deg) skew(8deg, 8deg); }
.sec-title small { font-size: 12px; font-weight: 400; letter-spacing: .08em; color: var(--sub); }
.sec-title::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }
.empty, .loading, .hint { color: var(--sub); font-size: 14px; }
.loading { padding: 30px 0; text-align: center; letter-spacing: .2em; }
.ext { display: inline-flex; align-items: baseline; gap: 2px; } .ext .ico { align-self: center; opacity: .7; }

/* 通用奇观卡片 */
.wonder-card { position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--ink-line); border-radius: var(--wob-a); box-shadow: 0 3px 0 var(--edge); transition: transform .15s, box-shadow .15s; }
.wonder-card:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--edge), 0 12px 24px rgba(80, 55, 30, .13); }
.wonder-card:active { transform: translateY(1px); box-shadow: 0 2px 0 var(--edge); }
.wc-thumb { display: block; aspect-ratio: 42 / 29; background: radial-gradient(ellipse at 50% 62%, #fffaf0 0%, var(--paper-deep) 78%); }
.wc-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 7px 5px 0; }
.wc-text { display: grid; gap: 1px; padding: 7px 12px 10px; min-width: 0; }
.wc-text strong { font-size: 15.5px; letter-spacing: .1em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-text small { color: var(--sub); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-text em { font-style: normal; font-size: 12px; color: var(--jade-deep); }
.wc-visited { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--seal); color: #fff5e6; box-shadow: 0 0 0 1.5px var(--card); }
.wc-visited .ico { stroke-width: 2.6; }
.wonder-card.row { flex-direction: row; align-items: center; gap: 10px; width: 100%; padding: 4px 8px 4px 4px; background: none; border-color: transparent; box-shadow: none; border-radius: 12px; }
.wonder-card.row:hover { background: rgba(58, 42, 30, .06); transform: none; }
.wonder-card.row .wc-thumb { flex: none; width: 78px; background: none; } .wonder-card.row .wc-thumb img { padding: 0; }
.wonder-card.row .wc-text { padding: 0; flex: 1; }
.wonder-card.row .wc-visited { position: static; flex: none; }

/* ------------------------------------------------------------ 地图与其上的浮层 */
#atlas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#atlas.can-pick { cursor: pointer; } #atlas:active { cursor: grabbing; }
#app:not([data-tab=explore]) :is(#atlas, #pins, #hover, #explore-top, #tourbar, #sheet) { display: none; }
#hover { position: absolute; left: 0; top: 0; z-index: 25; pointer-events: none; padding: 3px 10px; border-radius: 6px; background: rgba(58, 42, 30, .88); color: var(--card); font-size: 13px; letter-spacing: .06em; white-space: nowrap; opacity: 0; transition: opacity .12s; }
#hover.on { opacity: 1; }
#pins { position: absolute; inset: 0; z-index: 14; pointer-events: none; overflow: hidden; }
.pin { position: absolute; left: -15px; top: -38px; width: 30px; height: 38px; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; will-change: transform; }
.pin::before { content: ""; position: absolute; left: 2px; top: 1px; width: 26px; height: 26px; background: var(--card-hi); border: 1.6px solid var(--ink); border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); box-shadow: 2px 2px 0 rgba(58, 42, 30, .25); transition: background .15s; }
.pin span { position: relative; display: block; margin-top: 2px; font: 600 13px/26px var(--latin); text-align: center; color: var(--ink); }
.pin[aria-pressed=true]::before { background: var(--seal); border-color: var(--seal-deep); } .pin[aria-pressed=true] span { color: #fff5e6; }
.pin:hover::before { background: var(--gold); }

#explore-top { position: absolute; left: 0; right: 0; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center;
  padding: calc(9px + var(--sat)) calc(12px + var(--sar)) 18px calc(12px + var(--sal)); pointer-events: none; transition: opacity .25s, transform .3s var(--ease-out);
  background: linear-gradient(to bottom, rgba(243, 234, 216, .97) 0%, rgba(243, 234, 216, .9) 62%, rgba(243, 234, 216, 0) 100%); }
#explore-top > * { pointer-events: auto; }
#brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
#brand h1 { font-size: 18px; font-weight: 600; letter-spacing: .16em; line-height: 1.2; white-space: nowrap; }
#brand h1 small { display: block; font: italic 10.5px var(--latin); letter-spacing: .1em; color: var(--sub); }
#explore-tools { display: flex; gap: 7px; }
#btn-tour { width: 40px; padding: 0; } #btn-tour span { display: none; }
#chips { grid-column: 1 / -1; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px 5px; }
#chips::-webkit-scrollbar { display: none; }
body.sheet-open #explore-top, body.touring #explore-top { opacity: 0; transform: translateY(-14px); }
body.sheet-open #explore-top > *, body.touring #explore-top > * { pointer-events: none; }


/* 自动漫游条 */
#tourbar { position: absolute; z-index: 45; top: calc(8px + var(--sat)); left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; overflow: hidden;
  background: var(--card); border: 1.5px solid var(--ink-line); border-radius: var(--wob-b); box-shadow: var(--shadow); animation: drop .45s var(--ease-back) both; }
.tour-label { display: flex; align-items: center; gap: 5px; font-size: 13px; letter-spacing: .1em; color: var(--seal); white-space: nowrap; }
.tour-label small { font: 12px var(--latin); color: var(--sub); letter-spacing: 0; }
.tour-name { flex: 1; min-width: 0; font-size: 14.5px; letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.tour-ctl { display: flex; } .tour-ctl .icon-btn { width: 34px; min-height: 34px; }
.tour-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--gold); transform-origin: left; animation: tourbar linear both; }
.tour-progress.paused { animation-play-state: paused; }
@keyframes tourbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ------------------------------------------------------------ 导航：手机在底部 */
#tabs { position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(var(--tabbar) + var(--sab)); padding: 0 var(--sar) var(--sab) var(--sal);
  background: var(--card); border-top: 1.5px solid var(--ink-line); box-shadow: 0 -8px 22px rgba(80, 55, 30, .08); }
#tabs a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--sub); font-size: 11px; letter-spacing: .2em; text-indent: .2em; text-decoration: none; transition: color .15s; }
#tabs a .ico { transition: transform .25s var(--ease-back); }
#tabs a[aria-current] { color: var(--seal); } #tabs a[aria-current] .ico { transform: translateY(-1px) scale(1.08); }
#tabs a[aria-current]::before { content: ""; position: absolute; top: -6px; width: 9px; height: 9px; background: var(--gold); border: 1.5px solid var(--ink-line); transform: rotate(45deg); }
#tabs .rail-brand { display: none; }

/* ------------------------------------------------------------ 奇观详情：手机是底部抽屉 */
#sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; height: 0; max-height: calc(100% - 54px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border-top: 1.5px solid var(--ink-line); border-radius: 20px 22px 0 0 / 18px 20px 0 0; box-shadow: 0 -12px 40px rgba(80, 55, 30, .22);
  transform: translateY(105%); transition: height .45s var(--ease-out), transform .45s var(--ease-out); will-change: height, transform; }
#sheet.open { transform: none; }
#sheet.dragging { transition: none; }
.sheet-handle { flex: none; display: grid; place-items: center; height: 22px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; }
.sheet-handle i { width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.sheet-head { position: relative; flex: none; padding: 0 18px 13px; touch-action: none; }
.sheet-topline { display: flex; align-items: center; gap: 8px; min-height: 40px; margin-right: -8px; }
.sheet-topline .icon-btn { width: 38px; min-height: 38px; margin-left: -6px; color: var(--ink-soft); }
.sheet-place { min-width: 0; font-size: 13.5px; letter-spacing: .08em; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-title { margin-top: 1px; font-size: 27px; font-weight: 600; letter-spacing: .14em; line-height: 1.25; }
.sheet-sub { margin-top: 3px; font-size: 13.5px; color: var(--sub); line-height: 1.5; }
.sheet-sub .en { font-family: var(--latin); font-style: italic; } .sheet-sub .en::before { content: " · "; font-style: normal; }
.sheet-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.fav-btn.on { color: var(--seal); } .fav-btn.on .ico { fill: var(--seal); }
.sheet-tabs { flex: none; display: flex; padding: 0 12px; border-bottom: 1.5px solid var(--line); }
.sheet-tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 2px 9px; margin-bottom: -1.5px; border: 0; border-bottom: 2.5px solid transparent; background: none; cursor: pointer;
  font-size: 14.5px; letter-spacing: .22em; color: var(--sub); }
.sheet-tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--seal); font-weight: 600; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 26px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-body:focus-visible { outline: none; }
.sheet-foot { flex: none; display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px calc(9px + var(--sab)); border-top: 1.5px solid var(--line); background: var(--card); }
.sheet-foot .btn { flex: 1; padding: 6px 6px; }

/* 详情里的排版 */
.tab-panel { animation: fade .3s ease both; }
.tab-panel > p, .tab-panel .record p, .person p { margin: 0 0 14px; text-align: justify; }
.tab-panel .lead { font-size: 17px; line-height: 1.95; }
.tab-panel .lead::first-letter { font-size: 2.1em; line-height: 1; padding-right: 3px; color: var(--seal); font-weight: 600; float: left; margin-top: 4px; }
.photo { margin: 6px 0 18px; }
.photo button { display: block; width: 100%; padding: 0; overflow: hidden; cursor: zoom-in; background: var(--paper-deep); border: 1.5px solid var(--ink-line); border-radius: var(--wob-a); box-shadow: 0 3px 0 var(--edge); }
.photo img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: cover; }   /* 竖幅照片只露中间一段，点开看全图 */
.photo figcaption { margin-top: 9px; font-size: 13px; line-height: 1.6; color: var(--sub); }
.photo details { margin-top: 2px; font-size: 12px; } .photo summary { cursor: pointer; color: var(--faint); }
.fact-cards { display: grid; gap: 9px; margin: 4px 0 20px; }
.fact-card { display: grid; grid-template-columns: 26px 1fr; column-gap: 9px; align-items: start; padding: 10px 13px 11px 11px; background: var(--card-hi); border: 1.5px solid var(--line-strong); border-radius: var(--wob-b); }
.fact-card > .ico { grid-column: 1; grid-row: 1 / span 8; margin-top: 3px; color: var(--seal); }
.fact-card > :not(.ico) { grid-column: 2; min-width: 0; }   /* 文字行不管有几行，都排在右侧一列（图标列只有 26px 宽） */
.fact-card small { font-size: 12px; letter-spacing: .2em; color: var(--sub); line-height: 1.4; }
.fact-card strong { font-size: 15px; font-weight: 600; line-height: 1.55; }
.fact-card span { font-size: 12.5px; color: var(--sub); line-height: 1.7; }
.fact-card span a { white-space: nowrap; }
/* 待补充的五类内容：标签、小图、规模数字、建造步骤、传说与误解 */
.tab-panel .tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 7px; margin: -4px 0 14px; }
.tag { padding: 0 10px; border: 1.2px solid var(--line-strong); border-radius: 999px; background: var(--card-hi); font-size: 12.5px; line-height: 1.75; color: var(--ink-soft); white-space: nowrap; }
.gallery { display: flex; gap: 9px; overflow-x: auto; scrollbar-width: none; margin: -6px -18px 18px; padding: 2px 18px 6px; }
.gallery::-webkit-scrollbar { display: none; }
.gallery button { position: relative; flex: none; width: 132px; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; cursor: zoom-in; background: var(--paper-deep); border: 1.5px solid var(--ink-line); border-radius: var(--wob-b); box-shadow: 0 2.5px 0 var(--edge); }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery .seal { position: absolute; left: 6px; bottom: 6px; font-size: 11px; }
.photo details div { margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 0 0 10px; }
.stat-grid div { display: grid; align-content: start; gap: 1px; padding: 9px 10px 8px; background: var(--card-hi); border: 1.5px solid var(--line-strong); border-radius: var(--wob-b); }
.stat-grid dd { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--seal-deep); }
.stat-grid dt { font-size: 12px; letter-spacing: .14em; color: var(--sub); }
.stat-grid small { font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.stages { list-style: none; display: grid; gap: 11px; margin: 4px 0 14px; padding: 0; }
.stages li { display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; align-items: start; }
.stages .num { grid-row: 1 / span 2; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border: 1.6px solid var(--ink); border-radius: 50%; background: var(--card-hi); font: 600 13px var(--latin); }
.stages strong { font-size: 15px; letter-spacing: .08em; line-height: 1.7; } .stages strong small { margin-left: 9px; font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--sub); }
.stages p { margin: 0; font-size: 14.5px; line-height: 1.75; text-align: justify; }
.materials { list-style: none; display: grid; gap: 3px; margin: 0 0 10px; padding: 0; font-size: 14px; }
.materials strong { margin-right: .7em; } .materials span { color: var(--ink-soft); }
.lore { display: grid; gap: 10px; }
.lore-card { padding: 11px 14px 3px; background: var(--card-hi); border: 1.5px solid var(--line-strong); border-radius: var(--wob-b); }
.lore-card p { margin: 0 0 9px; font-size: 14.5px; text-align: justify; }
.lore-card .lore-head { display: flex; align-items: center; gap: 9px; text-align: left; } .lore-head strong { font-size: 15px; letter-spacing: .06em; line-height: 1.5; }
.lore-card .lore-fact { padding: 6px 11px; background: rgba(79, 138, 128, .11); border-left: 3px solid var(--jade); border-radius: 0 7px 7px 0; }
.lore-fact b { margin-right: .7em; color: var(--jade-deep); }
#photo-dialog small { display: block; margin-top: 3px; font-size: 12px; color: var(--sub); }
.quote-card { position: relative; margin: 0 0 18px; padding: 18px 18px 15px 46px; background: linear-gradient(135deg, #f8efdc, #f2e6cc); border: 1.5px solid var(--line-strong); border-radius: var(--wob-a); }
.quote-card > .ico { position: absolute; left: 13px; top: 14px; color: var(--seal); opacity: .7; }
.quote-card blockquote { margin: 0; font-size: 16.5px; line-height: 1.9; }
.quote-card figcaption { margin-top: 8px; text-align: right; font-size: 13px; color: var(--sub); }
.next-hint { display: flex; gap: 9px; flex-wrap: wrap; }
.next-hint .btn { flex: 1; }
.timeline { list-style: none; margin: 4px 0 0; padding: 0 0 0 7px; }
.timeline li { position: relative; display: grid; gap: 1px; padding: 0 0 15px 21px; border-left: 1.5px dashed var(--line-strong); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 2px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 9px; height: 9px; background: var(--gold); border: 1.5px solid var(--ink-line); transform: rotate(45deg); }
.timeline strong { font-size: 14px; color: var(--seal-deep); letter-spacing: .05em; }
.timeline span { font-size: 14.5px; line-height: 1.75; }
.people { display: grid; gap: 10px; }
.person { padding: 11px 14px 4px; background: var(--card-hi); border: 1.5px solid var(--line-strong); border-radius: var(--wob-b); }
.person strong { display: block; font-size: 15.5px; letter-spacing: .08em; } .person small { color: var(--sub); font-size: 12.5px; } .person p { margin: 5px 0 9px; font-size: 14.5px; }
.person .btn { margin-bottom: 10px; }
.cites { font-size: 12.5px !important; color: var(--sub); text-align: left !important; line-height: 1.8; } .cites a { margin-right: 9px; }
.dossier { margin-top: 10px; border: 1.5px solid var(--line-strong); border-radius: var(--wob-b); background: var(--card-hi); }
.dossier summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 14.5px; letter-spacing: .14em; list-style: none; }
.dossier summary::-webkit-details-marker { display: none; }
.dossier summary small { font-size: 12px; color: var(--sub); letter-spacing: 0; } .dossier summary small::after { content: " ▾"; } .dossier[open] summary small::after { content: " ▴"; }
.dossier .record { padding: 12px 14px 2px; border-top: 1px dashed var(--line-strong); }
.dossier h4 { margin-bottom: 7px; font-size: 14.5px; line-height: 1.6; }
.dossier .record.source { padding: 8px 14px; font-size: 13.5px; }
.facts { display: grid; gap: 3px; margin: 0 0 10px; font-size: 13.5px; }
.facts div { display: grid; grid-template-columns: 5.2em 1fr; gap: 8px; } .facts dt { color: var(--sub); } .facts dd { margin: 0; }
.spot-list { list-style: none; margin: 10px 0 16px; padding: 0; display: grid; gap: 9px; }
.spot-list li { border: 1.5px solid var(--line-strong); border-radius: var(--wob-b); background: var(--card-hi); overflow: hidden; }
.spot-list li > button { display: grid; grid-template-columns: 30px 1fr 18px; column-gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.spot-list .num { grid-row: 1 / 3; display: grid; place-items: center; width: 28px; height: 28px; border: 1.6px solid var(--ink); border-radius: 50%; font: 600 13px var(--latin); background: var(--card); }
.spot-list strong { font-size: 15.5px; letter-spacing: .08em; } .spot-list small { grid-column: 2; font-size: 12.5px; color: var(--sub); }
.spot-list .chev { grid-row: 1 / 3; grid-column: 3; color: var(--sub); transition: transform .2s; }
.spot-list button[aria-expanded=true] .num { background: var(--seal); border-color: var(--seal-deep); color: #fff5e6; }
.spot-list button[aria-expanded=true] .chev { transform: rotate(180deg); }
.spot-detail { padding: 2px 14px 4px 14px; border-top: 1px dashed var(--line-strong); font-size: 14.5px; } .spot-detail p { margin: 10px 0; text-align: justify; }
.spot-detail .note { font-size: 13px; color: var(--ink-soft); }

/* ------------------------------------------------------------ 搜索 */
#search { position: absolute; inset: 0; z-index: 82; background: rgba(58, 42, 30, .3); opacity: 0; transition: opacity .2s; }
#search.open { opacity: 1; }
.search-box { position: absolute; inset: 0; display: flex; flex-direction: column; border-radius: 0; border: 0; padding-top: var(--sat); transform: translateY(12px); transition: transform .25s var(--ease-out); }
#search.open .search-box { transform: none; }
.search-row { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 16px; border-bottom: 1.5px solid var(--line); }
.search-ico { display: grid; color: var(--sub); }
#search-input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: none; font: inherit; font-size: 17px; color: var(--ink); letter-spacing: .06em; }
#search-input::placeholder { color: var(--faint); }
#search-results { flex: 1; overflow-y: auto; padding: 6px 10px 20px; overscroll-behavior: contain; }
.search-label { margin: 12px 8px 4px; font-size: 12px; letter-spacing: .24em; color: var(--sub); }
.search-regions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 8px; }
#search .empty { padding: 30px 10px; }

/* ------------------------------------------------------------ 提示条、大图、开场 */
#toasts { position: absolute; z-index: 80; left: 0; right: 0; top: calc(var(--sat) + 104px); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
body.sheet-open #toasts, #app:not([data-tab=explore]) #toasts { top: calc(12px + var(--sat)); }
.toast { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 15px; background: rgba(58, 42, 30, .93); color: var(--card); border-radius: var(--wob-b); font-size: 13.5px; letter-spacing: .06em; box-shadow: 0 8px 22px rgba(60, 40, 20, .25); animation: rise .4s var(--ease-back) both; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .35s; }
.toast .seal { transform: rotate(-6deg); }
.stamp-in { animation: stamp .5s var(--ease-back) .15s both; }
#photo-dialog { max-width: min(96vw, 1180px); max-height: 94vh; padding: 0; border: 1.5px solid var(--ink-line); border-radius: var(--wob-a); background: var(--card); color: var(--ink); overflow: hidden; }
#photo-dialog::backdrop { background: rgba(40, 28, 18, .72); }
#photo-dialog form { position: absolute; right: 8px; top: 8px; }
#photo-dialog img { display: block; max-width: 100%; max-height: calc(94vh - 60px); margin: 0 auto; }
#photo-dialog p { padding: 10px 16px 12px; font-size: 13.5px; color: var(--ink-soft); }
#splash { position: absolute; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--paper); color: var(--sub); letter-spacing: .4em; font-size: 14px; transition: opacity .6s; }
#splash.gone { opacity: 0; pointer-events: none; }
.splash-seal { display: grid; place-items: center; width: 74px; height: 74px; background: var(--seal); color: #fff3e2; font-size: 27px; font-weight: 700; line-height: 1.05; letter-spacing: .04em; writing-mode: vertical-rl;
  border-radius: 12px 15px 12px 16px / 15px 12px 16px 12px; box-shadow: inset 0 0 0 2.5px rgba(255, 236, 214, .6), 0 4px 0 var(--seal-deep); animation: stamp .7s var(--ease-back) both; }

/* ------------------------------------------------------------ 其余页面的公共骨架 */
#pages { display: contents; }
.page { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--tabbar) + var(--sab)); z-index: 10; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--paper); }
.page-inner { max-width: 1080px; margin: 0 auto; padding: calc(18px + var(--sat)) calc(16px + var(--sar)) 40px calc(16px + var(--sal)); }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-size: 25px; font-weight: 600; letter-spacing: .2em; line-height: 1.3; }
.page-head p { flex: 1 1 220px; color: var(--sub); font-size: 13.5px; line-height: 1.6; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

/* ------------------------------------------------------------ 动效 */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.2) rotate(-24deg); } 60% { opacity: 1; transform: scale(.92) rotate(-8deg); } 100% { opacity: .72; transform: scale(1) rotate(-10deg); } }
.toast .stamp-in, .splash-seal { --_r: 0deg; }
@keyframes pop { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ------------------------------------------------------------ 桌面布局（≥900px）：左侧导航栏，右侧详情栏 */
@media (min-width: 900px) {
  body { font-size: 16px; }
  #tabs { top: 0; right: auto; bottom: 0; width: var(--rail); height: auto; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 14px 0;
    border-top: 0; border-right: 1.5px solid var(--ink-line); box-shadow: 8px 0 22px rgba(80, 55, 30, .07); }
  #tabs a { flex: none; width: 62px; height: 62px; margin: 0 auto; border-radius: var(--wob-b); font-size: 12px; gap: 3px; }
  #tabs a:hover { background: rgba(58, 42, 30, .06); color: var(--ink-soft); }
  #tabs a[aria-current] { background: rgba(185, 69, 47, .1); color: var(--seal); }
  #tabs a[aria-current]::before { top: auto; left: -12px; }
  #tabs .rail-brand { display: grid; place-items: center; height: 50px; margin-bottom: 12px; } #tabs .rail-brand:hover { background: none; }
  #explore-top { left: var(--rail); grid-template-columns: auto 1fr auto; gap: 14px 22px; padding: 16px 22px 26px 24px; transition: right .45s var(--ease-out), opacity .25s; }
  #brand .brand-seal { display: none; }
  #brand h1 { font-size: 21px; } #brand h1 small { font-size: 11.5px; }
  #chips { grid-column: auto; order: 2; margin: 0; padding: 2px 2px 5px; }
  #explore-tools { order: 3; }
  #btn-tour { width: auto; padding: 6px 14px; } #btn-tour span { display: inline; }
  body.sheet-open #explore-top { opacity: 1; transform: none; right: calc(var(--sheet-w) + 16px); }
  body.sheet-open #explore-top > * { pointer-events: auto; }
  body.sheet-open #chips { visibility: hidden; }
  #tourbar { left: calc(var(--rail) + (100% - var(--rail) - var(--sheet-w) - 16px) / 2 - 230px); right: auto; top: auto; bottom: 22px; width: 460px; animation-name: rise; }
  #sheet { left: auto; right: 16px; top: 16px; bottom: 16px; width: var(--sheet-w); height: auto !important; max-height: none; border: 1.5px solid var(--ink-line); border-radius: var(--wob-a);
    box-shadow: 0 4px 0 var(--edge), 0 20px 48px rgba(80, 55, 30, .22); transform: translateX(calc(100% + 44px)); transition: transform .5s var(--ease-out); }
  #sheet.open { transform: none; }
  .sheet-handle { display: none; }
  .sheet-head { padding: 12px 22px 14px; touch-action: auto; }
  .sheet-title { font-size: 30px; }
  .sheet-tabs { padding: 0 16px; }
  .sheet-body { padding: 18px 22px 28px; }
  .gallery { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }
  .gallery button { width: 150px; }
  .sheet-foot { padding: 10px 14px; }
  #search { background: rgba(58, 42, 30, .22); }
  .search-box { inset: 12px auto auto calc(var(--rail) + 20px); width: 500px; max-height: min(78vh, 720px); border: 1.5px solid var(--ink-line); border-radius: var(--wob-a); padding-top: 0; }
  #toasts, body.sheet-open #toasts, #app:not([data-tab=explore]) #toasts { top: auto; bottom: 26px; left: var(--rail); } body.sheet-open #toasts { right: var(--sheet-w); }
  .page { left: var(--rail); bottom: 0; }
  .page-inner { padding: 30px 34px 60px; }
  .page-head h2 { font-size: 30px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
}
/* 手机横屏：导航栏挪到左边，详情停在右边 */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
  :root { --tabbar: 0px; --rail: 58px; --sheet-w: 340px; }
  #tabs { top: 0; right: auto; width: calc(var(--rail) + var(--sal)); height: auto; flex-direction: column; padding: 6px 0 6px var(--sal); border-top: 0; border-right: 1.5px solid var(--ink-line); }
  #tabs a[aria-current]::before { top: auto; left: -5px; }
  #explore-top, .page { left: calc(var(--rail) + var(--sal)); }
  #sheet { left: auto; right: calc(8px + var(--sar)); top: 8px; bottom: 8px; width: var(--sheet-w); height: auto !important; max-height: none; border: 1.5px solid var(--ink-line); border-radius: var(--wob-a);
    box-shadow: 0 3px 0 var(--edge), 0 14px 32px rgba(80, 55, 30, .2); transform: translateX(calc(100% + 30px)); transition: transform .5s var(--ease-out); }
  #sheet.open { transform: none; }
  .sheet-handle { display: none; }
  .sheet-head { padding: 6px 14px 9px; touch-action: auto; }
  .sheet-title { font-size: 21px; } .sheet-meta { margin-top: 4px; }
  .sheet-tabs button { padding: 6px 2px; }
  .sheet-body { padding: 12px 14px 18px; }
  .sheet-foot { padding: 6px 8px; } .sheet-foot .btn { min-height: 34px; font-size: 13px; }
  body.sheet-open #explore-top { opacity: 1; transform: none; right: calc(var(--sheet-w) + 12px); }
  body.sheet-open #explore-top > * { pointer-events: auto; }
  body.sheet-open #chips { visibility: hidden; }
  #toasts, body.sheet-open #toasts { top: 8px; left: var(--rail); } body.sheet-open #toasts { right: var(--sheet-w); }
  #tourbar { left: calc(var(--rail) + var(--sal) + 10px); right: calc(var(--sheet-w) + 20px); top: auto; bottom: 8px; }
}

/* Language controls remain in the primary navigation at either screen size. */
.language-switch { align-self: center; flex: none; min-height: 36px; padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 8px;
  color: var(--jade-deep); background: var(--card-hi); cursor: pointer; font: 600 13px Georgia, "Songti SC", serif; }
#tabs .language-switch { margin: 0 6px; }
@media (min-width: 900px), (orientation: landscape) and (max-height: 520px) {
  #tabs .language-switch { margin: auto 0 4px; }
}
html:lang(en) { --serif: Georgia, "Times New Roman", "Songti SC", serif; }
:lang(en) :is(#tabs a, .seal, #brand h1, .sheet-tabs button, .sec-title, .page-head h2, .sheet-title, .chip) { letter-spacing: normal; text-indent: 0; }
:lang(en) :is(.brand-seal, .splash-seal) { writing-mode: horizontal-tb; }
:lang(en) .fact-card span a { white-space: normal; }
:lang(en) :is(.fact-card, .stat-grid > div, .facts dd, .materials li, .spot-list strong, .sheet-title, .wc-text) { min-width: 0; overflow-wrap: anywhere; }
:lang(en) .fact-card { grid-template-columns: 24px minmax(0,1fr); }
:lang(en) .sheet-place { min-width: 0; line-height: 1.25; }
:lang(en) .tag-row { line-height: 1.35; }
/* 规模卡片：英文数值长，手机上两列、字号略小，标签不加字距，单词不从中间断开 */
:lang(en) .stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
:lang(en) .stat-grid > div { overflow-wrap: break-word; }
:lang(en) .stat-grid dd { font-size: 15.5px; line-height: 1.3; }
:lang(en) .stat-grid dt { letter-spacing: .02em; line-height: 1.35; }
:lang(en) .lore-head strong { letter-spacing: .01em; line-height: 1.35; }
.sheet-topline .language-switch { display: none; }
@media (max-width: 899px) and (orientation: portrait) {
  .sheet-topline .language-switch { display: inline-block; padding: 2px 7px; min-height: 32px; }
}
:lang(en) :is(.tab-panel > p, .tab-panel .record p, .person p, .stages p, .lore-card p, .spot-detail p) { text-align: left; }
:lang(en) .wc-text strong { white-space: normal; letter-spacing: .015em; line-height: 1.3; }
:lang(en) .sheet-place { white-space: normal; }
:lang(en) .tag { max-width: 100%; white-space: normal; }
