/* ============================================================
   期货监控 · 设计系统 v2
   统一配色 / 阴影 / 圆角 / 字阶；浅色 + 深色双主题
   ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f7f8fc;
  --border: #e6eaf2;
  --border-strong: #d8deeb;
  --text: #18213a;
  --muted: #69738a;
  --red: #e5484d;
  --green: #2f9e6e;
  --gray: #98a2b3;
  --accent: #3d63f5;
  --accent-hover: #2f52e0;
  --accent-soft: rgba(61, 99, 245, 0.09);
  --accent-text: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 20px -4px rgba(16, 24, 40, 0.09);
  --shadow-lg: 0 18px 50px -12px rgba(16, 24, 40, 0.22);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Cascadia Mono", Consolas, "DIN Alternate", monospace;

  /* Element Plus 主色桥接 */
  --el-color-primary: #3d63f5;
  --el-color-primary-light-3: #6f8bf8;
  --el-color-primary-light-5: #9bb1fa;
  --el-color-primary-light-7: #c6d2fc;
  --el-color-primary-light-8: #dae1fd;
  --el-color-primary-light-9: #edf1fe;
  --el-color-primary-dark-2: #2f52e0;
  --el-border-radius-base: 8px;
  --el-font-family: var(--font);
}

[data-theme="dark"] {
  --el-color-primary: #6d95ff;
  --el-color-primary-light-3: #8dabff;
  --el-color-primary-light-5: #aebfff;
  --el-color-primary-light-7: #ced9ff;
  --el-color-primary-light-8: #dde4ff;
  --el-color-primary-light-9: #edf1ff;
  --el-color-primary-dark-2: #5780e6;
}

/* EP 暗色变量挂在 html.dark 上，优先级更高，这里同步覆盖主色 */
html.dark {
  --el-color-primary: #6d95ff;
  --el-color-primary-light-3: #8dabff;
  --el-color-primary-light-5: #aebfff;
  --el-color-primary-light-7: #ced9ff;
  --el-color-primary-light-8: #dde4ff;
  --el-color-primary-light-9: #edf1ff;
  --el-color-primary-dark-2: #5780e6;
}

[data-theme="dark"] {
  --bg: #0d1017;
  --panel: #151a23;
  --panel-2: #1c2230;
  --border: #262e3f;
  --border-strong: #333d52;
  --text: #e3e9f6;
  --muted: #8b96ad;
  --red: #f2555a;
  --green: #3cbc85;
  --gray: #5d6980;
  --accent: #6d95ff;
  --accent-hover: #86a9ff;
  --accent-soft: rgba(109, 149, 255, 0.14);
  --accent-text: #0d1017;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

::selection { background: var(--accent-soft); }

/* ================= 顶部栏 ================= */
.topbar {
  height: 50px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  z-index: 90;
}

.logo {
  font-weight: 800;
  color: var(--accent);
  font-size: 15.5px;
  white-space: nowrap;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 8px -2px rgba(61, 99, 245, 0.5);
}

.user-chip {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--mono);
}

.search-box {
  position: relative;
  flex: 0 0 340px;
}

.search-box .el-input__wrapper {
  background: var(--panel-2);
  border-radius: var(--r-sm);
}

.search-box .el-input__wrapper.is-focus { background: var(--panel); }

.search-results {
  position: absolute;
  top: 38px;
  left: 0;
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  padding: 4px;
}

/* 搜索结果分组标题（具体合约 / 主力连续） */
.search-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.search-group .gc { font-weight: 400; opacity: 0.75; }

.search-item {
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-radius: var(--r-sm);
  transition: background 0.12s;
}

.search-item:hover { background: var(--accent-soft); }

.search-item .n { color: var(--text); flex: 1; font-weight: 500; }
.search-item .c { color: var(--muted); font-size: 11px; font-family: var(--mono); }

.search-item .add-wl {
  width: 22px;
  height: 22px;
  line-height: 20px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  transition: all 0.15s;
}

.search-item .add-wl:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.spacer { flex: 1; }

/* 导航标签 */
.nav-tabs { display: flex; align-items: center; gap: 4px; }

.nav-tabs a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.nav-tabs a:hover { color: var(--text); background: var(--panel-2); }

