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

/* ══════════════════════════════════
   DARK (default)
══════════════════════════════════ */
:root {
  --teal:       #40c4d0;
  --teal-dark:  #2ca8b3;
  --blue-dark:  #7eb3f5;
  --bg-light:   #0d0f1c;
  --bg-pale:    #141728;
  --white:      #1a1e35;
  --text:       #dde2f5;
  --muted:      #7880a0;
  --placeholder: #363a58;
  --border:     #1e2242;
  --shadow-card: 0 2px 8px rgba(0,0,0,.6), 0 8px 32px rgba(64,196,208,.12);
  --shadow-sm:   0 2px 12px rgba(0,0,0,.4);
  --shadow-form: 0 4px 20px rgba(0,0,0,.5);
  --navbar-bg:   rgba(13, 15, 28, 0.88);
  --footer-bg:   #080c1a;
  --footer-border: rgba(255,255,255,.05);
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 14px;
}

/* ══════════════════════════════════
   LIGHT OVERRIDES
══════════════════════════════════ */
[data-theme="light"] {
  --blue-dark:  #2556d3;
  --bg-light:   #f8faff;
  --bg-pale:    #eff4fe;
  --white:      #ffffff;
  --text:       #1b1e2a;
  --muted:      #6b7288;
  --placeholder: #b0b6c8;
  --border:     #e1e7f7;
  --shadow-card: 0 2px 8px rgba(0,0,0,.04), 0 8px 32px rgba(37,86,211,.12);
  --shadow-sm:   0 2px 12px rgba(0,0,0,.07);
  --shadow-form: 0 4px 20px rgba(0,0,0,.06);
  --navbar-bg:   rgba(248, 250, 255, 0.92);
  --footer-bg:   #111a33;
  --footer-border: rgba(255,255,255,.07);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 17px;
  color: var(--text);
  background: var(--bg-light);
  line-height: 1.6;
  transition: background .3s, color .3s;
}

/* ══════════════════════════════════
   KEYFRAMES
══════════════════════════════════ */
@keyframes sec-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 4px 2px rgba(64,196,208,.5); opacity: 1; }
  50%       { box-shadow: 0 0 10px 4px rgba(64,196,208,.95); opacity: .7; }
}

@keyframes electric-flow {
  0%   { left: -8px; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { left: calc(100% + 4px); opacity: 0; }
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
@keyframes blink-cursor { 0%,100%{opacity:1} 50%{opacity:0} }

/* ══════════════════════════════════
   SCROLL SNAP
══════════════════════════════════ */
#hero, #product, #gallery, #agents, #analyze, #pdf-section {
  scroll-margin-top: 68px;
  min-height: calc(100dvh - 68px);
  position: relative; z-index: 1;
}

#page-veil {
  position: fixed;
  inset: 68px 0 0;
  background: var(--bg-light);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s ease;
}
#page-veil.visible { opacity: 1; pointer-events: all; }

section.snap-in { animation: sec-enter 1.1s ease forwards; }

/* ══════════════════════════════════
   NAVBAR
══════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; padding: 0 100px;
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background .3s, border-color .3s;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; cursor: pointer; flex-shrink: 0;
}
.logo-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; }
.logo-icon svg { width: 36px; height: 36px; }
.logo-name { font-size: 20px; font-weight: 700; color: var(--text); white-space: nowrap; }

.nav-links { display: flex; gap: 36px; }
.nav-links a {
  font-size: 16px; font-weight: 500; color: var(--muted);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--teal); }

.nav-login-btn {
  font-size: 15px; font-weight: 600; color: var(--teal);
  border: 1.5px solid var(--teal); border-radius: 8px;
  padding: 7px 20px; cursor: pointer; white-space: nowrap;
  text-decoration: none; transition: background .18s, color .18s;
  background: transparent;
}
.nav-login-btn:hover { background: rgba(64,196,208,.1); }

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

/* Theme toggle button */
.theme-toggle {
  width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s, background .2s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--teal); border-color: var(--teal); }
.theme-toggle svg { width: 16px; height: 16px; }

/* Show sun in dark mode, moon in light mode */
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }

.lang-switcher {
  display: flex; gap: 2px;
  background: var(--bg-pale); border-radius: 20px; padding: 4px; flex-shrink: 0;
  transition: background .3s;
}
.lang-btn {
  padding: 5px 12px; border-radius: 16px;
  border: none; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all .18s;
}
.lang-btn.active { background: var(--white); color: var(--teal); box-shadow: 0 1px 4px rgba(0,0,0,.15); }

/* ══════════════════════════════════
   EYEBROW — shared component
══════════════════════════════════ */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(64,196,208,.08);
  border: 1px solid rgba(64,196,208,.22);
  border-radius: 100px; padding: 6px 16px;
  align-self: flex-start;
}
.eyebrow span:last-child { font-size: 13px; font-weight: 500; color: var(--blue-dark); }

.eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal); flex-shrink: 0;
  animation: glow-pulse 2.4s ease-in-out infinite;
}

/* Section-level eyebrow (centered, slightly larger) */
.sec-eyebrow {
  align-self: center;
  padding: 7px 18px;
}
.sec-eyebrow span:last-child { font-size: 13px; }

/* ══════════════════════════════════
   HERO
══════════════════════════════════ */
#hero {
  display: flex; align-items: center; justify-content: center;
  gap: 72px;
  padding: 80px 120px 96px;
  background: var(--bg-light);
  position: relative; overflow: hidden;
}
#hero::after {
  content: '';
  position: absolute; right: 8%; top: 50%;
  transform: translateY(-50%);
  width: 560px; height: 560px;
  background: radial-gradient(ellipse, rgba(64,196,208,.06) 0%, transparent 70%);
  pointer-events: none;
}
[data-theme="light"] #hero::after {
  background: radial-gradient(ellipse, rgba(64,196,208,.04) 0%, transparent 70%);
}

