:root {
  --bg: #05070d;
  --bg-deep: #03040a;
  --bg-elevated: #0e141f;
  --bg-card: rgba(18, 25, 37, 0.62);
  --bg-card-solid: #121926;
  --border: rgba(120, 190, 235, 0.10);
  --border-strong: rgba(120, 190, 235, 0.18);
  --border-hover: rgba(94, 234, 212, 0.45);
  --text: #e8edf4;
  --text-muted: #7a8a9e;
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --accent-3: #818cf8;
  --accent-dim: rgba(94, 234, 212, 0.12);
  --accent-glow: rgba(94, 234, 212, 0.28);
  --violet-glow: rgba(129, 140, 248, 0.25);
  --warn: #fbbf24;
  --danger: #f87171;
  --success: #4ade80;
  --radius: 16px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Orbitron", "DM Sans", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(1000px 800px at 100% 0%, rgba(129, 140, 248, 0.10), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(94, 234, 212, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ============================ 背景动效层 ============================ */
.bg-layers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#glyphCanvas { z-index: 1; }
#neuralCanvas { z-index: 2; }

.bg-aurora {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(closest-side, rgba(56, 189, 248, 0.18), transparent),
    radial-gradient(closest-side, rgba(129, 140, 248, 0.16), transparent),
    radial-gradient(closest-side, rgba(94, 234, 212, 0.16), transparent);
  background-size: 55% 55%, 50% 50%, 60% 60%;
  background-position: 12% 8%, 88% 20%, 50% 100%;
  background-repeat: no-repeat;
  filter: blur(40px);
  animation: auroraDrift 26s ease-in-out infinite alternate;
  opacity: 0.75;
}

@keyframes auroraDrift {
  0%   { background-position: 12% 8%, 88% 20%, 50% 100%; }
  50%  { background-position: 24% 22%, 70% 8%, 40% 86%; }
  100% { background-position: 6% 16%, 96% 30%, 60% 94%; }
}

.bg-grid {
  position: absolute;
  inset: 0;
  z-index: 3;
  background-image:
    linear-gradient(rgba(94, 234, 212, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 75% at 50% 0%, black, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 0%, black, transparent 85%);
}

.bg-scan {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.4;
  animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
  0% { background-position: 0 0; }
  100% { background-position: 0 400px; }
}

.bg-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: radial-gradient(ellipse 100% 100% at 50% 40%, transparent 55%, rgba(3, 4, 10, 0.72) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .bg-aurora, .bg-scan { animation: none; }
}

/* ================================ 布局 ================================ */
.app {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 30px 24px 56px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #7ff2df 0%, #2dd4bf 45%, #0d9488 100%);
  color: #05121a;
  font-size: 30px;
  font-weight: 800;
  font-family: var(--display);
  display: grid;
  place-items: center;
  box-shadow:
    0 8px 32px var(--accent-glow),
    inset 0 0 18px rgba(255, 255, 255, 0.35);
  overflow: visible;
}

.brand-ring {
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  border: 1px solid rgba(94, 234, 212, 0.45);
  animation: ringPulse 3s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 0.15; }
}

.brand h1 {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #e8fffb, #7dd3fc 60%, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.debug-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.debug-toggle-label input {
  accent-color: var(--accent);
}

.hidden { display: none !important; }

/* ================================ Pill ================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(18, 25, 37, 0.7);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 0 transparent;
}

.pill.running {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.pill.running .pill-dot {
  background: var(--accent);
  animation: dotPulse 1.4s ease infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.pill.completed { color: var(--success); border-color: rgba(74, 222, 128, 0.45); }
.pill.completed .pill-dot { background: var(--success); }
.pill.failed { color: var(--danger); border-color: rgba(248, 113, 113, 0.45); }
.pill.failed .pill-dot { background: var(--danger); }
.pill.stopped { color: var(--warn); border-color: rgba(251, 191, 36, 0.45); }
.pill.stopped .pill-dot { background: var(--warn); }

.meta-item {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(14, 20, 31, 0.5);
}

/* ============================== 面板 ============================== */
.panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow:
    0 24px 60px -30px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

/* 顶部渐变高光描边 */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(94, 234, 212, 0.35), transparent 30%, transparent 70%, rgba(129, 140, 248, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
  pointer-events: none;
}

/* HUD 四角装饰 */
.hud-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(94, 234, 212, 0.5);
  z-index: 2;
  pointer-events: none;
}
.hud-corner.tl { top: 8px; left: 8px; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.hud-corner.tr { top: 8px; right: 8px; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.hud-corner.bl { bottom: 8px; left: 8px; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.hud-corner.br { bottom: 8px; right: 8px; border-left: none; border-top: none; border-bottom-right-radius: 6px; }

.panel h2 {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.panel h2::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(var(--accent), var(--accent-3));
  box-shadow: 0 0 10px var(--accent-glow);
}

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

.panel-head h2 { margin-bottom: 0; }

.hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* ============================== 表单 ============================== */
.launch-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.launch-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.launch-form label span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
}

select:focus { border-color: var(--accent); }

.launch-form label.path-label {
  flex: 1 1 320px;
  min-width: 280px;
}

.launch-form input[type="text"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

.launch-form input[type="text"]:focus { border-color: var(--accent); }

.field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.field-hint.invalid { color: var(--danger); }
.field-hint.valid { color: var(--success); }

.checkbox-label {
  flex-direction: row !important;
  align-items: center !important;
  min-width: auto !important;
  padding-bottom: 10px;
}

.checkbox-label input { accent-color: var(--accent); }

.launch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ============================== 按钮 ============================== */
.btn {
  position: relative;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.15s, border-color 0.2s, color 0.2s;
  overflow: hidden;
}

.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #7ff2df, #14b8a6 55%, #0ea5e9);
  color: #04121a;
  box-shadow: 0 6px 26px var(--accent-glow);
}

.btn-primary:not(:disabled):hover {
  box-shadow: 0 10px 34px var(--accent-glow), 0 0 0 1px rgba(94, 234, 212, 0.5);
}

/* 扫光效果 */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
}

.btn-primary:not(:disabled):hover::after {
  animation: btnShine 0.8s ease;
}

@keyframes btnShine {
  0% { left: -60%; }
  100% { left: 120%; }
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.btn-danger:not(:disabled):hover {
  background: rgba(248, 113, 113, 0.2);
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.25);
}

.btn-secondary {
  background: rgba(14, 20, 31, 0.7);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 18px rgba(94, 234, 212, 0.18);
}

.btn-unlimited {
  background: linear-gradient(135deg, #fbbf24, #f59e0b 45%, #f97316);
  color: #1a0b00;
  border: 1px solid rgba(251, 191, 36, 0.85);
  box-shadow: 0 6px 26px rgba(249, 115, 22, 0.35);
  animation: unlimitedPulse 1.8s ease-in-out infinite;
}

.btn-unlimited:not(:disabled):hover {
  box-shadow: 0 10px 34px rgba(249, 115, 22, 0.45), 0 0 0 1px rgba(251, 191, 36, 0.5);
}

@keyframes unlimitedPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.launch-form-file {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.launch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.launch-row .launch-actions { margin-left: auto; }

/* 主行：选择按钮与信息卡等高并排 */
.launch-row-main { align-items: stretch; }

.btn-browse {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* 操作按钮独占一行（训练页）：不再右推，左对齐成组 */
.launch-form-file > .launch-actions {
  margin-left: 0;
  margin-top: 2px;
}

/* 控制组 / 文件操作组之间的竖线分隔 */
.action-sep {
  align-self: stretch;
  width: 1px;
  min-height: 22px;
  margin: 0 5px;
  background: var(--border-strong);
  opacity: 0.7;
}

.bt-cost-row {
  align-items: flex-end;
  gap: 14px;
  padding-top: 4px;
}

.bt-cost-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.bt-cost-field span {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.bt-cost-field input[type="number"],
.launch-form input[type="number"] {
  width: 120px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.9rem;
  outline: none;
}

.bt-cost-field input[type="number"]:focus,
.launch-form input[type="number"]:focus {
  border-color: var(--accent);
}

.bt-cost-sum {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-bottom: 10px;
}

.field-hint code {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--accent);
}

/* ========================== 数据文件卡片 ========================== */
.data-file-card {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 50px;
  background: rgba(14, 20, 31, 0.6);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 7px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.data-file-card.valid {
  border-style: solid;
  border-color: rgba(94, 234, 212, 0.3);
  box-shadow: inset 0 0 20px rgba(94, 234, 212, 0.06);
}

.data-file-card.invalid { border-color: rgba(248, 113, 113, 0.4); }

.data-file-empty { color: var(--text-muted); font-size: 0.85rem; }

/* 信息卡：仪表盘统计条（每个指标竖向小格 + 细竖线分隔）*/
.data-file-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.data-file-row .item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 13px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}
.data-file-row .item:first-child { border-left: none; padding-left: 2px; }

.data-file-row .label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-file-row .value {
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.1;
  color: var(--text);
}
.data-file-row .value.sym { font-weight: 600; color: var(--accent); text-shadow: 0 0 12px var(--accent-glow); }
.data-file-row .value.score-best { color: #34f5c8; font-weight: 600; }
.data-file-row .value.score-val { color: #38bdf8; font-weight: 600; }

/* 文件名：独立一行放在指标条下方，带顶部细分割线，避免右侧留白 */
.data-file-card > .path {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-file-error { color: var(--danger); font-size: 0.82rem; }

.data-file-path {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* ============================ 品种卡片 ============================ */
.symbols-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.sym-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.sym-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.sym-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sym-card .sym-name { font-weight: 600; font-size: 1rem; margin-bottom: 10px; }

.sym-card .sym-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sym-card .sym-status.completed { color: var(--success); }
.sym-card .sym-status.in_progress { color: var(--accent); }
.sym-card .sym-status.running-job { color: var(--warn); }

.progress-ring-wrap { display: flex; align-items: center; gap: 12px; }

.progress-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--bg-elevated) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.progress-ring::after {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card-solid);
}

.progress-text { font-family: var(--mono); font-size: 0.8rem; }
.progress-text .score { display: block; color: var(--accent); font-weight: 500; }

/* ============================== 分栏 ============================== */
.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
  align-items: stretch;
}

.split > .panel {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.chart-panel .panel-head, .log-panel .panel-head { flex-shrink: 0; }

.log-panel .log-view {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split > .panel { height: auto; }
  .log-panel .log-view { flex: none; min-height: 320px; }
}

.chart-wrap {
  height: 288px;
  position: relative;
}

/* ============================ 指标说明 ============================ */
.chart-metrics-help {
  margin-top: 14px;
  padding: 11px 13px;
  background: rgba(14, 20, 31, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chart-metrics-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  list-style: none;
}

.chart-metrics-help summary::-webkit-details-marker { display: none; }

.chart-metrics-help summary::after {
  content: "收起";
  float: right;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-metrics-help:not([open]) summary::after { content: "展开"; }

.metrics-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.metrics-list li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: start;
}

.metric-swatch {
  display: block;
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 3px;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 10px var(--swatch);
}

.metrics-list strong { display: block; color: var(--text); font-size: 0.84rem; margin-bottom: 2px; }
.metrics-list p { margin: 0; line-height: 1.45; }

.bt-howto-list {
  margin: 12px 0 2px;
  padding: 0 0 0 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bt-howto-list > li {
  padding-left: 4px;
  color: var(--text-muted);
}

.bt-howto-list > li > strong {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.bt-howto-list p {
  margin: 0 0 6px;
  line-height: 1.6;
  font-size: 0.82rem;
}

.bt-howto-list p:last-child {
  margin-bottom: 0;
}

.bt-howto-list ul {
  margin: 0 0 6px;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bt-howto-list ul li {
  line-height: 1.55;
  font-size: 0.82rem;
  list-style: disc;
}

.bt-howto-list code {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--accent);
}

/* ============================== 公式 ============================== */
.formula-box {
  position: relative;
  margin-top: 16px;
  padding: 13px 15px;
  background: linear-gradient(135deg, rgba(14, 20, 31, 0.8), rgba(18, 25, 37, 0.5));
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
}

.formula-box::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--accent), var(--accent-3));
  box-shadow: 0 0 12px var(--accent-glow);
}

.formula-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.formula-box code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  word-break: break-all;
  line-height: 1.6;
  text-shadow: 0 0 14px rgba(94, 234, 212, 0.25);
}

/* ============================== 日志 ============================== */
.log-view {
  overflow: auto;
  background: rgba(3, 6, 12, 0.75);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.55;
  color: #a8b8cc;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-view::-webkit-scrollbar, .debug-view::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.log-view::-webkit-scrollbar-thumb, .debug-view::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb {
  background: rgba(94, 234, 212, 0.25);
  border-radius: 8px;
}
.log-view::-webkit-scrollbar-track, .debug-view::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track { background: transparent; }

/* ============================== 表格 ============================== */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(94, 234, 212, 0.04); }

td code { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }

td:first-child { font-weight: 600; }
td:nth-child(2) { color: var(--accent); font-family: var(--mono); }

.empty-row td { text-align: center; color: var(--text-muted); padding: 24px; }

/* ============================== 调试 ============================== */
.debug-panel::before {
  background: linear-gradient(120deg, rgba(248, 113, 113, 0.35), transparent 40%, transparent 70%, rgba(248, 113, 113, 0.2));
}

.debug-panel .hud-corner { border-color: rgba(248, 113, 113, 0.5); }

.debug-view {
  height: 220px;
  overflow: auto;
  background: rgba(6, 4, 8, 0.8);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.55;
  color: #f0c4c4;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ============================== AI 分析 ============================== */
.ai-panel::before {
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.28), transparent 42%, transparent 68%, rgba(94, 234, 212, 0.22));
}

.ai-panel .hud-corner { border-color: rgba(56, 189, 248, 0.45); }

.ai-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 180px;
}

.ai-field span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ai-field select,
.ai-field input {
  background: rgba(14, 20, 31, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-family: var(--font);
  font-size: 0.88rem;
  min-width: 220px;
}

.ai-key-field {
  flex: 1 1 240px;
}

.ai-key-field input { width: 100%; }

.ai-url-field {
  flex: 1 1 280px;
}

.ai-url-field input { width: 100%; min-width: 260px; }

.ai-model-field {
  flex: 0 1 220px;
}

.ai-model-field input { width: 100%; min-width: 180px; }

.ai-answer {
  min-height: 180px;
  max-height: 480px;
  overflow: auto;
  background: rgba(8, 14, 24, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-answer.loading {
  color: var(--text-muted);
  font-style: italic;
}

.ai-answer.error {
  color: #f0c4c4;
  border-color: rgba(248, 113, 113, 0.35);
}

.ai-answer.streaming::after {
  content: "▍";
  display: inline-block;
  margin-left: 2px;
  color: var(--accent);
  animation: aiCaret 0.9s steps(1) infinite;
}

@keyframes aiCaret {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.modal[hidden] { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  background: #121926;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal-card h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}

.modal-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 18px;
}

.modal-card-error {
  width: min(860px, 100%);
  border-color: rgba(248, 113, 113, 0.45);
}

.modal-card-error h3 {
  color: #fca5a5;
}

.modal-error-detail {
  margin: 0 0 18px;
  max-height: min(55vh, 480px);
  overflow: auto;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.22);
  color: #fecaca;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-tv-blocked-body {
  margin: 0 0 18px;
  padding: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  border: none;
}

.data-file-card .path.data-file-missing {
  color: #fca5a5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* ============================ 进入动画 ============================ */
.panel { animation: panelIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.launch-panel { animation-delay: 0.05s; }
.split { animation: panelIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both; }
.strategies-panel { animation-delay: 0.18s; }
.debug-panel { animation-delay: 0.24s; }
.ai-panel { animation-delay: 0.30s; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .split { animation: none; }
}

/* ============================ 步骤导航 ============================ */
.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.step {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s;
}

.step:hover { color: var(--text); background: rgba(94, 234, 212, 0.04); }

.step.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.1), rgba(129, 140, 248, 0.08));
  border-color: rgba(94, 234, 212, 0.3);
  box-shadow: 0 0 24px rgba(94, 234, 212, 0.12), inset 0 0 20px rgba(94, 234, 212, 0.05);
}

.step-index {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(14, 20, 31, 0.7);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.step.active .step-index {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: #04121a;
  border-color: transparent;
  box-shadow: 0 6px 20px var(--accent-glow);
}

.step-body { display: flex; flex-direction: column; gap: 3px; }

.step-title {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.step-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.step-link {
  flex: 0 0 40px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.4), rgba(129, 140, 248, 0.4));
  opacity: 0.4;
}

@media (max-width: 640px) {
  .step-sub { display: none; }
  .step { padding: 10px 12px; gap: 10px; }
  .step-link { flex-basis: 16px; }
}

/* ============================== 分页 ============================== */
.page { display: none; }
.page.active {
  display: block;
  animation: pageIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
}

/* ============================ 回测选项 ============================ */
.bt-options {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(14, 20, 31, 0.6);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.switch-label:hover { border-color: var(--border-hover); }

.switch-label input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

/* ============================ 指标卡片 ============================ */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

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

.metric-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 18px 4px;
  text-align: center;
}

.metric-card {
  position: relative;
  padding: 16px 16px 14px;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(14, 20, 31, 0.85), rgba(18, 25, 37, 0.5));
  border: 1px solid var(--border-strong);
  overflow: hidden;
  min-width: 0;
  min-height: 84px;
}

/* 右下角迷你趋势微线 */
.metric-spark {
  position: absolute;
  right: 12px;
  bottom: 9px;
  width: 74px;
  height: 22px;
  opacity: 0.9;
  pointer-events: none;
}

.metric-spark .spark-svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px rgba(94, 234, 212, 0.22));
}

.metric-card .metric-value { position: relative; z-index: 1; }

.metric-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--accent), var(--accent-3));
  box-shadow: 0 0 12px var(--accent-glow);
}

