/* ============ 挺拔星球 · Tripothon S1 ============ */
:root {
  --bg0: #FFF9EC;
  --bg1: #FFF3D6;
  --bg2: #FFFDF7;
  --ink: #4A3B2A;
  --ink-dim: #A08D74;
  --panel: #FFFFFF;
  --panel-border: #F2E3C4;
  --teal: #38C79A;
  --teal-dim: #E2F8EF;
  --amber: #FF9F1C;
  --amber-dim: #FFF1D6;
  --red: #FF5D5D;
  --red-dim: #FFE3E3;
  --blue: #4FB7FF;
  --sun: #FFC93C;
  --coral: #FF8A5B;
  --berry: #FF8FAB;
  --glow-teal: 0 6px 0 rgba(46, 158, 122, .35);
  --radius: 20px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 201, 60, .22) 0 34px, transparent 35px),
    radial-gradient(circle at 88% 30%, rgba(79, 183, 255, .18) 0 42px, transparent 43px),
    radial-gradient(circle at 22% 82%, rgba(255, 143, 171, .16) 0 38px, transparent 39px),
    radial-gradient(circle at 78% 88%, rgba(56, 199, 154, .15) 0 30px, transparent 31px),
    radial-gradient(circle at 50% 55%, rgba(255, 138, 91, .10) 0 46px, transparent 47px),
    linear-gradient(180deg, #FFFBEF 0%, #FFF3D6 100%);
  overflow: hidden;
}

#app { height: 100vh; display: flex; flex-direction: column; }

/* ============ 顶栏 ============ */
#topbar {
  display: flex; align-items: center; gap: 18px;
  margin: 10px 12px 0; padding: 10px 18px; z-index: 20;
  background: #FFFFFF; border: 3px solid #FFE7B8;
  border-radius: 22px;
  box-shadow: 0 6px 0 rgba(242, 200, 120, .45);
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.logo-icon { font-size: 22px; }
.logo-text { font-size: 17px; letter-spacing: 1px; }
.logo-sub { font-size: 11px; color: var(--ink-dim); font-weight: 400; margin-left: 2px; }