.nav-tabs a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  margin-left: 5px;
  font-weight: 700;
}

/* ================= 页面骨架 ================= */
.page-content {
  flex: 1;
  padding: 24px 20px 40px;
  overflow-y: auto;
  min-height: 0;
}

.page-inner {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.2px;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* ================= 卡片 ================= */
.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.card-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: -12px;
  margin-bottom: 14px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.card-row:last-child { border-bottom: none; }

.card-row label { font-size: 13.5px; color: var(--text); font-weight: 500; }

.card-row .desc { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }

.section-title {
  font-size: 12px;
  color: var(--muted);
  margin: 22px 0 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.form-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* 逻辑条：AND/OR 组合 + 添加按钮 */
.logic-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.logic-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lp-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.logic-actions {
  display: inline-flex;
  gap: 6px;
}

/* 条件卡片：单条件独占一卡，禁用时半透明 */
.cond-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: all 0.15s;
}
.cond-card:hover { border-color: var(--border-strong); }
.cond-card.off { opacity: 0.5; }
.cond-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 10px;
}
.cond-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.cond-spacer { flex: 1; }
.cond-body { display: flex; flex-direction: column; gap: 8px; }
.cond-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cond-keyword {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  min-width: 32px;
  display: inline-block;
}

/* 通知卡片三栏：图标 + 标题 + 描述 + 状态标签 */
.notify-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 6px;
}
.notify-card {
  position: relative;
  display: block;
  background: var(--panel-2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.notify-card.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.notify-card input { display: none; }
.notify-card .nc-icon { font-size: 24px; margin-bottom: 6px; }
.notify-card .nc-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.notify-card .nc-desc { font-size: 12px; color: var(--muted); line-height: 1.5; min-height: 32px; }
.notify-card .nc-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
  margin-top: 8px;
}
.notify-card .nc-tag.warn {
  background: rgba(255, 170, 0, 0.12);
  color: #d68a00;
  border-color: rgba(255, 170, 0, 0.4);
}
.notify-card.on .nc-tag { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 设置页双列 */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

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

/* ================= 按钮 ================= */
.btn {
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  font-family: var(--font);
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  color: #fff;
  box-shadow: 0 2px 8px -2px rgba(61, 99, 245, 0.5);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -2px rgba(61, 99, 245, 0.55);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-ghost {
  background: var(--panel);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--panel-2);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--red);
}

.btn-danger:hover:not(:disabled) { background: rgba(229, 72, 77, 0.1); }

.btn-sm { height: 27px; padding: 0 11px; font-size: 12px; border-radius: 7px; }

/* ================= 表单 ================= */
.form-section { margin-bottom: 16px; }

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.form-group label { font-size: 12px; color: var(--muted); font-weight: 600; }

.form-group input:not(.el-input__inner),
.form-group select:not(.el-input__inner),
.modal-body input[type="text"] {
  height: 36px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: 0 11px;
  font-size: 13px;
  min-width: 80px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  font-family: var(--font);
}

.form-group input::placeholder { color: var(--gray); }

.form-group input:not(.el-input__inner):focus,
.form-group select:not(.el-input__inner):focus,
.modal-body input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group input:disabled { opacity: 0.6; cursor: not-allowed; background: var(--bg); }

.form-group input[type="checkbox"] { height: auto; min-width: 0; }

/* Element Plus 卡片统一圆角 */
.fut-card { border-radius: var(--r-lg); border-color: var(--border); }
.fut-card .el-card__header { border-bottom-color: var(--border); }
.fut-card .el-card__body { padding: 20px; }

/* el-input 内原生输入框不叠加自定义背景 */
.el-input__wrapper,
.el-select__wrapper,
.el-textarea__inner { background: var(--panel-2); }

/* 通知渠道：复选框 → 胶囊开关 */
.notify-channels { display: flex; gap: 10px; flex-wrap: wrap; }

.notify-channels label,
.notify-channels button,
.notify-channels .channel-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.notify-channels label:has(input:checked),
.notify-channels label.on,
.notify-channels button.on,
.notify-channels .channel-item.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.notify-channels input { display: none; }

/* 开关 */
.toggle {
  width: 38px;
  height: 20px;
  border-radius: 10px;
  background: var(--gray);
  position: relative;
  cursor: pointer;
  transition: background 0.18s;
  flex-shrink: 0;
}

.toggle.on { background: var(--green); }

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.toggle.on::after { left: 20px; }

/* 开关行（设置页） */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.switch-row:last-child { border-bottom: none; }

.switch-row .s-label { font-size: 13.5px; font-weight: 500; }

.switch-row .s-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ================= 表格 ================= */
.table-card {
  padding: 0;
  overflow: hidden;
}

.table-card .strategy-table { margin: 0; }

.table-scroll { overflow-x: auto; }

.strategy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.strategy-table th,
.strategy-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.strategy-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  background: var(--panel-2);
  letter-spacing: 0.3px;
}

