/* ===== 直播间搭建闯关 · 深色高级感主题 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #0b0f1a;
  --bg2: #11182b;
  --panel: #171f33;
  --panel2: #1e2740;
  --accent: #4f8dff;
  --accent2: #7c5cff;
  --gold: #ffce6b;
  --green: #38d9a9;
  --red: #ff6b81;
  --text: #eef2ff;
  --text-dim: #93a0c0;
  --radius: 18px;
}
html, body { height: 100%; }
body {
  background: #05070d;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--text);
  display: flex; justify-content: center; align-items: stretch;
  overflow: hidden;
}

/* 桌面演示：手机框 */
#phone {
  width: 100%; max-width: 480px; height: 100dvh;
  background: radial-gradient(120% 90% at 50% 0%, #16204a 0%, var(--bg) 55%, #070a12 100%);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
@media (min-width: 520px) {
  body { align-items: center; }
  #phone {
    height: min(92vh, 900px);
    border-radius: 34px;
    border: 1px solid rgba(120, 140, 255, 0.18);
    box-shadow: 0 30px 90px rgba(0,0,0,.7), 0 0 0 8px #0d1120;
  }
}

/* ===== 圆球主持人 ===== */
#stage {
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 6px;
  display: flex; flex-direction: column; align-items: center;
  flex: 0 0 auto; z-index: 5;
}
.orb-wrap {
  width: 132px; height: 132px; position: relative;
  display: grid; place-items: center; margin-bottom: 12px;
}
.voice-orb {
  width: 62%; height: 62%; border-radius: 50%;
  position: relative; overflow: hidden;
  transition: transform .5s, filter .5s;
  background: radial-gradient(circle at 38% 30%,
    #eaf1ff 0, #8fb6ff 12%, #4f8dff 34%, #2b3f9e 62%, #101a4a 80%);
  box-shadow:
    inset -22px -26px 44px rgba(0,0,0,.38),
    inset 16px 13px 38px rgba(255,255,255,.20),
    0 0 50px rgba(79,141,255,.35),
    0 0 110px rgba(124,92,255,.18);
  animation: breathe 3.3s ease-in-out infinite;
}
.orb-core {
  position: absolute; inset: 18%;
  border-radius: 45% 55% 52% 48%;
  background: radial-gradient(circle at 40% 35%,
    rgba(230,240,255,.85), rgba(140,180,255,.10) 55%, transparent 70%);
  filter: blur(5px);
  animation: morph 5s ease-in-out infinite;
}
.orb-shine {
  position: absolute; width: 35%; height: 18%; left: 22%; top: 15%;
  border-radius: 50%; background: rgba(255,255,255,.5);
  filter: blur(12px); transform: rotate(-20deg);
}
.orbit {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(140,180,255,.20); opacity: .45;
}
.orbit-a { inset: 2%; animation: ring 3.6s ease-out infinite; }
.orbit-b { inset: 12%; animation: ring 3.6s 1.2s ease-out infinite; }

.orb-wrap.state-speaking .voice-orb {
  animation: speak .8s ease-in-out infinite;
  box-shadow: 0 0 70px rgba(124,160,255,.5), 0 0 150px rgba(124,92,255,.25);
}
.orb-wrap.state-speaking .orbit { border-color: rgba(140,180,255,.5); animation-duration: 1.6s; }
.orb-wrap.state-thinking .voice-orb { filter: hue-rotate(60deg) saturate(1.2); animation: think 1.6s linear infinite; }
.orb-wrap.state-thinking .orbit { border-color: rgba(255,206,107,.45); animation-duration: 1.2s; }

@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes speak { 0%,100% { transform: scale(1); } 30% { transform: scale(1.09); } 60% { transform: scale(.97); } }
@keyframes think { 0% { transform: rotate(0) scale(1.02); } 50% { transform: rotate(180deg) scale(1.08); } 100% { transform: rotate(360deg) scale(1.02); } }
@keyframes morph { 0%,100% { border-radius: 45% 55% 52% 48%; } 50% { border-radius: 55% 45% 46% 54%; } }
@keyframes ring { 0% { transform: scale(.85); opacity: .6; } 100% { transform: scale(1.25); opacity: 0; } }

/* ===== 气泡 ===== */
.bubble {
  max-width: 100%; background: linear-gradient(135deg, rgba(79,141,255,.16), rgba(124,92,255,.14));
  border: 1px solid rgba(140,160,255,.22);
  border-radius: 16px 16px 16px 4px;
  padding: 11px 15px; font-size: 15px; line-height: 1.65;
  color: var(--text); backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transition: opacity .3s;
}
.typing { display: none; gap: 4px; padding: 2px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); display: inline-block; animation: tp 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tp { 0%,100% { opacity:.3; transform: translateY(0);} 50% { opacity:1; transform: translateY(-3px);} }
.bubble.is-typing #bubbleText { display: none; }
.bubble.is-typing .typing { display: inline-flex; }

/* ===== 模块区 ===== */
#modules {
  flex: 1 1 auto; position: relative; overflow: hidden;
  padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 16px);
}
.module {
  position: absolute; inset: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: flex; flex-direction: column;
  transform: translateY(60px); opacity: 0; pointer-events: none;
  transition: transform .5s cubic-bezier(.22,1,.36,1), opacity .4s;
}
.module.active { transform: translateY(0); opacity: 1; pointer-events: auto; }
.module.leaving { transform: translateY(-40px); opacity: 0; }