.metric-card.pos::before { background: linear-gradient(var(--success), #22c55e); box-shadow: 0 0 12px rgba(74, 222, 128, 0.3); }
.metric-card.neg::before { background: linear-gradient(var(--danger), #ef4444); box-shadow: 0 0 12px rgba(248, 113, 113, 0.3); }

.metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.metric-value {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.metric-value.pos { color: var(--success); text-shadow: 0 0 16px rgba(74, 222, 128, 0.25); }
.metric-value.neg { color: var(--danger); text-shadow: 0 0 16px rgba(248, 113, 113, 0.25); }
.metric-value.accent { color: var(--accent); text-shadow: 0 0 16px var(--accent-glow); }

.metric-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 4px;
}

/* ============================ 回测绩效表 ============================ */
.bt-table td { font-family: var(--mono); font-size: 0.8rem; }
.bt-table td:first-child { font-family: var(--font); }
.bt-table td.pos { color: var(--success); }
.bt-table td.neg { color: var(--danger); }
.bt-table .sym-cell { color: var(--accent); font-weight: 600; }

/* ============================ 阶段进度条 ============================ */
.bt-phase {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.bt-phase-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: rgba(14, 20, 31, 0.9);
  border: 1px solid var(--border);
  overflow: hidden;
}

.bt-phase-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bt-phase-fill.animate {
  background-size: 200% 100%;
  animation: phaseFlow 2s linear infinite;
}

@keyframes phaseFlow {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.bt-phase-label {
  font-size: 0.74rem;
  font-family: var(--mono);
  color: var(--accent);
  white-space: nowrap;
  min-width: 68px;
  text-align: right;
}

/* ============================ 图表画廊 ============================ */
.chart-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.chart-card {
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(6, 10, 16, 0.6);
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.chart-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.8), 0 0 20px rgba(94, 234, 212, 0.1);
  transform: translateY(-2px);
}

.chart-card.portfolio {
  grid-column: 1 / -1;
  max-width: 100%;
}

.chart-card.portfolio img {
  width: 100%;
  min-height: 420px;
  object-fit: contain;
  background: #fff;
}

.chart-card .chart-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: rgba(14, 20, 31, 0.5);
}

.chart-card .chart-card-head::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.chart-card.portfolio .chart-card-head::before { background: var(--accent-3); box-shadow: 0 0 8px var(--violet-glow); }

.chart-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

/* ====================== 交互式资金曲线 (HTML) ====================== */
.equity-live {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.equity-stats {
  display: grid;
  grid-template-columns: auto repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.equity-stat-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.12), rgba(129, 140, 248, 0.08));
  border: 1px solid rgba(94, 234, 212, 0.28);
  text-shadow: 0 0 14px var(--accent-glow);
  white-space: nowrap;
}

.equity-stat-name::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.equity-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(14, 20, 31, 0.7);
  border: 1px solid var(--border-strong);
  min-width: 0;
}

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

@media (max-width: 560px) {
  .equity-stats {
    grid-template-columns: 1fr 1fr;
  }
  .equity-stat-name {
    grid-column: 1 / -1;
  }
}

.equity-stat-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.equity-stat-value {
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
}

.equity-stat-value.pos { color: var(--success); text-shadow: 0 0 14px rgba(74, 222, 128, 0.25); }
.equity-stat-value.neg { color: var(--danger); text-shadow: 0 0 14px rgba(248, 113, 113, 0.25); }
.equity-stat-value.accent { color: var(--accent); text-shadow: 0 0 14px var(--accent-glow); }

.equity-chart-block {
  position: relative;
  padding: 14px 14px 10px;
  border-radius: 12px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(94, 234, 212, 0.05), transparent 60%),
    rgba(6, 10, 16, 0.55);
  border: 1px solid var(--border);
}

