:root {
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --fg: #211f1b;
  --muted: #767068;
  --border: #e4ded4;
  --accent: #9d4b3b;
  --accent-deep: #7f3b2f;
  --accent-soft: rgba(157, 75, 59, .11);
  --fg-soft: rgba(33, 31, 27, .055);
  --reader-bg: #26221e;
  --reader-paper: #faf6ee;
  --font-display: 'Songti SC', 'STSong', 'Iowan Old Style', 'Charter', Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 4px;
  --shadow-soft: 0 20px 70px rgba(33, 31, 27, .10);
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100%; margin: 0; overflow-x: hidden; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
body.reader-open { background: var(--reader-bg); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--font-body); font-weight: 600; letter-spacing: -.025em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.screen { display: none; min-height: 100%; }
.screen.active { display: block; animation: screen-in .26s cubic-bezier(.2,.8,.2,1); }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.container { width: min(1240px, calc(100% - 72px)); margin: 0 auto; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.stack { display: flex; flex-direction: column; }
.meta { font: 12px/1.4 var(--font-mono); letter-spacing: .02em; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius); background: transparent; transition: background .16s, border-color .16s, transform .12s, color .16s; }
.btn:hover { border-color: var(--fg); background: var(--fg-soft); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-quiet { border-color: transparent; }
.btn-quiet:hover { border-color: transparent; background: var(--fg-soft); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; border-radius: var(--radius); }
.icon-btn:hover { background: var(--fg-soft); border-color: var(--border); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

/* 顶部导航 */
.topnav { position: sticky; top: 0; z-index: 18; height: 68px; border-bottom: 1px solid var(--border); background: rgba(247, 244, 238, .88); backdrop-filter: blur(16px) saturate(115%); }
.topnav .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.logo { border: 0; background: transparent; font-family: var(--font-display); font-size: 22px; letter-spacing: .12em; white-space: nowrap; }
.logo:hover { color: var(--accent); }
.search-wrap { position: relative; flex: 0 1 300px; }
.search { width: 100%; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255, 253, 248, .6); }
.search::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
.search-results { position: absolute; top: calc(100% + 8px); right: 0; width: min(380px, calc(100vw - 32px)); padding: 6px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 18px 44px rgba(33, 31, 27, .16); z-index: 40; }
.search-result { width: 100%; display: block; padding: 10px 11px; border: 0; background: transparent; text-align: left; border-radius: 3px; }
.search-result:hover, .search-result:focus-visible { background: var(--fg-soft); }
.search-result strong { display: block; font-size: 14px; font-weight: 500; }
.search-result small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.search-empty { padding: 12px 11px; color: var(--muted); font-size: 13px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--fg); color: var(--surface); font: 11px var(--font-mono); }

/* 城市记忆库 */
.memory-main { padding: 64px 0 96px; }
.memory-intro { display: grid; grid-template-columns: 1fr 380px; gap: 80px; align-items: end; margin-bottom: 38px; }
.memory-intro h1 { font-size: clamp(46px, 5vw, 72px); line-height: .96; }
.memory-intro p { color: var(--muted); font-size: 17px; line-height: 1.75; }
.city-hero { position: relative; min-height: 610px; overflow: hidden; background: var(--fg); border-radius: 18px; cursor: pointer; isolation: isolate; box-shadow: var(--shadow-soft); }
.city-hero img { width: 100%; height: 610px; object-fit: cover; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.city-hero:hover img { transform: scale(1.015); }
.city-hero-info { position: absolute; left: 24px; bottom: 24px; width: min(540px, calc(100% - 48px)); padding: 24px 26px; background: rgba(255, 253, 248, .94); color: var(--fg); border: 1px solid rgba(255, 253, 248, .72); border-radius: 14px; box-shadow: 0 12px 36px rgba(33, 31, 27, .22); }
.city-hero-info h2 { font-size: 36px; }
.city-hero-info .city-line { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 10px; color: var(--muted); }
.city-hero-info .open-city { color: var(--fg); font-weight: 600; white-space: nowrap; }
.library-note { display: flex; justify-content: space-between; gap: 24px; margin-top: 18px; color: var(--muted); font-size: 12px; }

/* 城市页 */
.city-main { padding: 44px 0 100px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.crumbs button { min-height: 32px; padding: 0; border: 0; background: transparent; color: inherit; }
.crumbs button:hover { color: var(--fg); }
.city-heading { display: grid; grid-template-columns: 1fr 360px; align-items: end; gap: 60px; margin: 42px 0 34px; }
.city-heading h1 { font-size: 58px; line-height: 1; }
.city-heading p { color: var(--muted); line-height: 1.75; }
.story-feature { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, .8fr); min-height: 510px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 14px 50px rgba(33, 31, 27, .06); }
.story-feature-media { position: relative; min-height: 510px; overflow: hidden; cursor: pointer; }
.story-feature-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.story-feature-media:hover img { transform: scale(1.012); }
.story-feature-copy { padding: 48px 42px 38px; display: flex; flex-direction: column; }
.story-feature-copy h2 { margin-top: 14px; font-size: 42px; line-height: 1.05; }
.story-summary { margin-top: 22px; color: var(--muted); font: 17px/1.85 var(--font-display); }
.story-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.chapter-list { margin-top: auto; padding-top: 30px; }
.chapter-row { width: 100%; min-height: 54px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; padding: 0; border: 0; border-top: 1px solid var(--border); background: transparent; text-align: left; }
.chapter-row:hover { background: var(--fg-soft); }
.chapter-row span:first-child { color: var(--muted); font: 11px var(--font-mono); }
.chapter-row small { color: var(--muted); }

/* 上传与示例 */
.upload-main { min-height: 100vh; padding: 70px 0; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); }
.back-link:hover { color: var(--fg); }
.upload-title { max-width: 650px; margin: 42px auto 34px; text-align: center; }
.upload-title h1 { font-size: 52px; }
.upload-title p { margin-top: 12px; color: var(--muted); font-size: 17px; }
.upload-title .demo-note { margin-top: 10px; font: 11px var(--font-mono); color: var(--accent); }
.dropzone { min-height: 250px; display: grid; place-items: center; text-align: center; border: 1px dashed rgba(33, 31, 27, .35); background: var(--surface); }
.dropzone.drag { background: var(--accent-soft); border-color: var(--accent); }
.dropzone strong { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 500; }
.dropzone p { margin: 8px 0 22px; color: var(--muted); }
.upload-toolbar { margin: 30px 0 16px; }
.thumb-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.upload-thumb { position: relative; aspect-ratio: 4/3; overflow: hidden; border: 1px solid var(--border); background: var(--fg-soft); }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-thumb::after { content: attr(data-index); position: absolute; left: 7px; bottom: 6px; color: #fff; font: 10px var(--font-mono); text-shadow: 0 1px 4px #000; }
.upload-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); }
select { min-height: 40px; padding: 0 32px 0 12px; border: 1px solid var(--border); background: var(--surface); }