/* 通用控件 */
.field-label { font-size: 13px; color: var(--text-dim); margin: 4px 0 10px; letter-spacing: .5px; }
input[type="text"] {
  width: 100%; padding: 14px 16px; font-size: 17px;
  background: var(--panel); color: var(--text);
  border: 1px solid rgba(140,160,255,.2); border-radius: 14px;
  outline: none; transition: border .2s, box-shadow .2s;
}
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,141,255,.18); }
.btn-primary {
  margin-top: auto; width: 100%; padding: 15px;
  font-size: 16px; font-weight: 600; color: #fff; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 26px rgba(79,141,255,.35);
  transition: transform .15s, opacity .2s;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .4; box-shadow: none; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 11px 20px; border-radius: 999px; font-size: 15px;
  background: var(--panel); border: 1px solid rgba(140,160,255,.18);
  color: var(--text); transition: all .2s; cursor: pointer;
}
.chip.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent; font-weight: 600;
  box-shadow: 0 6px 18px rgba(79,141,255,.4);
}
.step-dot { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; letter-spacing: 1px; }

/* ===== 滑动选样 ===== */
.swipe-tip { text-align: center; font-size: 13px; color: var(--text-dim); padding: 2px 0 8px; }
.swipe-progress { text-align: center; font-size: 12px; color: var(--gold); padding-bottom: 8px; letter-spacing: 1px; }
.deck { flex: 1; position: relative; }
.swipe-card {
  position: absolute; inset: 0 6px;
  border-radius: var(--radius); overflow: hidden;
  background: var(--panel2);
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  touch-action: none; user-select: none;
  transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .35s;
  will-change: transform;
}
.swipe-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.swipe-card.under { transform: scale(.94) translateY(14px); filter: brightness(.65); }
.stamp {
  position: absolute; top: 22px; padding: 6px 16px;
  font-size: 22px; font-weight: 800; border: 3px solid; border-radius: 10px;
  opacity: 0; transition: opacity .15s; letter-spacing: 2px;
}
.stamp.like { left: 18px; color: var(--green); border-color: var(--green); transform: rotate(-14deg); }
.stamp.nope { right: 18px; color: var(--red); border-color: var(--red); transform: rotate(14deg); }
.deck-actions { display: flex; justify-content: center; gap: 34px; padding-top: 14px; }
.action-btn {
  width: 62px; height: 62px; border-radius: 50%; border: none; font-size: 26px;
  display: grid; place-items: center; cursor: pointer;
  transition: transform .15s;
  background: var(--panel);
}
.action-btn:active { transform: scale(.88); }
.action-btn.nope { color: var(--red); box-shadow: 0 8px 22px rgba(255,107,129,.28); border: 1px solid rgba(255,107,129,.35); }
.action-btn.like { color: var(--green); box-shadow: 0 8px 22px rgba(56,217,169,.28); border: 1px solid rgba(56,217,169,.35); }
@keyframes flyRight { to { transform: translate(140%, -6%) rotate(24deg); opacity: 0; } }
@keyframes flyLeft { to { transform: translate(-140%, -6%) rotate(-24deg); opacity: 0; } }
.swipe-card.fly-right { animation: flyRight .45s ease-in forwards; }
.swipe-card.fly-left { animation: flyLeft .45s ease-in forwards; }