.hero-left {
  flex: 0 0 540px;
  display: flex; flex-direction: column; gap: 30px;
  position: relative; z-index: 1;
}

.hero-title {
  font-size: 70px; font-weight: 700; color: var(--text);
  line-height: 1.15; letter-spacing: -1.5px;
}
.hero-sub    { font-size: 18px; color: var(--muted); line-height: 1.6; white-space: nowrap; }
.hero-sub-en { font-size: 18px; color: var(--muted); line-height: 1.7; }

.hero-btns { display: flex; gap: 16px; align-items: center; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); color: #fff; border: none;
  border-radius: 10px; padding: 16px 34px;
  font-size: 18px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 20px rgba(64,196,208,.3);
  transition: background .2s, transform .15s, box-shadow .2s;
  white-space: nowrap; text-decoration: none;
}
.btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(64,196,208,.4);
}

/* Hero report card */
.hero-right {
  flex: 0 0 640px;
  position: relative; z-index: 1;
}
.report-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 14px;
  height: 540px;
  box-shadow: var(--shadow-card);
  transition: background .3s, border-color .3s;
}
.report-card-hd {
  display: flex; align-items: center; justify-content: space-between; height: 24px;
  flex-shrink: 0;
}
.report-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.pdf-badge {
  background: rgba(64,196,208,.12); color: var(--teal);
  font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: 5px; letter-spacing: .5px;
}

/* Scrolling report preview */
.report-preview-scroll {
  background: var(--bg-pale);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0;
  transition: background .3s, border-color .3s;
}
.report-preview-scroll::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 52px;
  background: linear-gradient(to bottom, transparent, var(--bg-pale));
  pointer-events: none; z-index: 2;
  transition: background .3s;
}

.report-scroll-track {
  display: flex; flex-direction: column; gap: 0;
  will-change: transform;
}

/* Report section elements */
.rs-page-header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.rs-page-title { font-size: 12px; font-weight: 700; color: var(--text); }
.rs-page-date  { font-size: 9px; color: var(--muted); }

