:root {
  --brand: #e25b2a;
  --brand-2: #ff8a55;
  --brand-dark: #9a3412;
  --brand-soft: #fff1e8;
  --ink: #241c16;
  --muted: #6d6258;
  --faint: #9a8d82;
  --line: #eadfd4;
  --bg: #f4efe8;
  --card: #fffcf8;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --amber-bg: #fff6e8;
  --amber: #8a5a12;
  --green-bg: #eef6ee;
  --green: #24633a;
  --shadow: 0 12px 32px rgba(60, 36, 16, .08);
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", "WenQuanYi Micro Hei", "Droid Sans Fallback", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}
button, input { font-family: inherit; }
#app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 252, 248, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.logo { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.brand { flex: 1; line-height: 1.15; }
.brand b { display: block; font-size: 18px; letter-spacing: .04em; }
.brand span { color: var(--muted); font-size: 12px; }
.lang { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang a {
  text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 4px 8px; border-radius: 999px;
}
.lang a.on { background: var(--ink); color: #fff; }
main { flex: 1; padding: 16px 16px 150px; }
.btn, .opt { scroll-margin-bottom: 160px; }
.hero {
  background: linear-gradient(160deg, #2a211c, #171311 60%);
  color: #fff; border-radius: 28px; padding: 26px 22px; margin-bottom: 14px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(226,91,42,.45), transparent 68%);
  top: -70px; right: -40px;
}
.hero h1, .hero p, .hero .btn { position: relative; z-index: 1; }
.hero h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.02em; }
.hero p { margin: 0 0 16px; color: rgba(255,255,255,.84); }
.kicker { display: inline-block; background: rgba(255,255,255,.12); border-radius: 999px; padding: 3px 10px; font-size: 12px; margin-bottom: 10px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px 18px 16px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.card h2 { margin: 0 0 8px; font-size: 20px; }
.card h3 { margin: 16px 0 6px; font-size: 16px; }
.card p { margin: 0 0 10px; color: var(--muted); }
.muted { color: var(--faint); font-size: 13px; }
.disclaimer, .note {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--amber-bg); color: var(--amber);
  border-radius: 16px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px;
}
.principles { display: grid; gap: 10px; }
.principle {
  display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start;
}
.num {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand-dark);
  display: grid; place-items: center; font-weight: 800;
}
.btn, .btn-link {
  display: block; width: 100%; text-align: center; text-decoration: none;
  border: 0; border-radius: 16px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; font-weight: 800; font-size: 16px; cursor: pointer;
  box-shadow: 0 8px 18px rgba(226,91,42,.25);
}
.btn.ghost { background: var(--brand-soft); color: var(--brand-dark); box-shadow: none; margin-top: 8px; }
.btn.small { width: auto; display: inline-block; padding: 8px 12px; font-size: 13px; box-shadow: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row .btn { flex: 1; margin-top: 0; }
.opt {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1.5px solid var(--line); border-radius: 16px; padding: 14px;
  margin-bottom: 10px; cursor: pointer; background: #fff;
}
.opt.on { border-color: var(--brand); background: var(--brand-soft); }
.box {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--faint);
  flex: 0 0 auto; margin-top: 2px; color: transparent; display: grid; place-items: center; font-size: 13px;
}
.opt.on .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.opt b { display: block; }
.opt span { color: var(--faint); font-size: 13px; }
.progress { height: 8px; background: #efe6dc; border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.alert { border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.alert b { display: block; margin-bottom: 4px; }
.alert.green { background: var(--green-bg); color: var(--green); }
.alert.amber { background: var(--amber-bg); color: var(--amber); }
.alert.red { background: var(--danger-bg); color: var(--danger); }
.type {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff; border-radius: 20px; padding: 16px 18px; margin-bottom: 12px;
}
.type small { opacity: .85; }
.type b { display: block; font-size: 22px; margin-top: 4px; }
.stop { background: var(--danger-bg); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.stop b { color: var(--danger); }
.stop li { margin: 6px 0; }
.move { background: #faf7f3; border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.move .bad { color: var(--danger); font-size: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.input, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; font-size: 16px; background: #fff;
}
.tabbar {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: min(728px, calc(100% - 16px));
  display: flex; gap: 2px; padding: 6px;
  background: rgba(255,252,248,.94); backdrop-filter: blur(16px);
  border-radius: 22px; box-shadow: 0 10px 30px rgba(40,24,10,.16); z-index: 30;
}
.tabbar button {
  flex: 1; border: 0; background: transparent; color: var(--faint);
  border-radius: 16px; padding: 8px 2px 6px; cursor: pointer; font-size: 10px; line-height: 1.15; font-weight: 700;
}
.tabbar button.on { background: var(--brand-soft); color: var(--brand-dark); }
.tabbar .i { display: block; font-size: 16px; margin-bottom: 2px; font-weight: 400; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat {
  text-align: left; border: 0; background: #fff; border-radius: 18px; padding: 14px;
  box-shadow: var(--shadow); cursor: pointer;
}
.cat b { display: block; }
.cat span { color: var(--faint); font-size: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot {
  border: 2px solid transparent; border-radius: 16px; overflow: hidden; background: #efe8df;
  padding: 0; cursor: pointer; position: relative; text-align: left;
}
.shot img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.shot.on { border-color: var(--brand); }
.shot .cap {
  display: none; position: absolute; left: 8px; right: 8px; bottom: 8px;
  background: rgba(180, 35, 24, .92); color: #fff; border-radius: 10px;
  font-size: 12px; font-weight: 800; padding: 6px 8px;
}
.shot.showcap .cap { display: block; }
.stat { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.badge {
  display: inline-block; background: var(--ink); color: #fff; border-radius: 999px;
  padding: 6px 12px; font-weight: 800; margin-bottom: 8px;
}
body.chat-mode { overflow: hidden; }
body.chat-mode .tabbar { display: none; }
body.chat-mode #app { height: 100%; }
body.chat-mode main { padding: 0; display: flex; min-height: 0; }
.chat {
  display: flex; flex-direction: column; flex: 1; min-height: 0; background: #fff;
}
.chat-hd { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-hd button { border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--muted); }
.msgs { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.bub { max-width: 86%; padding: 10px 12px; border-radius: 16px; white-space: pre-wrap; }
.bub.me { align-self: flex-end; background: linear-gradient(135deg, #f08a4a, var(--brand)); color: #fff; }
.bub.ai { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.bub.sos { background: var(--danger-bg); color: var(--danger); border: 0; }
.src { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--faint); font-size: 12px; }
.quick { display: flex; gap: 6px; overflow: auto; padding: 8px 12px 0; }
.quick.wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 8px; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 12px; cursor: pointer; text-align: left; }
.quick button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.composer[hidden] { display: none !important; }
.move img { width: 100%; border-radius: 14px; display: block; margin-bottom: 10px; }
.composer { display: flex; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); align-items: center; }
.composer input { flex: 1; }
.mic, .send { border: 0; border-radius: 14px; height: 44px; cursor: pointer; }
.mic { width: 44px; background: var(--brand-soft); }
.mic.on { background: var(--danger); color: #fff; }
.send { padding: 0 14px; background: var(--brand); color: #fff; font-weight: 800; }
.foot { text-align: center; color: var(--faint); font-size: 11px; padding: 0 12px 8px; }
#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 8px);
  background: #241c16; color: #fff; border-radius: 999px; padding: 10px 14px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90%;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#overlay {
  position: fixed; inset: 0; background: rgba(20,12,8,.72);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60;
}
#overlay[hidden] { display: none; }
.sheet { background: #fff; border-radius: 20px; max-width: 520px; width: 100%; max-height: 88vh; display: flex; flex-direction: column; }
.sheet-hd, .sheet-ft { padding: 12px 14px; }
.sheet-hd { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.sheet-hd button { border: 0; background: none; font-size: 24px; cursor: pointer; }
.sheet-bd { overflow: auto; padding: 0 14px; }
.sheet-bd img { width: 100%; border-radius: 12px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: bounce 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-3px); opacity: .4; } }
.voice-lobby, .voice-session {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  min-height: calc(100vh - 168px); padding: 8px 4px 12px;
}
.voice-lobby h1 { margin: 4px 0 8px; font-size: 28px; letter-spacing: -.02em; }
.voice-lobby p { margin: 0 0 18px; color: var(--muted); max-width: 34em; }
.va-go { width: min(100%, 320px); min-height: 56px; font-size: 18px; }
.va-top { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 8px; }
.va-top button { border: 0; background: none; font-size: 32px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.va-bar { flex: 1; height: 6px; background: #eadfd4; border-radius: 99px; overflow: hidden; }
.va-bar span { display: block; height: 100%; background: var(--brand); }
.va-orb {
  width: 132px; height: 132px; border-radius: 50%; margin: 12px 0;
  background: radial-gradient(circle at 38% 32%, #ffe1d2, #e25b2a 58%, #9a3412);
  box-shadow: 0 16px 40px rgba(226, 91, 42, .28);
}
.va-orb.listening {
  background: radial-gradient(circle at 38% 32%, #e8f7ec, #3e8f5a 58%, #1d5c34);
  box-shadow: 0 16px 40px rgba(36, 99, 58, .25);
}
.va-orb.speaking, .va-orb.listening { animation: va-pulse 1.15s ease-in-out infinite; }
.va-state { margin: 0; font-weight: 800; letter-spacing: .08em; }
.va-caption {
  width: 100%; text-align: left; background: var(--card); border-radius: 18px;
  padding: 14px 16px; margin: 14px 0 8px; box-shadow: var(--shadow); min-height: 4.5em;
}
.va-heard { width: 100%; text-align: left; margin: 0 0 8px; color: var(--muted); min-height: 1.6em; }
.va-heard span { font-weight: 800; color: var(--ink); margin-right: 6px; }
.va-heard.quiet { visibility: hidden; }
.va-note { margin: 0 0 8px; color: var(--amber); min-height: 0; }
.va-note:empty { display: none; }
.va-fallback { text-align: left; color: var(--muted); }
.va-type { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.va-type input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 16px; }
.va-mic {
  width: min(100%, 300px); min-height: 84px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
}
.va-mic.on { background: var(--danger); }
.va-mic-ico {
  width: 22px; height: 22px; background: #fff;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.9V20H9v2h6v-2h-2v-2.1A7 7 0 0 0 19 11h-2z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.9V20H9v2h6v-2h-2v-2.1A7 7 0 0 0 19 11h-2z'/></svg>") center / contain no-repeat;
}
.va-hint { margin-top: 10px; }
.plan-video { margin: 4px 0 16px; }
.plan-video-link { display: block; text-decoration: none; color: inherit; }
.plan-video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 16px; overflow: hidden; background: #1c1612;
}
.plan-video-frame.stills { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.plan-video-frame img, .plan-video-frame iframe {
  width: 100%; height: 100%; border: 0; display: block; object-fit: cover;
}
.plan-video-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(to top, rgba(20, 12, 8, .35), rgba(20, 12, 8, .08));
}
.plan-video-play::before {
  content: ""; width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255, 252, 248, .94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}
.plan-video-play::after {
  content: ""; position: absolute; width: 0; height: 0; margin-left: 6px;
  border-left: 18px solid var(--brand);
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}
.plan-video-meta { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; text-align: left; }
.plan-video-meta b { font-size: 16px; }
.plan-video-meta span, .plan-video-note { color: var(--muted); font-size: 13px; }
.plan-video-action { color: var(--brand-dark) !important; font-weight: 800; }
.plan-video-note { margin: 8px 0 0; }
@keyframes va-pulse { 50% { transform: scale(1.05); } }
@media (max-width: 640px) {
  .pair { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
  .voice-lobby h1 { font-size: 24px; }
  .va-orb { width: 112px; height: 112px; }
}
