/* ===== 基础 ===== */
:root {
  --ink: #1a2332;
  --ink-2: #3d4a5f;
  --muted: #7a8699;
  --line: #e3e8ef;
  --bg: #f2f5f9;
  --card: #ffffff;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-soft: #eff4ff;
  --accent: #b45309;
  --green: #15803d;
  --red: #b91c1c;
  --amber: #b45309;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
}
.hidden { display: none !important; }

/* ===== 顶栏 ===== */
.topbar {
  background: linear-gradient(135deg, #16233d 0%, #1e3a6e 100%);
  color: #fff;
  box-shadow: 0 2px 12px rgba(22, 35, 61, .25);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1000px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 12px; opacity: .75; letter-spacing: 1px; }
.nav { display: flex; gap: 6px; }
.nav-btn {
  background: transparent; color: rgba(255,255,255,.8);
  border: none; padding: 8px 18px; border-radius: 8px;
  font-size: 15px; cursor: pointer; transition: all .15s;
}
.nav-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-btn.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }

/* ===== 布局 ===== */
.container { max-width: 1000px; margin: 28px auto 60px; padding: 0 24px; }
.card {
  background: var(--card); border-radius: 14px; padding: 28px 32px;
  box-shadow: 0 1px 3px rgba(22,35,61,.06), 0 8px 24px rgba(22,35,61,.05);
  margin-bottom: 24px;
}
.card-title { font-size: 19px; font-weight: 700; margin-bottom: 18px; }
.card-head-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-head-row .card-title { margin-bottom: 0; }

