:root {
  --bg: #f7f8f5;
  --ink: #152d35;
  --muted: #65737a;
  --line: #dce2df;
  --panel: #ffffff;
  --good: #0e7c66;
  --bad: #b84a3a;
  --accent: #d98a1a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Avenir Next, Helvetica Neue, Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 28px 32px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--good);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
}

.date {
  color: var(--muted);
  font-size: 14px;
}

.date a {
  color: var(--good);
  text-decoration: none;
  font-weight: 700;
}

/* 观象 AI 导航入口：与其它导航一致，仅颜色微调 */
.date a.nav-ai {
  color: var(--good);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}

/* 工具箱下拉 */
.toolbox-wrap { position: relative; display: inline-block; margin-left: 4px; }
.date a.nav-toolbox {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}
.toolbox-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  min-width: 136px;
  padding: 6px;
  z-index: 200;
}
.toolbox-menu a {
  display: block;
  padding: 6px 14px;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
}
.toolbox-menu a:hover {
  background: #f1f5f9;
  color: var(--good);
}

.date span {
  margin-left: 10px;
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 32px 40px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  overflow: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-green { background: rgba(14, 124, 102, 0.1); color: var(--good); }
.tag-amber { background: rgba(217, 138, 26, 0.1); color: var(--accent); }
.tag-red { background: rgba(184, 74, 58, 0.1); color: var(--bad); }
.tag-gray { background: #f1f5f9; color: var(--muted); }

.hero-panel {
  background:
    radial-gradient(circle at top left, rgba(14, 124, 102, 0.1), transparent 30%),
    linear-gradient(135deg, #ffffff, #f7fbf9 60%, #fdf7ee);
}

.warning-panel {
  border-color: rgba(217, 138, 26, 0.35);
  background:
    linear-gradient(135deg, rgba(217, 138, 26, 0.08), rgba(255, 255, 255, 0.98)),
    #fff;
}

.warning-panel p {
  margin: 6px 0 0;
}

.hero-copy {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
}

.mode-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.mode-pill.active {
  border-color: var(--good);
  background: var(--good);
  color: #fff;
}

.focus-list {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.hero-link {
  margin: 0;
}

.hero-link a {
  color: var(--good);
  font-weight: 700;
  text-decoration: none;
}

.starter-box {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(14, 124, 102, 0.18);
  border-radius: 10px;
  background: rgba(14, 124, 102, 0.05);
}

.starter-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.starter-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(14, 124, 102, 0.06), rgba(255, 255, 255, 0.96)),
    #fff;
  color: var(--ink);
  text-decoration: none;
}

.starter-card strong {
  font-size: 15px;
}

.starter-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.panel table tbody tr:hover {
  background: #f8fbf9;
}

.span-2 {
  grid-column: span 2;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-strip div {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(14, 124, 102, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(14, 124, 102, 0.08), rgba(217, 138, 26, 0.08)),
    #fff;
}

.metric-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-strip strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.metric-strip em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.quant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.quant-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.tear-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tear-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.tear-card table {
  margin-top: 8px;
}

.log-block {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17262d;
  color: #eef5f3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

details {
  display: block;
}

summary {
  cursor: pointer;
  color: var(--good);
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

details[open] summary {
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td a {
  color: var(--good);
  text-decoration: none;
  font-weight: 700;
}

.path {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.status {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.status.ok {
  background: var(--good);
}

.status.missing {
  background: var(--bad);
}

.form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  font: inherit;
}

button {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

pre {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1f343b;
  font-family: Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.compact-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.hero-note {
  color: var(--muted);
  font-size: 13px;
}

.chain-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.chain-card {
  display: grid;
  gap: 10px;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.chain-card-head,
.chain-card-metrics {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.chain-card-head span,
.chain-card-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.score-cell {
  color: var(--good);
  font-size: 18px;
  font-weight: 800;
}

code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f8f5;
  color: var(--ink);
  font-family: Menlo, Consolas, monospace;
  font-size: 12px;
}

@media (max-width: 900px) {
  .chain-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .chain-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── AI 助手 ─────────────────────────────────────── */

.ai-trigger {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f7f7 0%, #b2ebeb 100%);
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(74, 158, 158, 0.3), 0 2px 8px rgba(21, 45, 53, 0.12);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.ai-trigger::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(74, 158, 158, 0.2);
  animation: aiPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

.ai-trigger:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 36px rgba(74, 158, 158, 0.4), 0 4px 14px rgba(21, 45, 53, 0.18);
}

.ai-trigger:active {
  transform: translateY(-1px) scale(0.96);
}

.ai-elephant {
  width: 52px;
  height: 52px;
  transition: transform 0.3s ease;
}

.ai-trigger:hover .ai-elephant {
  transform: rotate(-6deg) scale(1.05);
}

.ai-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  max-width: 100vw;
  height: 100vh;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 0%, rgba(14,124,102,0.10), transparent 32%),
    linear-gradient(180deg, #f8faf8 0%, #f3f6f4 100%);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(21, 45, 53, 0.18);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.ai-drawer.open {
  transform: translateX(0);
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
}

.ai-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(244, 238, 207, 0.28), rgba(14, 124, 102, 0.06));
  overflow: hidden;
}

.ai-avatar-ring {
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  border: 1px solid rgba(14, 124, 102, 0.16);
}

.ai-avatar-ring-1 {
  animation: aiSpin 10s linear infinite;
}

.ai-avatar-ring-2 {
  inset: 9px;
  border-color: rgba(21, 45, 53, 0.18);
  animation: aiSpinReverse 12s linear infinite;
}

.ai-avatar-core {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f4eecf, #e7d99f);
  box-shadow: 0 0 0 6px rgba(14, 124, 102, 0.08);
}

.ai-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.ai-identity-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.ai-header-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.ai-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.ai-mode-switch button {
  width: auto;
  padding: 6px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ai-mode-switch button.active {
  background: var(--good);
  color: #fff;
}

.ai-llm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ai-llm-toggle input {
  margin: 0;
}

.ai-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 18px;
}

.ai-welcome {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(14,124,102,0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(247,251,249,0.92)),
    radial-gradient(circle at top right, rgba(14,124,102,0.12), transparent 36%);
  box-shadow: 0 10px 28px rgba(21,45,53,0.07);
}

.ai-welcome-kicker {
  color: var(--good);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-welcome h4 {
  margin: 6px 0 6px;
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0;
}

.ai-welcome p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-capability-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.ai-capability-grid button {
  width: auto;
  padding: 11px 12px;
  border: 1px solid rgba(14,124,102,0.14);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.ai-capability-grid button:hover {
  transform: translateY(-1px);
  border-color: rgba(14,124,102,0.42);
  box-shadow: 0 8px 18px rgba(21,45,53,0.08);
}

.ai-capability-grid b {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.ai-capability-grid span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ai-hint {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(14, 124, 102, 0.05), rgba(255, 255, 255, 0.92));
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
}

.ai-hint strong {
  display: block;
  margin-bottom: 3px;
  color: var(--good);
}

.ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.ai-quick button {
  width: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}

.ai-quick button:hover {
  border-color: var(--good);
}

.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  max-width: 94%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
}

.ai-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #152d35, #24434a);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 8px 20px rgba(21,45,53,0.16);
}

.ai-msg.bot {
  align-self: flex-start;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom-left-radius: 5px;
}

.ai-answer-card {
  padding: 14px;
  border: 1px solid rgba(14,124,102,0.14);
  border-radius: 14px;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 10px 28px rgba(21,45,53,0.08);
}

.ai-answer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ai-answer-title {
  color: var(--good);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-verdict {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.ai-evidence-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.ai-evidence-card {
  padding: 10px 11px;
  border: 1px solid #e7ece9;
  border-radius: 10px;
  background: #fbfcfb;
}

.ai-evidence-card span,
.ai-risk-card span,
.ai-action-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ai-evidence-card p,
.ai-risk-card p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
}

.ai-risk-card {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(184,74,58,0.16);
  border-radius: 10px;
  background: rgba(184,74,58,0.045);
}

.ai-msg.bot .ai-section {
  margin: 6px 0;
}

.ai-msg.bot .ai-section strong {
  display: block;
  color: var(--good);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.ai-msg.bot .ai-section--secondary {
  color: rgba(226,232,240,0.85);
}
.ai-msg.bot .ai-section--secondary strong {
  color: rgba(226,232,240,0.9);
}

.ai-msg.bot .ai-section--muted {
  color: rgba(148,163,184,0.85);
}
.ai-msg.bot .ai-section--muted strong {
  color: rgba(148,163,184,0.85);
}

.ai-msg.bot .ai-section--meta {
  color: rgba(148,163,184,0.7);
  font-size: 11px;
}
.ai-msg.bot .ai-section--meta strong {
  color: rgba(148,163,184,0.75);
}

/* ── 思考中指示器 ── */
.ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14,124,102,0.06), rgba(14,124,102,0.02));
  border: 1px solid rgba(14,124,102,0.08);
}

.ai-typing-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.3px;
  animation: aiShimmer 2s ease-in-out infinite;
}

@keyframes aiShimmer {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.ai-typing-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--good);
  opacity: 0.3;
  animation: aiDotBounce 1.4s ease-in-out infinite;
}
.ai-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.35s; }
.ai-typing-dot:nth-child(4) { animation-delay: 0.55s; }

@keyframes aiDotBounce {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.7); }
  40% { opacity: 1; transform: scale(1.3); }
}

.ai-support-note {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(217,138,26,0.22);
  border-radius: 6px;
  background: rgba(217,138,26,0.06);
  color: #8a5a12;
  font-size: 12px;
  line-height: 1.45;
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.ai-actions a {
  display: inline-flex;
  padding: 7px 12px;
  border: 1px solid rgba(14,124,102,0.22);
  border-radius: 999px;
  background: rgba(14,124,102,0.06);
  color: var(--good);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.ai-actions a:hover {
  background: rgba(14, 124, 102, 0.08);
}

.ai-task-card {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(14, 124, 102, 0.16);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(14, 124, 102, 0.04), rgba(255, 255, 255, 0.96));
}

.ai-task-title {
  margin-bottom: 8px;
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-task-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0;
  font-size: 12px;
}

.ai-task-row span {
  color: var(--muted);
}

.ai-task-row b {
  color: var(--ink);
  text-align: right;
}

.ai-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ai-followups button {
  width: auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ai-followups button:hover {
  border-color: var(--good);
  color: var(--good);
}

.ai-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-source-badge.local {
  background: rgba(14,124,102,0.10);
  color: var(--good);
}

.ai-source-badge.llm {
  background: rgba(37,99,235,0.10);
  color: #2563eb;
}

.ai-source-badge.rule {
  background: rgba(217,138,26,0.12);
  color: #9a650f;
}

.ai-input-area {
  display: flex;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.96);
}

.ai-input-area input {
  flex: 1;
  padding: 12px 13px;
  border: 1px solid #d5ded9;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
}

.ai-input-area input:focus {
  border-color: rgba(14,124,102,0.48);
  box-shadow: 0 0 0 3px rgba(14,124,102,0.08);
}

.ai-input-area button {
  width: auto;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13px;
}

.ai-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(21, 45, 53, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.ai-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

@keyframes aiPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.18); opacity: 0.15; }
}

@keyframes aiSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes aiSpinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* ── 问观象 chip（表格行内小按钮）── */
.ask-ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid rgba(14, 124, 102, 0.25);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(14, 124, 102, 0.06), rgba(14, 124, 102, 0.02));
  color: var(--good);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.ask-ai-chip:hover {
  border-color: var(--good);
  background: linear-gradient(180deg, rgba(14, 124, 102, 0.12), rgba(14, 124, 102, 0.04));
  box-shadow: 0 2px 8px rgba(14, 124, 102, 0.12);
  transform: translateY(-1px);
}

