:root {
  --bg: #f5f7fb; --panel: #ffffff; --border: #e8ecf2;
  --text: #1a2233; --muted: #7a8598;
  --accent: #3b6ef6; --accent-hover: #2f5fe0; --accent-tint: #eef3ff;
  --green: #16b364; --red: #f04438; --yellow: #f5a623;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--text); }

.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--panel);
  position: sticky; top: 0; z-index: 100;
}
.brand { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.nav-right { display: flex; gap: 18px; align-items: center; font-size: 15px; }
.nav-right a { color: #4a5568; }
.nav-right a.muted { color: var(--muted); }

.container { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 20px; }

/* ── 首页 hero ── */
.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 { font-size: 42px; line-height: 1.28; margin-bottom: 16px; letter-spacing: -.02em; }
.hero .sub { color: var(--muted); font-size: 17px; max-width: 660px; margin: 0 auto 28px; line-height: 1.7; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 8px; font-size: 16px; }
.card p { color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ── 按钮 ── */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  padding: 10px 20px; border-radius: 10px; font-size: 15px; cursor: pointer; font-weight: 500;
  transition: background .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; box-shadow: 0 4px 12px rgba(59,110,246,.28); }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 8px; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); box-shadow: none; }

/* ── 登录/注册/账号卡 ── */
.auth-box { max-width: 400px; margin: 48px auto; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.auth-box h2 { margin-bottom: 18px; }
.auth-box h3 { font-size: 15px; }
.auth-box label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.auth-box input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px;
  background: #fbfcfe; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 15px;
}
.auth-box input:focus { outline: none; border-color: var(--accent); background: #fff; }
.auth-box .btn { width: 100%; margin: 8px 0 14px; }

/* ── 仪表盘 ── */
.welcome { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.welcome h1 { font-size: 26px; letter-spacing: -.01em; }
.welcome .subtitle { color: var(--muted); font-size: 14px; margin-top: 4px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.stat .num { font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.stat .num.accent { color: var(--accent); }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 4px; }

.analyze-card {
  background: linear-gradient(135deg, #3b6ef6 0%, #5b8def 100%);
  border-radius: 18px; padding: 26px 28px; margin-bottom: 28px; color: #fff;
  box-shadow: 0 8px 24px rgba(59,110,246,.25);
}
.analyze-card h2 { color: #fff; font-size: 20px; margin-bottom: 4px; }
.analyze-card .hint { color: rgba(255,255,255,.85); font-size: 14px; margin-bottom: 16px; }
.analyze-form { display: flex; gap: 10px; flex-wrap: wrap; }
.analyze-form input {
  flex: 1; min-width: 240px; padding: 12px 15px;
  background: #fff; border: none; border-radius: 10px; color: var(--text); font-size: 15px;
}
.analyze-form input:focus { outline: 2px solid rgba(255,255,255,.6); }
.analyze-form select {
  padding: 12px 14px; background: #fff; border: none;
  border-radius: 10px; color: var(--text); font-size: 15px; cursor: pointer;
}
.analyze-card .btn { background: #fff; color: var(--accent); font-weight: 600; }
.analyze-card .btn:hover { background: #f0f4ff; box-shadow: none; }

.section-title { font-size: 17px; font-weight: 700; margin: 4px 0 14px; }

/* ── 历史记录 / 任务表 ── */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
table.jobs { width: 100%; border-collapse: collapse; font-size: 14px; }
table.jobs th, table.jobs td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); }
table.jobs tbody tr:last-child td { border-bottom: none; }
table.jobs th { color: var(--muted); font-weight: 500; background: #fafbfd; font-size: 13px; }
table.jobs tr:last-child td { border-bottom: none; }
.ticker { font-weight: 700; }
.oneliner { color: var(--muted); max-width: 280px; }

.status { padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status-queued { background: rgba(245,166,35,.14); color: #b8791a; }
.status-running { background: var(--accent-tint); color: var(--accent); }
.status-done { background: rgba(22,179,100,.14); color: #0f8a4c; }
.status-failed { background: rgba(240,68,56,.12); color: var(--red); }

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

/* ── 任务详情页 ── */
.job-box { max-width: 680px; margin: 28px auto; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.status-line { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 14px 0 8px; font-weight: 600; }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error { color: var(--red); font-size: 14px; margin: 10px 0; white-space: pre-wrap; background: rgba(240,68,56,.06); border-radius: 8px; padding: 10px 12px; }
.muted { color: var(--muted); font-size: 14px; }

.ai-review {
  margin-top: 20px; padding: 18px 20px; background: var(--accent-tint);
  border: 1px solid #d6e2ff; border-radius: 14px;
}
.ai-review-title { font-weight: 700; color: var(--accent); margin-bottom: 8px; }
#ai-review-body { white-space: pre-wrap; font-size: 14px; line-height: 1.8; color: var(--text); }

.footer { text-align: center; padding: 28px; border-top: 1px solid var(--border); background: var(--panel); }
.footer p { font-size: 13px; color: var(--muted); margin: 4px 0; }

/* ── 移动端 ── */
@media (max-width: 720px) {
  .nav { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .brand { font-size: 16px; }
  .nav-right { gap: 14px; font-size: 14px; }
  .container { padding: 20px 14px; }
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 27px; }
  .hero .sub { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }
  .auth-box, .job-box { margin: 16px auto; padding: 22px; }
  .analyze-card { padding: 20px; }
  .analyze-form { flex-direction: column; }
  .analyze-form input, .analyze-form select, .analyze-form .btn { width: 100%; min-width: 0; }
  table.jobs { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.jobs th, table.jobs td { white-space: nowrap; }
  .oneliner { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
}