.rs-section { display: flex; flex-direction: column; gap: 5px; padding: 6px 0; }
.rs-section-hd {
  font-size: 9px; font-weight: 700; color: var(--teal);
  letter-spacing: .8px; text-transform: uppercase; margin-bottom: 4px;
}
.rs-row { display: flex; align-items: flex-start; gap: 6px; }
.rs-dot  { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.rs-strength    { background: #40c4d0; }
.rs-weakness    { background: #ef4444; }
.rs-opportunity { background: #49bf8a; }
.rs-threat      { background: #df7f37; }
.rs-text { font-size: 10px; color: var(--muted); line-height: 1.5; }

.rs-price-row { display: flex; align-items: center; gap: 7px; height: 16px; }
.rs-price-name { font-size: 9px; font-weight: 700; width: 60px; flex-shrink: 0; }
.rs-price-bar-wrap { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.rs-price-bar { height: 100%; border-radius: 3px; }
.rs-price-val { font-size: 9px; color: var(--muted); width: 48px; text-align: right; flex-shrink: 0; }

.rs-sentiment-row { display: flex; align-items: center; gap: 7px; height: 18px; }
.rs-s-name { font-size: 9px; font-weight: 700; width: 50px; flex-shrink: 0; }
.rs-s-bar-wrap { flex: 1; height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; }
.rs-s-bar { height: 100%; border-radius: 4px; }
.rs-s-pct { font-size: 9px; color: var(--muted); width: 28px; text-align: right; flex-shrink: 0; }

.rs-divider { height: 1px; background: var(--border); margin: 6px 0; }
.rs-spacer  { height: 20px; }

.report-scroll-track .mini-chart { display: flex; align-items: flex-end; gap: 5px; }
.report-scroll-track .bar-grp { display: flex; gap: 2px; align-items: flex-end; }
.report-scroll-track .bar { border-radius: 2px; width: 16px; }
.report-scroll-track .summary-line { height: 6px; border-radius: 2px; background: var(--border); margin-bottom: 5px; }
.report-scroll-track .summary-lines { display: flex; flex-direction: column; }

/* Chip row inside scroll track */
.rs-chip-row { display: flex; gap: 7px; margin-bottom: 8px; }
.chip { padding: 3px 9px; border-radius: 5px; font-size: 11px; font-weight: 500; }
.chip-teal   { background: rgba(64,196,208,.15);  color: var(--teal); }
.chip-green  { background: rgba(73,191,138,.15);  color: #49bf8a; }
.chip-orange { background: rgba(223,127,55,.15);  color: #df7f37; }

/* Report footer */
.report-footer {
  background: var(--bg-pale);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
  transition: background .3s, border-color .3s;
}
.report-filename { font-size: 12px; font-weight: 500; color: var(--muted); }
.btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); color: #fff; border: none;
  border-radius: 6px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.btn-sm:hover { background: var(--teal-dark); }
.btn-demo { cursor: default; pointer-events: none; opacity: .8; }

.required-star { color: #ef4444; margin-left: 3px; font-weight: 700; }
.optional-tag {
  margin-left: 6px; font-size: 11px; font-weight: 500;
  color: var(--muted); background: var(--border);
  padding: 1px 6px; border-radius: 4px; vertical-align: middle;
}

/* ══════════════════════════════════
   PRODUCT INTRO
══════════════════════════════════ */
#product {
  background: var(--bg-pale);
  padding: 88px 100px 96px;
  display: flex; flex-direction: column; gap: 48px;
  align-items: center; justify-content: center;
  transition: background .3s;
}
.sec-title { font-size: 42px; font-weight: 700; color: var(--text); text-align: center; letter-spacing: -.5px; }
.sec-sub   { font-size: 18px; color: var(--muted); text-align: center; line-height: 1.6; max-width: 780px; }

.step-cards { display: flex; gap: 28px; width: 100%; max-width: 1200px; }
.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 38px;
  display: flex; flex-direction: column; gap: 18px;
  flex: 1;
  transition: border-color .2s, box-shadow .2s, background .3s;
}
.step-card:hover {
  border-color: rgba(64,196,208,.3);
  box-shadow: 0 4px 24px rgba(64,196,208,.08);
}
.step-num {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--teal); color: #fff;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-card h3 { font-size: 22px; font-weight: 600; color: var(--text); }
.step-card p  { font-size: 16px; color: var(--muted); line-height: 1.7; }

/* ══════════════════════════════════
   AGENTS
══════════════════════════════════ */
#agents {
  background: var(--bg-light);
  padding: 88px 100px 96px;
  display: flex; flex-direction: column; gap: 48px;
  align-items: center; justify-content: center;
  transition: background .3s;
}

.agent-flow { display: flex; align-items: center; max-width: 1380px; }

.agent-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 34px 28px;
  width: 282px; min-height: 248px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, transform .2s, background .3s;
}
.agent-card:hover { border-color: rgba(64,196,208,.25); transform: translateY(-3px); }

.agent-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  animation: glow-pulse 2.4s ease-in-out infinite;
}

.agent-name { font-size: 18px; font-weight: 700; color: var(--text); }
.agent-role {
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; align-self: flex-start;
}
.agent-desc { font-size: 15px; color: var(--muted); line-height: 1.8; }

/* Electric flow connector */
.agent-sep {
  width: 52px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.agent-sep-line {
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--border), rgba(64,196,208,.25), var(--border));
  border-radius: 1px;
  position: relative;
}
.agent-sep-line::before {
  content: '';
  position: absolute;
  top: 50%; left: -8px;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px 3px rgba(64,196,208,.8);
  animation: electric-flow 2.4s ease-in-out infinite;
}

/* Staggered electric particles */
.agent-flow > :nth-child(2) .agent-sep-line::before { animation-delay: 0s; }
.agent-flow > :nth-child(4) .agent-sep-line::before { animation-delay: .8s; }
.agent-flow > :nth-child(6) .agent-sep-line::before { animation-delay: 1.6s; }

/* Stagger agent-dot glow so they don't all pulse together */
.agent-flow .agent-card:nth-child(1) .agent-dot { animation-delay: 0s; }
.agent-flow .agent-card:nth-child(3) .agent-dot { animation-delay: .6s; }
.agent-flow .agent-card:nth-child(5) .agent-dot { animation-delay: 1.2s; }
.agent-flow .agent-card:nth-child(7) .agent-dot { animation-delay: 1.8s; }

/* ══════════════════════════════════
   ANALYZE SECTION
══════════════════════════════════ */
#analyze {
  background: var(--bg-pale);
  padding: 96px 80px;
  display: flex; gap: 68px; align-items: center; justify-content: center;
  transition: background .3s;
}

.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  display: flex; flex-direction: column; gap: 24px;
  width: 600px; flex-shrink: 0;
  box-shadow: var(--shadow-form);
  transition: background .3s, border-color .3s;
}
.form-card-title { font-size: 26px; font-weight: 700; color: var(--text); }
.form-group { display: flex; flex-direction: column; gap: 10px; }
.form-label { font-size: 15px; font-weight: 500; color: var(--text); }

.form-input, .form-textarea {
  width: 100%; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-pale);
  padding: 13px 16px; font-size: 15px; color: var(--text);
  font-family: inherit; outline: none;
  transition: border-color .2s, box-shadow .2s, background .3s;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(64,196,208,.12);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-select {
  width: 100%; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-pale);
  padding: 13px 40px 13px 16px; font-size: 15px; color: var(--text);
  font-family: inherit; outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  transition: border-color .2s, box-shadow .2s, background-color .3s;
}
.form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(64,196,208,.12); }
::placeholder { color: var(--placeholder); }

.upload-area {
  background: var(--bg-pale); border: 1.5px dashed var(--border);
  border-radius: 8px; padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .2s, background .2s;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--teal); background: rgba(64,196,208,.05);
}
.upload-icon-wrap {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(64,196,208,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--teal); font-weight: 700;
}
.upload-main-text { font-size: 14px; font-weight: 500; color: var(--text); }
.upload-sub-text  { font-size: 12px; color: var(--muted); }