#stepper { display: flex; gap: 4px; margin: 0 auto; }
.step { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; color: var(--ink-dim); font-size: 12.5px; transition: all .3s; }
.step .dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: #FFF3D6; border: 2px solid #F2E3C4;
}
.step.active { color: var(--ink); }
.step.active .dot { background: var(--sun); color: #7A4A00; border-color: transparent; box-shadow: 0 3px 0 rgba(214, 150, 0, .4); }
.step.done { color: var(--teal); }
.step.done .dot { background: var(--teal-dim); color: var(--teal); border-color: rgba(52, 211, 153, .4); }

.icon-btn {
  background: var(--panel); border: 1px solid var(--panel-border); color: var(--ink);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 15px;
  transition: background .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

/* ============ 舞台与场景 ============ */
#stage { flex: 1; position: relative; overflow: hidden; }
.scene {
  position: absolute; inset: 0;
  display: none; padding: 24px;
  animation: sceneIn .45s ease;
}
.scene.active { display: flex; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.scene-title { font-size: 24px; margin-bottom: 8px; }
.scene-sub { color: var(--ink-dim); margin-bottom: 16px; line-height: 1.7; }

/* ============ 按钮 ============ */
.btn {
  font-family: var(--font); font-size: 14.5px; font-weight: 600;
  border-radius: 12px; padding: 11px 22px; cursor: pointer;
  border: 1px solid transparent; transition: all .2s; letter-spacing: .5px;
}
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #FFB25B, #FF8A3C);
  color: #fff; border: none;
  box-shadow: 0 5px 0 #E0741F, 0 10px 20px rgba(255, 138, 60, .3);
  text-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 #E0741F, 0 12px 24px rgba(255, 138, 60, .35); }
.btn-primary:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #E0741F; }
.btn-ghost { background: #FFFFFF; color: var(--ink); border: 2.5px solid #F2DDAE; box-shadow: 0 4px 0 rgba(242, 221, 174, .8); }
.btn-ghost:hover:not(:disabled) { background: #FFFBEF; border-color: #FFD98A; }
.btn-lg { font-size: 16.5px; padding: 14px 34px; border-radius: 14px; }
.btn-sm { font-size: 12.5px; padding: 7px 14px; }
.btn-sample { background: var(--panel); color: var(--ink); border-color: var(--panel-border); text-align: left; }
.btn-sample:hover { border-color: var(--teal); }

/* ============ 开场 ============ */
#scene-intro { align-items: center; justify-content: center; }
.intro-wrap { text-align: center; max-width: 720px; }
.gift-box { position: relative; width: 120px; height: 120px; margin: 0 auto 18px; animation: giftFloat 3.4s ease-in-out infinite; }
@keyframes giftFloat { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.gift-body { position: absolute; inset: 34px 10px 0; background: linear-gradient(160deg, #2dd4a0, #1da87e); border-radius: 10px; }
.gift-lid { position: absolute; inset: 22px 0 auto; height: 22px; background: linear-gradient(160deg, #38e2ac, #23b98c); border-radius: 8px; z-index: 2; }
.gift-ribbon { position: absolute; left: 50%; top: 22px; bottom: 0; width: 14px; margin-left: -7px; background: rgba(255, 255, 255, 0.75); z-index: 3; border-radius: 3px; }
.gift-glow { position: absolute; inset: -30px; background: radial-gradient(closest-side, rgba(52, 211, 153, 0.35), transparent 70%); animation: pulseGlow 3s ease-in-out infinite; }
@keyframes pulseGlow { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

.intro-title { font-size: 46px; letter-spacing: 6px; margin-bottom: 6px; text-shadow: 0 0 30px rgba(52, 211, 153, .45); }
.intro-tagline { color: var(--teal); font-size: 13.5px; letter-spacing: 2px; margin-bottom: 20px; }
.intro-desc { color: var(--ink-dim); line-height: 2; font-size: 15px; margin-bottom: 24px; }
.intro-desc b { color: var(--ink); }
.intro-cards { display: flex; gap: 14px; justify-content: center; margin-bottom: 28px; }
.intro-card {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius);
  padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; align-items: center;
  font-size: 12.5px; color: var(--ink-dim); line-height: 1.6; min-width: 128px;
}
.ic-emoji { font-size: 26px; }
.intro-foot { margin-top: 16px; font-size: 12px; color: var(--ink-dim); }

/* ============ 拍摄 ============ */
#scene-capture { align-items: stretch; }
.capture-grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; width: 100%; }
.guide-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.guide-list li {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 10px 14px; font-size: 13.5px; color: var(--ink-dim);
}
.source-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.sample-picker { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.sample-hint { font-size: 12.5px; color: var(--ink-dim); margin-bottom: 2px; }

.capture-right { display: flex; flex-direction: column; gap: 14px; }
.dropzone {
  flex: 1; min-height: 320px; border: 2px dashed rgba(255, 255, 255, 0.18); border-radius: var(--radius);
  display: grid; place-items: center; position: relative; overflow: hidden;
  transition: border-color .25s, background .25s;
}
.dropzone.dragover { border-color: var(--teal); background: rgba(52, 211, 153, 0.06); }
.dz-empty { text-align: center; color: var(--ink-dim); line-height: 2; font-size: 14px; }
.dz-icon { font-size: 44px; margin-bottom: 8px; opacity: .85; }

.cam-panel, .photo-panel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px; }
#cam-video { max-width: 100%; max-height: 82%; border-radius: 12px; transform: scaleX(-1); background: #000; }
.photo-stack { position: relative; height: 82%; display: flex; align-items: center; justify-content: center; }
#photo-preview { max-height: 100%; max-width: 100%; border-radius: 12px; }
#pose-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.capture-status { font-size: 13px; color: var(--ink-dim); }
.capture-status.ok { color: var(--teal); }
.capture-status.warn { color: var(--amber); }
.capture-actions { display: flex; justify-content: space-between; }

/* ============ 分析中 ============ */
#scene-analyze { align-items: center; justify-content: center; }
.analyze-wrap { text-align: center; }
.scan-ring { position: relative; width: 150px; height: 150px; margin: 0 auto 20px; }
.scan-planet {
  position: absolute; inset: 24px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #43e8b4, #14916b 68%, #0a5a44);
  box-shadow: 0 0 40px rgba(52, 211, 153, .5), inset -8px -10px 24px rgba(0, 0, 0, .4);
}
.scan-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--teal); border-right-color: rgba(52, 211, 153, .5);
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.analyze-steps { list-style: none; text-align: left; display: inline-flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.analyze-steps li { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 10px; background: var(--panel); font-size: 14px; color: var(--ink-dim); min-width: 260px; transition: all .3s; }
.analyze-steps li.run { color: var(--ink); border: 1px solid rgba(52, 211, 153, .35); }
.analyze-steps li.done { color: var(--teal); }
.as-state { margin-left: auto; font-size: 12px; }
li.run .as-state::after { content: "…"; }
li.done .as-state::after { content: "✓"; }
.tripo-status { margin-top: 14px; font-size: 12.5px; color: var(--blue); }

/* ============ 星球报告 ============ */
#scene-report, #scene-growth { padding: 18px 22px; }
.report-grid, .growth-grid { display: grid; grid-template-columns: 1fr 400px; gap: 22px; width: 100%; height: 100%; }
.world-holder {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(700px 500px at 60% 40%, rgba(96, 165, 250, 0.08), transparent 65%);
  border: 1px solid var(--panel-border); min-height: 300px;
}
.world-hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--ink-dim); background: rgba(7, 11, 24, .55); padding: 4px 12px; border-radius: 99px; z-index: 2; }

.report-panel, .growth-panel {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius);
  padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
}
.tier-badge { border-radius: 12px; padding: 13px 16px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.tier-badge.green { background: var(--teal-dim); color: var(--teal); border: 1px solid rgba(52, 211, 153, .35); }
.tier-badge.yellow { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(251, 191, 36, .35); }
.tier-badge.red { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248, 113, 113, .35); }

.metric-cards { display: flex; flex-direction: column; gap: 9px; }
.metric-card { background: rgba(255, 255, 255, 0.045); border: 1px solid var(--panel-border); border-radius: 12px; padding: 11px 14px; display: flex; align-items: center; gap: 12px; }
.mc-icon { font-size: 20px; width: 26px; text-align: center; }
.mc-main { flex: 1; }
.mc-name { font-size: 13.5px; }
.mc-note { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }
.mc-val { font-weight: 700; font-size: 15px; }
.mc-val.green { color: var(--teal); } .mc-val.yellow { color: var(--amber); } .mc-val.red { color: var(--red); }
.metric-note { font-size: 11.5px; color: var(--ink-dim); line-height: 1.7; }
.report-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: auto; }

/* ============ 修复任务 ============ */
#scene-exercise { padding: 18px 22px; }
.ex-grid { display: grid; grid-template-columns: 1fr 400px; gap: 22px; width: 100%; height: 100%; }
.ex-video-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: #05070f; border: 1px solid var(--panel-border); display: grid; place-items: center; }
#ex-video { width: 100%; height: 100%; object-fit: contain; transform: scaleX(-1); }
#ex-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ex-start-cover {
  position: absolute; inset: 0; background: rgba(5, 8, 16, 0.82); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; z-index: 3;
}
.ex-cover-title { font-size: 24px; font-weight: 700; }
.ex-cover-sub { color: var(--ink-dim); font-size: 13.5px; margin-bottom: 10px; }

.ex-right { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.mission-tabs { display: flex; gap: 8px; }
.mission-tab {
  flex: 1; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 10px 8px; text-align: center; cursor: pointer; color: var(--ink-dim); font-size: 12.5px; line-height: 1.5;
  transition: all .2s;
}
.mission-tab .mt-ico { display: block; font-size: 21px; margin-bottom: 3px; }
.mission-tab.active { border-color: var(--teal); color: var(--ink); background: var(--teal-dim); }
.mission-tab.locked { opacity: .4; cursor: not-allowed; }
.mission-tab.finished { border-color: rgba(52, 211, 153, .4); color: var(--teal); }

.ex-detail { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.ex-desc { color: var(--ink-dim); font-size: 13px; line-height: 1.8; }
.ex-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ex-stat { background: rgba(255, 255, 255, 0.045); border-radius: 10px; padding: 9px; text-align: center; }
.es-lbl { display: block; font-size: 11px; color: var(--ink-dim); margin-bottom: 3px; }
.es-val { font-size: 19px; font-weight: 700; }
.ex-gauge { height: 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ex-gauge-fill { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, #2dd4a0, #60a5fa); transition: width .3s; }
.ex-tip { font-size: 13px; color: var(--amber); min-height: 20px; }
.energy-row { display: flex; align-items: center; gap: 10px; }
.energy-lbl { font-size: 12.5px; color: var(--ink-dim); }
.energy-dots { display: flex; gap: 6px; }
.energy-dot { width: 13px; height: 13px; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 1px solid var(--panel-border); transition: all .4s; }
.energy-dot.on { background: var(--teal); box-shadow: var(--glow-teal); border-color: transparent; }
.ex-actions { display: flex; justify-content: space-between; align-items: center; }

/* ============ 成长 ============ */
.vitality { display: flex; align-items: center; gap: 10px; }
.vit-lbl { font-size: 13px; color: var(--ink-dim); white-space: nowrap; }
.vit-bar { flex: 1; height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.vit-fill { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, #fbbf24, #34d399); transition: width 1.2s ease; }
.vit-num { font-weight: 700; font-size: 17px; color: var(--teal); }
.growth-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.growth-list li { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.045); border-radius: 10px; padding: 7px 11px; font-size: 12.5px; }
.growth-list .g-ico { font-size: 18px; }
.growth-msg { font-size: 14px; line-height: 1.8; color: var(--ink); background: var(--teal-dim); border: 1px solid rgba(52, 211, 153, .3); border-radius: 12px; padding: 12px 14px; }
.growth-close { margin-top: auto; text-align: center; color: var(--ink-dim); font-size: 13px; line-height: 1.9; padding-top: 14px; }

/* ============ 页脚 ============ */
#foot {
  display: flex; justify-content: space-between; gap: 18px; align-items: center;
  padding: 7px 20px; font-size: 11px; color: var(--ink-dim);
  border-top: 1px solid var(--panel-border); background: rgba(7, 11, 24, 0.7);
}
.foot-dim { opacity: .6; }

/* ============ 弹窗 / Toast ============ */
.modal { position: fixed; inset: 0; background: rgba(4, 6, 12, 0.65); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; }
.modal-card { background: var(--bg2); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 22px; width: min(440px, 90vw); }
.modal-card h3 { margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; margin-bottom: 10px; }
.field input {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--panel-border); border-radius: 10px;
  color: var(--ink); padding: 10px 12px; font-size: 14px; outline: none; font-family: monospace;
}
.field input:focus { border-color: var(--teal); }
.field-note { font-size: 11.5px; color: var(--ink-dim); line-height: 1.6; margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.toast {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%);
  background: var(--bg2); border: 1px solid var(--teal); color: var(--ink);
  padding: 10px 20px; border-radius: 12px; font-size: 13.5px; z-index: 60;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============ 响应式 ============ */
@media (max-width: 980px) {
  #stepper .lbl { display: none; }
  .capture-grid, .report-grid, .growth-grid, .ex-grid { grid-template-columns: 1fr; overflow-y: auto; }
  .capture-right { min-height: 360px; }
  .world-holder { min-height: 260px; }
}

/* ============ 小脊对白 / 序章 ============ */
.spirit-dialog {
  display: flex; align-items: flex-end; gap: 10px;
  max-width: 620px; margin: 0 auto 18px; cursor: pointer;
}
.sd-avatar {
  font-size: 34px; width: 54px; height: 54px; flex: none;
  display: grid; place-items: center;
  background: var(--teal-dim); border: 1px solid rgba(52, 211, 153, .4);
  border-radius: 50%; animation: giftFloat 3s ease-in-out infinite;
}
.sd-bubble {
  position: relative; text-align: left;
  background: rgba(10, 16, 32, .88); border: 1px solid rgba(52, 211, 153, .35);
  border-radius: 4px 16px 16px 16px; padding: 12px 16px;
  font-size: 14.5px; line-height: 1.8; min-height: 52px; min-width: 340px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.sd-cursor { color: var(--teal); animation: blink 0.9s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }
.sd-hint {
  position: absolute; right: 12px; bottom: 6px; font-size: 11px;
  color: var(--teal); opacity: 0; transition: opacity .3s;
}

.spirit-line {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(10, 16, 32, .6); border: 1px solid rgba(52, 211, 153, .25);
  border-radius: 12px; padding: 10px 13px; font-size: 13px; line-height: 1.7;
}
.sl-avatar { font-size: 20px; flex: none; }
.sl-text { color: var(--ink); }

/* ============ 试炼过场 ============ */
.world-holder-ex { position: absolute; inset: 0; z-index: 6; border-radius: 0; border: none; }
.cutscene-banner {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(7, 11, 24, .82); border: 1px solid rgba(52, 211, 153, .45);
  border-radius: 14px; padding: 12px 22px; text-align: center; z-index: 3;
  animation: sceneIn .5s ease; max-width: 82%;
}
.cutscene-banner .cb-title { font-size: 17px; font-weight: 700; color: #bff7e4; }
.cutscene-banner .cb-sub { font-size: 12px; color: var(--blue); margin-top: 4px; font-family: Consolas, monospace; }

/* ============ 图鉴 / 信 ============ */
.codex-block { display: flex; flex-direction: column; gap: 8px; }
.codex-title, .letter-title { font-size: 14px; color: var(--ink-dim); }
.codex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.codex-card {
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 8px 9px; display: flex; flex-direction: column; gap: 3px;
  transition: all .25s;
}
.codex-card:hover { border-color: rgba(52, 211, 153, .5); transform: translateY(-2px); }
.cc-emoji { font-size: 20px; }
.cc-name { font-size: 12.5px; font-weight: 700; }
.cc-region { font-size: 10.5px; color: var(--teal); }
.cc-lore { font-size: 10px; color: var(--ink-dim); line-height: 1.5; }
.cc-source { font-size: 9.5px; color: var(--blue); border-top: 1px dashed var(--panel-border); padding-top: 5px; margin-top: 2px; }

.letter {
  background: linear-gradient(160deg, rgba(251, 191, 36, .08), rgba(52, 211, 153, .06));
  border: 1px solid rgba(251, 191, 36, .3); border-radius: 12px; padding: 13px 15px;
}
.letter-text { font-size: 11.5px; line-height: 1.75; color: var(--ink-dim); margin-top: 5px; }
.letter-text b { color: var(--ink); }

/* ============ 指标图例 ============ */
.legend {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ink-dim);
  background: rgba(255,255,255,.04); border-radius: 10px; padding: 8px 12px;
}
.legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.lg-green { background: var(--teal); }
.lg-yellow { background: var(--amber); }
.lg-red { background: var(--red); }
.legend-hint { margin-left: auto; opacity: .7; font-size: 10.5px; }
.metric-card { cursor: pointer; transition: border-color .2s, transform .2s; }
.metric-card:hover { border-color: rgba(96,165,250,.6); transform: translateX(2px); }

/* ============ 场景转场 ============ */
.scene { will-change: opacity, transform; }
.scene.leaving { animation: sceneOut .19s ease forwards; pointer-events: none; }
@keyframes sceneOut { to { opacity: 0; transform: translateY(-10px); } }

/* ============ 序章星尘 & 礼物开启 ============ */
.intro-wrap { position: relative; }
.twinkle {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #bdf5e0; opacity: 0; pointer-events: none;
  animation: twinkleAnim 3s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(125, 239, 196, .9);
}
@keyframes twinkleAnim { 0%,100% { opacity: 0; transform: scale(.6); } 50% { opacity: .9; transform: scale(1.15); } }

.gift-box { transition: transform .3s; }
.gift-box.opening { animation: giftOpen .62s cubic-bezier(.5,-.3,.3,1.4) forwards; }
.gift-box.opening .gift-lid { animation: lidFly .62s cubic-bezier(.4,-.2,.3,1.3) forwards; }
.gift-box.opening .gift-glow { animation: giftFlash .62s ease-out forwards; }
@keyframes giftOpen { 40% { transform: scale(.92) rotate(1deg); } 100% { transform: scale(1.5) translateY(6px); opacity: 0; } }
@keyframes lidFly { 55% { transform: translateY(-6px) rotate(0deg); } 100% { transform: translateY(-46px) rotate(-24deg); opacity: 0; } }
@keyframes giftFlash { 30% { opacity: 1; } 100% { opacity: 0; } }

/* ============ 试炼 Juice ============ */
.fx-burst {
  position: fixed; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle, #d9fff1, #34d399);
  box-shadow: 0 0 8px rgba(52, 211, 153, .9);
  pointer-events: none; z-index: 90;
  animation: burstFly .8s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes burstFly { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

.fx-flash {
  position: fixed; inset: 0; background:
    radial-gradient(circle at 50% 60%, rgba(255,244,214,.5), rgba(52,211,153,.12) 55%, transparent 75%);
  pointer-events: none; z-index: 89; animation: flashFade .68s ease-out forwards;
}
@keyframes flashFade { from { opacity: 1; } to { opacity: 0; } }

/* ============ 报告数据可视化 ============ */
.mc-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.09); margin-top: 6px; overflow: hidden; }
.mc-bar i { display: block; height: 100%; border-radius: 99px; }
.mc-bar i.green { background: var(--teal); }
.mc-bar i.yellow { background: var(--amber); }
.mc-bar i.red { background: var(--red); }

.spine-curve {
  background: rgba(255,255,255,.045); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 10px 12px;
}
.sc-title { font-size: 12px; color: var(--ink-dim); margin-bottom: 4px; }
.spine-curve svg { width: 100%; height: 96px; display: block; }
.sc-note { font-size: 10px; color: var(--ink-dim); opacity: .75; margin-top: 4px; }

/* ============ 读星历史 ============ */
.history-block { display: flex; flex-direction: column; gap: 8px; }
.history-spark svg { width: 100%; height: 38px; display: block; }
.history-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.history-list li {
  display: flex; align-items: center; gap: 9px; font-size: 12px;
  background: rgba(255,255,255,.045); border-radius: 9px; padding: 7px 10px;
}
.hl-date { color: var(--ink-dim); }
.hl-tier { flex: 1; }
.hl-vit { color: var(--teal); font-weight: 700; }

/* ============ R11 移动端适配 ============ */
@media (max-width: 760px) {
  #topbar { padding: 8px 10px; gap: 8px; }
  .logo-sub { display: none; }
  .step { padding: 3px 6px; font-size: 11px; }
  .scene { padding: 12px; }
  .capture-grid { grid-template-columns: 1fr; gap: 12px; overflow-y: auto; }
  .capture-left .guide-list { display: none; }
  .dropzone { min-height: 300px; }
  .report-grid, .growth-grid, .ex-grid { grid-template-columns: 1fr; overflow-y: auto; }
  .world-holder { min-height: 320px; }
  .report-panel, .growth-panel { max-height: none; overflow: visible; }
  .intro-title { font-size: 32px; letter-spacing: 3px; }
  .intro-desc { font-size: 13px; }
  .intro-cards { flex-wrap: wrap; gap: 8px; }
  .intro-card { min-width: 96px; padding: 10px; font-size: 11px; }
  .sd-bubble { min-width: 0; font-size: 13px; }
  .btn-lg { font-size: 15px; padding: 12px 26px; }
  #foot { font-size: 10px; padding: 6px 10px; }
  .codex-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ R12 加载层 ============ */
#boot {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: radial-gradient(1200px 800px at 50% 30%, #0c1530, #070b18 70%);
  transition: opacity .5s;
}
#boot.done { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; }
.boot-planet {
  width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #43e8b4, #14916b 68%, #0a5a44);
  box-shadow: 0 0 44px rgba(52, 211, 153, .45);
  animation: bootFloat 2.2s ease-in-out infinite;
}
@keyframes bootFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.boot-title { font-size: 19px; letter-spacing: 4px; margin-bottom: 10px; }
.boot-bar { width: 210px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.1); margin: 0 auto; overflow: hidden; }
.boot-fill { height: 100%; width: 8%; border-radius: 99px; background: linear-gradient(90deg,#2dd4a0,#60a5fa); transition: width .3s; }
.boot-msg { margin-top: 10px; font-size: 12px; color: #93a4c7; }
.boot-fail { color: #f87171; font-size: 13px; line-height: 1.9; max-width: 320px; }

/* ============ R13 无障碍焦点 ============ */
:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; border-radius: 6px; }
.skip-note {
  position: fixed; left: 8px; top: -40px; z-index: 300; background: var(--bg2);
  border: 1px solid var(--teal); padding: 6px 12px; border-radius: 8px; transition: top .2s;
}
.skip-note:focus { top: 8px; }

/* ============ R21 星云 / R22 说话头像 ============ */
#scene-intro { position: absolute; }
.nebula-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.intro-wrap { position: relative; z-index: 1; }
.sd-avatar { transition: transform .12s; }
.sd-avatar.talking { animation: avatarTalk .34s ease-in-out infinite; }
@keyframes avatarTalk { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.12) rotate(3deg); } }

/* ============ R23 快门倒计时 ============ */
.snap-count {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 5;
  background: rgba(5, 8, 16, .55); font-size: 92px; font-weight: 800; color: #bdf5e0;
  text-shadow: 0 0 30px rgba(52,211,153,.8); pointer-events: none;
}
.snap-count span { animation: countPop .92s ease-out; display: block; text-align: center; }
@keyframes countPop { from { transform: scale(1.7); opacity: 0; } 30% { transform: scale(1); opacity: 1; } to { transform: scale(.85); opacity: .25; } }

/* ============ R24 照片星光装裱 ============ */
.photo-stack.gilded::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(190,245,224,.35) 50%, transparent 70%);
  background-size: 250% 250%;
  animation: gildSweep 1.4s ease-out 1;
}
@keyframes gildSweep { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.photo-stack.gilded { box-shadow: 0 0 0 2px rgba(52,211,153,.45), 0 0 26px rgba(52,211,153,.25); }
.privacy-line { font-size: 11.5px; color: var(--ink-dim); opacity: .8; margin-bottom: 10px; }

/* ============ R26 依次点亮 / R27 双名 / R28 影蚀表 / R49 档案号 ============ */
.metric-card { opacity: 0; animation: cardIn .5s ease forwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mc-name { color: #d8fff0; }
.mc-name::before { content: "·"; color: var(--teal); margin-right: 5px; font-weight: 900; }

.corrupt-chip {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  background: rgba(20, 8, 28, .78); border: 1px solid rgba(192, 121, 232, .5);
  color: #e4c8f5; border-radius: 99px; padding: 5px 12px; font-size: 12px;
  backdrop-filter: blur(4px);
}
.corrupt-chip b { color: #d18af0; }
.archive-no { font-size: 12px; color: var(--ink-dim); font-weight: 400; font-family: Consolas, monospace; letter-spacing: 1px; }

/* ============ R34 星光雨 / R35 信 / R36 快照 / R47 命名 / R37 delta ============ */
.star-rain {
  position: absolute; top: -20px; width: var(--sz, 7px); height: var(--sz, 7px);
  background: radial-gradient(circle, #fff7d9, #ffd76a 60%, transparent);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: rainFall 2s linear forwards; pointer-events: none; z-index: 4;
}
@keyframes rainFall { to { transform: translateY(115vh) rotate(240deg); opacity: .1; } }

.name-row {
  display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-dim);
}
.name-row input {
  flex: 1; background: rgba(255,255,255,.06); border: 1px solid var(--panel-border);
  border-radius: 10px; color: var(--ink); padding: 8px 11px; font-size: 14px; outline: none;
  font-family: var(--font);
}
.name-row input:focus { border-color: var(--teal); }

.hl-thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; border: 1px solid var(--panel-border); }
.growth-msg { position: relative; }
.growth-msg::after {
  content: attr(data-delta);
  position: absolute; top: -10px; right: 10px; font-size: 11px; font-weight: 700;
  color: var(--teal); background: var(--bg2); border: 1px solid rgba(52,211,153,.4);
  padding: 2px 8px; border-radius: 99px;
}
.growth-msg:not([data-delta])::after { content: none; }

/* ============ R42 陪伴精灵 / R44 区域lore / R40 关于 ============ */
.companion {
  position: fixed; left: 14px; bottom: 40px; z-index: 70;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  opacity: 0; transform: translateY(8px); transition: all .35s; pointer-events: none;
}
.companion.visible { opacity: 1; transform: none; pointer-events: auto; }
.companion[hidden] { display: none !important; }
.cp-avatar {
  width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px;
  background: var(--teal-dim); border: 1px solid rgba(52,211,153,.45); border-radius: 50%;
  animation: giftFloat 3s ease-in-out infinite;
}
.cp-text {
  max-width: 300px; background: rgba(10,16,32,.92); border: 1px solid rgba(52,211,153,.35);
  border-radius: 4px 14px 14px 14px; padding: 9px 13px; font-size: 12.5px; line-height: 1.65;
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
}
.lore-row { display: flex; gap: 6px; flex-wrap: wrap; }
.lore-chip {
  background: rgba(255,255,255,.05); border: 1px solid var(--panel-border); color: var(--ink-dim);
  border-radius: 99px; padding: 4px 11px; font-size: 11.5px; cursor: pointer; font-family: var(--font);
  transition: all .2s;
}
.lore-chip:hover { border-color: var(--teal); color: var(--ink); }
.about-block { border-top: 1px solid var(--panel-border); margin-top: 14px; padding-top: 12px; }
.about-block h4 { font-size: 13.5px; margin-bottom: 7px; }
.about-block p { font-size: 12px; line-height: 1.8; color: var(--ink-dim); margin-bottom: 6px; }
.about-block p.dim { font-size: 11px; opacity: .7; }
.about-block b { color: var(--ink); }

/* ============ R66e 今昔对比 ============ */
.before-after { display: flex; flex-direction: column; gap: 7px; }
.ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ba-pair figure { margin: 0; text-align: center; }
.ba-pair img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px;
  border: 1px solid var(--panel-border); background: #0a1020;
}
.ba-pair figcaption { font-size: 11px; color: var(--ink-dim); margin-top: 4px; }

/* ============ R67 开场 5 秒规则 / R68 跳过 ============ */
.intro-kid { font-size: 17px; color: var(--ink); margin-bottom: 10px; }
.grownups {
  max-width: 640px; margin: 0 auto 16px; text-align: left;
  background: rgba(255,255,255,.03); border: 1px solid var(--panel-border);
  border-radius: 12px; overflow: hidden;
}
.grownups summary {
  cursor: pointer; padding: 9px 14px; font-size: 12.5px; color: var(--ink-dim);
  list-style: none; user-select: none;
}
.grownups summary::before { content: "▸ "; color: var(--teal); }
.grownups[open] summary::before { content: "▾ "; }
.grownups summary::-webkit-details-marker { display: none; }
.grownups-body { padding: 4px 14px 12px; }
.sd-skip {
  position: absolute; top: -34px; right: 0;
  background: rgba(255,255,255,.07); border: 1px solid var(--panel-border); color: var(--ink-dim);
  border-radius: 99px; padding: 4px 12px; font-size: 12px; cursor: pointer; font-family: var(--font);
}
.sd-skip:hover { color: var(--ink); border-color: var(--teal); }

/* ============ R69 粒子三色 / R67 折叠 / R68 跳过 ============ */
.fx-burst.b0 { background: radial-gradient(circle, #d9fff1, #34d399); box-shadow: 0 0 8px rgba(52, 211, 153, .9); }
.fx-burst.b1 { background: radial-gradient(circle, #fff3c4, #fbbf24); box-shadow: 0 0 8px rgba(251, 191, 36, .9); }
.fx-burst.b2 { background: radial-gradient(circle, #ffd9ec, #f472b6); box-shadow: 0 0 8px rgba(244, 114, 182, .9); }
.codex-card.pettable { cursor: pointer; }
.codex-card.pettable:hover .cc-emoji { transform: scale(1.25) rotate(-8deg); }
.cc-emoji { display: inline-block; transition: transform .18s; }

/* ============ R62 打印友好（在成长页 Ctrl+P 即星球档案） ============ */
@media print {
  #topbar, #foot, .report-actions, .world-holder, #companion, .legend,
  #stepper, .top-actions, .sd-hint, .sd-skip { display: none !important; }
  body { background: #fff !important; }
  .scene { position: static !important; display: block !important; padding: 0; }
  .scene:not(.active) { display: none !important; }
  .report-panel, .growth-panel { border: 1px solid #ccc; color: #111; background: #fff; max-height: none; overflow: visible; }
  .scene-title, .cc-name, .mc-name, .letter-text b { color: #111 !important; }
  .mc-note, .cc-lore, .sc-note, .letter-text, .growth-msg, .growth-list li { color: #333 !important; }
  .codex-card, .metric-card, .growth-list li, .history-list li, .letter, .growth-msg, .spine-curve {
    background: #fff !important; border: 1px solid #ddd !important; box-shadow: none !important;
  }
  .mc-bar { background: #eee; }
}

/* ============ R71 PK 匹配对战 ============ */
.btn-pk {
  width: 100%; background: linear-gradient(135deg, #7c5cff, #5a8bff);
  color: #fff; box-shadow: 0 6px 22px rgba(122, 108, 255, .35);
}
.btn-pk:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(122, 108, 255, .5); }

.pk-overlay {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center;
  background: rgba(4, 6, 12, .78); backdrop-filter: blur(6px);
}
.pk-card {
  width: min(430px, 92vw); background: var(--bg2); border: 1px solid rgba(122, 108, 255, .45);
  border-radius: 20px; padding: 26px 24px; text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: sceneIn .4s ease;
}
.pk-title { font-size: 20px; margin-bottom: 8px; }
.pk-sub { color: var(--ink-dim); font-size: 13.5px; line-height: 1.7; margin-bottom: 16px; }
.pk-alt { display: flex; gap: 8px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.pk-room-row { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 12px; }
.pk-room-row input {
  width: 110px; text-align: center; letter-spacing: 4px; text-transform: uppercase;
  background: rgba(255,255,255,.06); border: 1px solid var(--panel-border); color: var(--ink);
  border-radius: 10px; padding: 9px; font-size: 16px; font-family: monospace; outline: none;
}
.pk-room-row input:focus { border-color: var(--teal); }
.pk-myroom { font-size: 11px; color: var(--ink-dim); font-family: monospace; }
.pk-close { margin-top: 14px; }

.pk-radar { position: relative; width: 130px; height: 130px; margin: 6px auto 14px; border-radius: 50%;
  border: 1.5px solid rgba(122, 108, 255, .5); display: grid; place-items: center; }
.pk-radar i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(122, 108, 255, .7); animation: radarPing 1.8s ease-out infinite;
}
.pk-radar i:nth-child(2) { animation-delay: .6s; }
.pk-radar i:nth-child(3) { animation-delay: 1.2s; }
@keyframes radarPing { from { transform: scale(.45); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.pk-radar span { font-size: 34px; animation: giftFloat 2s ease-in-out infinite; }

.pk-vs { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0 6px; }
.pk-me, .pk-opp { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; }
.pk-ava {
  width: 52px; height: 52px; display: grid; place-items: center; font-size: 28px;
  background: var(--teal-dim); border: 2px solid rgba(52, 211, 153, .5); border-radius: 50%;
}
.pk-opp .pk-ava { background: rgba(122, 108, 255, .16); border-color: rgba(122, 108, 255, .6); }
.pk-vs-mark { font-weight: 900; font-size: 21px; color: #a08cff; text-shadow: 0 0 16px rgba(122, 108, 255, .8); }
.pk-count { font-size: 64px; font-weight: 900; color: #bdf5e0; text-shadow: 0 0 26px rgba(52, 211, 153, .8); }
.pk-count span { display: block; animation: countPop .95s ease-out; }

.pk-result-emoji { font-size: 58px; margin-bottom: 4px; animation: countPop .6s ease-out; }
.pk-actions { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }

.opp-strip {
  display: flex; align-items: center; gap: 8px; background: rgba(122, 108, 255, .12);
  border: 1px solid rgba(122, 108, 255, .4); border-radius: 10px; padding: 7px 10px;
}
.opp-ava { font-size: 18px; }
.opp-bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(255,255,255,.09); overflow: hidden; }
.opp-bar-fill { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, #7c5cff, #5a8bff); transition: width .35s; }
.opp-count { font-size: 12px; font-weight: 700; color: #c9bcff; font-family: monospace; }