.ask-ai-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f4eecf, #e7d99f);
  box-shadow: 0 0 0 2px rgba(244, 238, 207, 0.25);
}

/* ── 首页观象 C 位面板 ── */
.hero-ai-panel {
  padding: 16px 18px;
}

.hero-ai-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-ai-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.hero-ai-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.hero-ai-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.hero-ai-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 260px;
  max-width: 520px;
}

.hero-ai-search {
  flex: 1;
}

.btn-nowrap {
  white-space: nowrap;
}

.hero-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 860px) {
  .ai-drawer {
    width: 100vw;
  }

  .ai-quick {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .span-2 {
    grid-column: span 1;
  }

  .metric-strip,
  .quant-grid {
    grid-template-columns: 1fr;
  }

  .tear-sheet-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
    gap: 8px;
    padding: 22px 16px 16px;
  }
}

/* ── SOP 策略卡片组件（Linear Card + Notion Toggle 风格）── */

.sop-card {
  background: #1a1d23;
  border: 1px solid #2a2f3a;
  border-radius: 12px;
  overflow: hidden;
  font-family: Avenir Next, Helvetica Neue, Arial, sans-serif;
  color: #e2e4e9;
  margin-bottom: 16px;
}

.sop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  border-bottom: 1px solid #2a2f3a;
}

