/* ============================================
   VoiceGate · 声学实验室 × 暗色未来主义
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
  /* 色彩系统 */
  --bg-deep: oklch(0.13 0.008 75);        /* 深炭黑底 */
  --bg-card: oklch(0.17 0.01 75);         /* 卡片底 */
  --bg-card-hover: oklch(0.20 0.012 75);
  --bg-glass: oklch(0.17 0.01 75 / 0.7);  /* 玻璃质感 */

  --accent: oklch(0.78 0.14 65);          /* 暖琥珀主色 */
  --accent-bright: oklch(0.85 0.16 65);
  --accent-dim: oklch(0.55 0.10 65);
  --accent-glow: oklch(0.78 0.14 65 / 0.3);

  --cyan: oklch(0.72 0.10 200);           /* 冷青辅助 */
  --cyan-dim: oklch(0.55 0.08 200);

  --text-primary: oklch(0.95 0.01 75);
  --text-secondary: oklch(0.72 0.015 75);
  --text-muted: oklch(0.50 0.01 75);

  --border: oklch(0.28 0.015 75 / 0.6);
  --border-bright: oklch(0.40 0.02 75);

  --error: oklch(0.65 0.18 25);
  --success: oklch(0.70 0.15 145);

  /* 字体 */
  --font-display: 'Fraunces', 'Noto Serif SC', Georgia, serif;
  --font-mono: 'Geist Mono', 'SF Mono', 'Cascadia Code', 'Roboto Mono', monospace;
  --font-cn: 'Noto Serif SC', 'Fraunces', serif;

  /* 尺寸 */
  --max-width: 1200px;
  --radius: 6px;
  --radius-lg: 12px;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 噪点纹理叠加层 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' /%3E%3C/svg%3E");
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select {
  font-family: inherit;
  color: inherit;
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 32px;
  background: oklch(0.13 0.008 75 / 0.7);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.navbar-version {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.navbar-logo::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: pulse-logo 3s ease-in-out infinite;
}

@keyframes pulse-logo {
  0%, 100% { opacity: 1; transform: rotate(0deg); }
  50% { opacity: 0.6; transform: rotate(180deg); }
}

.navbar-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.navbar-link {
  text-decoration: none;
  transition: color 0.2s;
}

.navbar-link:hover {
  color: var(--accent);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar-feedback {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.navbar-feedback:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ---------- Hero 区 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 80px 32px 40px;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 32px;
  opacity: 0;
  animation: fade-up 0.8s 0.2s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 144px);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  color: var(--text-primary);
  opacity: 0;
  animation: fade-up 1s 0.4s forwards;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  position: relative;
}

.hero-subtitle {
  font-family: var(--font-cn);
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  margin-bottom: 48px;
  letter-spacing: 0.05em;
  opacity: 0;
  animation: fade-up 0.8s 0.6s forwards;
}

.hero-subtitle .sep {
  display: inline-block;
  margin: 0 12px;
  color: var(--accent-dim);
}

.hero-cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  opacity: 0;
  animation: fade-up 0.8s 0.8s forwards;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: oklch(0.15 0.01 75);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -8px var(--accent-glow), inset 0 1px 0 oklch(0.95 0.05 65 / 0.3);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--accent-bright), 0 12px 32px -8px var(--accent-glow), inset 0 1px 0 oklch(0.95 0.05 65 / 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ---------- 通用 section ---------- */
.section {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 32px;
}

.section-header {
  margin-bottom: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.section-title-group {
  flex: 1;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-title em {
  font-style: italic;
  color: var(--accent);
}

.section-desc {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 400px;
  line-height: 1.6;
}

/* ---------- 上传区 ---------- */
.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.upload-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

.upload-zone {
  border: 1.5px dashed var(--border-bright);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-zone.dragover {
  transform: scale(1.01);
}

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-icon {
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.upload-icon::before {
  content: '';
  width: 16px;
  height: 16px;
  border-top: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
  transform: rotate(-45deg);
  margin-top: 4px;
}

.upload-icon::after {
  content: '';
  position: absolute;
  width: 1.5px;
  height: 20px;
  background: var(--accent);
  top: 14px;
}

.upload-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.upload-text strong {
  color: var(--accent);
  font-weight: 500;
}

.upload-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 录音功能 */
.upload-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.upload-divider::before,
.upload-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 60px;
}

.record-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 999px;
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.record-btn:hover {
  background: var(--accent);
  color: var(--bg);
}
.record-btn.recording {
  background: oklch(0.62 0.22 25);
  border-color: oklch(0.62 0.22 25);
  color: #fff;
}
.record-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.record-btn.recording .record-dot {
  animation: record-pulse 1.2s ease-in-out infinite;
}
@keyframes record-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* 文件预览 */
.file-preview {
  display: none;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

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

.preview-info {
  flex: 1;
  min-width: 0;
}

.preview-filename {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-filesize {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.preview-play {
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.preview-play::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 10px solid var(--accent);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 3px;
}

.preview-play.playing::before {
  border-left: none;
  width: 10px;
  height: 12px;
  border-left: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
  margin-left: 0;
}

.preview-play:hover {
  background: var(--accent-glow);
}

.preview-reset {
  padding: 6px 14px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: all 0.2s;
}
.preview-reset:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.preview-waveform {
  height: 60px;
  background: oklch(0.15 0.01 75);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  align-items: center;
  position: relative;
}

.waveform-svg {
  width: 100%;
  height: 100%;
}

.waveform-loading {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  width: 100%;
}

.preview-duration {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
}

/* 语言选择 */
.lang-config {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: end;
  margin-top: 24px;
}

.lang-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lang-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.lang-select {
  background: oklch(0.15 0.01 75);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f59e0b' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: border-color 0.2s;
}

.lang-select:hover, .lang-select:focus {
  border-color: var(--accent);
  outline: none;
}

/* 开始按钮 */
.start-section {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.btn-start {
  padding: 16px 48px;
  font-size: 14px;
}

/* ---------- 进度区 ---------- */
.progress-section {
  display: none;
}

.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
}

.progress-stages {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  position: relative;
}

.progress-stages::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.progress-track {
  position: absolute;
  top: 16px;
  left: 10%;
  height: 1px;
  background: var(--accent);
  z-index: 1;
  transition: width 0.5s ease;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
  flex: 1;
}

.stage-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 1.5px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.3s;
}

.stage.active .stage-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-deep);
  box-shadow: 0 0 0 4px var(--accent-glow);
  animation: pulse-stage 2s ease-in-out infinite;
}

.stage.completed .stage-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg-deep);
}

.stage.completed .stage-dot::after {
  content: '✓';
  font-size: 14px;
}

@keyframes pulse-stage {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-glow); }
  50% { box-shadow:  0 0 0 8px oklch(0.78 0.14 65 / 0.1); }
}