/* 编辑器（桌面端） */
#screen-editor { height: 100vh; min-height: 720px; overflow: hidden; background: var(--surface); }
#screen-editor.active { display: grid; grid-template-rows: 58px 1fr; }
.editor-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.editor-toolbar .left, .editor-toolbar .right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.editor-toolbar .right { justify-content: flex-end; }
.editor-crumb { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-crumb strong { color: var(--fg); font-weight: 500; }
.save-state { color: var(--muted); font-size: 12px; white-space: nowrap; }
.editor-shell { min-height: 0; display: grid; grid-template-columns: 220px minmax(600px, 1fr) 276px; }
.page-nav { min-height: 0; overflow-y: auto; padding: 18px 14px; border-right: 1px solid var(--border); background: var(--bg); }
.panel-head { height: 36px; margin-bottom: 12px; }
.page-list { display: flex; flex-direction: column; gap: 14px; }
.page-item { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: start; padding: 7px; border: 1px solid transparent; background: transparent; cursor: pointer; }
.page-item:hover { background: var(--fg-soft); }
.page-item.selected { border-color: var(--fg); background: var(--surface); }
.page-num { font: 10px var(--font-mono); color: var(--muted); padding-top: 3px; }
.mini-page { aspect-ratio: 16/9; display: grid; grid-template-columns: 58% 42%; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.mini-page .mini-photo { background: var(--muted); }
.mini-page img.mini-photo { width: 100%; height: 100%; object-fit: cover; }
.mini-page .mini-copy { padding: 7px 5px; }
.mini-page .mini-copy::before, .mini-page .mini-copy::after { content: ''; display: block; height: 2px; margin-bottom: 4px; background: var(--border); }
.page-label { grid-column: 2; margin-top: -3px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-more { position: absolute; top: 5px; right: 5px; opacity: 0; }
.page-item:hover .page-more, .page-item:focus-within .page-more { opacity: 1; }
.canvas-area { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: #ece7de; overflow: auto; }
.canvas-top { width: min(920px, 100%); display: flex; justify-content: space-between; align-items: center; }
.canvas { width: min(920px, 100%); aspect-ratio: 16/9; position: relative; display: grid; overflow: hidden; background: var(--surface); box-shadow: 0 3px 20px rgba(33, 31, 27, .10); }
.canvas.layout-1 { grid-template-columns: 58% 42%; }
.canvas.layout-2 { grid-template-columns: 42% 58%; }
.canvas.layout-2 .canvas-photo { order: 2; }
.canvas.layout-3 { grid-template: 65% 35% / 1fr; }
.canvas.layout-4 { display: block; }
.canvas.layout-4 .canvas-photo { position: absolute; inset: 0; }
.canvas.layout-4 .canvas-copy { position: absolute; left: 6%; bottom: 8%; width: 42%; color: var(--surface); background: rgba(26, 23, 20, .72); padding: 20px; }
.canvas.layout-4 .essay { display: none; }
.canvas.layout-5 { grid-template: 68% 32% / 1fr; }
.canvas.layout-5 .canvas-photo { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.canvas.layout-5 .canvas-copy { grid-column: 1 / -1; padding: 18px 38px; }
.canvas.layout-5 .essay { display: none; }
.canvas.layout-6 { grid-template: 54% 46% / 64% 36%; }
.canvas.layout-6 .canvas-photo { grid-row: 1 / -1; display: grid; grid-template-rows: 2fr 1fr; gap: 4px; }
.canvas.layout-6 .canvas-copy { padding: 26px; }
.canvas.layout-6 .essay { display: none; }
.canvas.layout-7 { display: block; padding: 7% 12%; }
.canvas.layout-7 .canvas-photo { display: none; }
.canvas.layout-7 .canvas-copy { height: 100%; max-width: 560px; padding: 0; }
.canvas.layout-7 .essay { font-size: 15px; }
.canvas.layout-8 { display: block; }
.canvas.layout-8 .canvas-photo { position: absolute; inset: 0; }
.canvas.layout-8 .canvas-copy { position: absolute; inset: auto 28px 24px; padding: 0; display: flex; justify-content: space-between; color: var(--surface); }
.canvas.layout-8 .canvas-copy h2, .canvas.layout-8 .canvas-copy .essay { display: none; }
.canvas-photo { position: relative; min-width: 0; cursor: pointer; }
.story-img { width: 100%; height: 100%; object-fit: cover; min-width: 0; min-height: 0; }
.story-img.secondary { display: none; }
.canvas.layout-5 .story-img.secondary, .canvas.layout-6 .story-img.secondary { display: block; }
.canvas-photo.selected-block { outline: 2px solid var(--fg); outline-offset: -2px; }
.canvas-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 8%; cursor: text; }
.canvas-copy.selected-block { outline: 2px solid var(--fg); outline-offset: -2px; }
.canvas-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12%; font: 10px var(--font-mono); letter-spacing: .08em; color: var(--muted); }
.canvas-copy h2 { font-size: clamp(28px, 3vw, 44px); line-height: 1.05; }
.essay { margin-top: 9%; font-family: var(--font-display); font-size: clamp(12px, 1.2vw, 17px); line-height: 1.9; white-space: pre-line; }
.canvas-foot { margin-top: auto; padding-top: 16px; font: 10px var(--font-mono); color: var(--muted); }
.inspector { min-height: 0; overflow-y: auto; padding: 20px; border-left: 1px solid var(--border); background: var(--surface); }
.inspector-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.inspector-tab { height: 38px; padding: 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); }
.inspector-tab.active { color: var(--fg); border-color: var(--fg); }
.inspector-view { display: none; }
.inspector-view.active { display: block; }
.layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.layout-choice { min-height: 88px; padding: 9px; border: 1px solid var(--border); background: transparent; text-align: left; }
.layout-choice:hover, .layout-choice.selected { border-color: var(--fg); background: var(--fg-soft); }
.layout-icon { height: 48px; display: grid; grid-template-columns: 60% 40%; margin-bottom: 7px; border: 1px solid var(--border); background: var(--surface); }
.layout-icon span:first-child { background: var(--muted); }
.layout-choice:nth-child(2) .layout-icon { grid-template-columns: 40% 60%; }
.layout-choice:nth-child(2) .layout-icon span:first-child { order: 2; }
.layout-choice:nth-child(3) .layout-icon { grid-template: 65% 35% / 1fr; }
.layout-choice:nth-child(4) .layout-icon, .layout-choice:nth-child(8) .layout-icon { display: block; background: var(--muted); }
.layout-choice:nth-child(5) .layout-icon { grid-template: 68% 32% / 1fr 1fr; }
.layout-choice:nth-child(6) .layout-icon { grid-template-columns: 64% 36%; }
.layout-choice:nth-child(7) .layout-icon { display: block; background: var(--surface); padding: 10px; }
.layout-choice:nth-child(7) .layout-icon::after { content: ''; display: block; height: 2px; background: var(--muted); box-shadow: 0 6px var(--border), 0 12px var(--border); }
.layout-choice small { font-size: 11px; color: var(--muted); }
.control-row { margin: 18px 0; }
.control-row label { display: block; margin-bottom: 7px; font-size: 12px; color: var(--muted); }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--border); }
.segmented button { min-height: 38px; border: 0; border-right: 1px solid var(--border); background: transparent; }
.segmented button:last-child { border-right: 0; }
.segmented button.selected { background: var(--fg); color: var(--surface); }
input[type='range'] { width: 100%; accent-color: var(--fg); }
.notice { padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }

