:root {
  --bg: #0d0a1a;
  --bg-soft: #171230;
  --purple: #615CED;
  --purple-soft: #8b87ff;
  --green: #01B832;
  --green-soft: #9EEEA7;
  --red: #F55846;
  --text: #f5f2ff;
  --muted: #9a93b8;
  --line: rgba(255, 255, 255, 0.09);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 作者样式里的 display 会压过 UA 的 [hidden]，必须显式兜底 */
[hidden] { display: none !important; }

/* 表单控件默认不继承字体，CJK 会退到 UA 字体 */
button, input, textarea { font-family: inherit; }

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "MiSans", system-ui, -apple-system, sans-serif;
  overscroll-behavior: none;
}

.screen { display: none; min-height: 100dvh; }
.screen.active { display: block; }

/* ---------- 落地页 ---------- */
#screen-landing { position: relative; overflow: hidden; }
.landing-bg {
  position: absolute; inset: 0;
  background: url("/assets/bg-landing.webp") center/cover no-repeat;
  opacity: 0.55;
}
.landing-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,10,26,0.5) 0%, rgba(13,10,26,0.15) 40%, rgba(13,10,26,0.92) 100%);
}
.landing-inner {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom));
  text-align: center;
}
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.logo-watcha { height: 30px; filter: brightness(0) invert(1); }
.brand-x { color: var(--muted); font-size: 15px; }
.brand-qwen {
  font-size: 21px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(120deg, #8b87ff, #c0bdff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-img {
  width: min(64vw, 250px); border-radius: 24px; margin: 14px 0 18px;
  box-shadow: 0 8px 60px rgba(97, 92, 237, 0.35);
}
h1 { font-size: 38px; font-weight: 800; letter-spacing: 2px; }
.subtitle { color: var(--text); opacity: 0.85; margin-top: 8px; font-size: 16px; }
.event-line { color: var(--muted); font-size: 13px; margin-top: 6px; letter-spacing: 1px; }
.powered { color: var(--muted); font-size: 12px; margin-top: 14px; opacity: 0.8; }

/* ---------- 按钮 ---------- */
.btn-primary {
  margin-top: 26px;
  border: none; cursor: pointer;
  background: linear-gradient(120deg, var(--purple) 0%, #7a5cf0 100%);
  color: #fff; font-size: 17px; font-weight: 700;
  padding: 15px 44px; border-radius: 999px;
  box-shadow: 0 6px 24px rgba(97, 92, 237, 0.45);
  transition: transform 0.1s;
}
.btn-primary:active { transform: scale(0.96); }
.btn-ghost {
  border: 1px solid var(--line); background: rgba(255,255,255,0.05);
  color: var(--text); font-size: 15px; padding: 12px 26px; border-radius: 999px; cursor: pointer;
}

/* ---------- 点单 ---------- */
#screen-form { background: var(--bg); padding-bottom: 40px; }
.form-head {
  display: flex; align-items: center; gap: 14px;
  padding: max(22px, env(safe-area-inset-top)) 22px 16px;
  background: linear-gradient(180deg, rgba(97,92,237,0.16), transparent);
}
.form-cha { width: 62px; }
.form-head h2 { font-size: 19px; }
.form-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.form-body { padding: 6px 22px 0; }
.field { margin-top: 20px; }
.field > label { display: block; font-size: 14px; font-weight: 600; color: var(--green-soft); margin-bottom: 10px; }
.optional { color: var(--muted); font-weight: 400; font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-soft); color: var(--text);
  padding: 9px 16px; font-size: 14px; cursor: pointer;
  transition: all 0.15s;
}
.chip.on {
  background: linear-gradient(120deg, rgba(97,92,237,0.85), rgba(122,92,240,0.85));
  border-color: transparent; font-weight: 600;
  box-shadow: 0 3px 14px rgba(97,92,237,0.4);
}
.swatches .chip { display: flex; align-items: center; gap: 7px; }
.swatch { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.35); }

input[type="text"], textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-soft); color: var(--text);
  padding: 13px 15px; font-size: 15px; font-family: inherit; outline: none;
}
input[type="text"]:focus, textarea:focus { border-color: var(--purple-soft); }
textarea { resize: none; }

.photo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-previews { display: flex; gap: 8px; }
.photo-preview { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

.signal-panel { display: flex; flex-wrap: wrap; gap: 8px; }
.signal-chip {
  border: 1px dashed rgba(158,238,167,0.35); border-radius: 999px;
  color: var(--green-soft); background: rgba(1,184,50,0.06);
  padding: 7px 14px; font-size: 12.5px;
}
.btn-geo { margin-top: 10px; font-size: 13px; padding: 9px 18px; }

/* 思考直播 */
.thinking-box {
  margin-top: 22px; width: 100%; max-width: 420px;
  border: 1px solid rgba(97,92,237,0.35); border-radius: 16px;
  background: rgba(23,18,48,0.85); overflow: hidden; text-align: left;
}
.thinking-head {
  padding: 10px 16px; font-size: 13px; font-weight: 700; color: var(--purple-soft);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between;
}
.thinking-head span { color: var(--muted); font-weight: 400; }
.thinking-text {
  padding: 12px 16px; font-size: 13px; line-height: 1.8; color: #b8b2d8;
  max-height: 200px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}
.r-thinking {
  margin-top: 16px; width: 100%; text-align: left;
  border: 1px solid rgba(97,92,237,0.35); border-radius: 16px;
  background: rgba(23,18,48,0.6);
}
.r-thinking summary {
  padding: 13px 16px; font-size: 14px; color: var(--purple-soft);
  cursor: pointer; list-style: none;
}
.r-thinking .thinking-text { max-height: 300px; }

.btn-mylist { margin-top: 14px; }
.mylist-qr { width: 130px; border-radius: 16px; margin: 14px 0 6px; }
.mylist-item {
  display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255,255,255,0.04); padding: 13px 15px; margin-top: 10px;
}
.mylist-dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 12px currentColor; }
.mylist-info b { display: block; font-size: 15px; }
.mylist-info span { color: var(--muted); font-size: 12.5px; }

