/* ────────────────────────────────────────────────────────────────
   基础层：重置、排版、按钮、卡片，以及各屏共用的版心与氛围元素。
   ──────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-page);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgba(232, 194, 104, 0.28);
  color: var(--ink-1);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 滚动条：暗底上不要亮白条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* ── 版心 ─────────────────────────────────────────────────────── */

.app {
  min-height: 100vh;
}

.screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-page);
}

.screen--deep {
  background: var(--bg-deep);
}

.screen--console {
  background: var(--bg-console);
}

.screen[hidden] {
  display: none;
}

[hidden] {
  display: none !important;
}

.shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 32px var(--gutter) 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.shell--snug {
  padding-top: 26px;
  padding-bottom: 28px;
  gap: 18px;
}

.shell--between {
  justify-content: space-between;
}

.shell--center {
  justify-content: center;
  align-items: center;
}

/* ── 氛围 ─────────────────────────────────────────────────────── */

.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.glow--gold {
  background: radial-gradient(circle, rgba(232, 194, 104, 0.15) 0%, rgba(232, 194, 104, 0) 68%);
}

.glow--gold-strong {
  background: radial-gradient(circle, rgba(232, 194, 104, 0.3) 0%, rgba(232, 194, 104, 0) 70%);
}

.glow--vermilion {
  background: radial-gradient(circle, rgba(224, 120, 102, 0.14) 0%, rgba(224, 120, 102, 0) 68%);
}

.hairline {
  width: 100%;
  height: 1px;
  background: var(--line-3);
  flex: none;
}

.hairline--v {
  width: 1px;
  height: 100%;
  background: var(--line-3);
}

/* ── 排版 ─────────────────────────────────────────────────────── */

.brush {
  font-family: var(--font-brush);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-deep);
  letter-spacing: 0.04em;
}

.title-xl {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 5.4vw, 78px);
  line-height: 1.22;
  color: var(--ink-1);
}

.title-l {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.26;
  color: var(--ink-2);
}

.title-m {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(21px, 2.4vw, 26px);
  line-height: 1.3;
  color: var(--ink-1);
}

.title-s {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink-3);
}

.lede {
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-9);
}

.fineprint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-13);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.price {
  font-family: var(--font-price);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── 布局工具 ─────────────────────────────────────────────────── */

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row--between {
  justify-content: space-between;
}

.row--top {
  align-items: flex-start;
}

.row--wrap {
  flex-wrap: wrap;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.col--tight {
  gap: 6px;
}

.grow {
  flex: 1;
  min-width: 0;
}

.between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.top-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

/* ── 顶栏 ─────────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
  flex: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__mark {
  width: 26px;
  height: 26px;
  flex: none;
}

.brand__name {
  font-family: var(--font-brush);
  font-size: 15px;
  color: var(--ink-11);
}

.brand__name--hero {
  font-size: 22px;
  color: var(--ink-2);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav__link {
  font-size: 15px;
  color: var(--ink-9);
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--ink-4);
}

.nav__link--on {
  color: var(--gold);
  font-weight: 500;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-9);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.back:hover {
  color: var(--ink-4);
}

.back svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ── 按钮 ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 15px 28px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.btn--gold {
  background: var(--gold);
  color: var(--gold-ink);
}

.btn--gold:hover {
  background: #f0cd7d;
}

.btn--ghost {
  background: var(--glass-3);
  border-color: var(--line-5);
  color: var(--ink-7);
}

.btn--ghost:hover {
  background: var(--glass-4);
  border-color: var(--line-6);
}

.btn--quiet {
  background: transparent;
  color: var(--ink-9);
  padding: 15px 6px;
}

.btn--quiet:hover {
  color: var(--ink-4);
}

.btn--danger {
  background: var(--vermilion-veil);
  border-color: rgba(224, 120, 102, 0.4);
  color: var(--vermilion);
}

.btn--danger:hover {
  background: rgba(224, 120, 102, 0.18);
}

.btn--outline {
  background: var(--line-4);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--ink-3);
  padding: 9px 20px;
  font-size: 13px;
}

.btn--block {
  width: 100%;
  padding: 14px 0;
}

.btn--sm {
  padding: 9px 18px;
  font-size: 14px;
  border-radius: var(--r-1);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ── 卡片 / 容器 ──────────────────────────────────────────────── */

.card {
  position: relative;
  background: var(--glass-5);
  border: 1px solid var(--line-2);
  border-radius: var(--r-5);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card--plain {
  background: var(--glass-3);
  border-color: var(--line-1);
}

.card--faint {
  background: var(--glass-1);
  border-color: var(--line-1);
}

.card--gold {
  background: linear-gradient(135deg, rgba(196, 154, 74, 0.16) 0%, rgba(196, 154, 74, 0.03) 100%);
  border-color: rgba(196, 154, 74, 0.32);
}

.card--pad-s {
  padding: 20px 22px;
  gap: 14px;
}

.card--pad-l {
  padding: 26px 28px;
  border-radius: var(--r-6);
}

.card__label {
  font-size: 12px;
  color: var(--ink-11);
}

.card__value {
  font-family: var(--font-price);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ── 小件 ─────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill--gold {
  background: var(--gold-veil-2);
  border-color: rgba(196, 154, 74, 0.32);
  color: var(--gold);
}

.pill--quiet {
  background: var(--glass-2);
  border-color: var(--line-2);
  color: var(--ink-7);
}

.pill--jade {
  background: var(--jade-veil);
  border-color: rgba(125, 217, 166, 0.3);
  color: var(--jade);
}

.pill--vermilion {
  background: var(--vermilion-veil);
  border-color: rgba(224, 120, 102, 0.35);
  color: var(--vermilion);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}

.dot--gold {
  background: var(--gold);
}

.dot--jade {
  background: var(--jade);
}

.dot--vermilion {
  background: var(--vermilion);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  background: var(--gold-veil-2);
  border: 1px solid rgba(196, 154, 74, 0.35);
  color: var(--gold);
  font-size: 12px;
  font-weight: 500;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
}

.chip--gold {
  background: var(--gold);
  color: var(--gold-ink);
}

.chip--gold-veil {
  background: var(--gold-veil-4);
  color: var(--gold);
}

/* 额度进度轨 */
.meter {
  width: 100%;
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--gold);
  transition: width 0.4s linear;
}

.meter__fill--low {
  background: var(--vermilion);
}

/* 开关 */
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--glass-5);
  border: 1px solid var(--line-4);
  padding: 2px;
  display: flex;
  align-items: center;
  cursor: pointer;
  flex: none;
  transition: background 0.2s ease;
}

.switch__knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink-9);
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch[aria-checked="true"] {
  background: var(--gold);
  border-color: var(--gold);
}

