/*
 * Game Voice Studio. Light, in the TRTC Demo Center's visual language
 * (apps/portal/app/globals.css: the demo-v3 light tokens — brand #1c66e5 keeps
 * white text at 5.2:1 and brand text on its tint at 4.7:1; Ricky, 2026-10-19:
 * "风格上参考 demo portal 主站"). No web fonts: this page is opened on
 * conference-room wifi, so it renders in the system stack and never waits on
 * a font CDN.
 */
:root {
  --brand: #1c66e5;
  --brand-hover: #1859c7;
  --brand-400: #1c66e5;
  --brand-200: #bbd1f7;
  --brand-50: #f0f5ff;
  --navy: #001a45;
  --cyan: #0091c2;

  --bg: #f5f7fa;
  --bg-2: #f4f6fd;
  --card: #ffffff;
  --card-2: #f7f8fb;
  --line: #e3e6eb;
  --line-strong: #c9ced6;
  --text: #0f1f3d;
  --text-2: #4e5969;
  --text-3: #5f6a7e;

  --mm: #7c4ddb;
  --el: #344054;
  --tx: #1c66e5;
  --fish: #0f766e;
  --qw: #b4501f;

  --ok: #007a55;
  --warn: #a84f0c;
  --err: #b42332;

  --shadow-1: 0 1px 2px rgba(15, 31, 61, 0.06), 0 1px 1px rgba(15, 31, 61, 0.04);
  --shadow-2: 0 4px 12px rgba(15, 31, 61, 0.08), 0 1px 2px rgba(15, 31, 61, 0.04);
  --shadow-card-hover: 0 6px 24px color-mix(in srgb, var(--brand) 12%, transparent);

  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Noto Sans SC', 'Noto Sans Thai', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--brand-400);
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: flex;
}

.nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--text);
  background: var(--card-2);
}

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

.lang-switch {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px;
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.lang-switch button[aria-pressed='true'] {
  background: var(--brand);
  color: #fff;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 18px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: progress;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--brand-400);
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 16px 64px;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(0, 110, 255, 0.35), transparent 60%),
    radial-gradient(700px 380px at 95% 10%, rgba(0, 200, 255, 0.18), transparent 60%),
    linear-gradient(180deg, var(--navy), var(--bg));
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, var(--brand-200));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--text-2);
  font-size: clamp(15px, 2vw, 18px);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.stat {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 26, 58, 0.6);
}

.stat b {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.stat span {
  color: var(--text-2);
  font-size: 13px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-wave {
  position: absolute;
  inset: auto -10% -40px -10%;
  height: 180px;
  opacity: 0.35;
  background: repeating-linear-gradient(90deg, transparent 0 10px, rgba(0, 200, 255, 0.5) 10px 12px);
  mask: radial-gradient(60% 100% at 50% 100%, #000, transparent 70%);
  -webkit-mask: radial-gradient(60% 100% at 50% 100%, #000, transparent 70%);
}

/* ── Sections ──────────────────────────────────────────────────────────── */
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 16px 8px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 32px);
  letter-spacing: -0.01em;
}

.section-head p {
  margin: 8px 0 24px;
  color: var(--text-2);
  max-width: 760px;
}

.tabs,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab,
.chip {
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
}

.tab[aria-selected='true'],
.chip[aria-pressed='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.scene-blurb {
  color: var(--text-2);
  margin: 14px 0 22px;
  max-width: 820px;
}

/* ── Vendor tags & play buttons ────────────────────────────────────────── */
.vendor-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.v-minimax {
  --vc: var(--mm);
}

.v-elevenlabs {
  --vc: var(--el);
}

.v-tencent {
  --vc: var(--tx);
}

.v-fish {
  --vc: var(--fish);
}

.v-qwen {
  --vc: var(--qw);
}

.vendor-dot {
  background: var(--vc);
}

.vendor-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--vc);
}

.play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--vc) 45%, transparent);
  background: color-mix(in srgb, var(--vc) 10%, transparent);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.play:hover {
  background: color-mix(in srgb, var(--vc) 22%, transparent);
}

.play:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.play .icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--vc);
  color: #fff;
  flex: none;
}

.play .icon svg {
  width: 10px;
  height: 10px;
}

.play[data-state='loading'] .icon {
  animation: pulse 0.9s ease-in-out infinite;
}

.play[data-state='playing'] {
  background: color-mix(in srgb, var(--vc) 30%, transparent);
  border-color: var(--vc);
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

/* ── Cast cards ────────────────────────────────────────────────────────── */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr));
  gap: 16px;
}

.cast {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

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

.avatar {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: linear-gradient(135deg, var(--brand-50), #dce8fd);
  border: 1px solid var(--line-strong);
}

.cast-head h3 {
  margin: 0;
  font-size: 18px;
}

.cast-head p {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 13px;
}

.casting {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card-2);
  border-radius: 10px;
  font-size: 13px;
}

.casting-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.casting-voice {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}

.voice-name {
  color: var(--text);
}

.id-copy {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.id-copy:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  white-space: nowrap;
}

.badge-warn {
  color: var(--warn);
  background: #fff8f0;
  border-color: color-mix(in srgb, var(--warn) 50%, transparent);
}

/* Brand text on the brand tint: 4.7:1. */
.badge-brand {
  color: var(--brand);
  background: var(--brand-50);
  border-color: var(--brand-200);
}

.custom-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--vc) 50%, transparent);
  color: var(--text-2);
  font-size: 12.5px;
}