/* ===== 拍照 ===== */
.photo-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.photo-frame {
  width: 100%; aspect-ratio: 4/3; border-radius: var(--radius);
  border: 2px dashed rgba(140,160,255,.35);
  display: grid; place-items: center; overflow: hidden;
  background: rgba(23,31,51,.6); color: var(--text-dim); font-size: 14px;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-btns { display: flex; gap: 12px; width: 100%; }
.photo-btns .btn-primary { margin-top: 0; }
.btn-ghost {
  flex: 1; padding: 15px; border-radius: 14px; font-size: 15px;
  background: transparent; border: 1px solid rgba(140,160,255,.25); color: var(--text-dim);
}
.analysis-card {
  background: var(--panel); border-radius: var(--radius); padding: 18px;
  border: 1px solid rgba(56,217,169,.25); box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.analysis-card h3 { font-size: 15px; color: var(--green); margin-bottom: 10px; }
.analysis-card li { font-size: 14px; color: var(--text); margin: 8px 0 8px 18px; line-height: 1.6; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(140,160,255,.15); border-top-color: var(--gold);
  animation: spin .9s linear infinite; margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 设备卡片 & 报告 ===== */
.scroll-col { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 2px; }
.device-card {
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  border: 1px solid rgba(140,160,255,.16); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(36px) scale(.96);
  transition: opacity .5s, transform .55s cubic-bezier(.22,1,.36,1);
}
.device-card.in { opacity: 1; transform: translateY(0) scale(1); }
.device-card .dc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.device-card .dc-name { font-size: 16px; font-weight: 700; }
.device-card .dc-price { font-size: 15px; color: var(--gold); font-weight: 700; }
.device-card .dc-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 8px; }
.device-card a.dc-link {
  display: inline-block; font-size: 13px; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #ff7a45, #ff4d6d);
  padding: 7px 14px; border-radius: 999px;
}
.budget-bar {
  margin-top: 4px; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,206,107,.14), rgba(255,154,107,.10));
  border: 1px solid rgba(255,206,107,.3);
  display: flex; justify-content: space-between; align-items: baseline;
}
.budget-bar .total { font-size: 20px; font-weight: 800; color: var(--gold); }

/* 报告页 */
.report { font-size: 14px; }
.report h2 { font-size: 19px; margin: 4px 0 14px; }
.report h3 {
  font-size: 13px; color: var(--accent); letter-spacing: 1px;
  margin: 18px 0 8px; padding-left: 9px; border-left: 3px solid var(--accent);
}
.report .kv { display: flex; justify-content: space-between; padding: 7px 2px; border-bottom: 1px dashed rgba(140,160,255,.12); }
.report .kv b { font-weight: 600; }
.report .verdict {
  background: linear-gradient(135deg, rgba(79,141,255,.14), rgba(124,92,255,.12));
  border: 1px solid rgba(140,160,255,.25); border-radius: 14px;
  padding: 13px 15px; line-height: 1.7;
}
.report .verdict .big { font-size: 17px; font-weight: 800; color: var(--gold); }
.report .hint { font-size: 12px; color: var(--text-dim); margin-top: 8px; line-height: 1.6; }
.report .r-device { display: flex; justify-content: space-between; padding: 6px 2px; }
.report .r-device span:last-child { color: var(--gold); }
.report .next-box {
  margin-top: 18px; padding: 15px; border-radius: 14px;
  background: var(--panel); border: 1px solid rgba(56,217,169,.3);
  line-height: 1.8;
}
.copy-toast {
  position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: rgba(20,28,48,.95); border: 1px solid rgba(56,217,169,.4);
  color: var(--green); padding: 10px 20px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: all .3s; pointer-events: none; z-index: 50;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#muteBtn {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(140,160,255,.2);
  background: rgba(23,31,51,.7); font-size: 16px; z-index: 20; cursor: pointer;
}
