/* 港中大紫 #633859 - 浅色/深色严格对调 */
:root,
[data-theme="light"] {
  --c-purple: #633859;
  --c-white: #ffffff;
  --c-black: #2a1f2e;
  --c-gray: #7a6b78;
  --c-soft: #f5eef3;

  --brand: var(--c-purple);
  --surface: var(--c-white);
  --surface-soft: var(--c-soft);
  --text: var(--c-black);
  --text-muted: var(--c-gray);
  --border: var(--c-purple);
  --on-brand: var(--c-white);
  --shadow: 0 4px 20px rgba(99, 56, 89, 0.1);
}

[data-theme="dark"] {
  --c-purple: #633859;
  --c-white: #ffffff;
  --c-black: #2a1f2e;

  --brand: #f6d7ea;
  --surface: #633859;
  --surface-soft: #75496d;
  --text: var(--c-white);
  --text-muted: #f4dceb;
  --border: #e2b7d2;
  --on-brand: #633859;
  --shadow: 0 12px 34px rgba(45, 20, 42, 0.32);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
  background: var(--surface-soft);
}

.app-shell {
  width: min(1100px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 14px 0 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.topbar-brand strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  line-height: 34px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}

.topbar-cluster {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.usage-chip, .user-chip {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--brand);
}

.variant-nav.compact {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.variant-nav.compact a {
  padding: 6px 12px;
  font-size: 12px;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: 999px;
  font-weight: 600;
}

.variant-nav.compact a.active {
  background: var(--brand);
  color: var(--on-brand);
}

.primary-button, .ghost-button, .icon-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-weight: 600;
}

.primary-button {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

.ghost-button:hover { color: var(--brand); }
.primary-button.compact, .ghost-button.small { padding: 5px 10px; font-size: 12px; }
.icon-button, .ghost-button.icon-only { padding: 7px; width: 34px; height: 34px; justify-content: center; }
.icon-button svg, .ghost-button svg { width: 16px; height: 16px; }
.icon-button.recording { opacity: 0.85; outline: 2px solid var(--border); }

.product-main { display: flex; flex-direction: column; align-items: center; }

.hero-card { display: none; }

.platform-title-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 12px 28px 14px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.platform-title-line {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--brand);
}

.platform-subtitle-line {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.18em;
  color: var(--text);
}

.platform-motto { display: none; }

.task-mode-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 12px;
  width: 100%;
  max-width: 560px;
  flex-wrap: wrap;
}

.task-mode-btn {
  flex: 1 1 110px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.task-mode-btn.active {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}

.pay-chip {
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}

.input-with-voice-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 160px;
}

.input-with-voice-row textarea#sourceText {
  flex: 1;
  min-height: 160px;
  border-right: 1px solid var(--border);
}

.voice-btn-prominent {
  flex: 0 0 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: var(--brand);
  color: var(--on-brand);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 12px 8px;
}

.voice-btn-prominent svg { width: 28px; height: 28px; }
.voice-btn-prominent.recording {
  outline: 3px solid var(--border);
  outline-offset: -3px;
  opacity: 0.96;
  animation: voicePulse 0.95s ease-in-out infinite alternate;
}
.voice-btn-prominent:disabled { opacity: 0.45; cursor: not-allowed; }

@keyframes voicePulse {
  from { filter: brightness(1); transform: translateY(0); }
  to { filter: brightness(1.12); transform: translateY(-1px); }
}

.payment-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#paymentModal .auth-card {
  background:
    linear-gradient(160deg, #633859 0%, #774a70 56%, #5a3155 100%);
  border: 1px solid rgba(246, 215, 234, 0.56);
  box-shadow: 0 24px 60px rgba(45, 20, 42, 0.36);
}
#paymentModal .auth-card-header h3 {
  color: #ffe3f2;
  font-size: 22px;
}
#paymentModal .auth-card-header p {
  color: #f9ddec;
  line-height: 1.7;
}
#paymentModal .auth-card-body {
  padding-top: 18px;
}
.payment-qr-wrap {
  align-self: center;
  width: min(100%, 320px);
  text-align: center;
  padding: 14px;
  border: 1px solid rgba(246, 215, 234, 0.55);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}
.payment-qr-wrap img {
  width: min(100%, 248px);
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(99, 56, 89, 0.24);
}
.payment-amount {
  font-weight: 800;
  color: #633859;
  margin: 10px 0 0;
}
.payment-plan-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.payment-plan-card {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 13px 12px;
  border: 1px solid rgba(246, 215, 234, 0.42);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #342033;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.payment-plan-card strong {
  font-size: 16px;
  color: #633859;
}
.payment-plan-card span {
  font-size: 12px;
  line-height: 1.4;
  color: #6f5270;
}
.payment-plan-card.active {
  transform: translateY(-1px);
  border-color: #ffe3f2;
  box-shadow: 0 0 0 3px rgba(246, 215, 234, 0.28), 0 10px 26px rgba(45, 20, 42, 0.18);
  background: #fff6fb;
}
.payment-company-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 10px;
}
.payment-company-fields[hidden] { display: none; }
.contract-box {
  max-height: 160px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid rgba(246, 215, 234, 0.44);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #f9e7f2;
  background: rgba(72, 37, 68, 0.42);
}
.contract-check { font-size: 12px; align-items: flex-start; }
.contract-check input { margin-top: 3px; }

.payment-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.payment-upload-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #f9ddec;
}

.payment-upload-hint.ready {
  color: #ffe3f2;
  font-weight: 600;
}

.payment-upload input[type="file"] {
  display: none;
}

.payment-screenshot-preview {
  display: block;
  max-width: 100%;
  max-height: 200px;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid rgba(246, 215, 234, 0.46);
  object-fit: contain;
  background: #fff;
}

.payment-screenshot-preview[hidden] { display: none; }

@media (min-width: 768px) {
  .input-with-voice-row { min-height: 140px; }
  .input-with-voice-row textarea#sourceText { min-height: 140px; }
}

.hero-kicker {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-card h1 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text);
}

.hero-desc {
  margin: 0 auto;
  max-width: 480px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.guest-hint { display: none; }

.fold-panel {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.fold-trigger {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: inherit;
}

.fold-trigger svg { width: 16px; height: 16px; pointer-events: none; }
.fold-trigger .fold-chevron { margin-left: auto; transition: transform 0.2s; opacity: 0.55; }
.fold-panel.is-open .fold-chevron { transform: rotate(180deg); }
.fold-body { display: none; padding: 4px 16px 16px; }
.fold-panel.is-open .fold-body { display: block; }

.option-grid { display: grid; gap: 0; }

.option-group {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.option-group:last-child {
  border-bottom: 0;
}

.option-grid.compact .option-group { padding: 8px 0; }

.option-group-duo {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-start;
}

.option-duo-item { flex: 1 1 140px; min-width: 0; }

.option-group-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 0;
}

.option-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 6px;
}

.guest-identity-tip {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--brand);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 600;
}

