:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --core: #dc2626;
  --secondary: #ea580c;
  --defense: #2563eb;
}
 :root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --core: #dc2626;
  --secondary: #ea580c;
  --defense: #2563eb;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "HarmonyOS Sans", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; }
.topbar { background: linear-gradient(135deg, #111827, #1e3a8a); color: #fff; padding: 28px 42px; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar h1 { margin: 0 0 8px; font-size: 28px; }
.topbar p { margin: 0; color: #cbd5e1; line-height: 1.6; }
nav { display: flex; gap: 10px; flex-wrap: wrap; }
nav a { color: #e5e7eb; text-decoration: none; padding: 9px 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; white-space: nowrap; }
nav a.active, nav a:hover { background: #fff; color: #1e3a8a; }
.container { width: min(1280px, calc(100% - 32px)); margin: 24px auto 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 10px 30px rgba(15,23,42,.06); margin-bottom: 20px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.hero h2, .card h2 { margin: 0 0 10px; }
.hero p, .card p, li { line-height: 1.7; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
button { border: 1px solid var(--line); background: #fff; color: var(--text); padding: 10px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; min-height: 42px; }
button:hover { border-color: var(--primary); color: var(--primary); }
button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.primary:hover { background: var(--primary-dark); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; padding-bottom: 10px; }
.section-title span, .muted { color: var(--muted); }
.compact-title h2 { margin-bottom: 0; }
.grid { display: grid; gap: 16px; }
.positions { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.two { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
.position-box { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fafafa; }
.position-box h3 { margin-top: 0; }
.num { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; align-items: center; justify-content: center; margin: 3px 4px; color: #fff; font-weight: 800; }
.num.core { background: var(--core); }
.num.secondary { background: var(--secondary); }
.num.defense { background: var(--defense); }
details { margin-top: 12px; color: var(--muted); }
details li { margin: 8px 0; line-height: 1.6; }
.combo-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.combo { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; display: flex; flex-direction: column; gap: 6px; }
.combo strong { font-size: 24px; letter-spacing: 2px; color: var(--primary-dark); }
.combo span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1px solid var(--line); }
.table-scroll table { min-width: 620px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #475467; background: #f9fafb; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.text-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; color: var(--muted); }
.pagination a, .pagination span { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; }
.pagination a { color: var(--primary); font-weight: 700; }
.pagination .disabled { color: #98a2b3; background: #f9fafb; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.summary-grid div { border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.summary-grid strong { color: var(--muted); font-size: 13px; }
.summary-grid span { font-size: 20px; font-weight: 800; color: var(--primary-dark); }
.empty { color: var(--muted); text-align: center; padding: 40px; }
.markdown pre { white-space: pre-wrap; word-break: break-word; line-height: 1.75; font-family: "Microsoft YaHei", sans-serif; }
.notice { font-weight: 700; border-left: 5px solid var(--primary); }
.notice.warn { background: #fffbeb; color: #92400e; border-color: #f59e0b; }
.notice.success { background: #ecfdf5; color: #065f46; border-color: #10b981; }
.module-title { margin: 18px 0 12px; font-size: 18px; font-weight: 800; color: #0f172a; border-left: 4px solid var(--primary); padding-left: 10px; }
.compact-module { margin-top: 24px; }
.compact-positions { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.compact-box { background: #f8fbff; }
.compact-digits { margin: 8px 0 0; }
.num.compact { width: 28px; height: 28px; font-size: 14px; }
.result-panel { border: 2px solid #bfdbfe; background: #eff6ff; border-radius: 16px; padding: 16px; margin: 0 0 18px; }
.result-panel h3 { margin: 0 0 8px; color: #1e3a8a; }
.result-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #dbeafe; background: #fff; border-radius: 12px; padding: 12px; }
.result-row strong { white-space: nowrap; color: #334155; }
.result-row span { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.result-row b { display: inline-flex; width: 34px; height: 34px; border-radius: 999px; align-items: center; justify-content: center; background: #2563eb; color: #fff; font-size: 18px; }
.trend-metrics p { margin: 6px 0; font-size: 14px; line-height: 1.6; }
.trend-metrics strong { color: #334155; }
@media (max-width: 860px) {
  .topbar, .hero, .section-title { flex-direction: column; align-items: flex-start; }
  .topbar { padding-top: 22px; padding-bottom: 22px; }
  .actions { justify-content: flex-start; width: 100%; }
  .actions form, .actions button { width: 100%; }
  .two { grid-template-columns: 1fr; }
  nav { width: 100%; }
  nav a { flex: 1; text-align: center; }
}
@media (max-width: 520px) {
  .container { width: min(100% - 20px, 1280px); margin-top: 12px; }
  .topbar h1 { font-size: 22px; }
  .card { padding: 16px; border-radius: 14px; margin-bottom: 12px; }
  .positions { grid-template-columns: 1fr; }
  .combo-list { grid-template-columns: 1fr; }
  .num { width: 30px; height: 30px; }
  th, td { padding: 9px 7px; font-size: 14px; }
  .pagination { justify-content: stretch; }
  .pagination a, .pagination span { flex: 1; text-align: center; }
}

