/* ═══════════ 共享引擎样式（皮肤变量由各自 skin.css 注入） ═══════════ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; overflow-x: hidden; }
.page { display: none; min-height: 100vh; min-height: 100dvh; flex-direction: column; padding: 0 24px 40px; animation: fadeUp .45s ease both; }
.page.active { display: flex; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.serif { font-family: "Songti SC", "STSong", "STSongti-SC", "SimSun", serif; }

/* ── 进度条 ── */
.progress-wrap { padding: 18px 0 6px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; letter-spacing: .05em; }
.progress-bar { height: 3px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .35s ease; }

/* ── 按钮 ── */
.btn {
  display: block; width: 100%; border: none; cursor: pointer;
  padding: 16px 20px; border-radius: 14px; font-size: 16px; font-weight: 600; letter-spacing: .12em;
  background: var(--accent); color: var(--accent-fg, #fff);
  transition: transform .15s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); margin-top: 12px; }

/* ── 输入 ── */
.code-input {
  width: 100%; padding: 15px 16px; font-size: 17px; text-align: center; letter-spacing: .12em;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink);
  outline: none; transition: border-color .2s;
}
.code-input:focus { border-color: var(--accent); }
.code-input::placeholder { color: var(--ink-faint); letter-spacing: .02em; font-size: 14px; }

/* ── 选项卡 ── */
.opt {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 15px 16px; margin-bottom: 12px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px;
  font-size: 15px; line-height: 1.65; color: var(--ink);
  transition: border-color .18s, background .18s, transform .12s;
}
.opt:active { transform: scale(.985); }
.opt .opt-key {
  flex: none; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%;
  border: 1.5px solid var(--line); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  transition: all .18s;
}
.opt.picked { border-color: var(--accent); background: var(--accent-soft); }
.opt.picked .opt-key { background: var(--accent); border-color: var(--accent); color: var(--accent-fg, #fff); }

/* ── 提示 ── */
.toast {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%) translateY(20px);
  max-width: 82%; padding: 12px 20px; border-radius: 12px;
  background: rgba(20, 16, 24, .88); color: #fff; font-size: 14px; line-height: 1.6;
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 99; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.field-err { color: #C0455E; font-size: 13px; text-align: center; min-height: 20px; margin: 8px 0 4px; }

/* ── 分析动画 ── */
.analyzing-inner { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.spinner {
  width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin 1s linear infinite; margin-bottom: 28px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.analyzing-text { font-size: 15px; color: var(--ink-soft); letter-spacing: .08em; line-height: 2; transition: opacity .3s; }

/* ── 结果通用 ── */
.result-hero { text-align: center; padding: 44px 0 26px; }
.result-kicker { font-size: 12px; letter-spacing: .3em; color: var(--ink-soft); margin-bottom: 14px; }
.result-emoji { font-size: 46px; line-height: 1; margin-bottom: 14px; }
.result-name { font-size: 34px; font-weight: 700; letter-spacing: .1em; }
.result-match { display: inline-block; margin-top: 12px; padding: 4px 14px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.result-quote { margin: 22px 0 8px; padding: 0 8px; font-size: 16px; line-height: 2; color: var(--ink); }
.result-quote::before { content: "“"; color: var(--accent); }
.result-quote::after { content: "”"; color: var(--accent); }

.section { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 14px; }
.section h3 { font-size: 13px; letter-spacing: .18em; color: var(--accent); margin-bottom: 10px; font-weight: 700; }
.section p { font-size: 14.5px; line-height: 1.95; color: var(--ink); }

.bar-row { margin-bottom: 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.bar-label b { font-weight: 600; }
.bar-label span { color: var(--ink-soft); font-size: 12px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.bar-track i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); }
.bar-track.dual i.from-left { left: 0; }
.bar-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-faint); margin-top: 4px; }

.top3-item { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px dashed var(--line); }
.top3-item:last-child { border-bottom: none; }
.top3-emoji { font-size: 24px; }
.top3-info { flex: 1; }
.top3-name { font-size: 15px; font-weight: 600; }
.top3-match { font-size: 13px; color: var(--accent); font-weight: 700; }

.disclaimer { margin-top: 26px; font-size: 11px; line-height: 1.9; color: var(--ink-faint); text-align: center; padding: 0 10px; }
.result-actions { margin-top: 26px; }

/* ── 海报弹层 ── */
.poster-mask {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(12, 10, 16, .82); backdrop-filter: blur(4px);
  flex-direction: column; align-items: center; justify-content: center; padding: 24px;
}
.poster-mask.show { display: flex; }
.poster-img { max-width: 100%; max-height: 74vh; border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,.4); }
.poster-tip { color: rgba(255,255,255,.85); font-size: 13px; margin-top: 16px; letter-spacing: .05em; }
.poster-close { margin-top: 18px; padding: 10px 34px; border-radius: 99px; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-size: 14px; cursor: pointer; }

/* 海报渲染节点（离屏） */
#poster-node { position: fixed; left: -9999px; top: 0; width: 720px; }