.guest-identity-tip[hidden] { display: none; }

.option-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.identity-strip.compact .chip-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-start;
}

.mode-chip, .language-chip, .industry-chip, .identity-chip, .scene-chip, .tone-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

.mode-chip.active, .language-chip.active, .industry-chip.active, .identity-chip.active, .scene-chip.active, .tone-chip.active {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}

.translator-stack {
  width: 100%;
  max-width: 1100px;
  display: grid;
  gap: 12px;
}

.translator-stack.compare-vertical {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .translator-stack {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .translator-stack.compare-vertical {
    grid-template-columns: 1fr;
  }

  .input-card,
  .output-card {
    display: flex;
    flex-direction: column;
    min-height: 320px;
  }

  .input-card .io-foot {
    margin-top: auto;
  }

  textarea#sourceText {
    flex: 1;
    min-height: 140px;
  }

  .output-card .big-line {
    flex: 1;
    min-height: 140px;
  }
}

.io-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.io-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.io-head-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.io-role {
  font-weight: 700;
  color: var(--brand);
}

.io-sep { color: var(--text-muted); font-weight: 400; }

.io-label { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.io-label.gold { color: var(--brand); font-weight: 700; }
.io-tools { display: flex; gap: 6px; }

textarea#sourceText {
  width: 100%;
  min-height: 160px;
  border: 0;
  resize: vertical;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  outline: none;
  font-family: inherit;
}

textarea#sourceText::placeholder { color: var(--text-muted); opacity: 0.55; }

[data-theme="dark"] textarea#sourceText::placeholder {
  opacity: 0.75;
}

.tone-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.tone-bar-label {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.tone-track {
  display: inline-flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 2px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tone-track::-webkit-scrollbar { display: none; }

.tone-track .tone-chip {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11px;
  background: transparent;
  color: var(--text-muted);
  white-space: nowrap;
}

.tone-track .tone-chip:hover:not(.active) {
  color: var(--brand);
}

.tone-track .tone-chip.active {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 1px 4px rgba(99, 56, 89, 0.18);
}

[data-theme="dark"] .tone-track .tone-chip.active {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.io-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
}

.io-foot-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.char-count { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.voice-hint { font-size: 12px; color: var(--brand); font-weight: 600; }

.contrast-toolbar {
  margin: 0 12px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 6%, var(--surface)) 0%, var(--surface) 100%);
}

.contrast-toolbar.is-running {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 20%, transparent);
}

.contrast-toolbar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.contrast-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed color-mix(in srgb, var(--brand) 22%, var(--border));
}

.contrast-toolbar-actions[hidden] { display: none; }

.contrast-toolbar {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, var(--surface)), var(--surface));
}

.contrast-action {
  min-height: 36px;
  border-width: 2px;
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  color: var(--brand);
}

#continuousContrastBtn {
  min-height: 36px;
  border-width: 2px;
}

.toolbar-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.toolbar-keep { margin-left: auto; }

.seg-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.seg-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.seg-track {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
}

.seg-btn {
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.seg-btn:hover:not(:disabled):not(.active) { color: var(--brand); }

.seg-btn.active {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 1px 4px rgba(99, 56, 89, 0.2);
}

.seg-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.contrast-action i { width: 14px; height: 14px; }

#continuousContrastBtn.active {
  box-shadow: 0 2px 10px rgba(99, 56, 89, 0.22);
}

.batch-panel {
  margin: 0 12px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
  overflow: hidden;
}

.batch-panel-head,
.batch-panel-head--right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border));
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.batch-panel-head--right {
  margin: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border));
}

#continuousRightPanelHead[hidden],
#continuousLeftPanel[hidden],
.batch-panel[hidden] {
  display: none !important;
}

.batch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
}

.batch-badge i { width: 14px; height: 14px; }

.batch-progress {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.batch-list {
  list-style: none;
  margin: 0;
  padding: 10px 12px 12px;
  max-height: min(36vh, 280px);
  overflow-y: auto;
}

.batch-item {
  display: flex;
  gap: 10px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 12%, transparent);
  background: var(--surface);
  margin-bottom: 12px;
  box-shadow: 0 3px 10px rgba(99, 56, 89, 0.05);
}

.batch-item:last-child { margin-bottom: 0; }

.batch-item-num {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--on-brand);
  background: var(--brand);
}

.batch-item-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
}

.batch-item-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  font-weight: 600;
  color: var(--text);
}

.batch-empty {
  padding: 14px 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.input-card--auto textarea#sourceText { min-height: 88px; }

.input-card--auto .batch-panel { flex: 1; min-height: 0; }

.output-card--auto .big-line.continuous-scroll {
  max-height: min(42vh, 340px);
}

.toggle.compact { font-size: 11px; }

.settings-branding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.branding-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.branding-hint.ok { color: #0d7a4a; font-weight: 600; }
.io-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }

.io-actions .contrast-main,
.io-actions .auto-contrast-button {
  border-width: 2px;
  min-height: 38px;
}

.io-actions .contrast-main {
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  color: var(--brand);
}

.io-actions .auto-contrast-button {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; }

.big-line {
  min-height: 140px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-line;
}

.big-line.continuous-scroll,
.continuous-correct-hint.continuous-scroll {
  max-height: min(42vh, 320px);
  overflow-y: auto;
}

.optimization-note {
  margin: 0 14px 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  background: var(--surface);
}
.optimization-note[hidden], .optimization-note:empty { display: none; }

.meta-strip { display: none; }
.manual-fold { width: 100%; max-width: 1100px; margin: 16px auto 0; }
.manual-body ol { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 13px; line-height: 1.75; }

dialog { border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(42, 31, 46, 0.4); }

.settings-modal, .identity-modal, .auth-modal {
  border-radius: 14px;
  max-width: 440px;
  width: calc(100vw - 28px);
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-modal.wide { max-width: 520px; }
.auth-modal.wide .auth-card {
  background: #633859;
  color: #f8f2f7;
  border-radius: 14px;
}
.auth-modal.wide .auth-card-header h3,
.auth-modal.wide .auth-card-header strong {
  color: #f0c7df;
}
.auth-modal.wide .auth-card-header p,
.auth-modal.wide .hint {
  color: #d9c8d7;
}
#paymentModal.auth-modal.wide .auth-card {
  background:
    linear-gradient(160deg, #633859 0%, #774a70 56%, #5a3155 100%);
  color: #fff7fc;
}
#paymentModal.auth-modal.wide .auth-card input,
#paymentModal.auth-modal.wide .auth-card textarea,
#paymentModal.auth-modal.wide .auth-card select {
  background: #fff7fc;
  color: #342033;
  border-color: rgba(246, 215, 234, 0.76);
}
#paymentModal.auth-modal.wide .ghost-button {
  background: rgba(255, 247, 252, 0.92);
  color: #633859;
  border-color: rgba(246, 215, 234, 0.76);
}
#paymentModal.auth-modal.wide .primary-button {
  background: #f6d7ea;
  color: #633859;
  border-color: #f6d7ea;
}
.auth-card-header { padding: 20px 20px 0; text-align: center; }
.auth-card-header h3, .auth-card-header strong { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: var(--brand); }
.auth-card-header p { margin: 0; font-size: 13px; color: var(--text-muted); }
.auth-card-body { padding: 16px 20px; }
.auth-card label { display: grid; gap: 5px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.input-with-voice { display: flex; gap: 6px; }
.input-with-voice input { flex: 1; }

.auth-card input, .auth-card textarea, .auth-card select,
.settings-grid input, .settings-grid select, .identity-picker select, .identity-picker input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  width: 100%;
}