.strategy-table tbody tr:last-child td { border-bottom: none; }

.strategy-table tbody tr { transition: background 0.12s; }

.strategy-table tbody tr:hover td { background: var(--accent-soft); }

.strategy-table .actions { display: flex; gap: 6px; }

.strategy-table td.actions { white-space: nowrap; }

/* 状态点 */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray);
  margin-right: 7px;
}

.status-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(47, 158, 110, 0.18); }
.status-dot.off { background: var(--gray); }

/* 状态标签 */
.status-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.status-pending { background: rgba(154, 103, 0, 0.1); color: #9a6700; }
.status-active { background: rgba(47, 158, 110, 0.12); color: var(--green); }
.status-disabled { background: rgba(229, 72, 77, 0.1); color: var(--red); }

[data-theme="dark"] .status-pending { background: rgba(210, 153, 34, 0.15); color: #d29922; }

/* 条件标签 */
.cond-tags { display: flex; gap: 5px; flex-wrap: wrap; max-width: 380px; white-space: normal; }

.cond-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.cond-tag.disabled { opacity: 0.4; text-decoration: line-through; }

/* ================= 弹窗 ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 16, 23, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.loading-tip { display: block; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 720px;
  max-width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title, .modal-header h3 { font-size: 15.5px; font-weight: 700; }

.modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover { background: var(--panel-2); color: var(--red); }

.modal-body { padding: 20px; overflow-y: auto; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.modal-body input[type="text"] { width: 100%; }

/* ================= 策略条件编辑 ================= */
.logic-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.logic-bar label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.logic-bar select {
  height: 30px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 0 8px;
  font-size: 12.5px;
}

.condition-row {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 10px;
  transition: opacity 0.15s, border-color 0.15s;
}

.condition-row:hover { border-color: var(--border-strong); }

.condition-row.disabled { opacity: 0.5; }

.condition-main {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.condition-main select:not(.el-input__inner),
.condition-main input:not(.el-input__inner) {
  height: 30px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 0 8px;
  font-size: 12.5px;
}

.condition-main input:not(.el-input__inner):focus,
.condition-main select:not(.el-input__inner):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.condition-main input:not(.el-input__inner) { width: 70px; }

.condition-label { color: var(--muted); font-size: 12px; font-weight: 500; }

.condition-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 模板卡片 */
.template-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.template-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--panel);
}

.template-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.template-name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }

.template-desc { font-size: 12px; color: var(--muted); }

.template-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.backtest-result p { font-size: 13px; margin-bottom: 10px; }

/* ================= 空态 ================= */
.empty-state {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.empty-state::before {
  content: "📭";
  display: block;
  font-size: 30px;
  margin-bottom: 10px;
  opacity: 0.7;
}

.empty { padding: 10px; color: var(--muted); text-align: center; font-size: 12px; }

/* ================= 登录页 ================= */
.login-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background:
    radial-gradient(700px 420px at 15% 10%, rgba(61, 99, 245, 0.14), transparent 60%),
    radial-gradient(600px 380px at 88% 85%, rgba(47, 158, 110, 0.12), transparent 60%),
    var(--bg);
  padding: 40px 16px;
}

.login-box {
  width: 400px;
  max-width: 94vw;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.login-brand .brand-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -4px rgba(61, 99, 245, 0.55);
}

.login-brand h2 { font-size: 19px; font-weight: 800; letter-spacing: 0.3px; }