.stage-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stage.active .stage-label,
.stage.completed .stage-label {
  color: var(--accent);
}

.progress-status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 24px;
  letter-spacing: 0.05em;
}

.progress-timer {
  font-family: var(--font-mono);
  font-size: 28px;
  color: var(--accent);
  font-weight: 300;
  margin-top: 16px;
  letter-spacing: 0.1em;
}

.error-text {
  color: var(--error);
}

/* ---------- 结果区 ---------- */
.result-section {
  display: none;
}

.result-empty {
  display: none;
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.result-content {
  display: none;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

/* 字幕对照 */
.subtitle-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.subtitle-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subtitle-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 400;
}

.subtitle-actions {
  display: flex;
  gap: 8px;
}

.subtitle-action-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s;
}
.subtitle-action-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}
.subtitle-action-btn.primary {
  border-color: var(--accent);
  color: var(--accent);
}
.subtitle-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.subtitle-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
}

.subtitle-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.subtitle-container::-webkit-scrollbar {
  width: 6px;
}

.subtitle-container::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 3px;
}

.subtitle-row {
  display: grid;
  grid-template-columns: 100px 1fr 24px 1fr;
  gap: 16px;
  padding: 12px 24px;
  align-items: start;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 2px solid transparent;
}

.subtitle-row:hover {
  background: oklch(0.20 0.012 75 / 0.5);
}

.subtitle-row.active {
  background: var(--accent-glow);
  border-left-color: var(--accent);
}

.subtitle-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding-top: 2px;
}

.subtitle-source {
  font-family: var(--font-cn);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.subtitle-arrow {
  color: var(--accent-dim);
  font-size: 14px;
  padding-top: 2px;
  text-align: center;
}

.subtitle-target {
  font-family: var(--font-cn);
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}

.subtitle-row.active .subtitle-target {
  color: var(--accent);
}

/* 行内字幕编辑模式 */
.subtitle-row.editing {
  cursor: default;
  align-items: stretch;
  border-left-color: transparent;
}
.subtitle-row.editing:hover,
.subtitle-row.editing.active {
  background: transparent;
  border-left-color: transparent;
}
.subtitle-row.editing .subtitle-source,
.subtitle-row.editing .subtitle-target {
  padding: 0;
}
.subtitle-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: oklch(0.13 0.008 75);
  color: var(--text-primary);
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.5;
  padding: 6px 10px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.subtitle-input:focus {
  border-color: var(--accent);
}

.subtitle-empty {
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
}

/* 音频播放器 */
.audio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.audio-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.audio-tab {
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.audio-tab:hover {
  color: var(--text-secondary);
}

.audio-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.audio-panel {
  display: flex;
  align-items: center;
  gap: 16px;
}

.audio-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 4px 16px -4px var(--accent-glow);
}

.audio-play::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 14px solid var(--bg-deep);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  margin-left: 4px;
}