.profile-section { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.profile-section-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--brand); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-grid .wide { grid-column: 1 / -1; }
.profile-choice-panel {
  display: grid;
  gap: 12px;
}
.profile-choice-row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.profile-choice-label {
  display: block;
  margin-bottom: 6px;
  color: #f3d4e6;
  font-size: 13px;
  font-weight: 800;
}
.profile-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.profile-chip {
  border: 1px solid rgba(240, 199, 223, 0.45);
  background: #111c2e;
  color: #f8f2f7;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.profile-chip.active {
  background: #f0c7df;
  color: #3b1f38;
  border-color: #f0c7df;
}
.auth-card-actions { display: flex; gap: 8px; padding: 0 20px 20px; }
.auth-card-actions .primary-button, .auth-card-actions .ghost-button { flex: 1; justify-content: center; min-height: 40px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 20px; }
.settings-grid .wide { grid-column: 1 / -1; }
.settings-grid label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
.settings-head, .settings-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px 0; }
.settings-foot { padding: 10px 20px 16px; }
.identity-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 20px 16px; }
.identity-picker .wide { grid-column: 1 / -1; }
.identity-picker label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }

.hint { color: var(--text-muted); font-size: 13px; min-height: 1.2em; margin: 0 20px 10px; }
.hint.ok { color: var(--text); }

.admin-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }

.status-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid var(--border); color: var(--text-muted); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .profile-grid, .profile-choice-row.two, .settings-grid, .identity-picker { grid-template-columns: 1fr; }
  .io-actions { width: 100%; }
  .payment-plan-grid,
  .payment-company-fields { grid-template-columns: 1fr; }
}

/* ===== 自动对照：当前组大字左侧显示卡 ===== */
.group-left-display {
  margin: 0 12px 12px;
  padding: 18px 16px;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--brand) 28%, var(--border));
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.group-left-display[hidden] { display: none; }

.group-left-display.speaking {
  border-color: #e07a20;
  box-shadow: 0 0 0 3px color-mix(in srgb, #e07a20 18%, transparent);
  animation: speakPulse 1.1s ease-in-out infinite alternate;
}

.group-left-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--brand);
  text-transform: none;
}

.group-left-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-line;
}

/* ===== 自动对照：右侧朗读高亮 ===== */
.big-line.speaking {
  border-color: #e07a20 !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, #e07a20 18%, transparent);
  animation: speakPulse 1.1s ease-in-out infinite alternate;
}

@keyframes speakPulse {
  from { box-shadow: 0 0 0 2px color-mix(in srgb, #e07a20 15%, transparent); }
  to   { box-shadow: 0 0 0 5px color-mix(in srgb, #e07a20 30%, transparent); }
}

/* ===== 自动对照：右侧导航栏 ===== */
.group-nav-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border));
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

.group-nav-bar[hidden] { display: none; }

.group-nav-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--brand);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  transition: background 0.15s, color 0.15s;
  flex: 0 0 auto;
}

.group-nav-btn:hover:not(:disabled) {
  background: var(--brand);
  color: var(--on-brand);
}

.group-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.group-nav-btn svg { width: 16px; height: 16px; }

.group-nav-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}

.group-nav-sep {
  flex: 1;
}

.group-right-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--brand);
  opacity: 0.75;
}

/* ===== 自动对照：可折叠历史面板 ===== */
.batch-history-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  border-radius: 0;
}

.batch-history-toggle:hover {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
}

.history-chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s;
  pointer-events: none;
  flex: 0 0 auto;
}

.batch-panel--left.is-open .history-chevron {
  transform: rotate(180deg);
}

/* ===== 自动模式：隐藏输入框行，显示组显示区 ===== */
.input-card--auto #sourceInputRow {
  display: none;
}

.input-card--auto .tone-bar {
  display: none;
}

.input-card--auto .group-left-display {
  flex: 1;
}

.output-card--auto .big-line {
  flex: 1;
}

/* ===== 自动对照：右侧 big-line 在 auto 模式下保持单组大字风格 ===== */
.output-card--auto .big-line {
  font-size: 17px;
  line-height: 1.8;
  border-left: 0;
}

/* 覆盖旧的 continuousRightPanelHead 和 continuousRightProgress（已由 groupNavBar 取代） */
#continuousRightPanelHead[hidden] { display: none !important; }

/* ==========================================================================
   历史记录页样式 (History page styles)
   ========================================================================== */

.history-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 15px;
}

.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.history-search-group {
  display: flex;
  flex: 1;
  min-width: 280px;
  gap: 10px;
}

.history-search-input {
  flex: 1;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.history-search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.history-filter-select {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.history-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .history-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  }
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.history-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 56, 89, 0.15);
}

.history-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
}

.history-card-time {
  margin-right: auto;
}

.history-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  border: 1px solid var(--border);
}

.history-badge-role {
  background: var(--surface-soft);
  color: var(--text);
}

.history-badge-scene {
  background: var(--surface-soft);
  color: var(--text);
  opacity: 0.85;
}

.history-badge-type {
  background: var(--brand);
  color: var(--on-brand);
  font-size: 10px;
  text-transform: uppercase;
}

.history-badge-type.auto {
  background: var(--surface-soft);
  color: var(--text);
}

.history-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-translation-pair {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item-label {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-text-wrong {
  color: #c0392b;
  font-family: inherit;
  font-size: 14px;
  background: rgba(192, 57, 43, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #c0392b;
  margin: 0;
  white-space: pre-wrap;
}

.history-text-correction {
  color: #27ae60;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  background: rgba(39, 174, 96, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #27ae60;
  margin: 0;
  white-space: pre-wrap;
}

/* Custom coloring depending on variant page (ceo, parent) */
.history-card-ceo {
  border-left: 4px solid #d4af37 !important;
}

.history-card-parent {
  border-left: 4px solid #3498db !important;
}

.history-golden-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
}

.history-golden-title {
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.history-golden-content {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.history-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.history-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 16px;
  text-align: center;
  color: var(--text-muted);
}

.history-empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: var(--border);
  opacity: 0.6;
}

.history-empty-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.history-empty-desc {
  font-size: 14px;
  max-width: 320px;
  line-height: 1.5;
  margin: 0;
}

/* ===== 隐藏属性的全局定义 ===== */
[hidden] {
  display: none !important;
}

/* ===== 自动生成 10 组对比面板 ===== */
.contrast-batch-board {
  width: 100%;
  max-width: 1100px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 16px auto 0;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.contrast-batch-board[hidden] {
  display: none !important;
}

.contrast-batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  border-bottom: 1px solid var(--border);
}

.contrast-batch-head div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contrast-batch-head p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.contrast-pair-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border-bottom: 1px solid var(--border);
}

.contrast-pair-col-head {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  text-align: center;
}

.contrast-pair-col-head:first-child {
  border-right: 1px solid var(--border);
}

.contrast-batch-board.is-vertical .contrast-pair-header {
  grid-template-columns: 1fr;
}

.contrast-batch-board.is-vertical .contrast-pair-col-head:first-child {
  border-right: 0;
  border-bottom: 1px solid var(--border);
}

.contrast-pair-list {
  padding: 20px;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface-soft);
}