.btn-brew { width: 100%; margin-top: 30px; }
.btn-brew:disabled { opacity: 0.55; }

/* ---------- 调制中 ---------- */
#screen-brewing { display: none; }
#screen-brewing.active { display: flex; align-items: center; justify-content: center; }
.brewing-inner { text-align: center; padding: 0 36px; }
.brewing-cha {
  width: min(58vw, 230px); border-radius: 22px;
  animation: shake 0.7s ease-in-out infinite;
  box-shadow: 0 8px 60px rgba(97,92,237,0.4);
}
@keyframes shake {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-7px); }
}
.brewing-status { margin-top: 26px; font-size: 16px; color: var(--text); min-height: 24px; }
.brewing-bar {
  margin: 18px auto 0; width: 200px; height: 5px;
  border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden;
}
.brewing-bar-fill {
  height: 100%; width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--green));
  animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* ---------- 出酒 ---------- */
#screen-result { background: radial-gradient(80% 50% at 50% 0%, rgba(97,92,237,0.22), transparent), var(--bg); }
.result-inner {
  padding: max(26px, env(safe-area-inset-top)) 26px max(30px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.queue-chip {
  border: 1px solid rgba(158,238,167,0.4); color: var(--green-soft);
  border-radius: 999px; padding: 7px 18px; font-size: 14px;
  background: rgba(1,184,50,0.08);
}
.queue-chip b { font-size: 17px; letter-spacing: 1px; }
.glass-wrap { margin-top: 18px; height: 170px; display: flex; align-items: flex-end; }
.r-emoji { font-size: 30px; margin-top: 10px; }
#r-name { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: 1px; }
.r-tagline { color: var(--purple-soft); margin-top: 8px; font-size: 15px; }
.r-base { color: var(--muted); font-size: 13px; margin-top: 6px; }
.r-card {
  margin-top: 20px; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: 18px;
  background: rgba(255,255,255,0.04); padding: 18px;
}
.r-card-title { color: var(--green-soft); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.r-card p { font-size: 14.5px; line-height: 1.75; color: var(--text); margin-bottom: 14px; }
.r-card p:last-child { margin-bottom: 0; }
.r-note { margin-top: 14px; color: #f0c060; font-size: 13px; }
.r-tip { color: var(--muted); font-size: 13px; margin-top: 16px; }
.r-actions { display: flex; gap: 12px; margin-top: 18px; }
.r-actions .btn-primary { margin-top: 0; }

/* ---------- 酒卡弹层 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5,3,12,0.88); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.modal-inner { text-align: center; padding: 20px; }
#card-img {
  max-width: min(78vw, 340px); max-height: 68dvh;
  border-radius: 18px; box-shadow: 0 10px 60px rgba(97,92,237,0.5);
}
.modal-tip { color: var(--muted); font-size: 13px; margin: 14px 0; }

/* ---------- 调酒师端 ---------- */
.bar-page { padding: 20px 18px 60px; max-width: 560px; margin: 0 auto; }
.bar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.bar-head h1 { font-size: 22px; }
.bar-head .count { color: var(--green-soft); font-size: 14px; }
.order-card {
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--bg-soft); padding: 16px; margin-bottom: 14px;
}
.order-top { display: flex; align-items: center; gap: 10px; }
.order-no { font-size: 20px; font-weight: 800; color: var(--green-soft); }
.order-name { font-size: 17px; font-weight: 700; }
.order-nick { color: var(--muted); font-size: 13px; margin-left: auto; }
.order-base { color: var(--purple-soft); font-size: 14px; margin-top: 8px; font-weight: 600; }
.order-ing { color: var(--text); font-size: 13.5px; line-height: 1.7; margin-top: 6px; }
.order-method { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 6px; }
.order-twist { color: #f0c060; font-size: 13px; margin-top: 8px; }
.order-actions { margin-top: 12px; text-align: right; }
.btn-done {
  border: none; cursor: pointer; border-radius: 999px;
  background: var(--green); color: #fff; font-weight: 700;
  padding: 9px 24px; font-size: 14px;
}
.bar-empty { text-align: center; color: var(--muted); padding: 60px 0; }
.bar-empty img { width: 110px; opacity: 0.9; margin-bottom: 12px; }