/* 阅读模式 */
#screen-reader { background: var(--reader-bg); color: var(--reader-paper); min-height: 100vh; }
#screen-reader.active { display: block; }
.reader-bar { position: fixed; top: 18px; left: 50%; z-index: 30; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(255, 253, 248, .92); color: var(--fg); border: 1px solid rgba(255, 253, 248, .72); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); backdrop-filter: blur(14px) saturate(110%); transition: opacity .26s ease-out; }
.reader-bar.hidden { opacity: 0; pointer-events: none; }
.reader-bar .btn { min-height: 36px; }
.reader-bar .icon-btn { width: 34px; height: 36px; }
.reader-pages { width: min(1120px, calc(100% - 72px)); margin: 0 auto; padding: 100px 0; }
.reader-page { aspect-ratio: 16/9; margin: 0 0 54px; background: var(--reader-paper); color: var(--fg); display: grid; grid-template-columns: 58% 42%; overflow: hidden; border-radius: 3px; box-shadow: 0 24px 80px rgba(0, 0, 0, .26); }
.reader-page.canvas { width: 100%; }
.reader-page .story-img { object-fit: cover; }
.reader-page .canvas-copy { cursor: default; }
.reader-page .essay { font-size: clamp(13px, 1.08vw, 16px); }
.reader-page.chapter { display: flex; align-items: center; justify-content: center; padding: 12%; }
.reader-page.chapter .chapter-inner { max-width: 640px; }
.reader-page.chapter h2 { font-family: var(--font-display); font-weight: 500; line-height: 1.18; }
.reader-page.chapter p:not(.meta) { margin-top: 28px; font: 18px/2 var(--font-display); color: #57504a; }
.reader-page.chapter .meta { color: var(--accent); }

/* 播放模式 */
#screen-slideshow { position: fixed; inset: 0; z-index: 200; min-height: 0; background: #1e1b18; color: var(--reader-paper); }
#screen-slideshow.active { display: flex; align-items: center; justify-content: center; }
.slide-stage { width: min(1280px, calc(100vw - 80px)); aspect-ratio: 16/9; background: var(--reader-paper); color: var(--fg); display: grid; grid-template-columns: 58% 42%; overflow: hidden; border-radius: 3px; box-shadow: 0 30px 100px rgba(0, 0, 0, .45); transition: opacity .25s, transform .25s; }
.slide-stage.fading { opacity: .12; transform: scale(.995); }
.slide-stage.chapter { display: flex; align-items: center; justify-content: center; padding: 10%; }
.slide-stage.chapter .chapter-inner { max-width: 700px; }
.slide-stage.chapter h2 { font-family: var(--font-display); font-size: clamp(34px, 3vw, 48px); font-weight: 500; line-height: 1.18; }
.slide-stage.chapter p:not(.meta) { margin-top: 26px; font: 18px/2 var(--font-display); color: #57504a; }
.slide-controls { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px; background: rgba(255, 253, 248, .92); color: var(--fg); border: 1px solid rgba(255, 253, 248, .72); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .26); backdrop-filter: blur(14px) saturate(110%); opacity: 0; transition: opacity .18s ease-out; }
#screen-slideshow:hover .slide-controls, .slide-controls:focus-within { opacity: 1; }
.slide-exit { position: fixed; top: 22px; left: 24px; color: var(--reader-paper); border-color: rgba(255, 253, 248, .32); z-index: 210; }
.slide-exit:hover { background: rgba(255, 253, 248, .1); border-color: rgba(255, 253, 248, .6); }
.play-settings { position: fixed; right: 24px; bottom: 24px; width: 240px; padding: 14px; background: var(--surface); color: var(--fg); border: 1px solid var(--border); z-index: 220; display: none; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.play-settings.open { display: block; }
.play-settings .control-row { margin: 12px 0; }

/* 弹窗、提示、页脚 */
.overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(28, 25, 22, .58); }
.overlay.open { display: flex; animation: overlay-in .22s ease-out both; }
.modal { position: relative; width: min(510px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; animation: modal-in .26s cubic-bezier(.2,.8,.2,1) both; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 14px; right: 14px; }
.flow-step[hidden] { display: none; }
.city-choice { width: 100%; min-height: 70px; display: flex; align-items: center; justify-content: space-between; margin-top: 22px; padding: 0 18px; border: 1px solid var(--fg); border-radius: 10px; background: var(--fg-soft); text-align: left; }
.city-choice strong { display: block; }
.city-choice small { color: var(--muted); }
.modal h2 { font-size: 30px; }
.modal .intro { margin-top: 8px; color: var(--muted); }
.field { margin-top: 24px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; color: var(--muted); }
.input, .textarea { width: 100%; border: 1px solid var(--border); background: var(--surface); padding: 12px 13px; border-radius: var(--radius); }
.textarea { min-height: 106px; resize: vertical; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.photo-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.photo-pick { position: relative; aspect-ratio: 1; overflow: hidden; border: 2px solid transparent; background: var(--fg-soft); padding: 0; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick:hover, .photo-pick.selected { border-color: var(--accent); }
.photo-pick span { position: absolute; left: 4px; bottom: 4px; color: #fff; font: 9px var(--font-mono); text-shadow: 0 1px 4px #000; }
.toast { position: fixed; z-index: 300; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 14px; background: var(--fg); color: var(--surface); opacity: 0; pointer-events: none; transition: opacity .2s; font-size: 13px; text-align: center; }
.toast.show { opacity: 1; }
.site-footer { border-top: 1px solid var(--border); padding: 26px 0 40px; color: var(--muted); font-size: 12px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

@media (max-width: 1100px) {
  .memory-intro, .city-heading { grid-template-columns: 1fr; gap: 18px; }
  .story-feature { grid-template-columns: 1fr; }
  .album-grid { grid-template-columns: 1fr 1fr; }
  .editor-shell { grid-template-columns: 170px minmax(0, 1fr); }
  .inspector { display: none; }
  .editor-toolbar { grid-template-columns: 1fr 1fr; }
  .save-state { display: none; }
  .thumb-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .editor-toolbar .right .btn-quiet, .editor-crumb { display: none; }
  .editor-toolbar { grid-template-columns: 1fr auto; }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 32px); }
  .topnav { height: 60px; }
  .topnav .container { gap: 10px; }
  .logo { font-size: 20px; letter-spacing: .08em; }
  .search-wrap { display: none; }
  .avatar { width: 32px; height: 32px; }
  .memory-main { padding: 40px 0 58px; }
  .memory-intro { margin-bottom: 24px; }
  .memory-intro h1 { font-size: clamp(44px, 13vw, 58px); }
  .memory-intro p { font-size: 15px; line-height: 1.7; }
  .memory-intro .btn { margin-top: 18px !important; }
  .city-hero { min-height: 0; border-radius: 14px; }
  .city-hero img { height: 62vw; min-height: 300px; max-height: 440px; }
  .city-hero-info { position: relative; left: auto; bottom: auto; width: calc(100% - 24px); margin: -46px auto 0; padding: 18px; }
  .city-hero-info h2 { font-size: 30px; }
  .city-line { flex-direction: column; align-items: flex-start; gap: 6px; }
  .city-hero-info .city-line { font-size: 12px; }
  .library-note { flex-direction: column; gap: 4px; font-size: 11px; }
  .city-main { padding: 28px 0 60px; }
  .city-heading { margin: 28px 0 24px; gap: 14px; }
  .city-heading h1 { font-size: 44px; }
  .story-feature { min-height: 0; border-radius: 12px; }
  .story-feature-media { min-height: 0; height: 58vw; max-height: 330px; }
  .story-feature-copy { padding: 24px 20px 20px; }
  .story-feature-copy h2 { font-size: 32px; }
  .story-summary { margin-top: 16px; font-size: 15px; line-height: 1.8; }
  .story-actions { margin-top: 20px; }
  .story-actions .btn { flex: 1 1 auto; }
  .chapter-list { padding-top: 22px; }
  .chapter-row { min-height: 50px; }
  .upload-main { padding: 40px 0; }
  .upload-title { margin: 24px auto; }
  .upload-title h1 { font-size: 40px; }
  .upload-title p { font-size: 15px; }
  .dropzone { min-height: 220px; padding: 22px; }
  .thumb-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-toolbar { align-items: flex-start; gap: 10px; }
  .upload-footer { flex-direction: column-reverse; }
  .upload-footer .btn { width: 100%; }
  .reader-pages { width: calc(100% - 20px); padding: 78px 0 32px; }
  .reader-page { aspect-ratio: auto; grid-template: auto / 1fr !important; margin-bottom: 14px; }
  .reader-page .canvas-photo { aspect-ratio: 4/3; }
  .reader-page .canvas-copy { padding: 22px 20px 24px; }
  .reader-page .canvas-meta { margin-bottom: 16px; }
  .reader-page .canvas-copy h2 { font-size: 28px; }
  .reader-page .essay { margin-top: 16px; font-size: 15px; line-height: 1.85; }
  .reader-page.chapter { padding: 30px 22px; }
  .reader-page.chapter h2 { font-size: 30px !important; }
  .reader-page.chapter p:not(.meta) { margin-top: 20px; font-size: 16px; line-height: 1.9; }
  .reader-bar { top: 10px; width: calc(100% - 20px); justify-content: space-between; gap: 2px; padding: 5px; }
  .reader-bar .btn { min-height: 34px; padding: 0 8px; font-size: 12px; }
  .reader-bar .icon-btn { width: 30px; height: 34px; }
  .reader-bar .meta { font-size: 10px; }
  .slide-stage { width: calc(100vw - 16px); aspect-ratio: auto !important; grid-template: auto / 1fr !important; max-height: calc(100vh - 96px); overflow: auto; }
  .slide-stage .canvas-photo { aspect-ratio: 4/3 !important; min-height: 0; }
  .slide-stage.layout-4, .slide-stage.layout-8 { height: min(72vh, 560px); min-height: 360px; }
  .slide-stage.layout-4 .canvas-photo, .slide-stage.layout-8 .canvas-photo { aspect-ratio: auto !important; height: 100%; }
  .slide-stage.layout-4 .canvas-copy, .slide-stage.layout-8 .canvas-copy { left: 18px; right: 18px; bottom: 18px; width: auto; padding: 16px; }
  .slide-stage.layout-4 .canvas-copy h2, .slide-stage.layout-8 .canvas-copy h2 { font-size: 28px; }
  .slide-stage .canvas-copy { padding: 22px 20px; }
  .slide-stage .canvas-copy h2 { font-size: 30px; line-height: 1.16; }
  .slide-stage .essay { margin-top: 16px; font-size: 15px; line-height: 1.85; }
  .slide-stage .canvas-meta { flex-wrap: wrap; gap: 6px 14px; }
  .slide-stage .canvas-meta span:first-child { white-space: normal; }
  .slide-stage.chapter { padding: 28px 22px; }
  .slide-stage.chapter h2 { font-size: 30px; }
  .slide-controls { bottom: 14px; opacity: 1; }
  .slide-exit { top: 14px; left: 14px; }
  .play-settings { right: 12px; bottom: 74px; width: calc(100% - 24px); }
  .modal { padding: 24px; }
  .modal h2 { font-size: 26px; }
  .photo-picker-grid { grid-template-columns: repeat(3, 1fr); }
  .site-footer .container { flex-direction: column; gap: 6px; }
}
/* 播放控件：移动端页码不换行、触屏隐藏 Esc 提示 */
#slide-count { white-space: nowrap; }
@media (max-width: 760px) {
  .slide-controls { gap: 2px; padding: 5px; }
  .slide-controls .icon-btn { padding: 6px 5px; }
  #slide-count { font-size: 11px; }
}
@media (hover: none), (pointer: coarse) {
  .kbd-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .screen.active, .modal, .overlay.open { transform: none !important; }
  .city-hero img, .story-feature-media img, .slide-stage { transform: none !important; }
  .topnav, .reader-bar, .slide-controls { backdrop-filter: none; }
}
