/* =============================================================
   Pocket Coach UI 2.0 — 业务适配层样式（v3）
   ------------------------------------------------------------
   覆盖：数据来源徽章 / 环境条 / 表单 / SKU / 会员 /
         语音适配状态 / 异常与失败态 / 无障碍与性能
   所有数值色与尺寸均取自 tokens.css，页面样式不硬编码色值。
   ============================================================= */

/* =============== 数据来源徽章 =============== */
.src {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.src svg { flex: none; }
.src--mock { color: #8A5A00; background: rgba(217,135,0,.13); border-color: rgba(217,135,0,.30); }
.src--replay { color: #2B4E9B; background: rgba(70,120,220,.13); border-color: rgba(70,120,220,.28); }
.src--live { color: #0B6F6B; background: rgba(14,159,154,.14); border-color: rgba(14,159,154,.30); }
.src--unknown { color: #A32227; background: rgba(229,72,77,.13); border-color: rgba(229,72,77,.30); }

/* =============== 环境提示条（离线 / 弱网） =============== */
.envbar {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 9px 12px; border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.4;
  border: 1px solid transparent;
}
.envbar svg { flex: none; }
.envbar--offline { color: #A32227; background: var(--ev-block-bg); border-color: var(--ev-block-bd); }
.envbar--weak { color: #8A5A00; background: var(--ev-cond-bg); border-color: var(--ev-cond-bd); }

/* =============== 小标签 =============== */
.pill {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap;
}
.pill--neutral { color: var(--ink-3); background: rgba(125,122,147,.12); }
.pill--brand { color: #fff; background: var(--brand-grad); }
.pill--ok { color: #0B6F6B; background: var(--ev-verified-bg); }
.pill--warn { color: #8A5A00; background: var(--ev-cond-bg); }

/* =============== 键值 =============== */
.kv-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.kv {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3); padding: 7px 0;
  border-bottom: 1px solid var(--glass-stroke);
  font-size: var(--fs-sm);
}
.kv:last-child { border-bottom: 0; }
.kv__k { color: var(--ink-3); flex: none; }
.kv__v { color: var(--ink-1); text-align: right; word-break: break-all; }
.kv__v--mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--fs-xs); }

.inline-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--fs-xs);
  background: rgba(124,92,255,.10); color: #5B46C7;
  padding: 1px 6px; border-radius: var(--r-xs);
}
.code-block {
  margin: 0; padding: 12px;
  background: rgba(20,18,40,.05); border-radius: var(--r-md);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--fs-xs); line-height: 1.6;
  color: var(--ink-2); overflow-x: auto; white-space: pre;
}

/* =============== 提示块 =============== */
.notice {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: 10px 12px; border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.5;
  border: 1px solid transparent;
}
.notice svg { flex: none; margin-top: 1px; }
.notice--ok { color: #0B6F6B; background: var(--ev-verified-bg); border-color: var(--ev-verified-bd); }
.notice--warn { color: #8A5A00; background: var(--ev-cond-bg); border-color: var(--ev-cond-bd); }
.notice--info { color: var(--ink-2); background: rgba(124,92,255,.07); border-color: rgba(124,92,255,.18); }

/* =============== 缺口项 =============== */
.gap-item {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--ev-cond-bg); border: 1px solid var(--ev-cond-bd);
  color: var(--ink-2);
}
.gap-item svg { flex: none; margin-top: 2px; color: var(--ev-cond); }

/* =============== 表单字段 =============== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.field__wrap {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 0 12px; min-height: 48px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.field__wrap:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-ring); }
.field__wrap svg { color: var(--ink-3); flex: none; }
.field__input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: var(--fs-body); color: var(--ink-1);
  height: 46px;
}
.field__input::placeholder { color: var(--ink-4); }
.field--error .field__wrap { border-color: var(--ev-block); }
.field__err { font-size: var(--fs-xs); color: var(--ev-block); }
.field__hint { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }

.linkbtn {
  border: 0; background: transparent; padding: 6px 0;
  font-family: inherit; font-size: var(--fs-sm);
  color: var(--brand-1); font-weight: 600;
  min-height: 44px; cursor: pointer;
}

/* =============== 步骤条 =============== */
.stepper { display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px; }
.stepper__item, .phasebar__item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-pill);
  background: rgba(125,122,147,.09);
  font-size: var(--fs-xs); color: var(--ink-3);
  white-space: nowrap; flex: none;
}
.stepper__dot, .phasebar__dot {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(125,122,147,.25); color: #fff;
  font-size: 10px; font-weight: 700; flex: none;
}
.stepper__item.is-done, .phasebar__item.done { color: var(--ink-2); }
.stepper__item.is-done .stepper__dot, .phasebar__item.done .phasebar__dot { background: var(--ev-verified); }
.stepper__item.is-current, .phasebar__item.current {
  color: var(--brand-1); background: rgba(124,92,255,.13); font-weight: 650;
}
.stepper__item.is-current .stepper__dot, .phasebar__item.current .phasebar__dot { background: var(--brand-grad); }
.phasebar { display: flex; gap: 5px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px 0; }

/* =============== 语音：状态芯片 / 指标 / 失败卡 =============== */
.state-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600;
  background: rgba(125,122,147,.12); color: var(--ink-2);
}
.state-chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.state-chip--recording { background: rgba(229,72,77,.12); color: #A32227; }
.state-chip--recording .state-chip__dot { background: var(--ev-block); animation: chipPulse 1s ease-in-out infinite; }
.state-chip--chat_pending, .state-chip--recognizing, .state-chip--uploading, .state-chip--tts_pending {
  background: rgba(124,92,255,.12); color: #5B46C7;
}
.state-chip--chat_pending .state-chip__dot, .state-chip--recognizing .state-chip__dot,
.state-chip--uploading .state-chip__dot, .state-chip--tts_pending .state-chip__dot {
  background: var(--brand-2); animation: chipPulse 1.2s ease-in-out infinite;
}
.state-chip--playing { background: rgba(14,159,154,.13); color: #0B6F6B; }
.state-chip--playing .state-chip__dot { background: var(--ev-verified); animation: chipPulse 1s ease-in-out infinite; }
.state-chip--failed { background: var(--ev-block-bg); color: #A32227; }
.state-chip--failed .state-chip__dot { background: var(--ev-block); }
@keyframes chipPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }

.metric {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.66); border: 1px solid var(--glass-stroke);
  font-size: 11px;
}
.metric__k { color: var(--ink-3); }
.metric__v { font-weight: 650; color: var(--ink-1); }
.metric--none { background: rgba(125,122,147,.10); }
.metric--none .metric__v { color: var(--ink-3); font-weight: 500; }

.bubble__foot { margin-top: 8px; border-top: 1px dashed var(--glass-stroke); padding-top: 7px; }
.bubble__foot .metric { background: rgba(255,255,255,.5); }

.tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: var(--r-xs); font-size: 10px; font-weight: 700;
  vertical-align: middle;
}
.tag--demo { background: var(--ev-cond-bg); color: #8A5A00; border: 1px solid var(--ev-cond-bd); }

/* 失败 / 重试卡 */
.alert {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: 14px; border-radius: var(--r-lg);
  border: 1px solid var(--ev-block-bd); background: var(--ev-block-bg);
  flex-wrap: wrap;
}
.alert__icon { flex: none; color: var(--ev-block); margin-top: 2px; }
.alert__title { font-weight: 700; font-size: var(--fs-body); color: #A32227; }
.alert__desc { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.alert__quote {
  margin-top: 9px; padding: 9px 11px;
  background: rgba(255,255,255,.6); border-radius: var(--r-sm);
  border-left: 3px solid var(--ev-block);
}
.alert__quote-text { font-size: var(--fs-sm); color: var(--ink-1); margin-top: 3px; line-height: 1.5; }
.alert__actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 4px; }
.alert--timeout, .alert--network { border-color: var(--ev-cond-bd); background: var(--ev-cond-bg); }
.alert--timeout .alert__icon, .alert--network .alert__icon { color: var(--ev-cond); }
.alert--timeout .alert__title, .alert--network .alert__title { color: #8A5A00; }
.alert--timeout .alert__quote, .alert--network .alert__quote { border-left-color: var(--ev-cond); }

/* 人工审核横幅 */
.review-banner {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 14px; border-radius: var(--r-lg);
  background: var(--brand-grad-soft);
  border: 1px solid rgba(124,92,255,.28);
}
.review-banner svg { flex: none; color: var(--brand-1); }
.review-banner__title { font-weight: 700; color: var(--brand-1); font-size: var(--fs-body); }
.review-banner__desc { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 3px; line-height: 1.5; }

/* =============== 选择框 =============== */
.select {
  width: 100%; min-height: 44px; padding: 0 12px;
  font-family: inherit; font-size: var(--fs-sm); color: var(--ink-1);
  background: rgba(255,255,255,.72);
  border: 1px solid var(--glass-border); border-radius: var(--r-md);
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 51%, calc(100% - 13px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* =============== 分段控件小尺寸（仍保持 44px 触控高度） =============== */
.seg--sm .seg__item { font-size: var(--fs-xs); padding: 0 12px; }

/* =============== 芯片变体 =============== */
.chip--block { background: var(--ev-block-bg); border-color: var(--ev-block-bd); color: #A32227; }

/* =============== 会员：头像 / 账户卡 =============== */
.avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--brand-grad); color: #fff;
  font-size: 21px; font-weight: 700;
  box-shadow: var(--sh-brand);
}
.avatar--sm { width: 42px; height: 42px; font-size: 16px; }
.profile__name { font-size: var(--fs-h3); font-weight: 700; color: var(--ink-1); }
.profile__sub { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; }

/* 可点击列表行 */
.list-row--btn {
  width: 100%; border: 0; background: transparent;
  font-family: inherit; text-align: left; cursor: pointer;
  min-height: 56px; align-items: center;
}
.list-row--btn:active { background: rgba(124,92,255,.06); }
.ico-badge {
  width: 42px; height: 42px; flex: none; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--brand-grad-soft); color: var(--brand-1);
}

/* =============== 会员：倒计时 =============== */
.countdown {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--ev-verified-bg); border: 1px solid var(--ev-verified-bd);
  color: #0B6F6B; font-weight: 650;
}
.countdown svg { flex: none; }
.countdown__text { flex: 1 1 auto; font-size: var(--fs-body); }
.countdown--warn { background: var(--ev-cond-bg); border-color: var(--ev-cond-bd); color: #8A5A00; }
.countdown--err { background: var(--ev-block-bg); border-color: var(--ev-block-bd); color: #A32227; }

/* =============== 会员：一日票 =============== */
.daypass {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #6E4FE0 0%, #8B6BF2 46%, #6FC9E8 100%);
  box-shadow: var(--sh-brand);
}
.daypass__glow {
  position: absolute; inset: -40% -10% auto auto; width: 190px; height: 190px;
  background: radial-gradient(circle, rgba(255,255,255,.5), rgba(255,255,255,0) 68%);
  pointer-events: none;
}
.daypass__body { position: relative; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.daypass__name { font-size: var(--fs-h3); font-weight: 750; color: #fff; }
.daypass__desc { font-size: var(--fs-sm); color: rgba(255,255,255,.90); line-height: 1.5; }
.daypass__price { display: flex; align-items: baseline; gap: 3px; color: #fff; }
.daypass__cur { font-size: 17px; font-weight: 700; }
.daypass__amt { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.daypass__unit { font-size: var(--fs-xs); color: rgba(255,255,255,.82); margin-left: 3px; }
.daypass .pill--brand { background: rgba(255,255,255,.24); color: #fff; }
.daypass .btn--primary { background: #fff; color: #5B46C7; box-shadow: none; }

/* =============== 会员：SKU 网格 =============== */
.sku-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
.sku {
  display: flex; flex-direction: column; gap: 9px;
  padding: 15px; border-radius: var(--r-lg);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
}
.sku--rec { border-color: rgba(124,92,255,.42); box-shadow: var(--sh-brand); }
.sku__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sku__name { font-size: var(--fs-h3); font-weight: 700; color: var(--ink-1); }
.sku__desc { font-size: var(--fs-xs); color: var(--ink-3); }
.sku__price { display: flex; align-items: baseline; gap: 3px; color: var(--ink-1); }
.sku__cur { font-size: 14px; font-weight: 700; }
.sku__amount { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.sku__unit { font-size: var(--fs-xs); color: var(--ink-3); margin-left: 2px; }
.sku__price--pending { flex-direction: column; align-items: flex-start; gap: 2px; }
.sku__price--pending .sku__amount {
  font-size: 17px; color: var(--ink-3); font-weight: 650;
  border: 1px dashed var(--glass-stroke); border-radius: var(--r-sm);
  padding: 4px 10px;
}
.sku__price--pending .sku__unit { font-size: 11px; margin: 0; }
.sku__feats { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.sku__feats li { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.5; }

/* =============== 登录页 =============== */
.auth-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 2px; }
.auth-hero__title { font-size: var(--fs-h2); font-weight: 750; color: var(--ink-1); letter-spacing: var(--ls-tight); }
.auth-hero__desc { font-size: var(--fs-sm); color: var(--ink-3); }

/* =============== 光球：思考 / 播放 =============== */
.orb--thinking { animation: orbThink 2.6s var(--ease-out) infinite; }
.orb--thinking::before { animation-duration: 7s; }
.orb--speaking { animation: orbSpeak 1.15s var(--ease-out) infinite; }
@keyframes orbThink {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}
@keyframes orbSpeak {
  0%,100% { transform: scale(1); }
  38% { transform: scale(1.05); }
  62% { transform: scale(.99); }
}

/* =============== 中文可读性精修 =============== */
.card__title, .sec-title, .appbar__title { letter-spacing: .006em; }
.script__text, .fact__text, .bubble__body, .datum__label { line-height: 1.62; }
.tiny, .small { line-height: 1.55; }
.datum__meta { line-height: 1.55; }

/* =============== Android 小屏适配 =============== */
@media (max-width: 360px) {
  :root { --gutter: 14px; }
  .daypass__amt { font-size: 29px; }
  .avatar { width: 46px; height: 46px; font-size: 18px; }
  .navbar__item span { font-size: 10px; }
  .seg__item { padding: 0 10px; font-size: var(--fs-xs); }
  .sku__amount { font-size: 23px; }
  .kv { font-size: var(--fs-xs); }
  .phasebar__label { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
}

/* 横屏 / 平板：保持单列可读宽度 */
@media (min-width: 520px) {
  .sku-grid { grid-template-columns: 1fr 1fr; }
  .kv-grid { grid-template-columns: 1fr 1fr; column-gap: var(--sp-4); }
}

/* =============== 无障碍与性能 =============== */
/* 尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 低性能设备：由 net.js 在 <html> 上打 pc-lite，关闭持续位移动画 */
html.pc-lite .aurora-bg .blob { animation: none !important; }
/* .orb 自身在 aurora.css 里挂了 orb-spin(24s) + orb-breathe(6.5s) 两条常驻动画，
   是最耗电的一条；pc-lite 下必须连同 listening/listening 变体一起停掉，
   否则"低性能降级"只关掉了 thinking/speaking，空闲态仍在常驻重绘。 */
html.pc-lite .orb,
html.pc-lite .orb--listening,
html.pc-lite .orb--thinking,
html.pc-lite .orb--speaking { animation: none !important; }
html.pc-lite .orb::before,
html.pc-lite .orb::after { animation: none !important; }
html.pc-lite .orb-halo { animation: none !important; }
html.pc-lite .rise { animation: none !important; }
html.pc-lite .card, html.pc-lite .sku { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass-bg-dim); }

/* 触控目标兜底：所有可点元素不低于 44px */
.linkbtn, .seg__item, .btn, .navbar__item, .accordion__head, .fund-hit, .select, .field__input { min-height: 44px; }

/* 搜索框内的 input 必须撑满外层 48px 药丸，否则真实手机点药丸上下边缘无法聚焦 */
.search input {
  align-self: stretch;
  min-height: 44px;
  height: auto;
  padding: 0;
}