.custom-note {
  color: var(--text-2);
  font-size: 12.5px;
}

.lines {
  display: grid;
  gap: 10px;
}

.line {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.line-text {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.emotion {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand);
}

.line-plays {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Multilingual ──────────────────────────────────────────────────────── */
.multi-table {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.multi-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

.multi-row:first-child {
  border-top: 0;
}

.multi-lang {
  font-weight: 600;
}

.multi-text {
  color: var(--text-2);
  min-width: 0;
}

.multi-plays {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.multi-cast {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--card);
}

/* ── Library ───────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filters select {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 7px 10px;
  max-width: 100%;
}

.library-count {
  color: var(--text-3);
  font-size: 13px;
  margin: 14px 0 12px;
}

.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 12px;
}

.voice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  min-width: 0;
}

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

.voice h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.voice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.voice-sample {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  flex: 1;
}

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

.voice-bottom a {
  font-size: 12px;
  color: var(--text-3);
}

.voice-bottom a:hover {
  color: var(--brand-400);
}

/* ── Live ──────────────────────────────────────────────────────────────── */
.live {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card), var(--bg-2));
}

.live-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > span:first-child {
  font-size: 13px;
  color: var(--text-2);
}

.field select,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 12px;
}

.field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.6;
}

.field-text {
  position: relative;
}

.counter {
  justify-self: end;
  font-size: 12px;
  color: var(--text-3);
}

.live-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.live-status {
  font-size: 14px;
  color: var(--text-2);
}

.live-status.is-error {
  color: var(--err);
}

.live-status.is-ok {
  color: var(--ok);
}

.live-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ── Service path ──────────────────────────────────────────────────────── */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 18px 18px 18px 60px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--brand));
  color: #fff;
}

.steps h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.steps p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

/* ── Pricing ───────────────────────────────────────────────────────────── */
.page-title {
  margin: 0;
  font-size: clamp(26px, 3.8vw, 36px);
  letter-spacing: -0.01em;
}

#pricing {
  padding-bottom: 64px;
}

.nav a[aria-current='page'] {
  color: var(--text);
}

.pricing-cta {
  margin: 20px 0 0;
}

.pricing-cta a {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 60%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  font-weight: 600;
}

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

.pricing-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pricing-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pricing-label {
  color: var(--text-3);
  font-size: 13px;
}

.pricing-controls .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
}

.seg button {
  border: 0;
  background: var(--bg-2);
  color: var(--text-2);
  padding: 6px 12px;
  font-size: 14px;
}

.seg button + button {
  border-left: 1px solid var(--line-strong);
}

.seg button[aria-pressed='true'] {
  background: var(--brand);
  color: #fff;
}

.pricing-volume {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pricing-volume input {
  width: 110px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 6px 10px;
}

.pricing-unit {
  color: var(--text-2);
  font-size: 13px;
}

.pricing-summary {
  color: var(--text-2);
  font-size: 13.5px;
  margin: 16px 0 10px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.price-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.price-table--work {
  min-width: 640px;
}

.price-table th,
.price-table td {
  padding: 10px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--line);
}

.price-table thead th {
  border-top: 0;
  background: var(--card);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.price-table tbody tr {
  background: var(--bg-2);
}

.price-table tbody tr:hover {
  background: var(--card);
}

.price-table .model {
  font-family: var(--mono);
  font-size: 12.5px;
  margin-bottom: 4px;
}

.price-table .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.price-table .nowrap,
.price-table .col-region {
  white-space: nowrap;
}

.price-table .col-model {
  min-width: 150px;
}

.price-table .col-list {
  min-width: 120px;
}

.price-table .col-price {
  min-width: 140px;
}

.price-table .col-month {
  white-space: nowrap;
}

.price-table .col-note {
  min-width: 200px;
  color: var(--text-2);
  font-size: 12.5px;
}

.price-main b,
.col-month b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.price-bar {
  height: 4px;
  margin: 6px 0 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.price-bar i {
  display: block;
  height: 100%;
  background: var(--vc);
  border-radius: 2px;
}

.price-sub {
  color: var(--text-3);
  font-size: 12px;
}

.price-promo {
  color: var(--ok);
}

.price-free {
  color: var(--ok);
}

.badge-ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 55%, transparent);
}

.muted {
  color: var(--text-3);
}

.sub-head {
  margin: 32px 0 12px;
  font-size: 18px;
}

.pricing-note {
  color: var(--text-3);
  font-size: 12.5px;
  margin: 14px 0 0;
  max-width: 900px;
}

/* ── Footer & toast ────────────────────────────────────────────────────── */
.footer {
  max-width: 1180px;
  margin: 64px auto 0;
  padding: 24px 16px 48px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12.5px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100vw - 32px);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Narrow screens ────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav {
    display: none;
  }

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

  .live-row {
    grid-template-columns: 1fr 1fr;
  }

  .live-row .field:first-child {
    grid-column: 1 / -1;
  }

  .multi-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .multi-plays {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .brand-text {
    display: none;
  }

  .casting-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .hero {
    padding-top: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .play[data-state='loading'] .icon {
    animation: none;
  }
}