.contrast-history-fold {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.contrast-history-fold summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  list-style-position: inside;
  margin-bottom: 12px;
}

.contrast-history-fold[open] {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contrast-pair-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.contrast-batch-board.is-vertical .contrast-pair-row,
.contrast-pair-list.is-vertical .contrast-pair-row {
  grid-template-columns: 1fr;
  gap: 12px;
}

.contrast-pair-row.is-current {
  padding: 6px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 7%, transparent);
}

.contrast-pair-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(99, 56, 89, 0.04);
  transition: all 0.25s ease;
  position: relative;
}

.contrast-pair-card.speaking {
  border-color: #e07a20 !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, #e07a20 18%, transparent);
  animation: speakPulse 1.1s ease-in-out infinite alternate;
}

.contrast-pair-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 500;
  color: var(--text);
  white-space: pre-wrap;
}

.contrast-pair-empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

@media (max-width: 768px) {
  .contrast-pair-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ==========================================================================
   Modern workspace refresh: DeepL-like calm, airy, feature-complete UI
   ========================================================================== */

:root,
[data-theme="light"] {
  --c-purple: #633859;
  --c-ink: #111827;
  --c-muted: #64748b;
  --c-hairline: #dbe3ea;
  --c-page: #f7f9fb;
  --c-panel: #ffffff;
  --c-panel-soft: #f3f7fa;
  --c-accent-soft: #f4edf2;
  --c-focus: #0f766e;

  --brand: var(--c-purple);
  --surface: var(--c-panel);
  --surface-soft: var(--c-page);
  --text: var(--c-ink);
  --text-muted: var(--c-muted);
  --border: var(--c-hairline);
  --on-brand: #ffffff;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --soft-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] {
  --c-ink: #fff7fc;
  --c-muted: #eed0e3;
  --c-hairline: rgba(246, 215, 234, 0.32);
  --c-page: #4f2b49;
  --c-panel: #633859;
  --c-panel-soft: #5a3152;
  --c-accent-soft: rgba(246, 215, 234, 0.13);

  --brand: #f3d7eb;
  --surface: var(--c-panel);
  --surface-soft: var(--c-page);
  --text: var(--c-ink);
  --text-muted: var(--c-muted);
  --border: var(--c-hairline);
  --on-brand: #301629;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --soft-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

html {
  background: var(--surface-soft);
}

body {
  color: var(--text);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 72%, var(--surface-soft)) 0, var(--surface-soft) 230px),
    var(--surface-soft);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  width: min(1240px, calc(100vw - 32px));
  padding: 12px 0 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  align-items: center;
  min-height: 52px;
  margin: 0 -8px 18px;
  padding: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-actions {
  gap: 8px;
  justify-content: center;
}

.topbar-cluster {
  gap: 6px;
}

.usage-chip,
.user-chip,
.pay-chip {
  min-height: 34px;
  padding: 6px 12px;
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: none;
}

.pay-chip {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.variant-nav.compact {
  gap: 2px;
  min-height: 36px;
  padding: 3px;
  border-color: var(--border);
  background: var(--c-panel-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 60%, transparent);
}

.variant-nav.compact a {
  padding: 6px 13px;
  color: var(--text-muted);
  border-radius: 999px;
}

.variant-nav.compact a.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08);
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 36px;
  border-color: var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.primary-button {
  border-color: color-mix(in srgb, var(--brand) 78%, #111827);
  color: var(--on-brand);
  background: var(--brand);
}

.primary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 36%, var(--border));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.ghost-button.icon-only,
.icon-button {
  border-radius: 10px;
}

.product-main {
  align-items: stretch;
}

.platform-title-box {
  width: 100%;
  margin: 2px auto 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.platform-title-line {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 760;
  color: var(--text);
}

.platform-subtitle-line {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-muted);
}

.task-mode-bar {
  justify-content: center;
  max-width: 640px;
  margin-bottom: 14px;
  padding: 4px;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--c-panel-soft);
}

.task-mode-btn {
  flex: 1 1 118px;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.task-mode-btn:hover:not(.active) {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 68%, transparent);
}

.task-mode-btn.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.contrast-toolbar {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 12px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.contrast-toolbar.is-running {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 8%, transparent), var(--soft-shadow);
}

.contrast-toolbar-main {
  gap: 8px;
  padding: 12px 16px 0;
}

.contrast-toolbar-actions {
  margin-top: 9px;
  padding: 9px 16px 14px;
  border-top-color: color-mix(in srgb, var(--border) 72%, transparent);
}

.toolbar-note {
  color: var(--text-muted);
  font-size: 12px;
}

.seg-label,
.tone-bar-label,
.option-label {
  color: var(--text-muted);
  letter-spacing: 0;
}

.seg-track {
  border-color: var(--border);
  background: var(--c-panel-soft);
}

.seg-btn {
  min-height: 28px;
  color: var(--text-muted);
}

.seg-btn.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 7px rgba(15, 23, 42, 0.08);
}

#continuousContrastBtn,
.contrast-action {
  border-width: 1px;
}

.fold-panel {
  max-width: 1100px;
  margin-bottom: 12px;
  border-color: var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.fold-trigger {
  min-height: 48px;
  padding: 12px 16px;
  color: var(--text);
}

.fold-body {
  padding: 0 18px 18px;
}

.option-group {
  border-bottom-color: color-mix(in srgb, var(--border) 72%, transparent);
}

.chip-row {
  gap: 6px;
}

.mode-chip,
.language-chip,
.identity-chip,
.scene-chip,
.tone-chip {
  min-height: 30px;
  border-color: var(--border);
  color: var(--text-muted);
  background: var(--surface);
}

.mode-chip:hover:not(.active),
.language-chip:hover:not(.active),
.identity-chip:hover:not(.active),
.scene-chip:hover:not(.active),
.tone-chip:hover:not(.active) {
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--border));
}

.mode-chip.active,
.language-chip.active,
.identity-chip.active,
.scene-chip.active,
.tone-chip.active {
  color: var(--on-brand);
  background: var(--brand);
  border-color: var(--brand);
}

