:root {
  --bg: #F6F3ED;
  --surface: #FFFFFF;
  --ink: #2E2A25;
  --muted: #8A8378;
  --line: #E7E0D5;
  --accent: #A65E2E;
  --accent-soft: #F4E6D6;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #EDE8DF;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.stage {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 22px 12px; gap: 12px;
}
.phone {
  position: relative;
  width: 100%; max-width: 430px;
  height: min(880px, calc(100vh - 78px));
  min-height: 580px;
  background: var(--bg);
  border-radius: 26px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 48px rgba(64, 50, 32, .16);
}
.stage-hint { font-size: 12px; color: #9A9286; margin: 0; }

.topbar {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 12px 18px 8px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.topbar .tb-left, .topbar .tb-right { font-size: 12px; color: var(--muted); min-width: 62px; }
.topbar .tb-right { text-align: right; }
.topbar .tb-title { font-size: 14px; font-weight: 600; }
.link { border: 0; background: none; padding: 2px 0; font-size: 12px; color: var(--muted); }
.link:active { color: var(--accent); }

.scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 0 18px 20px; -webkit-overflow-scrolling: touch; }
.actionbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; flex: 1; }
.btn-grow { flex: 1; }
.btn-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* 首屏 */
.hero { padding: 12px 0 16px; }
.q { font-size: 26px; font-weight: 650; letter-spacing: -.6px; margin: 0; }
.sub { font-size: 13px; color: var(--muted); margin: 7px 0 0; }
.resume {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left;
  padding: 11px 13px; margin: 4px 0 20px;
  background: var(--accent-soft); border: 1px solid #E8D3BC;
  border-radius: 12px; font-size: 13px; color: #7A4420;
}
.section-label { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.scene-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.scene-card {
  display: block; width: 100%; padding: 0; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.scene-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #EDE7DC; }
.scene-meta { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 11px 11px; }
.scene-name { font-size: 14px; font-weight: 600; }
.scene-count { font-size: 11px; color: var(--muted); }
.fallback-wrap { margin-top: 20px; display: flex; gap: 8px; }
.input {
  flex: 1; min-width: 0;
  border: 1px dashed #D6CCBB; background: transparent;
  border-radius: 12px; padding: 11px 12px; font-size: 13px; outline: none;
}
.input:focus { border-color: var(--accent); background: var(--surface); }
.input::placeholder { color: #A39B8D; }
.random-btn {
  display: block; width: 100%; margin-top: 12px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 13px; padding: 10px;
}
.foot-note { text-align: center; font-size: 11px; color: #A8A093; margin: 18px 0 0; }

/* 卡片流 */
.flow-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.flow-title { font-size: 17px; font-weight: 650; margin: 0; }
.flow-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; color: var(--muted);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bigcard {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.bigcard img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #EDE7DC; }
.card-no {
  position: absolute; top: 10px; left: 12px;
  background: rgba(255,255,255,.9); color: #6B4A2C;
  font-size: 12px; font-weight: 600; letter-spacing: .5px;
  padding: 4px 9px; border-radius: 8px;
}
.zoom-btn {
  position: absolute; top: 10px; right: 12px;
  background: rgba(255,255,255,.9); border: 0; color: #6B4A2C;
  font-size: 12px; padding: 5px 10px; border-radius: 8px;
}
.tips { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; }
.tips-label { font-size: 11px; color: var(--muted); margin: 0 0 8px; }
.tip-row { display: flex; gap: 9px; font-size: 13px; line-height: 1.65; padding: 3px 0; }
.tip-num { flex: 0 0 auto; color: var(--accent); font-weight: 600; }
.source-note { font-size: 11px; color: #A8A093; margin: 9px 0 0; line-height: 1.5; }
.empty { text-align: center; padding: 46px 12px; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* 放大举牌 */
.poster {
  position: absolute; inset: 0; z-index: 30;
  background: #fff; display: flex; flex-direction: column;
}
.poster-bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font-size: 13px; color: var(--muted); }
.poster-img { flex: 1 1 auto; min-height: 0; width: 100%; object-fit: contain; background: #F0ECE4; }
.poster-tips { flex: 0 0 auto; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); }
.poster-tips h3 { margin: 0 0 8px; font-size: 20px; }
.poster-tips p { margin: 4px 0; font-size: 17px; line-height: 1.55; }

@media (max-width: 480px) {
  .stage { padding: 0; gap: 0; justify-content: flex-start; }
  .phone { height: 100dvh; min-height: 0; max-width: none; border-radius: 0; box-shadow: none; }
  .stage-hint { display: none; }
}