.login-brand p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.login-box .form-group { margin-bottom: 14px; }

.login-tabs { margin-bottom: 4px; }

.login-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: var(--panel-2);
  padding: 4px;
  border-radius: var(--r-sm);
}

.login-tab {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  transition: all 0.15s;
}

.login-tab.active {
  color: var(--accent);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.login-msg { font-size: 12.5px; margin-top: 12px; line-height: 1.6; }
.login-msg.error { color: var(--red); }
.login-msg.info { color: var(--muted); }

/* ================= 主题切换 ================= */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}

.theme-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ================= 通知中心 ================= */
.notif-list { display: flex; flex-direction: column; }

.notif-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: var(--panel-2); }

.notif-item.unread { background: var(--accent-soft); }

.notif-item.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--accent);
}

.notif-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }

.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.notif-content { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.notif-time { font-size: 11px; color: var(--gray); }
.notif-tag { display: inline-block; font-size: 11px; padding: 1px 7px; margin-left: 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }

/* 最新 / 历史标签页 */
.notif-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.notif-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.notif-tab:hover { color: var(--text); border-color: var(--accent); }

.notif-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.notif-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ================= 后台看板 ================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.dashboard-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(61, 99, 245, 0.25));
}

.dashboard-card label { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.dashboard-card .value {
  font-size: 27px;
  font-weight: 800;
  margin-top: 8px;
  color: var(--text);
  font-family: var(--mono);
  letter-spacing: -0.5px;
}

/* ================= 行情页（K线终端） ================= */
.snapshot {
  min-height: 74px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 26px;
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.symbol-info { min-width: 150px; }

.symbol-line { display: flex; align-items: center; gap: 9px; }

.symbol-name { display: block; font-size: 17px; font-weight: 800; }

.symbol-code { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 1px; }

.market-status {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--panel-2);
  color: var(--muted);
}

.status-trade { background: rgba(47, 158, 110, 0.14); color: var(--green); }
.status-wait, .status-pause { background: rgba(152, 162, 179, 0.15); color: var(--muted); }
.status-close { background: rgba(229, 72, 77, 0.12); color: var(--red); }

.price-info { display: flex; align-items: flex-end; gap: 18px; }

.price-col { display: flex; flex-direction: column; align-items: center; min-width: 60px; }

.price-col:first-child { min-width: 110px; }

/* 表格行操作按钮：一行排布、间距收紧，避免"删除"被挤到第二行 */
.row-actions { display: flex; flex-wrap: nowrap; align-items: center; }

.row-actions .el-button + .el-button { margin-left: 8px; }

.price-col label { font-size: 10.5px; color: var(--muted); margin-bottom: 2px; font-weight: 500; }

.last-price { font-size: 28px; font-weight: 800; font-family: var(--mono); letter-spacing: -0.5px; line-height: 1.15; }

.price-change, .price-pct { font-size: 15px; font-weight: 700; font-family: var(--mono); }

.mini-fields { display: flex; gap: 18px; margin-left: auto; }

.mini-fields div { display: flex; flex-direction: column; align-items: flex-end; min-width: 62px; }

.mini-fields label { font-size: 11px; color: var(--muted); }

.mini-fields span { font-size: 14px; font-family: var(--mono); font-weight: 500; }

/* 主体三栏 */
.main-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 190px 1fr 300px;
  grid-template-rows: minmax(0, 1fr); /* 行高严格=容器高，防止内容把行撑出视口 */
  min-height: 0;
  overflow: hidden;
}

/* 行情页（K线）专用骨架：占满视口剩余高度，让 K 线/VOL/MACD 三窗格完整自适应显示 */
.chart-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 44px; /* 给底部固定自选条留位，MACD 不再被盖住 */
}

.chart-page .snapshot { flex-shrink: 0; }

.left-panel, .right-panel {
  background: var(--panel);
  padding: 12px 10px;
  overflow-y: auto;
}

.left-panel { border-right: 1px solid var(--border); }

.right-panel { border-left: 1px solid var(--border); }

.center-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-width: 0;
  overflow: hidden;
}