.translator-stack {
  max-width: 1100px;
  gap: 0;
  align-items: stretch;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

@media (min-width: 768px) {
  .translator-stack {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .translator-stack.compare-vertical {
    grid-template-columns: 1fr;
  }
}

.io-card {
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

@media (min-width: 768px) {
  .translator-stack:not(.compare-vertical) .input-card {
    border-right: 1px solid var(--border);
  }

  .translator-stack.compare-vertical .input-card {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 767px) {
  .input-card {
    border-bottom: 1px solid var(--border);
  }
}

.io-head {
  min-height: 58px;
  padding: 14px 18px;
  border-bottom-color: var(--border);
  background: var(--surface);
}

.io-head-title {
  min-width: 0;
}

.io-role {
  color: var(--text);
}

.io-label,
.io-label.gold {
  color: var(--text-muted);
  font-weight: 700;
}

.io-sep {
  color: var(--border);
}

.input-with-voice-row {
  min-height: 260px;
}

.input-with-voice-row textarea#sourceText {
  border-right-color: var(--border);
}

textarea#sourceText {
  min-height: 260px;
  padding: 22px;
  color: var(--text);
  background: var(--surface);
  font-size: 18px;
  line-height: 1.75;
}

textarea#sourceText::placeholder {
  color: color-mix(in srgb, var(--text-muted) 72%, transparent);
}

.voice-btn-prominent {
  flex-basis: 84px;
  background: var(--c-panel-soft);
  color: var(--brand);
  border-left: 1px solid var(--border);
}

.voice-btn-prominent:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.tone-bar {
  padding: 10px 16px;
  border-top-color: var(--border);
  background: color-mix(in srgb, var(--surface) 84%, var(--c-panel-soft));
}

.tone-track {
  border: 0;
  background: transparent;
}

.tone-track .tone-chip {
  padding: 5px 10px;
  color: var(--text-muted);
}

.tone-track .tone-chip.active {
  color: var(--on-brand);
  background: var(--brand);
  box-shadow: none;
}

.io-foot {
  padding: 14px 18px;
  border-top-color: var(--border);
  background: color-mix(in srgb, var(--surface) 86%, var(--c-panel-soft));
}

.char-count,
.voice-hint,
.toggle {
  color: var(--text-muted);
}

.voice-hint {
  color: var(--brand);
}

.big-line {
  min-height: 260px;
  padding: 22px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.85;
  background: var(--surface);
}

.optimization-note {
  margin: 0 18px 16px;
  border-left-color: color-mix(in srgb, var(--brand) 46%, var(--border));
  border-radius: 8px;
  background: var(--c-panel-soft);
}

.group-nav-bar,
.batch-panel-head,
.batch-panel-head--right,
.batch-history-toggle {
  background: var(--c-panel-soft);
  border-color: var(--border);
}

.group-left-display,
.batch-panel,
.contrast-batch-board {
  border-color: var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.group-left-display {
  margin: 14px 18px;
  padding: 18px;
  background: var(--c-panel-soft);
}

.group-left-tag,
.group-right-tag,
.batch-badge,
.batch-progress,
.group-nav-label,
.contrast-pair-col-head,
.contrast-history-fold summary,
.batch-item-tag {
  color: var(--brand);
}

.output-card--auto .big-line {
  font-size: 18px;
}

.contrast-batch-board {
  max-width: 1100px;
  margin: 14px auto 0;
  overflow: hidden;
}

.contrast-batch-head {
  padding: 16px 20px;
  background: var(--surface);
  border-bottom-color: var(--border);
}

.contrast-batch-head p {
  color: var(--text-muted);
}

.contrast-pair-header {
  background: var(--c-panel-soft);
  border-bottom-color: var(--border);
}

.contrast-pair-col-head:first-child {
  border-right-color: var(--border);
}

.contrast-pair-list {
  padding: 18px;
  background: var(--c-panel-soft);
}

.contrast-pair-row.is-current {
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand) 7%, transparent);
}

.contrast-pair-card,
.batch-item {
  border-color: var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.batch-item-num {
  border-radius: 8px;
  background: var(--brand);
}

.manual-fold {
  margin-top: 14px;
}

.settings-modal,
.identity-modal,
.auth-modal,
.history-toolbar,
.history-card {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card input,
.auth-card textarea,
.auth-card select,
.settings-grid input,
.settings-grid select,
.identity-picker select,
.identity-picker input,
.history-search-input,
.history-filter-select {
  border-color: var(--border);
  background: var(--c-panel-soft);
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 18px, 1240px);
    padding-top: 8px;
  }

  .topbar {
    position: static;
    margin-inline: 0;
  }

  .platform-title-line {
    font-size: 24px;
  }

  .contrast-toolbar-main,
  .contrast-toolbar-actions,
  .io-actions {
    gap: 7px;
  }

  .input-with-voice-row,
  textarea#sourceText,
  .big-line {
    min-height: 210px;
  }
}

@media (max-width: 640px) {
  .task-mode-bar {
    max-width: 100%;
  }

  .task-mode-btn {
    flex-basis: calc(50% - 4px);
  }

  .contrast-toolbar,
  .translator-stack,
  .fold-panel,
  .contrast-batch-board {
    border-radius: 14px;
  }

  .input-with-voice-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .input-with-voice-row textarea#sourceText {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .voice-btn-prominent {
    min-height: 72px;
    flex-basis: auto;
    border-left: 0;
  }

  .io-foot,
  .io-actions {
    align-items: stretch;
  }

  .io-actions > button {
    justify-content: center;
  }
}

/* Keep voice input available without turning it into a visual divider. */
.input-with-voice-row {
  position: relative;
  display: block;
}

.input-with-voice-row textarea#sourceText {
  min-height: 260px;
  padding-right: 118px;
  border-right: 0;
}

.voice-btn-prominent {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 78px;
  min-height: 64px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, var(--c-panel-soft));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.voice-btn-prominent svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 640px) {
  .input-with-voice-row {
    display: block;
  }

  .input-with-voice-row textarea#sourceText {
    padding-right: 22px;
    padding-bottom: 98px;
    border-bottom: 0;
  }

  .voice-btn-prominent {
    right: 18px;
    bottom: 18px;
    width: 88px;
  }
}