/* ===== 上传区 ===== */
.dropzone {
  border: 2px dashed #c4cedd; border-radius: 12px;
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: all .2s; background: #fafbfd;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-icon { font-size: 40px; margin-bottom: 10px; }
.dropzone-text { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.dropzone-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.file-selected {
  margin-top: 14px; padding: 12px 16px; border-radius: 10px;
  background: var(--primary-soft); border: 1px solid #cdddfd;
  font-size: 14px; color: var(--primary-dark); font-weight: 600;
}
.form-row { margin-top: 18px; }
.form-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.optional { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.form-row input, .form-row textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 14px; font-size: 14px; font-family: inherit; color: var(--ink);
  transition: border-color .15s; background: #fff;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.1); }

/* ===== 按钮 ===== */
.btn {
  border: none; border-radius: 9px; padding: 9px 18px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #b9c5da; cursor: not-allowed; }
.btn-lg { width: 100%; padding: 13px; font-size: 16px; margin-top: 22px; }
.btn-ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger-ghost { background: #fff; color: var(--red); border: 1px solid #f3d1d1; }
.btn-danger-ghost:hover { background: #fef2f2; border-color: var(--red); }

/* ===== 进度 ===== */
.steps { display: flex; align-items: center; padding: 10px 0 4px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; }
.step-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: #dde4ee; border: 3px solid #dde4ee; transition: all .3s;
}
.step-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.step-line { flex: 1; height: 3px; background: #dde4ee; border-radius: 2px; margin: 0 4px 28px; }
.step.active .step-dot { background: #fff; border-color: var(--primary); animation: pulse 1.2s infinite; }
.step.active .step-label { color: var(--primary); font-weight: 700; }
.step.done .step-dot { background: var(--green); border-color: var(--green); }
.step.done .step-label { color: var(--green); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(29,78,216,.35);} 50% { box-shadow: 0 0 0 7px rgba(29,78,216,0);} }
.progress-message { margin-top: 14px; font-size: 14px; color: var(--muted); }
.progress-message.error { color: var(--red); font-weight: 600; }

/* ===== 历史列表 ===== */
.history-item {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 6px; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background .12s; border-radius: 8px;
}
.history-item:hover { background: #f7f9fc; }
.history-main { flex: 1; min-width: 0; }
.history-title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.badge {
  font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 999px; white-space: nowrap;
}
.badge.completed { background: #e7f6ec; color: var(--green); }
.badge.failed { background: #fdecec; color: var(--red); }
.badge.processing { background: #fff7e8; color: var(--amber); }
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* ===== 报告 ===== */
.detail-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.audio-bar { margin-bottom: 16px; }
.audio-bar audio { width: 100%; height: 42px; }

.report {
  background: #fff; border-radius: 14px; padding: 48px 56px;
  box-shadow: 0 1px 3px rgba(22,35,61,.06), 0 8px 24px rgba(22,35,61,.05);
}
.report-header { border-bottom: 3px solid var(--ink); padding-bottom: 18px; margin-bottom: 26px; }
.report-badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--primary-dark); background: var(--primary-soft);
  padding: 4px 12px; border-radius: 4px; margin-bottom: 12px;
}
.report-title { font-size: 26px; font-weight: 800; line-height: 1.35; }
.report-meta {
  display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 14px;
  font-size: 13px; color: var(--muted);
}
.report-meta b { color: var(--ink-2); font-weight: 600; }

.rpt-section { margin-bottom: 26px; }
.rpt-h {
  font-size: 16.5px; font-weight: 800; color: var(--ink);
  display: flex; align-items: center; gap: 9px; margin-bottom: 12px;
  padding-bottom: 7px; border-bottom: 1px solid var(--line);
}
.rpt-h::before { content: ""; width: 4px; height: 17px; background: var(--primary); border-radius: 2px; }
.rpt-p { font-size: 14.5px; color: var(--ink-2); text-align: justify; }

.rpt-list { list-style: none; }
.rpt-list li {
  position: relative; padding: 5px 0 5px 22px; font-size: 14.5px; color: var(--ink-2);
}
.rpt-list li::before {
  content: ""; position: absolute; left: 4px; top: 14px;
  width: 7px; height: 7px; border-radius: 2px; background: var(--primary); opacity: .55;
}
.rpt-list.risk li::before { background: var(--red); }

.rpt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rpt-table th {
  background: #f4f6fa; text-align: left; padding: 9px 13px;
  font-weight: 700; color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap;
}
.rpt-table td { padding: 9px 13px; border: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.rpt-table tr:nth-child(even) td { background: #fafbfd; }

.topic-item { padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.topic-name { font-weight: 700; font-size: 14.5px; display: flex; justify-content: space-between; gap: 10px; }
.topic-time { font-weight: 400; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.topic-detail { font-size: 14px; color: var(--ink-2); margin-top: 5px; }

.quote-item {
  border-left: 3px solid var(--accent); background: #fffaf3;
  padding: 11px 16px; border-radius: 0 9px 9px 0; margin-bottom: 10px;
}
.quote-text { font-size: 14.5px; color: var(--ink); font-style: italic; }
.quote-note { font-size: 13px; color: var(--muted); margin-top: 5px; }

.sentiment-box { display: flex; gap: 14px; align-items: flex-start; }
.sentiment-tag {
  flex-shrink: 0; background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 700; font-size: 14px; padding: 7px 16px; border-radius: 9px;
}

/* 转写全文 */
.transcript-block { margin-top: 6px; }
.ts-line { display: flex; gap: 12px; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed #eef1f6; }
.ts-time { flex-shrink: 0; color: var(--muted); font-family: "SF Mono", Menlo, monospace; font-size: 12.5px; padding-top: 2px; }
.ts-speaker { flex-shrink: 0; font-weight: 700; font-size: 13px; padding-top: 1px; }
.ts-text { color: var(--ink-2); }
.spk-0 { color: #1d4ed8; } .spk-1 { color: #b45309; } .spk-2 { color: #15803d; }
.spk-3 { color: #9d174d; } .spk-4 { color: #5b21b6; } .spk-5 { color: #0e7490; }

.report-footer {
  margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
}

/* ===== 说明页 · 宣传页 ===== */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #14213d 0%, #1e3a6e 55%, #274b8f 100%);
  border-radius: 18px; padding: 64px 40px 48px; text-align: center; color: #fff;
  box-shadow: 0 16px 44px rgba(20, 33, 61, .30);
}
.hero-glow {
  position: absolute; inset: -40% -20% auto; height: 130%;
  background:
    radial-gradient(600px 300px at 25% 20%, rgba(96,165,250,.22), transparent 65%),
    radial-gradient(500px 280px at 80% 10%, rgba(180,131,9,.18), transparent 65%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero-badge {
  display: inline-block; font-size: 12.5px; letter-spacing: 3px; font-weight: 600;
  color: #bfd3f5; border: 1px solid rgba(191,211,245,.35); border-radius: 999px;
  padding: 6px 18px; margin-bottom: 26px;
}
.hero-title { font-size: 40px; font-weight: 800; line-height: 1.3; letter-spacing: 1px; }
.hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, #7db4ff, #ffd58a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 15.5px; color: #c3d0e8; margin-top: 18px; line-height: 1.9; }
.hero-actions { margin-top: 30px; }
.btn-hero {
  background: linear-gradient(90deg, #3b82f6, #2563eb); color: #fff;
  font-size: 16.5px; font-weight: 700; padding: 14px 42px; border-radius: 12px;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .45);
  transition: transform .15s, box-shadow .15s;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37, 99, 235, .55); }
.hero-stats {
  margin-top: 44px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; justify-content: center; align-items: center; gap: 34px; flex-wrap: wrap;
}
.stat-num { font-size: 30px; font-weight: 800; color: #fff; }
.stat-num span { font-size: 15px; font-weight: 600; margin-left: 2px; color: #a8bbdd; }
.stat-label { font-size: 12.5px; color: #a8bbdd; margin-top: 2px; letter-spacing: 1px; }
.stat-divider { width: 1px; height: 38px; background: rgba(255,255,255,.16); }

.promo-section { margin-top: 46px; }
.promo-head { text-align: center; margin-bottom: 26px; }
.promo-kicker { font-size: 12px; font-weight: 700; letter-spacing: 4px; color: var(--primary); }
.promo-title { font-size: 26px; font-weight: 800; margin-top: 8px; color: var(--ink); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card {
  background: #fff; border-radius: 14px; padding: 26px 24px;
  box-shadow: 0 1px 3px rgba(22,35,61,.06), 0 8px 24px rgba(22,35,61,.05);
  border: 1px solid transparent; transition: transform .18s, border-color .18s, box-shadow .18s;
}
.feature-card:hover {
  transform: translateY(-4px); border-color: #cdddfd;
  box-shadow: 0 4px 8px rgba(22,35,61,.06), 0 16px 36px rgba(29,78,216,.12);
}
.feature-icon {
  width: 50px; height: 50px; border-radius: 13px; font-size: 24px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 15px;
}
.fi-blue { background: #eaf1ff; } .fi-amber { background: #fdf3e3; } .fi-green { background: #e7f6ec; }
.fi-purple { background: #f1ecfd; } .fi-red { background: #fdeceb; } .fi-cyan { background: #e3f6fa; }
.feature-name { font-size: 16px; font-weight: 750; margin-bottom: 7px; }
.feature-desc { font-size: 13.5px; color: var(--muted); line-height: 1.75; }

.flow-grid { display: flex; align-items: stretch; gap: 8px; }
.flow-card {
  flex: 1; background: #fff; border-radius: 14px; padding: 24px 20px;
  box-shadow: 0 1px 3px rgba(22,35,61,.06), 0 8px 24px rgba(22,35,61,.05);
}
.flow-num {
  font-size: 13px; font-weight: 800; color: var(--primary);
  background: var(--primary-soft); display: inline-block;
  padding: 3px 12px; border-radius: 999px; letter-spacing: 2px; margin-bottom: 12px;
}
.flow-name { font-size: 15.5px; font-weight: 750; margin-bottom: 6px; }
.flow-desc { font-size: 13px; color: var(--muted); line-height: 1.75; }
.flow-arrow { align-self: center; color: #b9c5da; font-size: 20px; font-weight: 700; flex-shrink: 0; }

.scene-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.scene-card {
  background: #fff; border-radius: 13px; padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(22,35,61,.06), 0 8px 24px rgba(22,35,61,.05);
  display: flex; align-items: center; gap: 13px; font-size: 15px;
}
.scene-emoji { font-size: 26px; }
.scene-card b { white-space: nowrap; }
.scene-card span:last-child { font-size: 12.5px; color: var(--muted); }

.dims { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 760px; margin: 0 auto; }
.dim {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 22px; font-size: 14px; font-weight: 600; color: var(--ink-2);
  box-shadow: 0 1px 3px rgba(22,35,61,.05); transition: all .15s;
}
.dim:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.faq-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.faq-item {
  background: #fff; border-radius: 13px; padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(22,35,61,.06), 0 8px 24px rgba(22,35,61,.05);
}
.faq-q { font-size: 14.5px; font-weight: 750; margin-bottom: 8px; position: relative; padding-left: 24px; }
.faq-q::before { content: "Q"; position: absolute; left: 0; top: 0; color: var(--primary); font-weight: 800; }
.faq-a { font-size: 13.5px; color: var(--muted); line-height: 1.8; }

.cta-band {
  margin-top: 46px; text-align: center;
  background: linear-gradient(135deg, #16233d, #1e3a6e);
  border-radius: 18px; padding: 46px 30px; color: #fff;
  box-shadow: 0 16px 44px rgba(20, 33, 61, .28);
}
.cta-title { font-size: 24px; font-weight: 800; }
.cta-sub { font-size: 14px; color: #c3d0e8; margin: 10px 0 24px; }

@media (max-width: 820px) {
  .hero-title { font-size: 28px; }
  .feature-grid, .scene-grid { grid-template-columns: 1fr 1fr; }
  .faq-list { grid-template-columns: 1fr; }
  .flow-grid { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); align-self: center; }
}
@media (max-width: 520px) {
  .feature-grid, .scene-grid { grid-template-columns: 1fr; }
  .stat-divider { display: none; }
}

.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 20px 0 34px; }

/* ===== 登录 / 注册 ===== */
.auth-screen {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(150deg, #14213d 0%, #1e3a6e 55%, #274b8f 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto;
}
.auth-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 18px;
  padding: 36px 32px 28px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand .brand-mark {
  margin: 0 auto 12px; width: 56px; height: 56px; font-size: 28px;
  background: linear-gradient(135deg, #1d4ed8, #274b8f); border: none; color: #fff;
}
.auth-brand-name { font-size: 20px; font-weight: 800; color: var(--ink); }
.auth-brand-sub { font-size: 12px; color: var(--muted); letter-spacing: 2px; margin-top: 4px; }
.auth-tabs {
  display: flex; background: #f1f4f9; border-radius: 10px; padding: 4px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; border: none; background: transparent; padding: 9px; border-radius: 8px;
  font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(22,35,61,.12); }
.auth-error {
  margin-top: 14px; padding: 10px 14px; border-radius: 9px;
  background: #fdecec; color: var(--red); font-size: 13.5px; font-weight: 600;
}
.auth-tip { text-align: center; font-size: 12px; color: var(--muted); margin-top: 16px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px; padding: 5px 6px 5px 16px; font-size: 13.5px; color: #fff;
}
.logout-btn {
  border: none; background: rgba(255,255,255,.18); color: #fff;
  font-size: 12.5px; padding: 5px 13px; border-radius: 999px; cursor: pointer;
  font-family: inherit; transition: background .15s;
}
.logout-btn:hover { background: rgba(255,255,255,.3); }

/* ===== A4 打印适配 ===== */
@media print {
  @page { size: A4; margin: 16mm 15mm; }
  body { background: #fff; }
  .no-print, .topbar, .footer, .detail-toolbar, .audio-bar { display: none !important; }
  .container { max-width: none; margin: 0; padding: 0; }
  .view { display: block !important; }
  #view-upload, #view-history, #view-help { display: none !important; }
  .report {
    box-shadow: none; border-radius: 0; padding: 0;
  }
  .report-title { font-size: 22pt; }
  .rpt-section { break-inside: auto; }
  .rpt-h { break-after: avoid; }
  .topic-item, .quote-item, .rpt-list li, .ts-line { break-inside: avoid; }
  .rpt-table tr { break-inside: avoid; }
  .rpt-table th { background: #f4f6fa !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-badge, .quote-item, .sentiment-tag {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  a { text-decoration: none; color: inherit; }
}

/* ===== 手机端适配 ===== */
@media (max-width: 640px) {
  .container { margin: 16px auto 40px; padding: 0 14px; }
  .report { padding: 26px 18px; }
  .card { padding: 20px 18px; }
  .topbar-inner { padding: 10px 14px; justify-content: center; gap: 10px; }
  .brand-sub { display: none; }
  .brand-mark { width: 36px; height: 36px; font-size: 18px; }
  .brand-name { font-size: 16px; }
  .nav { order: 3; width: 100%; justify-content: space-around; }
  .nav-btn { padding: 7px 10px; font-size: 14px; flex: 1; }
  .user-chip { position: absolute; right: 12px; top: 12px; padding: 3px 4px 3px 12px; font-size: 12.5px; }
  .dropzone { padding: 28px 14px; }
  .dropzone-text { font-size: 14.5px; }
  .steps { flex-wrap: nowrap; overflow-x: auto; }
  .step { width: auto; min-width: 64px; }
  .step-label { font-size: 11.5px; }
  .detail-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-actions { justify-content: space-between; }
  .toolbar-actions .btn { flex: 1; padding: 9px 6px; font-size: 13px; }
  .report-title { font-size: 21px; }
  .report-meta { gap: 4px 16px; font-size: 12px; }
  .rpt-table { display: block; overflow-x: auto; white-space: nowrap; }
  .rpt-table td { white-space: normal; min-width: 110px; }
  .ts-line { flex-wrap: wrap; gap: 6px 10px; }
  .history-item { gap: 10px; }
  .auth-card { padding: 28px 22px 22px; }
  .topbar { position: relative; }
}