.audio-play.playing::before {
  border-left: none;
  width: 12px;
  height: 16px;
  border-left: 4px solid var(--bg-deep);
  border-right: 4px solid var(--bg-deep);
  margin-left: 0;
}

.audio-play:hover {
  transform: scale(1.05);
  background: var(--accent-bright);
}

.audio-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-progress-bar {
  height: 4px;
  background: oklch(0.15 0.01 75);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.audio-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  width: 0;
  transition: width 0.1s linear;
  border-radius: 2px;
}

.audio-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* 下载区 */
.download-card-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.download-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.download-title {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 400;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.download-card {
  background: oklch(0.15 0.01 75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-card:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-1px);
}

.download-card:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.download-icon {
  width: 24px;
  height: 24px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  position: relative;
}

.download-icon-doc::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 4px 0 var(--accent), 0 8px 0 var(--accent);
}

.download-icon-audio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.download-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
}

.download-ext {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.download-all-wrap {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ---------- 历史记录 ---------- */
.history-section {
  padding-bottom: 120px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-empty {
  display: none;
  text-align: center;
  padding: 64px 32px;
  color: var(--text-muted);
}

.history-empty-icon {
  font-family: var(--font-mono);
  font-size: 32px;
  color: var(--accent-dim);
  margin-bottom: 12px;
  letter-spacing: 0.3em;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s;
}

.history-card:hover {
  border-color: var(--border-bright);
  background: var(--bg-card-hover);
}

.history-main {
  flex: 1;
  min-width: 0;
}

.history-filename {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lang-pair {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-success {
  background: oklch(0.70 0.15 145 / 0.15);
  color: var(--success);
}

.status-failed {
  background: oklch(0.65 0.18 25 / 0.15);
  color: var(--error);
}

.status-running {
  background: var(--accent-glow);
  color: var(--accent);
}

.history-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.history-btn {
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  border-radius: 4px;
  border: 1px solid var(--border-bright);
  transition: all 0.2s;
}

.view-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.delete-btn:hover {
  border-color: var(--error);
  color: var(--error);
  background: oklch(0.65 0.18 25 / 0.1);
}

.clear-history-wrap {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  min-width: 200px;
  max-width: 360px;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--error);
}

.toast-info {
  border-left: 3px solid var(--accent);
}

/* ---------- 动画 ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 技术能力说明区 ---------- */
.features-section {
  padding-top: 40px;
  padding-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-index {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
  opacity: 0.8;
}

.feature-title {
  font-family: var(--font-cn);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.feature-desc {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* 卡片底部装饰波形 */
.feature-wave {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.feature-wave span {
  flex: 1;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.5;
  animation: feature-wave-anim 2.4s ease-in-out infinite;
}

.feature-wave span:nth-child(1) { animation-delay: 0s;    height: 40%; }
.feature-wave span:nth-child(2) { animation-delay: 0.2s;  height: 75%; }
.feature-wave span:nth-child(3) { animation-delay: 0.4s;  height: 100%; }
.feature-wave span:nth-child(4) { animation-delay: 0.6s;  height: 60%; }
.feature-wave span:nth-child(5) { animation-delay: 0.8s;  height: 35%; }

@keyframes feature-wave-anim {
  0%, 100% { opacity: 0.4; transform: scaleY(0.7); }
  50% { opacity: 0.9; transform: scaleY(1.1); }
}

.feature-card:hover .feature-wave span {
  opacity: 0.9;
}

/* 底部引擎背书链接 */
.features-footer {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--border);
}

.features-footer-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.features-footer-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: all 0.2s;
  border-bottom: 1px solid transparent;
}

.features-footer-link:hover {
  color: var(--accent-bright);
  border-bottom-color: var(--accent);
}

/* 演示视频链接 */
.features-demo-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.features-demo-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.05em;
  padding: 8px 18px;
  border: 1px solid var(--cyan-dim);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.features-demo-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.features-cta-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .navbar {
    padding: 12px 16px;
  }

  .navbar-logo {
    font-size: 17px;
  }

  .navbar-version {
    font-size: 10px;
  }

  .navbar-actions {
    gap: 10px;
  }

  .navbar-feedback {
    padding: 5px 10px;
    font-size: 11px;
  }

  .navbar-meta {
    font-size: 10px;
    letter-spacing: 0.05em;
  }

  .section {
    padding: 60px 20px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .lang-config {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .subtitle-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 16px;
  }

  .subtitle-time {
    order: -1;
  }

  .subtitle-arrow {
    display: none;
  }

  .download-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .history-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .history-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 80px 20px 40px;
  }

  /* 极小屏隐藏作者署名，只保留 logo + 问题反馈，避免挤压 */
  .navbar-meta {
    display: none;
  }

  /* 移动端隐藏「专业模式」和「API 设置」按钮（屏幕空间不足，功能非核心） */
  .navbar-mode-btn,
  .navbar-api-btn {
    display: none;
  }

  .navbar-actions {
    gap: 0;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .progress-stages {
    flex-direction: column;
    gap: 24px;
  }

  .progress-stages::before,
  .progress-track {
    display: none;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   专业模式（Pro Mode）
   ============================================ */

/* 模式切换按钮 */
.navbar-mode-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.navbar-mode-btn:hover {
  background: var(--accent-glow);
}
body[data-mode="pro"] .navbar-mode-btn {
  background: var(--accent);
  color: var(--bg-deep);
}

/* 专业模式页面 */
.pro-page {
  position: relative;
  z-index: 2;
}

/* Pro 卡片通用 */
.pro-upload-srt-card,
.pro-translate-card,
.pro-separate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
}

/* 试听区 */
.pro-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
}
.pro-preview-audios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}
@media (max-width: 768px) {
  .pro-preview-audios {
    grid-template-columns: 1fr;
  }
}

.pro-card-title {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.pro-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.pro-srt-name {
  display: inline-block;
  margin-left: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--success);
}

.pro-path-hint {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 8px 12px;
  background: oklch(0.15 0.008 75);
  border-radius: var(--radius);
  border-left: 2px solid var(--accent);
}

/* 分离结果下载按钮 */
.pro-sep-downloads {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 11px;
  align-self: flex-start;
}

/* 专业模式 section 间距 */
#pro-page .section {
  padding-top: 60px;
  padding-bottom: 60px;
}

#pro-page .section:first-child {
  padding-top: 100px;
}

@media (max-width: 768px) {
  .navbar-mode-btn {
    padding: 4px 10px;
    font-size: 11px;
  }
}

/* ==================== API 设置按钮 + 弹层 ==================== */

.navbar-api-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border: 1px solid var(--cyan-dim, oklch(0.72 0.10 200 / 0.4));
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.navbar-api-btn:hover {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}
/* 渠道 B 激活时按钮高亮 */
.navbar-api-btn.is-custom {
  background: var(--cyan);
  color: var(--bg-deep);
  border-color: var(--cyan);
}

.api-config-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: vb-fade-in 0.2s ease;
}

.api-config-modal {
  background: var(--bg-card);
  border: 1px solid oklch(0.3 0.01 75);
  border-radius: 12px;
  width: 92%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.api-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid oklch(0.25 0.01 75);
}
.api-config-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}
.api-config-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}
.api-config-close:hover {
  color: var(--accent);
}