.file-info {
  display: none; align-items: center; gap: 10px;
  background: var(--bg-pale); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
}
.file-info.show { display: flex; }
.file-name { font-size: 13px; font-weight: 500; flex: 1; word-break: break-all; color: var(--text); }
.file-remove { background: none; border: none; font-size: 14px; color: var(--muted); cursor: pointer; padding: 2px 4px; }
.file-remove:hover { color: #ef4444; }
#file-input { display: none; }

.submit-btn {
  width: 100%; height: 56px; border: none; border-radius: 10px;
  background: var(--teal); color: #fff;
  font-size: 18px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 20px rgba(64,196,208,.3);
  transition: background .2s, transform .15s, box-shadow .2s;
}
.submit-btn:hover:not(:disabled) {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(64,196,208,.4);
}
.submit-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Stream panel — always dark (terminal aesthetic) */
.stream-panel {
  width: 660px; height: 580px; flex-shrink: 0;
  background: #080a16; border: 1px solid #151828;
  border-radius: var(--radius-lg);
  padding: 20px 24px 24px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
}
.stream-hd { display: flex; align-items: center; justify-content: space-between; height: 20px; }
.term-dots { display: flex; gap: 8px; }
.term-dot  { width: 12px; height: 12px; border-radius: 50%; }
.stream-title { font-size: 13px; font-weight: 500; color: #9999b2; margin-left: 14px; }
.stream-timer {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px; font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.5px;
  background: rgba(64,196,208,.1);
  border-radius: 4px;
  padding: 1px 6px;
}

.think-badge {
  display: none; align-items: center; gap: 8px;
  background: rgba(64,196,208,.12); border-radius: 6px;
  padding: 6px 10px; align-self: flex-start;
}
.think-badge.show { display: flex; }
.think-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: blink 1s infinite; }
.think-text { font-size: 12px; font-weight: 500; color: var(--teal); }

.log-body {
  flex: 1; overflow-y: auto;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 13px; line-height: 1.5;
  scrollbar-width: thin; scrollbar-color: #1e2235 transparent;
  display: flex; flex-direction: column; gap: 12px;
}
.log-body::-webkit-scrollbar { width: 4px; }
.log-body::-webkit-scrollbar-thumb { background: #1e2235; border-radius: 2px; }
/* Bug fix: 固定宽度不足时 agent 标签文字会覆盖消息；改为白不换行后自动撑宽 */
.log-line { display: flex; gap: 10px; margin-bottom: 5px; align-items: baseline; }
.log-ts    { color: #4a4e6a; font-size: 11px; min-width: 42px; flex-shrink: 0; line-height: 1.5; padding-top: 1px; }
.log-agent { white-space: nowrap; flex-shrink: 0; padding-right: 4px; }
.log-msg   { word-break: break-word; line-height: 1.5; min-width: 0; }
.log-bright { color: #dbdbeb; }
.log-dim    { color: #808099; }

.log-hint {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(64,196,208,.06); border: 1px solid rgba(64,196,208,.15);
  border-radius: 8px; padding: 12px 14px;
  font-family: 'Inter', sans-serif; font-size: 12px;
  color: #8890b0; line-height: 1.7;
}
.log-hint-icon { flex-shrink: 0; margin-top: 1px; }
.log-hint p { margin: 0; }

.log-preview {
  display: flex; flex-direction: column; gap: 0;
  border-radius: 8px; overflow: hidden;
  border: 1px solid #151828;
}
.log-preview-label {
  font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600;
  color: #2a2e48; text-align: center; letter-spacing: 1px;
  padding: 6px 0; background: #070910;
  border-bottom: 1px solid #151828;
}
.preview-line { padding: 3px 12px; margin-bottom: 0; transition: background .15s; }
.preview-line:hover { background: rgba(255,255,255,.02); }
.preview-line:last-child { padding-bottom: 10px; }

.cursor-blink {
  display: inline-block; color: #40c4d0;
  animation: blink-cursor .9s step-end infinite; margin-left: 2px;
}

.progress-bg   { height: 5px; background: #13162a; border-radius: 3px; }
.progress-fill { height: 5px; background: var(--teal); border-radius: 3px; width: 0; transition: width .4s; }
.progress-text { font-size: 12px; color: #9999b2; }

/* ══════════════════════════════════
   PDF / REPORT SECTION
══════════════════════════════════ */
#pdf-section {
  background: var(--bg-light);
  padding: 56px 80px 72px;
  display: flex; flex-direction: column; gap: 32px;
  align-items: center; justify-content: flex-start;
  transition: background .3s;
}
#pdf-section h2 { font-size: 34px; font-weight: 700; color: var(--text); text-align: center; }

/* Two-column workspace */
.report-workspace {
  display: flex; gap: 36px; align-items: flex-start;
  width: 100%; max-width: 1440px;
}

.workspace-left {
  flex: 1; min-width: 460px;
  display: flex; flex-direction: column; gap: 18px;
}

.workspace-right {
  flex: 1; min-width: 0; max-width: 620px;
}

/* Stream panel in this context fills the left column */
#pdf-section .stream-panel {
  width: 100%;
  height: 430px;
}

/* PDF viewer fills right column */
#pdf-section .pdf-viewer {
  width: 100%;
}

.pdf-viewer {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 16px;
  padding: 24px 32px;
  width: 100%; max-width: 100%;
  box-shadow: var(--shadow-card);
  transition: background .3s, border-color .3s;
}
.pdf-toolbar {
  background: var(--bg-pale); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 18px; height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  transition: background .3s;
}
.pdf-fname { font-size: 14px; font-weight: 500; color: var(--text); }
.pdf-actions { display: flex; align-items: center; gap: 12px; }
.pdf-page-info { font-size: 14px; color: var(--muted); }
/* Bug fix: 高度改为视口自适应，不强制 A4 纸张高度，用户在 iframe 内滚动即可 */
.pdf-content {
  background: var(--bg-pale); border: 1px solid var(--border);
  border-radius: 8px;
  height: 58vh; min-height: 360px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: background .3s;
}
.pdf-content iframe { width: 100%; height: 100%; border: none; display: block; }
.pdf-empty { text-align: center; color: var(--muted); }
.pdf-empty svg { width: 56px; height: 56px; margin-bottom: 12px; opacity: .2; }

/* Chart dashboard */
.chart-dashboard {
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 28px;
  padding: 24px 28px;
  align-items: start;
}
.chart-panel { display: flex; flex-direction: column; gap: 10px; }
.chart-panel-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .8px; text-transform: uppercase;
}
.radar-wrap { position: relative; }
.radar-wrap svg { display: block; }
.radar-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.radar-legend span {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted); font-weight: 500;
}
.radar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.bar-h-item { display: flex; align-items: center; gap: 10px; height: 28px; }
.bar-h-label { font-size: 11px; font-weight: 600; width: 80px; flex-shrink: 0; color: var(--text); }
.bar-h-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bar-h-fill  { height: 100%; border-radius: 4px; width: 0; }
.bar-h-val   { font-size: 11px; color: var(--muted); width: 56px; text-align: right; flex-shrink: 0; }

.sentiment-row { display: flex; gap: 24px; align-items: center; margin-top: 8px; }
.sentiment-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sentiment-arc-wrap { position: relative; width: 72px; height: 72px; }
.sentiment-arc-wrap svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.sentiment-arc-bg { fill: none; stroke: var(--border); stroke-width: 5; }
.sentiment-arc-fill {
  fill: none; stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 175.9;
  stroke-dashoffset: 175.9;
}
.sentiment-pct {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px; font-weight: 700; color: var(--text);
}
.sentiment-name { font-size: 11px; font-weight: 600; color: var(--muted); }
.chart-divider { height: 1px; background: var(--border); margin: 12px 0 4px; }

/* ══════════════════════════════════
   INTERACTION BOXES (phase1 + Q&A)
══════════════════════════════════ */
.interaction-box {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: background .3s, border-color .3s;
}
.interaction-box.show {
  display: flex; flex-direction: column; gap: 12px;
}

.interaction-box-hd {
  display: flex; align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.interaction-box-title {
  font-size: 13px; font-weight: 700; color: var(--text);
}

.interaction-summary {
  font-size: 13px; color: var(--text); line-height: 1.8;
  max-height: 110px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.interaction-summary::-webkit-scrollbar { width: 3px; }
.interaction-summary::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.interaction-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-pale);
  padding: 9px 12px;
  font-size: 13px; color: var(--text);
  font-family: inherit; outline: none; resize: vertical;
  transition: border-color .2s, box-shadow .2s, background .3s;
}
.interaction-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(64,196,208,.12);
}
.interaction-input::placeholder { color: var(--placeholder); }

.interaction-footer { display: flex; flex-direction: column; gap: 8px; }
.interaction-actions {
  display: flex; gap: 8px; justify-content: flex-end; align-items: center;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px; font-weight: 500; cursor: pointer;
  padding: 6px 12px;
  transition: border-color .2s, color .2s, background .2s;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); background: rgba(64,196,208,.05); }