.panel-title {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 盘口 */
.order-book { width: 100%; border-collapse: collapse; margin-bottom: 10px; }

.order-book td {
  padding: 3.5px 5px;
  font-size: 12.5px;
  font-family: var(--mono);
  border-radius: 4px;
}

.order-book tr:hover td { background: var(--panel-2); }

.order-book .label { color: var(--muted); width: 36px; font-size: 11px; font-family: var(--font); }

.order-book .price { text-align: right; width: 72px; font-weight: 600; }

.order-book .vol { text-align: right; color: var(--muted); width: 52px; }

.snapshot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.snapshot-grid div {
  background: var(--panel-2);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
}

.snapshot-grid label { font-size: 10.5px; color: var(--muted); }

.snapshot-grid span { font-size: 13.5px; font-family: var(--mono); margin-top: 2px; font-weight: 600; }

/* 周期/指标栏 */
.period-bar {
  display: flex;
  gap: 3px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  align-items: center;
}

.period-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 4px 11px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.13s;
}

.period-btn:hover { background: var(--panel-2); color: var(--text); }

.period-btn.active { background: var(--accent); color: #fff; font-weight: 600; }

.indicator-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.indicator-bar input {
  width: 84px;
  height: 25px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0 7px;
  font-size: 12px;
  font-family: var(--mono);
  transition: all 0.15s;
}

.indicator-bar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.indicator-bar button {
  height: 25px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}

.indicator-bar button:hover { background: var(--accent-hover); }

.kline-box { flex: 1; position: relative; min-height: 0; }

.crosshair-info {
  position: fixed;
  bottom: 44px;
  left: 0;
  right: 0;
  z-index: 99;
  height: 28px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow-x: auto;
  font-family: var(--mono);
}

.loading-tip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  z-index: 10;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
}

/* 成交明细 */
.tick-header {
  display: grid;
  grid-template-columns: 54px 1fr 50px 54px 46px;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--panel);
}

.tick-list { overflow-y: auto; height: calc(100% - 28px); }

.tick-row {
  display: grid;
  grid-template-columns: 54px 1fr 50px 54px 46px;
  gap: 3px;
  padding: 2.5px 0;
  font-size: 11.5px;
  font-family: var(--mono);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.tick-row:hover { background: var(--panel-2); }

.tick-row span { text-align: right; white-space: nowrap; }

.tick-row span:first-child { text-align: left; }

/* 底部自选条 */
.watchlist-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 44px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  overflow-x: auto;
  box-shadow: 0 -2px 10px rgba(16, 24, 40, 0.04);
}

.wl-title { font-weight: 700; color: var(--muted); white-space: nowrap; font-size: 12.5px; }

.wl-items { display: flex; gap: 8px; }

.wl-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px;
  background: var(--panel-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.13s;
}

.wl-item:hover { background: var(--bg); border-color: var(--border-strong); }

.wl-item.active { border-color: var(--accent); background: var(--accent-soft); }

.wl-del {
  width: 17px;
  height: 17px;
  line-height: 15px;
  padding: 0;
  margin-left: 2px;
  background: transparent;
  border: none;
  color: var(--gray);
  font-size: 14px;
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.13s;
}

.wl-del:hover { background: rgba(229, 72, 77, 0.14); color: var(--red); }

.wl-name { font-size: 12.5px; color: var(--text); font-weight: 500; }

.wl-last, .wl-change, .wl-pct { font-size: 12px; font-family: var(--mono); }

.wl-change { font-size: 11px; }

/* ================= 通用 ================= */
.red { color: var(--red); }
.green { color: var(--green); }
.gray { color: var(--gray); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover { background-color: var(--gray); }

/* ================= Toast ================= */
.fut-toast {
  position: fixed;
  top: 62px;
  right: 18px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.fut-toast-item {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 11px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(14px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 330px;
  word-break: break-all;
}

.fut-toast-item.show { opacity: 1; transform: translateX(0); }
.fut-toast-item.error { border-left-color: var(--red); }
.fut-toast-item.success { border-left-color: var(--green); }

/* ===== 全局合规声明页脚 ===== */
.app-footer {
  padding: 14px 24px 18px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary, #999);
  border-top: 1px solid var(--border, #eee);
  margin-top: 8px;
}