.sop-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sop-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f0f2f5;
  letter-spacing: -0.01em;
}

.sop-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.sop-badge.fit-best {
  background: rgba(14, 124, 102, 0.2);
  color: #34d399;
  border-color: rgba(14, 124, 102, 0.4);
}

.sop-badge.fit-watch {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
  border-color: rgba(217, 119, 6, 0.3);
}

.sop-badge.fit-weak {
  background: rgba(184, 74, 58, 0.15);
  color: #f87171;
  border-color: rgba(184, 74, 58, 0.3);
}

.sop-tag {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.sop-body {
  padding: 4px 0;
}

.sop-section {
  border-bottom: 1px solid #252a33;
}

.sop-section:last-child {
  border-bottom: none;
}

.sop-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #d1d5db;
  transition: background 0.15s ease;
  user-select: none;
}

.sop-section > summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.sop-section > summary::-webkit-details-marker {
  display: none;
}

.sop-section > summary::before {
  content: "▸";
  font-size: 10px;
  color: #4b5563;
  transition: transform 0.15s ease;
  display: inline-block;
  width: 12px;
}

.sop-section[open] > summary::before {
  transform: rotate(90deg);
}

.sop-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-entry { background: var(--sop-primary, #2563eb); }
.dot-stop  { background: #b84a3a; }
.dot-exit  { background: #d98a1a; }

.sop-checklist,
.sop-rules {
  padding: 4px 20px 16px 46px;
}

.sop-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #b0b5c3;
}

.sop-check-item.sop-note {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed #2a2f3a;
}

.check-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sop-primary-soft, rgba(37, 99, 235, 0.08));
  color: var(--sop-primary, #2563eb);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.check-num.note {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  font-size: 9px;
  font-weight: 600;
  width: 20px;
  border-radius: 4px;
}

.check-text {
  flex: 1;
}

.sop-rule-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  font-size: 12.5px;
  line-height: 1.55;
}

.sop-rule-row .rule-label {
  color: #9ca3af;
  font-weight: 500;
  flex-shrink: 0;
  min-width: 80px;
}

.sop-rule-row .rule-value {
  color: #d1d5db;
  text-align: right;
  flex: 1;
}

.sop-rule-row.priority {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed #2a2f3a;
}

.sop-rule-row.priority .rule-value {
  color: var(--sop-primary, #2563eb);
  font-weight: 500;
}

.sop-footer {
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid #2a2f3a;
}

.sop-stats {
  display: flex;
  gap: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-label {
  font-size: 10.5px;
  color: #6b7280;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 13.5px;
  font-weight: 700;
  color: #f0f2f5;
}

/* ── 策略特定颜色覆盖 ── */
.sop-card.sop-vcp .stat-value { color: #60a5fa; }
.sop-card.sop-2560 .stat-value { color: #34d399; }
.sop-card.sop-bollinger .stat-value { color: #fbbf24; }

.sop-card.sop-vcp .sop-section-title { color: #93bbfc; }
.sop-card.sop-2560 .sop-section-title { color: #6ee7b7; }
.sop-card.sop-bollinger .sop-section-title { color: #fcd34d; }

/* ── 移动端适配 ── */
@media (max-width: 640px) {
  .sop-stats {
    gap: 16px;
  }
  .sop-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .sop-rule-row {
    flex-direction: column;
    gap: 2px;
  }
  .sop-rule-row .rule-value {
    text-align: left;
  }
}

/* ── 统一 topbar 导航高亮 ── */
.topbar .date a:not(.active) {
  color: var(--muted);
  font-weight: 400;
}
/* 赚钱秘籍三步进度条 */
.step-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.step-item.active {
  opacity: 1;
}
.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
}
.step-item.active .step-dot {
  background: var(--good);
}
.step-label {
  font-weight: 700;
}
.step-connector {
  flex: 1;
  height: 2px;
  min-width: 16px;
  margin: 0 8px;
  background: var(--line);
  border-radius: 1px;
  transition: background 0.15s;
}
.step-connector.active {
  background: var(--good);
}
.topbar .date a.active {
  color: var(--good);
  font-weight: 700;
}