/* Q&A message list */
.qa-messages {
  max-height: 160px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.qa-messages::-webkit-scrollbar { width: 3px; }
.qa-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.qa-hint-text {
  font-size: 12px; color: var(--muted); line-height: 1.6; font-style: italic;
}

.qa-msg {
  border-radius: 8px; padding: 8px 12px;
  font-size: 13px; line-height: 1.6; max-width: 92%;
}
.qa-msg.user {
  background: rgba(64,196,208,.12); color: var(--text);
  align-self: flex-end; border-bottom-right-radius: 3px;
}
.qa-msg.agent {
  background: var(--bg-pale); color: var(--text);
  border: 1px solid var(--border);
  align-self: flex-start; border-bottom-left-radius: 3px;
}

/* ══════════════════════════════════
   FOOTER
══════════════════════════════════ */
footer {
  scroll-margin-top: 68px;
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  padding: 48px 80px;
  display: flex; flex-direction: column; gap: 24px; align-items: center;
  transition: background .3s;
}
.footer-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  width: 1280px; max-width: 100%;
}
.footer-brand h3 { font-size: 18px; font-weight: 700; color: #e8eaf6; margin-bottom: 8px; }
.footer-brand p  { font-size: 13px; color: #6070a0; }
.footer-cols { display: flex; gap: 48px; }
.footer-col h4 { font-size: 13px; font-weight: 600; color: #8898c0; margin-bottom: 10px; }
.footer-col a  {
  display: block; font-size: 13px; color: #4d5f88;
  text-decoration: none; margin-bottom: 8px; transition: color .2s;
}
.footer-col a:hover { color: var(--teal); }
.footer-copy { font-size: 12px; color: #344060; }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 1440px) {
  .navbar   { padding: 0 60px; }
  #hero     { padding: 64px 60px; gap: 48px; }
  .hero-left { flex: 0 0 460px; }
  .hero-right { flex: 0 0 540px; }
  #product, #gallery, #agents, #analyze, #pdf-section { padding: 72px 60px; }
  footer    { padding: 48px 60px; }
}
@media (max-width: 1100px) {
  .navbar   { padding: 0 32px; }
  #hero     { padding: 56px 32px; gap: 32px; }
  .hero-left { flex: 0 0 380px; }
  .hero-right { flex: 0 0 420px; }
  #product, #gallery, #agents, #analyze, #pdf-section { padding: 56px 32px; }
  footer    { padding: 40px 32px; }
}
@media (max-width: 960px) {
  #hero { flex-direction: column; align-items: flex-start; }
  .hero-left, .hero-right { flex: none; width: 100%; }
  .hero-title { font-size: 46px; }
  .step-cards { flex-direction: column; max-width: 100%; }
  .agent-flow { flex-wrap: wrap; gap: 16px; }
  .agent-sep { display: none; }
  .form-card { width: 100%; }
  .report-workspace { flex-direction: column; }
  .workspace-left { width: 100%; }
  #pdf-section .stream-panel { height: 360px; }
  .pdf-viewer { width: 100%; }
  .chart-dashboard { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; gap: 32px; }
  .footer-cols { gap: 32px; }
}

/* ══════════════════════════════════
   GLOBAL PARTICLE CANVAS (fixed, behind all sections)
══════════════════════════════════ */
#bg-particles {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
/* In dark mode: sections are transparent so galaxy shows through */
[data-theme="dark"] #hero,
[data-theme="dark"] #product,
[data-theme="dark"] #gallery,
[data-theme="dark"] #agents,
[data-theme="dark"] #analyze,
[data-theme="dark"] #pdf-section { background: transparent; }
/* Alternate sections keep a very faint tint for visual rhythm */
[data-theme="dark"] #product,
[data-theme="dark"] #analyze { background: rgba(20,23,40,.22); }
/* In light mode: hide galaxy (doesn't suit light bg) */
[data-theme="light"] #bg-particles { display: none; }

/* CTA button arrow */
.btn-arrow {
  display: inline-flex; align-items: center;
  margin-left: 8px;
  transition: transform .25s ease;
}
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

/* ══════════════════════════════════
   GALLERY SECTION
══════════════════════════════════ */
#gallery {
  background: var(--bg-light);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: background .3s;
}

.gallery-inner {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 44px 80px 32px;
  gap: 24px;
}

.gallery-header {
  display: flex; align-items: center;
  width: 100%; max-width: 1000px;
}

.gallery-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; width: 100%; max-width: 1000px;
  padding-top: 4px;
}
.gallery-arrow {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--fg); font-size: 24px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s, background .2s;
  flex-shrink: 0;
}
.gallery-arrow:hover:not(:disabled){ border-color:var(--teal); color:var(--teal); background:rgba(64,196,208,.1); }
.gallery-arrow:disabled { opacity: .25; cursor: default; }
.gallery-nav-dots { display: flex; gap: 12px; align-items: center; }
.gallery-nav-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); cursor: pointer;
  transition: background .3s, transform .3s;
}
.gallery-nav-dot.active { background: var(--teal); transform: scale(1.6); }

