/* 数科科研 Agent · 静态网页版样式 */
:root {
  --indigo: #4f46e5;
  --indigo-dark: #312e81;
  --sky: #0ea5e9;
  --emerald: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --bg: #f6f8fc;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--slate-900);
  line-height: 1.65;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 252px;
  flex: 0 0 252px;
  background: #fff;
  border-right: 1px solid var(--slate-200);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 4px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 38px;
  background: linear-gradient(135deg, var(--indigo), var(--sky));
  color: #fff; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .3);
}
.brand-name { font-weight: 800; font-size: 16px; color: var(--indigo-dark); letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: var(--slate-500); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 11px; border-radius: 10px; color: var(--slate-600);
  font-size: 13.5px; font-weight: 600; transition: .18s;
}
.nav-item span {
  font-size: 10px; font-weight: 800; color: var(--slate-400, #94a3b8);
  background: var(--slate-100); border-radius: 6px; padding: 1px 6px;
}
.nav-item:hover { background: #eef2ff; color: var(--indigo); }
.nav-item.active { background: linear-gradient(90deg, #eef2ff, #f5f3ff); color: var(--indigo); }
.nav-item.active span { background: var(--indigo); color: #fff; }

.side-block { border-top: 1px solid var(--slate-200); padding-top: 13px; }
.side-label { font-size: 11px; font-weight: 700; color: var(--slate-500); letter-spacing: 1px; margin-bottom: 8px; }
.segmented { display: flex; background: var(--slate-100); border-radius: 9px; padding: 3px; }
.segmented button {
  flex: 1; border: 0; background: transparent; border-radius: 7px;
  padding: 6px 4px; font-size: 12px; color: var(--slate-500); font-weight: 600;
}
.segmented button.active { background: #fff; color: var(--indigo); box-shadow: var(--shadow-sm); }
.status { display: flex; flex-direction: column; gap: 5px; }
.status-item { font-size: 12px; color: var(--slate-500); display: flex; gap: 7px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--slate-300); }
.dot.on { background: var(--emerald); box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); }
.reset-btn {
  border: 1px solid var(--slate-200); background: #fff; color: var(--slate-600);
  border-radius: 10px; padding: 8px 10px; font-size: 12.5px; font-weight: 600;
}
.reset-btn:hover { border-color: var(--red); color: var(--red); }
.side-foot { font-size: 10.5px; color: #94a3b8; line-height: 1.6; margin-top: auto; }

/* Main */
.main { flex: 1; min-width: 0; padding: 20px 28px 10px; max-width: 1280px; }
.hero {
  background: linear-gradient(120deg, #312e81 0%, #4f46e5 55%, #0ea5e9 100%);
  border-radius: 20px; padding: 24px 30px 22px; color: #fff;
  box-shadow: 0 16px 38px rgba(49, 46, 129, .23);
}
.hero-tag {
  display: inline-block; font-size: 11px; letter-spacing: 1.5px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24);
  padding: 2px 10px; border-radius: 999px; margin-bottom: 8px;
}
.hero h1 { margin: 0 0 4px; font-size: 28px; letter-spacing: .5px; }
.hero p { margin: 0; font-size: 13.5px; opacity: .92; max-width: 760px; }
.hero-chips { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 7px; }
.hero-chips span {
  font-size: 11.5px; padding: 2px 10px; border-radius: 999px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22);
}
.page { padding: 22px 0 26px; min-height: 420px; }
.footer { color: #94a3b8; font-size: 11.5px; text-align: center; padding: 10px 0 22px; }

.page-head h2 { margin: 0 0 4px; font-size: 21px; color: var(--indigo-dark); }
.page-head p { margin: 0 0 18px; color: var(--slate-500); font-size: 13px; }

/* Cards & layout */
.card {
  background: var(--card); border: 1px solid var(--slate-200);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 14.5px; font-weight: 800; color: var(--slate-900); margin: 0 0 4px; }
.card-sub { font-size: 12px; color: var(--slate-500); margin: 0 0 14px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-title { font-size: 14px; font-weight: 800; color: var(--slate-900); margin: 4px 0 10px; }
.divider { height: 1px; background: var(--slate-200); margin: 18px 0; }
.muted { color: var(--slate-500); font-size: 12px; }
.small { font-size: 12px; }
.note {
  background: #eef2ff; border-left: 4px solid var(--indigo);
  border-radius: 8px; padding: 11px 14px; font-size: 12.5px; color: #3730a3;
}
.note.warn { background: #fffbeb; border-left-color: var(--amber); color: #92400e; }

/* Metrics */
.metric {
  background: #fff; border: 1px solid var(--slate-200); border-radius: 14px;
  padding: 13px 16px; box-shadow: var(--shadow-sm);
}
.m-label { display: block; font-size: 11.5px; color: var(--slate-500); }
.m-value { display: block; font-size: 23px; font-weight: 800; color: var(--indigo-dark); line-height: 1.35; }
.m-sub { display: block; font-size: 11px; color: var(--slate-500); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--slate-200); background: #fff; color: var(--slate-700);
  border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 700;
  transition: .16s;
}
.btn:hover { border-color: #a5b4fc; color: var(--indigo); }
.btn-primary {
  background: linear-gradient(120deg, var(--indigo), #6366f1);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .22);
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-ghost { border-color: transparent; background: var(--slate-100); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Upload / demos */
.upload-zone {
  border: 1.5px dashed #c7d2fe; background: #f8faff; border-radius: 14px;
  padding: 26px 20px; text-align: center; transition: .18s;
}
.upload-zone:hover { border-color: var(--indigo); background: #eef2ff; }
.upload-icon {
  width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 12px;
  background: #e0e7ff; color: var(--indigo); font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.demo-card {
  border: 1px solid var(--slate-200); border-radius: 13px; padding: 14px;
  background: #fff; transition: .18s;
}
.demo-card:hover { border-color: #a5b4fc; box-shadow: 0 8px 20px rgba(79,70,229,.08); transform: translateY(-1px); }
.demo-card h4 { margin: 0 0 2px; font-size: 13.5px; }
.demo-meta { font-size: 11px; color: var(--slate-500); margin-bottom: 10px; }
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 8px;
  border-radius: 999px; background: #eef2ff; color: var(--indigo);
}
.badge.green { background: #ecfdf5; color: #047857; }
.badge.amber { background: #fffbeb; color: #b45309; }
.badge.red { background: #fef2f2; color: #b91c1c; }
.badge.slate { background: var(--slate-100); color: var(--slate-600); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 700; color: var(--slate-600); }
select, input[type="number"], input[type="text"] {
  border: 1px solid var(--slate-200); border-radius: 9px; background: #fff;
  padding: 8px 10px; font-size: 13px; color: var(--slate-900); width: 100%;
  outline: none;
}
select:focus, input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
input[type="range"] { width: 100%; accent-color: var(--indigo); }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--slate-600); }
.checkline input { accent-color: var(--indigo); width: 15px; height: 15px; }

/* Tables */
.table-wrap { overflow: auto; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 520px; }
table.data th {
  background: #f8fafc; color: var(--slate-600); text-align: left; font-weight: 700;
  padding: 8px 10px; border-bottom: 1px solid var(--slate-200); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; color: var(--slate-700); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fafbff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Banners */
.banner { border-radius: 11px; padding: 11px 14px; font-size: 12.5px; margin: 12px 0; }
.banner.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.banner.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.banner.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.banner.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--slate-200); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; padding: 8px 13px; font-size: 13px; font-weight: 700;
  color: var(--slate-500); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--indigo); border-bottom-color: var(--indigo); }

/* Charts */
.chart { width: 100%; height: 340px; }
.chart.tall { height: 420px; }
.chart.short { height: 290px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-box { border: 1px solid var(--slate-200); border-radius: 14px; background: #fff; padding: 12px; }
.chart-box h4 { margin: 2px 0 4px 4px; font-size: 13px; color: var(--slate-700); }
.empty-chart { height: 300px; display: flex; align-items: center; justify-content: center; color: var(--slate-400, #94a3b8); font-size: 12.5px; }

/* Logs */
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-item { border: 1px solid var(--slate-200); border-radius: 10px; padding: 10px 13px; background: #fcfdff; }
.log-item b { color: var(--slate-800, #1e293b); font-size: 12.5px; }
.log-reason { color: var(--slate-500); font-size: 11.5px; margin-top: 2px; }

/* Chat */
.chat-box { display: flex; flex-direction: column; gap: 12px; max-height: 520px; overflow-y: auto; padding: 4px 2px 8px; }
.msg { display: flex; gap: 9px; align-items: flex-start; }
.msg .avatar {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; background: #e0e7ff; color: var(--indigo);
}
.msg.user .avatar { background: #dcfce7; color: #047857; }
.msg .bubble {
  background: #fff; border: 1px solid var(--slate-200); border-radius: 4px 13px 13px 13px;
  padding: 10px 13px; font-size: 12.8px; max-width: 78%; white-space: pre-wrap;
}
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: #eef2ff; border-color: #c7d2fe; border-radius: 13px 4px 13px 13px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.chat-form { display: flex; gap: 9px; margin-top: 10px; }
.chat-form input { flex: 1; }

/* Report */
.report-body { font-size: 13px; line-height: 1.8; color: var(--slate-700); }
.report-body h1 { font-size: 21px; color: var(--indigo-dark); border-bottom: 2px solid #e0e7ff; padding-bottom: 6px; }
.report-body h2 { font-size: 16px; color: var(--indigo-dark); margin-top: 22px; }
.report-body h3 { font-size: 14px; color: var(--slate-800, #1e293b); margin-top: 16px; }
.report-body table { width: 100%; border-collapse: collapse; font-size: 11.8px; margin: 8px 0 14px; }
.report-body th, .report-body td { border: 1px solid var(--slate-200); padding: 6px 8px; }
.report-body th { background: #f8fafc; }
.report-body blockquote { margin: 12px 0; padding: 8px 12px; background: #f8fafc; border-left: 3px solid #a5b4fc; color: var(--slate-500); font-size: 12px; }
.report-body ul { padding-left: 20px; }
.code-block {
  background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 16px;
  overflow: auto; max-height: 560px; font-size: 12px; line-height: 1.55;
  font-family: Consolas, "Courier New", monospace; white-space: pre;
}

/* Toast */
.toast {
  position: fixed; right: 22px; top: 18px; z-index: 99; background: #0f172a; color: #fff;
  border-radius: 10px; padding: 10px 16px; font-size: 12.5px; opacity: 0;
  transform: translateY(-8px); transition: .22s; pointer-events: none; max-width: 340px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #991b1b; }

/* Responsive */
@media (max-width: 1080px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { flex: 0 0 auto; }
  .side-foot { display: none; }
  .main { padding: 16px; }
  .cols-2, .cols-3, .cols-4, .chart-grid, .form-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 23px; }
}