.equity-chart-block.roll {
  background:
    radial-gradient(120% 100% at 0% 50%, rgba(251, 191, 36, 0.06), transparent 60%),
    rgba(6, 10, 16, 0.55);
}

.equity-axis-label {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.equity-axis-label::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  box-shadow: 0 0 8px var(--accent-glow);
}

.equity-chart-block.roll .equity-axis-label::before {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
}

.equity-chart-wrap {
  position: relative;
  height: 340px;
}

.equity-chart-wrap.roll { height: 150px; }

.equity-raw {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.equity-raw summary {
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.equity-raw summary:hover { color: var(--accent); }
.equity-raw summary::-webkit-details-marker { display: none; }

.equity-raw summary::before {
  content: "▸";
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.equity-raw[open] summary::before { transform: rotate(90deg); }

.equity-raw .chart-gallery { margin-top: 14px; }

@media (max-width: 640px) {
  .equity-chart-wrap { height: 260px; }
  .equity-chart-wrap.roll { height: 120px; }
}

/* ============================== 灯箱 ============================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(3, 4, 10, 0.9);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.lightbox.open { display: flex; animation: lbIn 0.2s ease both; }

@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  border-radius: 10px;
  border: 1px solid var(--border-hover);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
}

/* ══════════════════════ 实时分析（信号雷达）══════════════════════ */
.rt-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.rt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.rt-field span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rt-field-wide { flex: 1 1 260px; }

.rt-field select,
.rt-field input[type="text"],
.rt-field input[type="password"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

.rt-field input[type="text"],
.rt-field input[type="password"] { font-family: var(--mono); font-size: 0.85rem; }
.rt-field select:focus,
.rt-field input[type="text"]:focus,
.rt-field input[type="password"]:focus { border-color: var(--accent); }

.rt-actions { display: flex; gap: 10px; align-items: flex-end; }

.rt-form-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.rt-source-hint,
.rt-thr-hint {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--text-muted);
}

.rt-source-hint.bad { color: var(--danger); }

.rt-head-right { display: flex; align-items: center; gap: 14px; }

.rt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.rt-card {
  position: relative;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(14, 20, 31, 0.9), rgba(10, 15, 24, 0.6));
  border: 1px solid var(--border-strong);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.rt-card.rt-long {
  border-color: rgba(74, 222, 128, 0.4);
  box-shadow: inset 0 0 26px rgba(74, 222, 128, 0.07), 0 0 20px -8px rgba(74, 222, 128, 0.3);
}
.rt-card.rt-short {
  border-color: rgba(248, 113, 113, 0.4);
  box-shadow: inset 0 0 26px rgba(248, 113, 113, 0.07), 0 0 20px -8px rgba(248, 113, 113, 0.3);
}
.rt-card.rt-flat { border-color: var(--border-strong); }

.rt-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(14, 20, 31, 0.7);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: color 0.15s, border-color 0.15s;
}
.rt-remove:hover { color: var(--danger); border-color: rgba(248, 113, 113, 0.5); }

.rt-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.rt-card-head .rt-sym {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}
.rt-card-head .rt-tf {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text);
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: rgba(14, 20, 31, 0.7);
}
.rt-card-head .rt-src { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }

.rt-gauge {
  position: relative;
  height: 92px;
  margin: 2px 0 6px;
}
.rt-gauge-svg { display: block; width: 100%; height: 100%; }

.rt-gauge-track {
  fill: none;
  stroke: rgba(120, 190, 235, 0.12);
  stroke-width: 9;
  stroke-linecap: round;
}
.rt-gauge-val {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px currentColor);
  transition: stroke-dashoffset 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.rt-gauge-center {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  text-align: center;
}
.rt-strength {
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: 0.04em;
}
.rt-dir {
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.rt-dir.rt-long { color: var(--success); }
.rt-dir.rt-short { color: var(--danger); }
.rt-dir.rt-flat { color: var(--text-muted); }

.rt-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}
.rt-meta-item { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-meta-item b { color: var(--text); font-weight: 600; }

.rt-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--text-muted);
  margin-top: 6px;
}
.rt-countdown {
  margin-left: auto;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.rt-state.ok { color: var(--success); }
.rt-state.error { color: var(--danger); }
.rt-state.insufficient { color: var(--warn); }

.rt-warn {
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--warn);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rt-msg {
  margin-top: 8px;
  font-size: 0.68rem;
  color: #f0c4c4;
  line-height: 1.4;
}

.rt-feishu-panel {
  margin-top: 18px;
}
.rt-feishu-desc {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 52rem;
}
.rt-feishu-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}
.rt-feishu-enable {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  padding-bottom: 10px;
  min-width: 140px;
}
.rt-feishu-enable input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}
#rtFeishuHint {
  display: block;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
#rtFeishuHint.bad,
#rtFeishuHint.invalid { color: var(--danger); }
#rtFeishuHint.valid { color: var(--success); }

.rt-feishu-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn-feishu-help {
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  color: #fff;
  background: #4a90d9;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.btn-feishu-help:hover {
  background: #357abd;
}
.btn-feishu-help:active {
  background: #2a5f9e;
}
.modal-body-feishu-help {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.75;
}