.switch[aria-checked="true"] .switch__knob {
  transform: translateX(18px);
  background: #fff8ec;
}

/* 分段选择 */
.seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.seg__item {
  padding: 7px 14px;
  border-radius: var(--r-1);
  font-size: 13px;
  background: var(--glass-4);
  color: var(--ink-8);
  border: 1px solid transparent;
  cursor: pointer;
}

.seg__item--on {
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 500;
}

/* 说明文字较长的设置行：标签在上，控件在下，别把说明挤成一条 */
.field--wrap {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* 法相音色：每位一行，描述 + 试听 */
.voicerow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--glass-3);
}

.voicerow:first-of-type {
  border-top: 0;
}

.field__input--wide {
  width: 100%;
  min-width: 0;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

/* 设置行 */
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--r-2);
  background: var(--glass-2);
}

.field__label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-5);
}

.field__value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-1);
  background: var(--glass-5);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.field__input {
  width: 108px;
  padding: 8px 12px;
  border-radius: var(--r-1);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-4);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.field__input:focus {
  outline: none;
  border-color: var(--gold);
}

/* 数据行 */
.datarow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.datarow__label {
  color: var(--ink-11);
}

.datarow__value {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.datarow__value--gold {
  color: var(--gold);
}

.datarow__value--vermilion {
  color: var(--vermilion);
}

/* 香火账户码：等宽 + 大字距，抄错一位就找不回来，得让人看得清 */
.account-code {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 0.5px solid var(--line, rgba(201, 162, 39, 0.3));
  border-radius: var(--radius-sm, 8px);
  background: rgba(201, 162, 39, 0.06);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-align: center;
  user-select: all;
  overflow-wrap: anywhere;
}

.datarow__value--jade {
  color: var(--jade);
}

/* 法相圆 */
.avatar {
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: linear-gradient(135deg, #4c3318 0%, #b8802f 100%);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── 提示条（toast）──────────────────────────────────────────── */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--r-2);
  background: rgba(20, 18, 16, 0.94);
  border: 1px solid var(--line-4);
  color: var(--ink-4);
  font-size: 13px;
  backdrop-filter: blur(12px);
  animation: toast-in 0.28s ease;
}

.toast--gold {
  border-color: rgba(196, 154, 74, 0.4);
  color: var(--gold);
}

.toast--danger {
  border-color: rgba(224, 120, 102, 0.4);
  color: var(--vermilion);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 弹层 */
.sheet {
  position: absolute;
  z-index: 20;
  min-width: 220px;
  padding: 14px;
  border-radius: var(--r-3);
  background: rgba(22, 20, 18, 0.97);
  border: 1px solid var(--line-4);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-1);
  font-size: 13px;
  color: var(--ink-7);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.sheet__item:hover {
  background: var(--glass-3);
  color: var(--ink-3);
}

.sheet__item--on {
  color: var(--gold);
}

/* 空态 */
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--ink-11);
  font-size: 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-5);
}