.api-config-body {
  padding: 20px 22px;
}

.api-channel-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid oklch(0.25 0.01 75);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
}
.api-channel-option:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.api-channel-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}
.api-channel-info {
  flex: 1;
}
.api-channel-name {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}
.api-channel-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.api-key-input-wrap {
  margin-top: 14px;
  display: none;
}
.api-key-input-wrap.is-visible {
  display: block;
}
.api-key-field {
  position: relative;
}
.api-key-input {
  width: 100%;
  padding: 10px 44px 10px 12px;  /* 右侧留出眼睛按钮空间 */
  background: var(--bg-deep);
  border: 1px solid oklch(0.3 0.01 75);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  /* 等宽字体下星号与字符等宽，letter-spacing 为 0 保证对齐 */
  letter-spacing: 0;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.api-key-input:focus {
  border-color: var(--accent);
}
.api-key-input::placeholder {
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.api-key-eye {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s;
}
.api-key-eye:hover {
  color: var(--accent);
}
/* 默认显示睁眼图标，隐藏状态显示闭眼图标 */
.api-key-eye .eye-closed { display: none; }
.api-key-eye.is-hidden .eye-open { display: none; }
.api-key-eye.is-hidden .eye-closed { display: block; }
.api-key-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}
.api-key-guide-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 0.03em;
  margin-top: 10px;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid oklch(0.72 0.10 200 / 0.4);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.api-key-guide-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.api-key-guide-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.5;
}

.api-config-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid oklch(0.25 0.01 75);
}

@keyframes vb-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .navbar-api-btn {
    padding: 4px 10px;
    font-size: 11px;
  }
  .api-config-modal {
    width: 96%;
  }
  .api-config-header,
  .api-config-body,
  .api-config-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}