.gallery-viewport {
  width: 100%; max-width: 1000px;
  overflow: hidden; border-radius: 16px;
}

.gallery-track {
  display: flex; gap: 0;
  will-change: transform;
}

/* Cards always dark regardless of theme */
.gallery-card {
  flex-shrink: 0;
  background: #111520;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 24px 28px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.gallery-card-hd {
  display: flex; align-items: center; gap: 10px;
}
.gallery-card-title {
  font-size: 15px; font-weight: 700; color: #e0e4f5;
}
.gallery-card-tag {
  font-size: 10px; font-weight: 700;
  background: rgba(64,196,208,.15); color: #40c4d0;
  padding: 2px 8px; border-radius: 4px; letter-spacing: .4px;
}
.gallery-card-body {
  flex: 1;
  min-height: 0;          /* critical: lets flex child shrink below content size  */
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
/* SVG scales to fill height, preserves aspect ratio via viewBox */
.gallery-card-body svg {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
}

.gallery-hint {
  font-size: 12px; color: var(--muted); letter-spacing: .5px;
}

/* ══════════════════════════════════
   API CONFIG MODAL
══════════════════════════════════ */
.api-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.api-modal-overlay.show { opacity: 1; pointer-events: all; }

.api-modal {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 620px; max-width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  transition: background .3s, border-color .3s;
}

.api-modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 0;
  gap: 12px;
}
.api-modal-hd h3 { font-size: 18px; font-weight: 700; color: var(--text); flex: 1; }

.api-back {
  background: none; border: none; color: var(--muted);
  font-size: 14px; font-weight: 500; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  transition: color .2s, background .2s;
  white-space: nowrap; flex-shrink: 0;
}
.api-back:hover { color: var(--teal); background: rgba(64,196,208,.08); }

.api-modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: color .2s;
  flex-shrink: 0; line-height: 1;
}
.api-modal-close:hover { color: var(--text); }

.api-modal-sub {
  font-size: 14px; color: var(--muted);
  padding: 8px 28px 0; margin: 0;
}

/* Step 1: option cards */
.api-options {
  display: flex; gap: 14px;
  padding: 20px 28px 0;
}
.api-option {
  flex: 1; border: 1.5px solid var(--border);
  border-radius: 14px; padding: 20px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .2s, background .2s, box-shadow .2s;
  position: relative;
}
.api-option:hover { border-color: rgba(64,196,208,.4); background: rgba(64,196,208,.04); }
.api-option.selected {
  border-color: var(--teal);
  background: rgba(64,196,208,.07);
  box-shadow: 0 0 0 3px rgba(64,196,208,.12);
}
.api-option-icon { font-size: 28px; line-height: 1; }
.api-option-title { font-size: 15px; font-weight: 700; color: var(--text); }
.api-option-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.api-option-check {
  position: absolute; top: 14px; right: 14px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal); color: #fff;
  font-size: 11px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
}
.api-option.selected .api-option-check { display: flex; }
.api-option-badge {
  position: absolute; top: 14px; right: 14px;
  background: rgba(146,89,242,.15); color: #9259f2;
  font-size: 13px; font-weight: 800;
  padding: 3px 10px; border-radius: 8px;
}

.api-modal-next {
  display: block; width: calc(100% - 56px);
  margin: 20px 28px 24px;
  height: 46px; border: none; border-radius: 10px;
  background: var(--teal); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(64,196,208,.3);
  transition: background .2s, transform .15s;
}
.api-modal-next:hover { background: var(--teal-dark); transform: translateY(-1px); }

