/* 游戏视图沿用旧版深木色三栏和紧凑抽屉。其它创作界面继续沿用应用样式。 */
body.is-playing {
  height: 100dvh;
  overflow: hidden;
  background: #292727;
}
body.is-playing .app-shell { height: 100dvh; min-height: 0; }
body.is-playing .topbar { display: none; }
body.is-playing .main-content { width: 100%; max-width: none; height: 100%; margin: 0; padding: 0; }
body.is-playing #view-play.active { display: block; height: 100%; animation: none; }
.game-view {
  --ink: #f0e6d2;
  --muted: #b5aaa0;
  --faint: #8d847c;
  --gold: #ffd700;
  --line: rgba(140, 120, 83, .35);
  --line-strong: rgba(140, 120, 83, .8);
  height: 100%;
  min-height: 0;
  color: var(--ink);
  font-family: 'Noto Serif SC', 'Songti SC', SimSun, serif;
  background-color: #2c2a2a;
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.09) 0, rgba(0,0,0,.09) 1px, transparent 2px, transparent 23px, rgba(255,255,255,.018) 25px, transparent 29px);
}
.game-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 260px;
  align-items: stretch;
  gap: 0;
  height: 100%;
  min-height: 0;
  border: 1px solid #8c7853;
}
.game-drawer-scrim { display: none; }
.state-rail, .game-menu {
  display: block;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-color: #756448 transparent;
}
.state-card { padding: 0 0 18px; border: 0; background: none; }
.state-heading, .state-section h2 {
  margin: 0 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #8c7853;
  color: #ffd700;
  font: 700 16px/1.4 'Noto Serif SC', 'Songti SC', SimSun, serif;
}
.state-heading { display: flex; justify-content: space-between; align-items: center; }
.state-heading .tiny-button, .inventory-section-heading .tiny-button { min-width: 34px; min-height: 30px; color: #e7d8b6; border-color: #8c7853; font-size: 13px; }
.state-time, .state-location { margin: 0; padding: 7px 10px; color: #e0e0e0; font-size: 14px; background: rgba(0,0,0,.28); }
.state-time { border: 1px solid #8c7853; border-bottom: 0; border-radius: 4px 4px 0 0; }
.state-location { border: 1px solid #8c7853; border-top: 0; border-radius: 0 0 4px 4px; }
.state-section { padding: 0; margin: 0 0 20px; border: 0; }
.state-section h2 { letter-spacing: 0; text-transform: none; }
.game-person { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px dashed #5a4e3c; color: #e0e0e0; }
.game-person-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #8c7853; border-radius: 50%; color: #ffd700; font-size: 16px; }
.game-person strong { font-size: 15px; }
.game-ability { padding: 7px 5px; border-bottom: 1px solid #444; color: #ddd2bb; }
.game-ability summary { cursor: pointer; color: #f2daa4; }
.game-ability .rich-text { font-size: 14px; }
.stat-readout { display: block; }
.stat-line { display: flex; justify-content: space-between; padding: 6px 5px; border-bottom: 1px solid #444; color: #b0b0b0; font-size: 14px; }
.stat-line strong { color: #e0e0e0; font-size: 14px; }
.inventory-section-heading { align-items: center; margin-bottom: 10px; border-bottom: 1px solid #8c7853; }
.inventory-section-heading h2 { margin: 0; border: 0; }
.inventory-readout { display: grid; grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); gap: 10px; }
.inventory-slot { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid #5a4e3c; border-radius: 4px; background: rgba(0,0,0,.2); color: #e0e0e0; }
.inventory-slot:hover, .inventory-slot:focus-visible { border-color: #ffd700; }
.inventory-slot .item-art { position: absolute; inset: 0; width: 100%; height: 100%; padding: 6px; border: 0; border-radius: 0; background: transparent; color: #e0d4b7; font-size: 12px; }
.inventory-slot .item-art img { background: #242323; }
.inventory-slot-name { display: none; position: absolute; z-index: 1; bottom: 0; left: 0; right: 0; padding: 2px 14px 2px 3px; background: rgba(0,0,0,.65); color: #f0e6d2; font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.inventory-slot.has-image .inventory-slot-name { display: block; }
.inventory-slot-quantity { position: absolute; z-index: 2; right: 3px; bottom: 2px; padding: 0 4px; border-radius: 3px; background: rgba(0,0,0,.72); color: #ffd700; font-size: 11px; }
.story-column { position: relative; display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; overflow: hidden; padding: 20px; border-left: 1px solid #5a4e3c; border-right: 1px solid #5a4e3c; }
.game-mobile-header { display: none; }
.story-indicators { position: absolute; z-index: 1; top: 22px; right: 27px; display: flex; align-items: center; gap: 6px; }
.scene-background-status:not(:empty) { padding: 4px 7px; border-radius: 4px; background: rgba(0,0,0,.7); color: #e8d4a5; font-size: 12px; }
.story-log { flex: 1; min-height: 0; max-height: none; overflow: auto; padding: 15px; border: 1px solid #5a4e3c; border-radius: 4px; background-color: rgba(245,245,220,.045); background-size: cover; background-position: center; scrollbar-color: #756448 transparent; }
.story-entry { position: relative; margin: 0; padding: 7px 10px 24px; color: #f5f5dc; font-size: 16px; line-height: 1.8; }
.story-entry.assistant { border: 0; background: transparent; color: #f5f5dc; }
.story-entry.assistant .markdown-dialogue-speech { color: #fff4dc; font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif; }
.story-entry.assistant .markdown-dialogue > strong:first-child { color: #e8c985; font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif; font-weight: 700; }
.story-entry.assistant .markdown-action { color: #c8bdb0; }
.story-entry.assistant .markdown-action > em { font-style: normal; }
.story-entry.user { margin: 0; border: 0; border-left: 3px solid #aaeeff; background: rgba(170,238,255,.1); color: #aaeeff; }
.story-entry:not(:last-child)::after { content: ''; position: absolute; bottom: 10px; left: 5%; right: 5%; height: 1px; background: linear-gradient(to right, transparent, rgba(140,120,83,.6), transparent); }
.story-entry:not(:last-child)::before { content: '◆'; position: absolute; z-index: 1; bottom: 2px; left: 50%; transform: translateX(-50%); color: #8c7853; font-size: 11px; }
.story-entry-role { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.free-action { flex: none; margin: 0; padding: 15px 0 0; border: 0; }
.free-action-row { display: flex; gap: 10px; align-items: stretch; }
.free-action textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 30dvh; padding: 11px 12px; border: 1px solid #8c7853; border-radius: 4px; background: rgba(0,0,0,.5); color: #f0e6d2; font-size: 15px; line-height: 1.5; }
.free-action .primary-button { flex: none; width: 50px; min-width: 50px; padding: 0; border: 1px solid #8c7853; border-radius: 4px; background: #8c7853; color: #171515; font-size: 21px; }
.turn-feedback { min-height: 0; margin: 4px 0 0; color: #dbc79b; font-size: 12px; }
.turn-feedback:empty { display: none; }
.game-menu { padding: 20px; }
.game-title-block { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #5a4e3c; }
.game-title-block p { margin: 0 0 3px; color: #bba77c; font-size: 13px; }
.game-title-block h1 { margin: 0; color: #ffd700; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.game-menu-actions { display: grid; gap: 10px; }
.game-menu-button { min-height: 48px; padding: 9px 12px; border: 1px solid #8c7853; border-radius: 5px; background: rgba(0,0,0,.12); color: #ffd700; font: 600 15px 'Noto Serif SC', 'Songti SC', SimSun, serif; text-align: center; }
.game-menu-button:hover, .game-menu-button:focus-visible { background: rgba(140,120,83,.28); }
.game-more { margin-top: 15px; color: #bba77c; font-size: 13px; }
.game-more summary { cursor: pointer; padding: 5px 0; }
.game-more button { min-height: 34px; margin-top: 5px; font-size: 12px; }
.image-dialog .check-field { min-height: 44px; height: auto; color: var(--ink); font-size: 14px; }
.image-dialog .field > span { font-size: 13px; }
.image-dialog .field input { font-size: 14px; }
.image-dialog .image-config, .image-dialog .image-timing { margin-top: 14px; }
body.is-playing .modal-dialog { --ink:#f0e6d2; --muted:#b5aaa0; --gold:#ffd700; --line:rgba(140,120,83,.35); --line-strong:rgba(140,120,83,.8); background:#2c2a2a; border-color:#8c7853; }
body.is-playing .modal-dialog h2 { color:#ffd700; }
.game-dialog .action-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 16px; }
.game-dialog .action-choice { max-width: none; min-height: 48px; border-color:#8c7853; background:rgba(0,0,0,.16); }
.game-dialog .action-choice strong { color:#f0e6d2; font-size:14px; }
.game-dialog .action-choice span { color:#b5aaa0; font-size:12px; }
@media (max-width: 992px) {
  .game-layout { display: flex; border: 0; }
  .story-column { flex: 1; width: 100%; padding: 0; border: 0; }
  .game-mobile-header { display: flex; flex: none; align-items: center; justify-content: space-between; min-height: 48px; padding: 2px 8px; border-bottom: 1px solid #5a4e3c; background: rgba(0,0,0,.38); }
  .game-mobile-header button { min-width: 44px; min-height: 44px; border: 0; background: none; color: #f0e6d2; font-size: 22px; }
  .game-mobile-header strong { overflow: hidden; color: #ffd700; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .state-rail, .game-menu { position: fixed; z-index: 121; top: 0; bottom: 0; width: min(320px, 86vw); height: 100dvh; padding: 20px; background: #2c2a2a; box-shadow: 0 0 18px rgba(0,0,0,.5); transition: transform .2s ease; }
  .state-rail { left: 0; transform: translateX(-105%); }
  .game-menu { right: 0; width: min(260px, 86vw); transform: translateX(105%); }
  .game-view.state-open .state-rail, .game-view.menu-open .game-menu { transform: translateX(0); }
  .game-drawer-scrim { display: block; position: fixed; z-index: 120; inset: 0; border: 0; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .game-view.state-open .game-drawer-scrim, .game-view.menu-open .game-drawer-scrim { opacity: 1; pointer-events: auto; }
  .story-log { padding: 14px 12px; border: 0; border-radius: 0; }
  .story-entry { font-size: 15px; }
  .free-action { padding: 10px; background: rgba(0,0,0,.28); }
  .free-action textarea { font-size: 16px; }
  .story-indicators { top: 52px; right: 10px; }
  body.is-playing .game-dialog, body.is-playing .inventory-dialog, body.is-playing .item-detail-dialog { width: min(700px, 95vw); max-height: 90dvh; }
}

#progress-dialog .progress-entry{padding:12px 0;border-bottom:1px solid rgba(220,193,141,.2)}#progress-dialog .progress-entry:last-child{border-bottom:0}#progress-dialog .progress-entry h3{margin:0 0 8px;color:#dcca9e;font:500 20px var(--serif,serif)}#progress-readout{font-size:16px}
