:root { -webkit-tap-highlight-color: transparent; }
html, body { min-height:100%; overscroll-behavior-y:none; }
body { background:#e9dfcf; }
.site-compliance { padding:16px max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background:#f5efe3; color:#8a795f; text-align:center; font:11px/1.6 Arial,"Songti SC",sans-serif; }
.site-compliance a { color:#75634c; text-decoration:none; }
.site-compliance a:hover,.site-compliance a:focus-visible { color:#6b2d2a; text-decoration:underline; text-underline-offset:3px; }
.mobile-panel-trigger, .mobile-sheet { display:none; }
/* 《微光纪事》是 P70 优先产品：所有宽度共用手机交互布局；宽屏只呈现手机外框。 */
@media (min-width:0) {
  body { font-size:16px; background:#f5efe3; }
  .creation-screen { min-height:100dvh; padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
  .creation-copy { padding:clamp(56px,12vh,116px) 24px 28px; }
  .creation-copy h1 { font-size:clamp(40px,11vw,52px); letter-spacing:.02em; }
  .creation-copy > p:last-child { font-size:15px; line-height:1.8; }
  .world-form { margin:0 12px 16px; padding:22px 18px calc(24px + env(safe-area-inset-bottom)); border-radius:4px; }
  .world-form h2 { font-size:25px; }
  .world-form label { font-size:14px; }
  .world-form input, .world-form select { height:48px; font-size:16px; }
  .primary { height:54px; font-size:16px; }
  .game { min-height:100dvh; padding:env(safe-area-inset-top) 0 calc(89px + env(safe-area-inset-bottom)); background:#f5efe3; }
  .topbar { position:sticky; z-index:18; top:0; align-items:center; gap:7px; padding:11px 14px 10px; background:#f7f0e5f2; backdrop-filter:blur(12px); }
  .topbar>div:first-child { min-width:0; }
  .topbar .eyebrow { display:none; }
  .topbar h1 { max-width:none; margin:0; color:#66312c; font-size:18px; line-height:1.2; letter-spacing:.03em; white-space:nowrap; }
  .topbar .clock { display:block; margin-left:auto; min-width:54px; color:#756651; font-size:9px; }
  .topbar .clock strong { color:#6b2d2a; font-size:22px; }
  .topbar .clock small { display:none; }
  .topbar .quiet { min-width:0; min-height:38px; padding:6px 8px; border:0; background:transparent; color:#5e4c38; font-size:10px; }
  .topbar #restart { display:none; }
  .mobile-panel-trigger { display:block; }
  .topbar #archive-open { display:block; }
  .columns { display:block; margin-top:0; }
  .story-column { min-height:0; overflow:visible; border:0; background:transparent; box-shadow:none; }
  .character-card, .world-card, .bottom-grid, .first-steps { display:none; }
  .story-visual { position:relative; inset:auto; height:196px; background:linear-gradient(0deg,#1b201a9e,transparent 65%),var(--city-banner) center/cover; filter:saturate(.78); }
  .story-visual div { left:20px; bottom:13px; font-size:11px; letter-spacing:.12em; }
  .narrative { min-height:0; margin-top:0; padding:25px 20px 12px; background:#fffaf0; }
  .narrative-entry { margin:0; padding:0 0 22px; border-bottom:1px solid #e6d8c0; }
  .narrative-entry + .narrative-entry { padding-top:22px; }
  .narrative-entry-npc { display:grid; grid-template-columns:44px minmax(0,1fr); gap:12px; align-items:start; }
  .npc-avatar { width:44px; height:44px; border:1px solid #c9ad7e; border-radius:50%; object-fit:cover; background:#eee0c8; }
  .narrative h3 { margin-bottom:10px; color:#6b2d2a; font-size:10px; letter-spacing:.08em; }
  .narrative p { margin:0; color:#322b23; font-size:16px; line-height:2; }
  .mobile-quick-actions { display:flex; gap:10px; overflow-x:auto; overscroll-behavior-x:contain; padding:11px 16px 13px; border-top:1px solid #e2d1b2; background:#fffaf0; scrollbar-width:none; scroll-snap-type:x proximity; }
  .mobile-quick-actions button { flex:0 0 min(78vw,320px); min-height:52px; overflow:visible; border:1px solid #e0cfb0; border-radius:2px; background:#fffdf8; color:#526348; padding:8px 11px; text-align:left; text-overflow:clip; white-space:normal; overflow-wrap:anywhere; scroll-snap-align:start; font:700 12px/1.55 Georgia,"Songti SC",serif; }
  .action-box { position:sticky; z-index:19; bottom:calc(env(safe-area-inset-bottom) + 5px); margin:0 10px; border:1px solid #c9ad7e; box-shadow:0 13px 36px #39230f2e; padding:10px; background:#fffaf0f8; backdrop-filter:blur(10px); }
  .action-box label { font-size:14px; }
  .action-box > div { flex-direction:row; }
  .action-box input { height:48px; min-width:0; font-size:16px; }
  .action-box button { width:84px; min-width:84px; min-height:48px; font-size:14px; }
  .action-box p { font-size:10px; line-height:1.5; }
  .action-box p:not(.ai-status) { display:none; }
  .ai-status { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .first-steps { padding:13px; }
  .world-card article { padding:11px 0; }
  .bottom-grid { grid-template-columns:1fr; gap:12px; margin-top:12px; }
  .map-card, .choices-card { padding:18px; }
  .map { min-height:160px; }
  .quick-actions button, .time-row button, .route-list button, .local-board button, .consequence-actions button { min-height:46px; font-size:14px; }
  .route-list article, .local-board article, .route-supplies { gap:8px; padding:13px; }
  .archive { padding:0; align-items:end; }
  .archive-panel { width:100%; max-height:91dvh; padding:24px 17px calc(25px + env(safe-area-inset-bottom)); border:0; }
  .archive-panel h2 { font-size:30px; }
  .archive-actions button, .archive-actions label { min-height:46px; font-size:13px; }
  .ledger-person { display:grid; grid-template-columns:46px minmax(0,1fr); gap:10px; align-items:start; }
  .ledger-person .npc-avatar { width:46px; height:46px; }
  .mobile-sheet:not(.hidden) { position:fixed; z-index:30; inset:0; display:flex; align-items:end; }
  .mobile-sheet-backdrop { position:absolute; inset:0; background:#1d1711a3; }
  .mobile-sheet-panel { position:relative; width:100%; max-height:83dvh; overflow:auto; padding:20px 18px calc(26px + env(safe-area-inset-bottom)); border-top:1px solid #c9ad7e; background:#fffaf0; box-shadow:0 -16px 48px #20140b45; }
  .mobile-sheet-heading { display:flex; align-items:start; justify-content:space-between; border-bottom:1px solid #e4d5bd; padding-bottom:14px; }
  .mobile-sheet-heading h2 { margin:4px 0 0; color:#4a3427; font-size:25px; font-weight:500; }
  .mobile-sheet-heading .archive-close { position:static; flex:0 0 36px; }
  .mobile-sheet-character, .mobile-sheet-world, .mobile-sheet-life, .mobile-sheet-actions, .mobile-sheet-npcs { padding:16px 0; border-bottom:1px solid #eadfcd; }
  .mobile-sheet-character h3 { margin:6px 0 3px; color:#6b2d2a; font-size:23px; font-weight:500; }
  .mobile-sheet-character p, .mobile-sheet-world p { margin:6px 0; color:#695b48; font-size:13px; line-height:1.75; }
  .mobile-sheet-character>div { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
  .mobile-sheet-character span { border:1px solid #dfc9a4; color:#68543d; padding:5px 7px; font-size:11px; }
  .mobile-sheet-world>b { display:block; margin-top:7px; color:#6b2d2a; font-size:15px; }
  .mobile-sheet-life { display:grid; gap:14px; }
  .life-board-section { display:grid; gap:8px; }
  .life-board-section>b { color:#6b2d2a; font-size:15px; }
  .life-board-section>small { color:#85705a; font-size:11px; line-height:1.55; }
  .life-board-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 9px; padding:10px 11px; border:1px solid #e0ccb0; background:#fffdf8; }
  .life-board-item strong { color:#5e302b; font-size:13px; }
  .life-board-item span { grid-column:1 / -1; color:#6e5d49; font-size:11px; line-height:1.6; }
  .life-board-item em { align-self:start; color:#8a5a30; font-size:11px; font-style:normal; white-space:nowrap; }
  .life-board-empty { color:#6e5d49; font-size:12px; line-height:1.65; }
  .narrative-attention { margin:8px 0 18px; padding:14px 15px 2px; border:1px solid #c7a66f; background:#f8efdc; box-shadow:inset 4px 0 #b98238; }
  .narrative-attention-missed { border-color:#bd8475; background:#fff3e9; box-shadow:inset 4px 0 #8f4a42; }
  .narrative-attention>b { display:block; margin-bottom:7px; color:#8a5a30; font:700 10px Arial,sans-serif; letter-spacing:.12em; }
  .narrative-attention-missed>b { color:#7a302b; }
  .narrative-attention h3 { margin-bottom:8px; }
  .narrative-attention p { font-size:14px; }
  .mobile-sheet-actions { display:grid; gap:13px; }
  .mobile-action-group { display:grid; gap:8px; }
  .mobile-action-group>b { color:#6b2d2a; font-size:15px; }
  .mobile-ai-settings { padding:12px; border:1px solid #d8c39d; background:#f8f0e1; }
  .mobile-ai-settings>small { color:#857663; font-size:10px; line-height:1.55; }
  .mobile-ai-connection { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  .mobile-ai-connection input { min-width:0; height:42px; border:1px solid #cdb68d; background:#fffdf8; color:#332a20; padding:0 10px; font:12px Georgia,"Songti SC",serif; }
  .mobile-ai-connection button { min-height:42px; border:1px solid #b98238; background:#294638; color:#fff9eb; padding:7px 11px; font:700 12px Georgia,"Songti SC",serif; }
  .mobile-action-group article { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 10px; padding:11px; border:1px solid #e0ccb0; background:#fffdf8; }
  .mobile-action-group strong { color:#5e302b; font-size:13px; }
  .mobile-action-group span, .mobile-action-empty { color:#6e5d49; font-size:11px; line-height:1.6; }
  .mobile-action-group article button { grid-row:1 / span 2; grid-column:2; align-self:center; min-width:52px; min-height:42px; border:1px solid #b98238; background:#294638; color:#fff9eb; font:700 12px Georgia,"Songti SC",serif; }
  .mobile-supplies, .mobile-time-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
  .mobile-supplies { justify-content:space-between; padding:10px; border:1px solid #e0ccb0; background:#fffdf8; color:#6e5d49; font-size:12px; }
  .mobile-supplies button, .mobile-time-actions button { min-height:40px; border:1px solid #b98238; background:#fffdf8; color:#6b2d2a; padding:7px 9px; font:700 11px Georgia,"Songti SC",serif; }
  .mobile-new-life { padding-top:4px; }
  .mobile-new-life span { color:#85705a; }
  .mobile-new-life button { justify-self:start; min-height:42px; border:1px solid #8f4a42; background:#fffaf0; color:#7a302b; padding:8px 12px; font:700 12px Georgia,"Songti SC",serif; }
  .mobile-new-life.is-confirming { padding:13px; border:1px solid #c79c86; background:#fff7ed; }
  .mobile-new-life-actions { display:flex; flex-wrap:wrap; gap:8px; }
  .mobile-new-life-actions button:first-child { border-color:#8f4a42; background:#7a302b; color:#fff9eb; }
  .mobile-sheet-npcs article { display:grid; grid-template-columns:48px minmax(0,1fr); gap:11px; align-items:center; margin-top:12px; }
  .mobile-sheet-npcs .npc-avatar { width:48px; height:48px; }
  .mobile-sheet-npcs b, .mobile-sheet-npcs span { display:block; }
  .mobile-sheet-npcs b { color:#6b2d2a; font-size:13px; }
  .mobile-sheet-npcs span { margin-top:4px; color:#6e5d49; font-size:11px; line-height:1.6; }
}
@media (min-width:721px) {
  html, body { width:100%; min-height:100%; }
  body { display:grid; place-items:center; padding:18px; background:radial-gradient(circle at 50% 0,#495b4b 0,#19221b 48%,#0e130f 100%); }
  #app { width:auto; height:min(915px,calc(100dvh - 36px)); aspect-ratio:412 / 915; overflow-y:auto; overflow-x:hidden; border:1px solid #c8b28b; border-radius:26px; background:#f5efe3; box-shadow:0 28px 82px #0009; }
  #app .creation-screen, #app .game { min-height:100%; }
  #app .creation-copy { padding-top:clamp(72px,13vh,126px); }
  #app .story-visual { height:212px; }
}
@media (min-width:390px) and (max-width:440px) and (min-height:800px) {
  .creation-copy { padding-top:clamp(72px,13vh,126px); }
  .story-visual { height:212px; }
  .narrative { margin-top:0; padding-inline:20px; }
  .narrative p { font-size:16px; line-height:2; }
}
@media (display-mode:standalone) {
  .topbar { top:env(safe-area-inset-top); }
}