/* Final training controls and larger coaching readout. */
.request-button {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.io-tools .ghost-button.compact {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.io-head {
  gap: 10px;
}

.io-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.contrast-toolbar .tone-bar {
  order: 20;
  flex: 1 1 100%;
  padding: 8px 0 0;
  border-top: 1px dashed color-mix(in srgb, var(--border) 78%, transparent);
  background: transparent;
  align-items: flex-start;
}

.contrast-toolbar .tone-track {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
  scrollbar-width: auto;
}

.contrast-toolbar .tone-track .tone-chip {
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.contrast-toolbar .tone-track .tone-chip.active {
  border-color: var(--brand);
  color: var(--on-brand);
  background: var(--brand);
  box-shadow: none;
}

.contrast-toolbar-fold {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, var(--c-panel-soft));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.contrast-toolbar-fold span {
  font-weight: 800;
}

.contrast-toolbar-fold small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.contrast-toolbar-fold i {
  width: 16px;
  height: 16px;
}

.contrast-toolbar-fold .fold-chevron {
  margin-left: auto;
  opacity: 0.6;
}

.contrast-toolbar.is-collapsed .contrast-toolbar-fold {
  border-bottom: 0;
}

.contrast-toolbar.is-collapsed .contrast-toolbar-main,
.contrast-toolbar.is-collapsed .contrast-toolbar-actions {
  display: none !important;
}

.input-with-voice-row,
.input-with-voice-row textarea#sourceText,
textarea#sourceText,
.big-line {
  min-height: 320px;
}

textarea#sourceText,
.big-line {
  font-size: 20px;
  line-height: 1.9;
}

.big-line {
  font-weight: 750;
}

.platform-subtitle-line {
  cursor: pointer;
}

.translator-stack.compare-vertical {
  gap: 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.translator-stack.compare-vertical .io-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.contrast-pair-list {
  gap: 22px;
}

.contrast-pair-row {
  gap: 24px;
}

.contrast-batch-board.is-vertical .contrast-pair-row,
.contrast-pair-list.is-vertical .contrast-pair-row {
  gap: 18px;
}

.contrast-pair-card {
  min-height: 118px;
  padding: 18px;
}

.contrast-pair-card p,
.batch-item-body p {
  font-size: 17px;
  line-height: 1.85;
  font-weight: 650;
}

.batch-item-tag,
.contrast-pair-col-head {
  font-size: 15px;
}

@media (max-width: 900px) {
  .input-with-voice-row,
  .input-with-voice-row textarea#sourceText,
  textarea#sourceText,
  .big-line {
    min-height: 260px;
  }

  textarea#sourceText,
  .big-line {
    font-size: 18px;
  }
}

/* ==========================================================================
   MS1001 brand alignment — title band + four task modes
   ========================================================================== */

html[data-ms1001-chrome="on"] body {
  background: transparent;
}

html[data-ms1001-chrome="on"] .app-shell {
  background: transparent;
  min-height: calc(100vh - var(--ms1001-chrome-pad, 132px));
}

html[data-ms1001-chrome="on"] .product-header-band {
  display: none;
}

html[data-ms1001-chrome="on"] .product-main {
  padding-top: 0;
}

/* 共享顶栏已提供品牌名时，本地只保留模式条，避免首屏重复标题 */
html[data-ms1001-chrome="on"] .task-mode-bar {
  margin-top: 4px;
}

:root,
[data-theme="light"] {
  --brand-purple: #9333ea;
  --brand-fuchsia: #c026d3;
  --brand-orange: #f97316;
  --brand-gold: #e0c16b;
  --brand-gradient: linear-gradient(90deg, #9333ea, #f97316);
  --brand-gradient-soft: linear-gradient(135deg, rgba(255, 244, 223, 0.92), rgba(244, 232, 255, 0.92));
}

.product-header-band.is-slim {
  width: 100%;
  margin: 0 0 10px;
  padding: 10px 14px 8px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.product-header-band.is-slim .platform-title-box {
  margin: 0;
  text-align: left;
}

.product-header-band.is-slim .platform-title-line {
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 750;
  line-height: 1.3;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--text, #1f2937);
}

.product-header-band.is-slim .platform-subtitle-line {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
}

.product-header-band {
  width: 100%;
  margin: 0 0 16px;
  padding: 18px 18px 16px;
  border: 1px solid color-mix(in srgb, var(--brand-orange) 18%, var(--border));
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 244, 223, 0.88), transparent 34%),
    radial-gradient(circle at 88% 0%, rgba(244, 232, 255, 0.82), transparent 32%),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 40px rgba(147, 51, 234, 0.08);
}

.product-header-band .platform-title-box {
  margin: 0 0 14px;
  text-align: center;
}

.product-header-band .platform-title-line {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 40px);
  font-weight: 850;
  line-height: 1.18;
  background: linear-gradient(90deg, #ea580c, #db2777 52%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.product-header-band .platform-subtitle-line {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #64748b;
}

.task-mode-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  max-width: none;
  margin: 0 0 14px;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand-purple) 16%, var(--border));
  background: rgba(255, 255, 255, 0.78);
}

.product-header-band .task-mode-bar {
  max-width: none;
  margin: 0;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand-purple) 16%, var(--border));
  background: rgba(255, 255, 255, 0.72);
}

.task-mode-btn {
  min-height: 42px;
  font-size: 14px;
  font-weight: 750;
}

.product-header-band .task-mode-btn {
  min-height: 44px;
  font-size: 15px;
  font-weight: 800;
}