/* 视觉隐藏但可读屏 */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── 响应式 ───────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .nav__links {
    display: none;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 22px 20px 28px;
    gap: 18px;
  }

  .btn {
    padding: 14px 22px;
  }

  .card {
    padding: 18px 18px;
    gap: 14px;
  }

  .field {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .field__value,
  .field__input {
    width: 100%;
  }
}

/* ══ 云端链路组件 ═══════════════════════════════════════════════
   接上云端网关之后新长出来的一批件：通道模式徽标、降级提示条、
   套餐卡、支付面板、二维码。语言不变 —— 用 1px 描边分层次，
   金只给「神性 / 动作」，朱砂只给「要留意的事」。
   ════════════════════════════════════════════════════════════ */

/* 通道模式：一行说清这通电话走的哪条线（全双工 / 三段式） */
.modebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 2px;
}

.modebar .fineprint {
  padding-left: 0;
}

/* 降级提示条：语音落到浏览器朗读、或某条腿瘸了的时候出现 */
.noticebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-2);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.noticebar code {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.72;
}

.noticebar--info {
  background: var(--glass-2);
  border-color: var(--line-2);
  color: var(--ink-6);
}

.noticebar--gold {
  background: var(--gold-veil-3);
  border-color: rgba(232, 194, 104, 0.28);
  color: var(--gold);
}

.noticebar--warn {
  background: rgba(232, 194, 104, 0.07);
  border-color: rgba(232, 194, 104, 0.24);
  color: var(--ink-5);
}

.noticebar--error {
  background: var(--vermilion-veil);
  border-color: rgba(224, 120, 102, 0.3);
  color: var(--vermilion);
}

/* 告警卡片：缺激活码这类「不修好就不通」的事 */
.card--alert {
  background: rgba(224, 120, 102, 0.05);
  border-color: rgba(224, 120, 102, 0.34);
}

/* ── 套餐卡 ─────────────────────────────────────────────────── */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 14px 15px;
  border-radius: var(--r-3);
  background: var(--glass-3);
  border: 1px solid var(--line-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.plan:hover {
  background: var(--glass-5);
  border-color: var(--line-4);
}

.plan--on {
  background: var(--gold-veil-2);
  border-color: rgba(232, 194, 104, 0.5);
}

.plan__name {
  font-size: 13px;
  color: var(--ink-5);
}

.plan__price {
  font-family: var(--font-price);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.1;
  color: var(--ink-1);
  font-variant-numeric: tabular-nums;
}

.plan--on .plan__price {
  color: var(--gold);
}

/* ── 支付面板 ───────────────────────────────────────────────── */

.pay-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  border-radius: var(--r-5);
  background: var(--glass-2);
  border: 1px solid var(--line-2);
}

/* 嵌在卡片里时不再套一层壳，免得框套框 */
.pay-panel--compact {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

.qr {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 18px;
  border-radius: var(--r-4);
  background: var(--glass-3);
  border: 1px solid var(--line-2);
}

.qr__img {
  width: 146px;
  height: 146px;
  flex: none;
  padding: 6px;
  border-radius: var(--r-2);
  background: #fff;
  object-fit: contain;
}

.qr .col {
  flex: 1 1 190px;
  min-width: 0;
}

@media (max-width: 760px) {
  .plan-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .qr {
    flex-direction: column;
    align-items: flex-start;
  }

  .qr__img {
    width: 168px;
    height: 168px;
  }
}

/* 说明文字里嵌的字段名 / 文件路径。别让它继承正文的字距，
   否则 `data/business.json` 这种长串在窄卡片里会难认。 */
.fineprint code,
.card code {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--glass-4);
  color: var(--ink-5);
  white-space: nowrap;
}