/* Step 2: key config */
.api-section {
  padding: 20px 28px 0;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.api-section:first-of-type { border-top: none; margin-top: 16px; }

.api-section-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.api-section-tag {
  font-size: 10px; font-weight: 600;
  background: rgba(64,196,208,.15); color: var(--teal);
  padding: 2px 7px; border-radius: 4px; letter-spacing: .3px;
}
.api-section-desc { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.api-section-desc a { color: var(--teal); text-decoration: none; }
.api-section-desc a:hover { text-decoration: underline; }

.api-key-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.api-key-label { font-size: 12px; font-weight: 600; color: var(--muted); width: 36px; flex-shrink: 0; }
.api-key-input {
  flex: 1; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-pale);
  padding: 9px 12px; font-size: 13px; color: var(--text);
  font-family: 'Roboto Mono', monospace; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.api-key-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(64,196,208,.12); }
.api-key-remove {
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 4px 6px;
  border-radius: 6px; transition: color .2s;
}
.api-key-remove:hover { color: #ef4444; }

.api-add-key {
  background: none; border: 1px dashed var(--border);
  border-radius: 8px; color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 8px 14px;
  transition: border-color .2s, color .2s;
  width: 100%; text-align: center; margin-bottom: 12px;
}
.api-add-key:hover { border-color: var(--teal); color: var(--teal); }

.api-warn {
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25);
  border-radius: 8px; padding: 10px 14px;
  font-size: 12px; color: #f59e0b; line-height: 1.6;
  margin-bottom: 12px;
}

.api-family-slot {
  border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
}
.api-family-hd {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.api-family-label {
  font-size: 13px; font-weight: 700; color: var(--text);
}
.api-family-agents {
  font-size: 11px; color: var(--muted);
  background: var(--bg-pale); border-radius: 4px; padding: 2px 7px;
}
.api-family-model {
  margin-left: auto;
  font-size: 11px; font-family: 'Roboto Mono', monospace;
  color: var(--muted); background: var(--bg-pale);
  border-radius: 4px; padding: 2px 7px;
}

.api-modal-submit {
  display: block; width: calc(100% - 56px);
  margin: 20px 28px 24px;
  height: 46px; border: none; border-radius: 10px;
  background: var(--teal); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(64,196,208,.3);
  transition: background .2s, transform .15s;
}
.api-modal-submit:hover { background: var(--teal-dark); transform: translateY(-1px); }

/* Step 2B: payment */
.pay-summary {
  text-align: center; padding: 28px 28px 20px;
}
.pay-price {
  font-size: 56px; font-weight: 800; color: var(--text);
  letter-spacing: -2px; line-height: 1;
}
.pay-price::before { content: '¥'; font-size: 28px; vertical-align: super; font-weight: 700; color: var(--teal); }
.pay-desc { font-size: 14px; color: var(--muted); margin-top: 6px; }

.pay-features {
  padding: 0 28px 20px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 0 0 20px;
}
.pay-feature {
  font-size: 13px; color: var(--text); padding: 8px 0;
  border-bottom: 1px solid var(--border); line-height: 1.5;
}
.pay-feature:last-of-type { border-bottom: none; }
.pay-feature-note {
  font-size: 11px; color: var(--muted);
  padding: 10px 0 4px; line-height: 1.6;
}

.pay-btns {
  display: flex; gap: 12px; padding: 0 28px 28px;
}
.pay-btn {
  flex: 1; height: 46px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: opacity .2s, transform .15s;
}
.pay-btn:hover { opacity: .88; transform: translateY(-1px); }
.pay-wechat  { background: #07C160; color: #fff; }
.pay-alipay  { background: #1677FF; color: #fff; }

/* ══════════════════════════════════
   LOG BLOCKS — structured event panels
══════════════════════════════════ */
.log-block {
  background: #0c0e1f;
  border: 1px solid #1a1e30;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 5px;
  font-family: 'Inter', sans-serif;
}
.log-block-title {
  font-size: 10px; font-weight: 700;
  color: #9999b2; letter-spacing: .6px; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}
.log-block-row {
  display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; line-height: 1.5;
}
.log-block-label {
  font-size: 10px; font-weight: 600; color: #4a506e; width: 56px; flex-shrink: 0;
}
.log-block-review-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px;
}
.log-block-agent {
  font-size: 10px; font-weight: 600;
  font-family: 'Roboto Mono', monospace; width: 60px; flex-shrink: 0;
}
.log-block-product { font-size: 11px; font-weight: 600; color: #dbdbeb; }
.log-block-flags {
  font-size: 10px; color: #6e748e; line-height: 1.5; width: 100%; margin-top: 1px;
}
.log-block-rationale { font-size: 11px; color: #8890b0; line-height: 1.6; }
.log-block-note { font-size: 10px; color: #6e748e; font-style: italic; }

/* Review status badges */
.review-status-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; flex-shrink: 0; letter-spacing: .3px;
}
.rs-passed  { background: rgba(30,171,122,.15); color: #1eab7a; }
.rs-retry   { background: rgba(245,158,11,.15);  color: #f59e0b; }
.rs-forced  { background: rgba(146,89,242,.15);  color: #9259f2; }
.qa-passed  { background: rgba(30,171,122,.15);  color: #1eab7a; }
.qa-failed  { background: rgba(239,68,68,.15);   color: #ef4444; }

/* Debate verdict badge */
.verdict-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; flex-shrink: 0; letter-spacing: .3px;
}
.verdict-accepted  { background: rgba(30,171,122,.15); color: #1eab7a; }
.verdict-rejected  { background: rgba(239,68,68,.15);  color: #ef4444; }
.verdict-revised   { background: rgba(64,196,208,.15);  color: #40c4d0; }

/* Report status badge (PDF toolbar) */
.report-status-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 5px; letter-spacing: .3px; flex-shrink: 0;
}
.status-passed     { background: rgba(30,171,122,.15); color: #1eab7a; }
.status-failed     { background: rgba(239,68,68,.15);  color: #ef4444; }
.status-unreviewed { background: rgba(127,127,127,.12);color: #888; }
.status-pending    { background: rgba(64,196,208,.12); color: #40c4d0; }

/* Block accent colours */
.log-block-seed   { border-color: rgba(64,196,208,.25); }
.log-block-seed   .log-block-title { color: #40c4d0; }
.log-block-review { border-color: rgba(30,171,122,.2); }
.log-block-review .log-block-title { color: #49bf8a; }
.log-block-debate { border-color: rgba(146,89,242,.25); }
.log-block-debate .log-block-title { color: #9259f2; }
.log-block-qa-result { border-color: rgba(64,196,208,.18); }
.log-block-qa-result .log-block-title { color: #40c4d0; }

/* ── 历史报告按钮 ── */
.nav-reports-btn {
  font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  padding: 5px 10px; border-radius: 6px;
  transition: color .2s, background .2s;
  text-decoration: none;
}
.nav-reports-btn:hover { color: var(--teal); background: rgba(64,196,208,.07); }

/* ── 历史报告浮层 ── */
.reports-panel {
  position: fixed; top: 56px; right: 16px; z-index: 1200;
  width: 300px; max-height: 420px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(-8px) scale(.97);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.reports-panel.show { opacity: 1; transform: none; pointer-events: all; }

.reports-panel-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.reports-panel-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; padding: 2px 4px;
  border-radius: 4px; line-height: 1;
}
.reports-panel-close:hover { color: var(--text); }

.reports-list {
  flex: 1; overflow-y: auto; padding: 6px 0;
}
.reports-loading, .reports-empty {
  font-size: 12px; color: var(--muted);
  text-align: center; padding: 24px 16px;
}
.report-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 14px; cursor: pointer; gap: 8px;
  transition: background .15s;
}
.report-item:hover { background: rgba(64,196,208,.06); }
.report-item-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}
.report-item-date { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.qa-failed-checks { color: #ef4444; font-size: 10px; width: 100%; margin-top: 1px; }

/* ── Login Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.login-modal-box {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 32px;
  width: 400px; max-width: 92vw; position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  animation: modal-in .18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.modal-close-btn {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--muted); line-height: 1; padding: 2px 6px;
  transition: color .15s;
}
.modal-close-btn:hover { color: var(--text); }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--text); }
.login-tabs {
  display: flex; margin-bottom: 24px; border-bottom: 1px solid var(--border);
}
.login-tab {
  flex: 1; background: none; border: none; cursor: pointer;
  padding: 10px; font-size: 14px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.login-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.login-tab-content { display: flex; flex-direction: column; gap: 12px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label { font-size: 13px; color: var(--muted); }
.login-field input {
  padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-pale); color: var(--text);
  font-size: 15px; outline: none; transition: border-color .2s;
}
.login-field input:focus { border-color: var(--teal); }
.login-btn-full {
  width: 100%; padding: 11px; border-radius: 8px;
  background: var(--teal); color: #fff; font-size: 15px; font-weight: 600;
  border: none; cursor: pointer; transition: background .18s;
  text-align: center; text-decoration: none; display: block;
}
.login-btn-full:hover:not(:disabled) { background: var(--teal-dark); }
.login-btn-full:disabled { opacity: .5; cursor: not-allowed; }
.login-btn-google {
  background: var(--bg-pale); color: var(--text);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-sizing: border-box;
}
.login-btn-google:hover:not(:disabled) { background: var(--border); }
.login-btn-logout { background: #dc3545; }
.login-btn-logout:hover:not(:disabled) { background: #b02a37; }
.login-google-note { font-size: 12px; color: var(--muted); }
.login-user-info { text-align: center; padding: 16px 0 20px; }
.login-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  margin: 0 auto 12px;
}
.login-username { font-size: 16px; font-weight: 600; color: var(--text); }
.login-phone-hint { font-size: 12px; color: var(--muted); margin-top: -4px; }
.login-switch-hint { font-size: 13px; color: var(--muted); text-align: center; margin-top: 4px; }
.login-switch-hint a { color: var(--teal); cursor: pointer; text-decoration: none; }
.login-switch-hint a:hover { text-decoration: underline; }

/* ── Panel expand ── */
.panel-expand-btn {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s; flex-shrink: 0;
}
.panel-expand-btn:hover { color: var(--teal); background: rgba(64,196,208,.1); }

/* Overlay backdrop */
.panel-expand-backdrop {
  display: none; position: fixed; inset: 0; z-index: 7999;
  background: rgba(0, 0, 0, 0.6);
}
.panel-expand-backdrop.active { display: block; }

/* Expanded panel — centered large card */
.panel-fullscreen {
  position: fixed !important;
  top: 50% !important; left: 50% !important;
  transform: translate3d(-50%, -50%, 0) !important;
  z-index: 8000 !important;
  width: min(92vw, 1100px) !important; max-width: none !important;
  height: 82vh !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  overflow: hidden;
  animation: expand-in .18s ease;
}
@keyframes expand-in {
  from { opacity: 0; transform: translate(-50%,-48%) scale(.97); }
  to   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
.panel-fullscreen .pdf-content { height: calc(82vh - 108px) !important; }
.panel-fullscreen .log-body    { height: calc(82vh - 90px)  !important; }

/* Exit button — top-right inside the expanded panel */
.panel-fullscreen .panel-expand-btn {
  margin-left: auto;
  background: var(--teal) !important; color: #fff !important;
  border-radius: 7px !important; padding: 6px 14px !important;
  font-size: 13px; font-weight: 600;
  gap: 6px; display: flex; align-items: center;
  box-shadow: 0 2px 8px rgba(64,196,208,.4);
}