.task-mode-btn.active[data-task="translate"],
.product-header-band .task-mode-btn.active[data-task="translate"] {
  color: #fff;
  background: linear-gradient(90deg, #c026d3, #9333ea);
  box-shadow: 0 8px 22px rgba(192, 38, 211, 0.22);
}

.task-mode-btn.active[data-task="answer"],
.product-header-band .task-mode-btn.active[data-task="answer"] {
  color: #fff;
  background: linear-gradient(90deg, #f97316, #fb7185);
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.22);
}

.task-mode-btn.active[data-task="hearttalk"],
.product-header-band .task-mode-btn.active[data-task="hearttalk"] {
  color: #fff;
  background: linear-gradient(90deg, #0d9488, #14b8a6);
  box-shadow: 0 8px 22px rgba(13, 148, 136, 0.22);
}

.task-mode-btn.active[data-task="teleprompter"],
.product-header-band .task-mode-btn.active[data-task="teleprompter"] {
  color: #fff;
  background: linear-gradient(90deg, #7c3aed, #6366f1);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.22);
}

.task-mode-btn.active[data-task="model"],
.product-header-band .task-mode-btn.active[data-task="model"] {
  color: #3b1f05;
  background: linear-gradient(90deg, #fde68a, #e0c16b);
  box-shadow: 0 8px 22px rgba(224, 193, 107, 0.24);
}

.secondary-tools {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.secondary-tools .contrast-toolbar {
  margin: 0;
}

.fold-hint {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #6b7280);
}

.io-more {
  position: relative;
}

.io-more > summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted, #6b7280);
  padding: 6px 8px;
  border-radius: 8px;
  user-select: none;
}

.io-more > summary::-webkit-details-marker { display: none; }

.io-more[open] > summary {
  color: var(--text, #1f2937);
  background: rgba(0, 0, 0, 0.04);
}

.io-more-body {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.input-card .tone-bar {
  margin: 8px 0 0;
  padding: 6px 0 2px;
  border-top: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
}

.input-card .tone-bar-label {
  font-size: 12px;
  opacity: 0.8;
}

.input-card .tone-track {
  gap: 4px;
}

.input-card .tone-chip {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}

.io-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.io-actions .primary-button {
  min-width: 132px;
}

.hearttalk-board {
  display: grid;
  gap: 12px;
}

.hearttalk-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: rgba(255, 255, 255, 0.72);
}

.hearttalk-card.soft {
  border-color: color-mix(in srgb, #0d9488 28%, var(--border));
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.08), rgba(255, 255, 255, 0.78));
}

.hearttalk-card.hard {
  border-color: color-mix(in srgb, #e11d48 24%, var(--border));
  background: linear-gradient(180deg, rgba(225, 29, 72, 0.07), rgba(255, 255, 255, 0.78));
}

.hearttalk-card header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.hearttalk-badge {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hearttalk-card.soft .hearttalk-badge { color: #0f766e; }
.hearttalk-card.hard .hearttalk-badge { color: #be123c; }

.hearttalk-card header small {
  color: var(--muted, #6b7280);
  font-size: 12px;
}

.hearttalk-card p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 15px;
}

.hearttalk-empty {
  color: var(--muted, #6b7280);
  line-height: 1.6;
}

body.is-hearttalk-mode #continuousContrastBtn,
body.is-hearttalk-mode #continuousToolbarPauseBtn,
body.is-hearttalk-mode #contrastBatchBoard,
body.is-hearttalk-mode #continuousLeftPanel,
body.is-hearttalk-mode #groupNavBar,
body.is-hearttalk-mode #groupLeftDisplay,
body.is-hearttalk-mode .contrast-toolbar,
body.is-hearttalk-mode .contrast-auto-actions,
body.is-hearttalk-mode .auto-module-note {
  display: none !important;
}

body.is-hearttalk-mode .translator-stack {
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 320px;
}

body.is-hearttalk-mode .workbench-panel.is-hearttalk-panel {
  padding-top: 10px;
}

.hearttalk-context {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.hearttalk-slogan {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
  color: var(--text);
}
.hearttalk-slogan small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.ht-ctx-grid {
  display: grid;
  gap: 10px;
}
.ht-ctx-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.ht-chip {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ht-chip.active {
  color: var(--on-brand, #fff);
  background: var(--brand, #633859);
  border-color: transparent;
}
.ht-want-reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.hearttalk-board {
  display: grid;
  gap: 10px;
}
.hearttalk-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ht-view-tab {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ht-view-tab.active {
  color: var(--text);
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
}
.hearttalk-card.risk,
.hearttalk-card.unknown {
  border-color: color-mix(in srgb, #f59e0b 35%, var(--border));
}
.hearttalk-card.ask {
  border-color: color-mix(in srgb, #0ea5e9 35%, var(--border));
}
.hearttalk-card.reply {
  border-color: color-mix(in srgb, #6366f1 35%, var(--border));
}
.hearttalk-card.surface,
.hearttalk-card.original {
  border-color: color-mix(in srgb, #94a3b8 35%, var(--border));
}
.hearttalk-card.risk .hearttalk-badge,
.hearttalk-card.unknown .hearttalk-badge { color: #b45309; }
.hearttalk-card.ask .hearttalk-badge { color: #0284c7; }
.hearttalk-card.reply .hearttalk-badge { color: #4f46e5; }
.hearttalk-card.surface .hearttalk-badge,
.hearttalk-card.original .hearttalk-badge { color: #64748b; }
.hearttalk-disclaimer {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.hearttalk-board[data-ht-view="surface"] .hearttalk-card:not([data-ht-card="surface"]),
.hearttalk-board[data-ht-view="soft"] .hearttalk-card:not([data-ht-card="soft"]),
.hearttalk-board[data-ht-view="hard"] .hearttalk-card:not([data-ht-card="hard"]),
.hearttalk-board[data-ht-view="unknown"] .hearttalk-card:not([data-ht-card="unknown"]),
.hearttalk-board[data-ht-view="ask"] .hearttalk-card:not([data-ht-card="ask"]),
.hearttalk-board[data-ht-view="reply"] .hearttalk-card:not([data-ht-card="reply"]),
.hearttalk-board[data-ht-view="risk"] .hearttalk-card:not([data-ht-card="unknown"]) {
  display: none;
}

html[data-theme="dark"] .hearttalk-card,
html[data-surfaceTheme="dark"] .hearttalk-card {
  background: color-mix(in srgb, #2a1428 55%, transparent);
  border-color: color-mix(in srgb, var(--border) 90%, transparent);
}

html[data-theme="dark"] .hearttalk-card.soft .hearttalk-badge,
html[data-surfaceTheme="dark"] .hearttalk-card.soft .hearttalk-badge {
  color: #5eead4;
}

html[data-theme="dark"] .hearttalk-card.hard .hearttalk-badge,
html[data-surfaceTheme="dark"] .hearttalk-card.hard .hearttalk-badge {
  color: #fda4af;
}

html[data-theme="dark"] .hearttalk-card.risk .hearttalk-badge,
html[data-theme="dark"] .hearttalk-card.unknown .hearttalk-badge,
html[data-surfaceTheme="dark"] .hearttalk-card.risk .hearttalk-badge,
html[data-surfaceTheme="dark"] .hearttalk-card.unknown .hearttalk-badge {
  color: #fcd34d;
}

html[data-theme="dark"] .hearttalk-card.ask .hearttalk-badge,
html[data-surfaceTheme="dark"] .hearttalk-card.ask .hearttalk-badge {
  color: #7dd3fc;
}

html[data-theme="dark"] .hearttalk-card.reply .hearttalk-badge,
html[data-surfaceTheme="dark"] .hearttalk-card.reply .hearttalk-badge {
  color: #c4b5fd;
}

html[data-theme="dark"] .hearttalk-empty,
html[data-surfaceTheme="dark"] .hearttalk-empty {
  color: var(--text-muted);
}

.product-header-band .task-mode-btn.active[data-task="model"] {
  color: #3b1f05;
  background: linear-gradient(90deg, #fde68a, #e0c16b);
  box-shadow: 0 8px 22px rgba(224, 193, 107, 0.24);
}

.primary-button,
#continuousContrastBtn.primary-button {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #fff;
}

.primary-button:hover,
#continuousContrastBtn.primary-button:hover {
  filter: brightness(1.03);
}

.contrast-toolbar,
.workspace-card,
.fold-panel,
.history-card {
  border-color: color-mix(in srgb, var(--brand-purple) 12%, var(--border));
}

@media (max-width: 760px) {
  .product-header-band {
    padding: 10px 12px;
  }

  .task-mode-bar,
  .product-header-band .task-mode-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .task-mode-btn,
  .product-header-band .task-mode-btn {
    min-height: 40px;
    font-size: 13px;
  }
}

/* unify-chrome-shell */
html[data-ms1001-chrome="on"] .topbar {
  display: none !important;
}
html[data-ms1001-chrome="on"] .variant-nav {
  display: none !important;
}
html[data-ms1001-chrome="on"] .product-header-band {
  display: none !important;
}

/* chrome 浅/深 → 本站紫色深色 */
html[data-surfaceTheme="dark"] {
  --c-purple: #633859;
  --c-ink: #fff7fc;
  --c-muted: #eed0e3;
  --c-hairline: rgba(246, 215, 234, 0.32);
  --c-page: #4f2b49;
  --c-panel: #633859;
  --c-panel-soft: #5a3152;
  --c-accent-soft: rgba(246, 215, 234, 0.13);
  --brand: #f3d7eb;
  --surface: var(--c-panel);
  --surface-soft: var(--c-page);
  --text: var(--c-ink);
  --text-muted: var(--c-muted);
  --border: var(--c-hairline);
  --on-brand: #301629;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --soft-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.account-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}
.account-strip .pay-chip {
  margin-left: auto;
  font-weight: 780;
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
}
.account-strip .usage-chip {
  font-weight: 700;
}

/* intro-and-options-order */
.intro-shell {
  width: min(1120px, calc(100vw - 24px));
  padding-top: 8px;
}
.intro-main {
  max-width: none;
  margin: 0;
  padding: 0 0 48px;
}
.intro-cover {
  position: relative;
  min-height: min(58vh, 520px);
  overflow: hidden;
  border-radius: 18px;
  color: #fff7fc;
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, rgba(240, 193, 75, 0.2), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 22%, rgba(255, 255, 255, 0.1), transparent 50%),
    linear-gradient(145deg, #2a1428 0%, #633859 48%, #4a2a45 100%);
}
.intro-cover-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, rgba(26, 10, 24, 0.5) 100%),
    repeating-linear-gradient(-12deg, transparent 0 14px, rgba(255,255,255,0.02) 14px 15px);
  pointer-events: none;
}
.intro-cover-inner {
  position: relative;
  z-index: 1;
  padding: clamp(36px, 6vw, 64px) clamp(22px, 4vw, 40px);
}
.intro-brand {
  margin: 0 0 10px;
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 860;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.intro-kicker {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.14em;
  color: #f0c14b;
}
.intro-cover h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.35;
  font-weight: 750;
  color: #fff7fc;
}
.intro-lead {
  margin: 14px 0 0;
  max-width: 42rem;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 247, 252, 0.86);
}
.intro-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.intro-cover .intro-ghost {
  color: #fff7fc;
  border-color: rgba(255, 247, 252, 0.35);
  background: transparent;
}
.intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.intro-card {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
.intro-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 780;
}
.intro-card p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}
.intro-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.intro-note p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}
.secondary-tools {
  margin: 0 0 12px;
}
@media (max-width: 760px) {
  .intro-grid { grid-template-columns: 1fr; }
  .account-strip .pay-chip { margin-left: 0; }
}

/* ========== Workbench UI v2：统一宽幅 + 紫色深色整页 ========== */
html[data-ms1001-chrome="on"][data-theme="dark"] body::before,
html[data-ms1001-chrome="on"][data-surfaceTheme="dark"] body::before {
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, rgba(240, 193, 75, 0.12), transparent 50%),
    linear-gradient(180deg, #2a1428 0%, #3a2236 40%, #2f1a2d 100%) !important;
}

html[data-theme="dark"],
html[data-surfaceTheme="dark"] {
  --c-purple: #633859;
  --c-page: #3a2236;
  --c-panel: #4f314a;
  --c-panel-soft: #5a3854;
  --c-ink: #fff7fc;
  --c-muted: #efd4e6;
  --c-hairline: rgba(246, 215, 234, 0.26);
  --brand: #f6d7ea;
  --surface: var(--c-panel);
  --surface-soft: var(--c-page);
  --text: var(--c-ink);
  --text-muted: var(--c-muted);
  --border: var(--c-hairline);
  --on-brand: #301629;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  --soft-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  color-scheme: dark;
}

html[data-theme="dark"] body,
html[data-surfaceTheme="dark"] body,
html[data-theme="dark"] html,
html[data-surfaceTheme="dark"] {
  background: var(--c-page) !important;
  color: var(--text);
}

html[data-theme="dark"] .app-shell,
html[data-surfaceTheme="dark"] .app-shell {
  background: transparent;
}

.workbench {
  width: 100%;
  display: grid;
  gap: 12px;
}

.workbench-chrome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.workbench-chrome .task-mode-bar {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.workbench-chrome .task-mode-btn {
  min-height: 40px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 750;
  color: var(--text-muted);
  background: transparent;
  border: 0;
}

.workbench-chrome .task-mode-btn:hover:not(.active) {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.workbench-chrome .task-mode-btn.active {
  color: #fff;
}

.account-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  white-space: nowrap;
}

.account-inline .usage-chip {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.account-inline .pay-chip {
  margin: 0;
  font-weight: 780;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #f0c14b 55%, transparent);
  background: color-mix(in srgb, #f0c14b 18%, transparent);
  color: var(--text);
}

.account-inline--solo {
  margin: 0 0 12px auto;
  width: fit-content;
}

/* 旧版满宽额度条：若残留则压成紧凑 */
.account-strip {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.workbench-panel {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: var(--soft-shadow);
}

.workbench-panel .secondary-tools,
.workbench-panel .contrast-toolbar,
.workbench-panel .fold-panel,
.workbench-panel .translator-stack,
.workbench-panel .manual-fold {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.workbench-panel .secondary-tools {
  display: grid;
  gap: 8px;
}

.workbench-panel .contrast-toolbar,
.workbench-panel .fold-panel {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 96%, #000 4%);
  box-shadow: none;
  overflow: hidden;
}

.workbench-panel .contrast-toolbar-fold,
.workbench-panel .fold-trigger {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.workbench-panel .contrast-toolbar-fold small,
.workbench-panel .fold-trigger .fold-hint,
.workbench-panel .fold-trigger small {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.workbench-panel .translator-stack {
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 98%, #000 2%);
  box-shadow: none;
}

html[data-theme="dark"] .workbench-panel .io-card,
html[data-surfaceTheme="dark"] .workbench-panel .io-card {
  background: transparent;
}

html[data-theme="dark"] textarea,
html[data-surfaceTheme="dark"] textarea,
html[data-theme="dark"] #rewritten,
html[data-surfaceTheme="dark"] #rewritten {
  color: var(--text);
  background: color-mix(in srgb, #2a1428 55%, transparent);
}

html[data-theme="dark"] .task-mode-btn:not(.active),
html[data-surfaceTheme="dark"] .task-mode-btn:not(.active) {
  color: rgba(255, 247, 252, 0.78);
}

html[data-theme="light"] .workbench-panel {
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .workbench-chrome .task-mode-bar,
html[data-theme="light"] .account-inline {
  background: rgba(255, 255, 255, 0.88);
}

@media (max-width: 860px) {
  .workbench-chrome {
    grid-template-columns: 1fr;
  }
  .account-inline {
    justify-content: space-between;
    width: 100%;
  }
  .workbench-chrome .task-mode-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .workbench-chrome .task-mode-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

