:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #7b8794;
  --line: #e4e7eb;
  --accent: #0b6e4f;
  --accent-ink: #ffffff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}
main { max-width: 1480px; margin: 24px auto; padding: 0 20px; }
.nav {
  display: flex; align-items: center; gap: 18px;
  background: #102a43; color: #fff; padding: 10px 24px;
}
.nav a { color: #bde0d4; text-decoration: none; }
.nav a:hover { color: #fff; }
.nav .brand { font-weight: 700; color: #fff; margin-right: 8px; }
.nav .spacer { flex: 1; }
.nav .who { color: #9fb3c8; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 26px; margin-bottom: 20px; overflow-x: auto;
}
.card.narrow { max-width: 420px; margin: 60px auto; }
h2 { margin-top: 0; }
h3 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
label { display: block; margin: 10px 0; }
label.check { display: inline-block; margin-right: 16px; }
input, select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  width: 100%; font-size: 14px; background: #fff;
}
label.check input { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
button, .button {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px;
  padding: 9px 18px; font-size: 14px; cursor: pointer; text-decoration: none;
  display: inline-block; margin-top: 8px;
}
button.small { padding: 5px 10px; }
button.link {
  background: none; color: #bde0d4; padding: 0; font-size: 14px; text-decoration: underline;
}
table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 14px; }
th, td {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line);
  line-height: 1.5;
}
th { color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
td a { white-space: nowrap; }
.nowrap, .nowrap a { white-space: nowrap; }
a { color: var(--accent); }
.error { color: #c0392b; background: #fdecea; padding: 8px 12px; border-radius: 6px; }
.muted { color: var(--muted); }
.inline { display: inline; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
.legend, legend { color: var(--muted); font-size: 13px; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; white-space: nowrap; line-height: 1.6; }
.s-queued { background: #fff3cd; color: #856404; }
.s-running { background: #cce5ff; color: #004085; }
.s-done { background: #d4edda; color: #155724; }
.s-error { background: #f8d7da; color: #721c24; }
.rating { display: inline-block; font-weight: 700; padding: 2px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; line-height: 1.6; }
.r-Buy { background: #0b6e4f; color: #fff; }
.r-Overweight { background: #68a19b; color: #fff; }
.r-Hold { background: #e4e7eb; color: #1f2933; }
.r-Underweight { background: #f0c070; color: #5f4406; }
.r-Sell { background: #c0392b; color: #fff; }
.stages { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.stage {
  padding: 5px 14px; border-radius: 999px; background: var(--line); color: var(--muted);
  font-size: 13px;
}
.stage.active { background: #cce5ff; color: #004085; font-weight: 600; }
.stage.done { background: #d4edda; color: #155724; }
.timeline { margin: 10px 0; }
.tl-item { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.tl-bar {
  flex: 1; height: 10px; background: var(--line); border-radius: 5px; overflow: hidden;
  display: inline-block;
}
.tl-fill { display: block; height: 100%; background: var(--accent); }
.pre { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line);
  border-radius: 8px; padding: 14px; line-height: 1.7; }
details { margin: 12px 0; }
summary { cursor: pointer; color: var(--accent); }
.tabs { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a {
  padding: 6px 14px; border-radius: 6px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line);
}
.tabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tabs input[type=date] { width: auto; }

/* 运行日志面板 */
.feed {
  background: #102a43; color: #d9e2ec; border-radius: 8px;
  max-height: 420px; overflow-y: auto; padding: 12px 16px;
  font-family: Consolas, Menlo, monospace; font-size: 13px; line-height: 1.7;
}
.feed .ts { color: #627d98; margin-right: 8px; }
.feed .k-tool { color: #7fd4c1; }
.feed .k-data { color: #8bd0f7; }
.feed .k-agent { color: #f0d68a; }
.feed .k-report { color: #6ee7a8; font-weight: 700; }
.feed .k-info { color: #bde0d4; font-style: italic; }

/* 决策摘要完整滚动框 */
.pre.tall { max-height: 620px; overflow-y: auto; }

/* 目标价列：限宽换行，避免长依据文本把表格撑开（td 的 max-width 在
   自动表格布局下不生效，限宽放在内层 div 上） */
td.cell-target { white-space: normal; }
.target-text {
  max-width: 190px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.5;
}
