/* ─── CSS 变量 ─────────────────────────── */
:root {
  --bg-base: #0b0d10;
  --bg-dark: #090b0e;
  --bg-panel: #11151b;
  --bg-card: #171c23;
  --bg-hover: #202630;
  --border: #2a323c;
  --border-light: #3a4552;

  --text-primary: #eef1f4;
  --text-secondary: #a2aab5;
  --text-muted: #68727f;

  --up: #22c58b;
  --down: #ef5b6d;
  --hold: #e1a33f;
  --blue: #4f8cff;
  --purple: #7d6df2;
  --accent-green: var(--up);
  --accent-red: var(--down);
  --accent-blue: var(--blue);

  --signal-strong-buy: #22c58b;
  --signal-buy: #5ac98c;
  --signal-hold: #e1a33f;
  --signal-sell: #e9874e;
  --signal-strong-sell: #ef5b6d;

  --font-mono: Consolas, 'SFMono-Regular', 'Liberation Mono', Menlo, monospace;
  --radius: 6px;
  --transition: 0.2s ease;
}

.hidden {
  display: none !important;
}

/* ─── 重置 ─────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior-x: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

input {
  outline: none;
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

/* ─── 布局 ─────────────────────────────── */
#app {
  display: grid;
  grid-template-rows: 86px 0 calc(100vh - 86px);
  grid-template-columns: 170px 1fr 440px 300px;
  grid-template-areas:
    "header header header header"
    "buy-alert buy-alert buy-alert buy-alert"
    "sidebar  main  panel history";
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns 0.3s ease;
}

#app.has-buy-alert {
  grid-template-rows: 86px 44px calc(100vh - 130px);
}

#app.main-hidden {
  grid-template-columns: 170px 0px 1fr 300px;
}

#app.main-hidden #main {
  display: none !important;
}

/* ─── 顶部导航栏 ────────────────────────── */
#header {
  grid-area: header;
  display: flex;
  flex-direction: column;
  background: rgba(20, 24, 38, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  overflow: visible;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.buy-alert {
  grid-area: buy-alert;
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 6px 16px;
  background: rgba(13, 28, 25, 0.96);
  border-bottom: 1px solid rgba(34, 197, 139, 0.28);
  color: var(--text-primary);
  overflow: hidden;
  z-index: 900;
}

.buy-alert-main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: max-content;
}

.buy-alert-kicker {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(34, 197, 139, 0.35);
  border-radius: 4px;
  background: rgba(34, 197, 139, 0.1);
  color: var(--up);
  font-size: 12px;
  font-weight: 700;
}

.buy-alert-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 3px;
  background: rgba(34, 197, 139, 0.22);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}

.buy-alert-list {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%);
}

.buy-alert-track {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  padding-right: 24px;
  animation: buyAlertMarquee var(--buy-alert-duration, 22s) linear infinite;
  transform: translateX(var(--buy-alert-start, 100%));
  will-change: transform;
}

@keyframes buyAlertMarquee {
  from {
    transform: translateX(var(--buy-alert-start, 100%));
  }

  to {
    transform: translateX(var(--buy-alert-end, -100%));
  }
}

@media (prefers-reduced-motion: reduce) {
  .buy-alert-track {
    animation: none;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

.buy-alert-list::-webkit-scrollbar {
  display: none;
}

.buy-alert-track::-webkit-scrollbar {
  display: none;
}

.buy-alert-list {
  overflow-y: hidden;
  scrollbar-width: none;
}

.buy-alert-chip {
  flex: 0 0 auto;
  min-width: max-content;
  max-width: none;
  min-height: 30px;
  height: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(90, 201, 140, 0.32);
  border-radius: 5px;
  background: rgba(90, 201, 140, 0.08);
  color: var(--text-primary);
  font-size: 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
}

.buy-alert-chip:hover {
  background: rgba(90, 201, 140, 0.16);
  border-color: rgba(90, 201, 140, 0.62);
}

.buy-alert-chip.strong {
  border-color: rgba(34, 197, 139, 0.55);
  background: rgba(34, 197, 139, 0.14);
}

.buy-alert-chip-name {
  flex: 0 0 auto;
  max-width: none;
  font-weight: 700;
  white-space: nowrap;
}

.buy-alert-chip-score {
  color: var(--up);
  font-family: var(--font-mono);
  font-weight: 700;
}

.buy-alert-chip-window {
  color: var(--text-secondary);
  max-width: none;
  white-space: nowrap;
  line-height: 1.35;
}

.header-row {
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

#header-row-1 {
  height: 50px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#header-row-2 {
  height: 36px;
  background: rgba(0, 0, 0, 0.2);
  gap: 20px;
}

#logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: #00ffcc;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

#logo svg {
  width: 22px;
  height: 22px;
}

/* 搜索框 */
#search-wrap {
  position: relative;
  flex: 1;
  min-width: 140px;
  max-width: 300px;
}

#search-input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color var(--transition);
}

#search-input:focus {
  border-color: var(--blue);
}

#search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

#search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
  display: none;
}

#search-results .sr-item {
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#search-results .sr-item:hover {
  background: var(--bg-hover);
}

#search-results .sr-symbol {
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--blue);
}

#search-results .sr-name {
  color: var(--text-secondary);
  font-size: 12px;
}

#bt-symbol-results {
  position: fixed;
  z-index: 10020;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.bt-sr-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.bt-sr-item:hover {
  background: var(--bg-hover);
}

.bt-sr-symbol {
  color: var(--blue);
  font-family: var(--font-mono);
  font-weight: 700;
}

.bt-sr-name,
.bt-sr-exchange,
.bt-sr-empty {
  color: var(--text-muted);
  font-size: 12px;
}

.bt-sr-empty {
  padding: 10px;
}

/* 顶部右侧信息 */
#header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

#market-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.open {
  background: var(--up);
  animation: pulse 2s infinite;
}

#clock {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

/* 顶部控制项统一样式（分析频率 / 分析天数 / 投资偏好 / AI平台） */
#freq-wrap,
.header-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}

#freq-label,
.header-ctrl>span {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

#freq-select,
.header-ctrl>select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--transition);
}

#freq-select:hover,
.header-ctrl>select:hover {
  border-color: var(--border-light);
}

#freq-select:focus,
.header-ctrl>select:focus {
  border-color: var(--blue);
  outline: none;
}

/* ─── 左侧监控列表 ──────────────────────── */
#sidebar {
  grid-area: sidebar;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

#sidebar-title {
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

#sidebar-title>span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

#sidebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitor-task-notice {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(225, 163, 63, 0.36);
  border-radius: 7px;
  background: rgba(225, 163, 63, 0.1);
  color: var(--text-secondary);
  line-height: 1.35;
}

.monitor-task-notice-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.monitor-task-notice-heading strong {
  color: var(--hold);
  font-size: 12px;
}

.monitor-task-notice-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--hold);
  box-shadow: 0 0 0 3px rgba(225, 163, 63, 0.14);
  animation: monitor-task-pulse 1.8s ease-in-out infinite;
}

.monitor-task-notice-progress {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.monitor-task-notice small {
  color: var(--text-muted);
  font-size: 10px;
}

@keyframes monitor-task-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.sidebar-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.sidebar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--blue);
}

#btn-batch-remove {
  color: var(--down);
  border-color: rgba(255, 77, 106, 0.3);
}

.wl-select-all-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

#watchlist {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  min-height: 0;
  overscroll-behavior: contain;
}

.wl-item {
  padding: 10px 14px;
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  display: flex !important;
  flex-direction: row !important;
  /* 横向排列：[复选框] [内容容器] */
  align-items: center;
  gap: 12px;
}

.wl-item:hover {
  background: var(--bg-hover);
}

/* 隐藏原生复选框，使用自定义样式 */
.wl-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  display: none;
  /* 默认隐藏 */
  transition: all var(--transition);
}

.wl-checkbox:checked {
  background: var(--blue);
  border-color: var(--blue);
}

.wl-checkbox:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 12px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
}

.wl-item.select-mode {
  padding-left: 14px;
  /* 保持与非选择模式一致，因为复选框现在是flex item */
}

.wl-item.select-mode .wl-checkbox {
  display: inline-block;
}

/* 内容容器占据剩余空间 */
.wl-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wl-item.active {
  background: var(--bg-hover);
  border-color: rgba(59, 130, 246, 0.55);
  border-left-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.16);
}

.wl-item.active::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.wl-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.wl-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.wl-symbol {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
}

.wl-price {
  font-family: var(--font-mono);
  font-size: 13px;
}

.wl-row2 {
  display: flex;
  justify-content: space-between;
}

.wl-name {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wl-change {
  font-size: 11px;
  font-family: var(--font-mono);
}

/* 右侧：涨跌幅 + 移除按钮 */
.wl-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 移除按钮：默认隐藏，hover 时显示 */
.wl-remove {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 77, 106, 0.15);
  border: 1px solid rgba(255, 77, 106, 0.3);
  color: var(--down);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
  flex-shrink: 0;
}

.wl-remove:hover {
  background: rgba(255, 77, 106, 0.3);
  border-color: var(--down);
}

.wl-item:hover .wl-remove {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wl-item-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.wl-backtest,
.mobile-watch-backtest {
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
}

.wl-backtest:hover,
.mobile-watch-backtest:hover {
  border-color: var(--blue);
  color: var(--text-primary);
}

/* 信号徽章独立行容器 */
.wl-row-signal {
  display: block;
  margin-top: 2px;
}

.wl-signal-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ─── 目标价变动闪烁动画 ──────────────────── */
@keyframes flashDown {
  0% {
    background: rgba(255, 77, 106, 0);
    box-shadow: none;
  }

  20% {
    background: rgba(255, 77, 106, 0.25);
    box-shadow: 0 0 12px rgba(255, 77, 106, 0.5);
  }

  50% {
    background: rgba(255, 77, 106, 0.15);
  }

  80% {
    background: rgba(255, 77, 106, 0.25);
    box-shadow: 0 0 12px rgba(255, 77, 106, 0.5);
  }

  100% {
    background: rgba(255, 77, 106, 0);
    box-shadow: none;
  }
}

@keyframes flashUp {
  0% {
    background: rgba(0, 212, 170, 0);
    box-shadow: none;
  }

  20% {
    background: rgba(0, 212, 170, 0.2);
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.4);
  }

  50% {
    background: rgba(0, 212, 170, 0.1);
  }

  80% {
    background: rgba(0, 212, 170, 0.2);
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.4);
  }

  100% {
    background: rgba(0, 212, 170, 0);
    box-shadow: none;
  }
}

@keyframes priceAlertDown {

  0%,
  100% {
    color: var(--down);
    text-shadow: none;
  }

  30%,
  70% {
    color: #ff4d6a;
    text-shadow: 0 0 8px rgba(255, 77, 106, 0.8);
    transform: scale(1.08);
  }
}

@keyframes priceAlertUp {

  0%,
  100% {
    color: var(--up);
    text-shadow: none;
  }

  30%,
  70% {
    color: #00d4aa;
    text-shadow: 0 0 8px rgba(0, 212, 170, 0.8);
    transform: scale(1.08);
  }
}

/* 监控列表项目标价变动闪烁 */
.wl-item.flash-down {
  animation: flashDown 1.8s ease-in-out 3;
}

.wl-item.flash-up {
  animation: flashUp 1.8s ease-in-out 3;
}

/* 目标价数字变动闪烁 */
.price-alert-down {
  animation: priceAlertDown 0.8s ease-in-out 4;
}

.price-alert-up {
  animation: priceAlertUp 0.8s ease-in-out 4;
}

#history-header {
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

#history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hist-select-all-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.hist-item {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  margin-bottom: 10px;
  border-left: 4px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hist-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  display: none;
  transition: all var(--transition);
}

.hist-checkbox:checked {
  background: var(--blue);
  border-color: var(--blue);
}

.hist-checkbox:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 10px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
}

.hist-item.select-mode .hist-checkbox {
  display: inline-block;
}

.hist-item:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.hist-item.active {
  background: rgba(59, 130, 246, 0.08);
  border-left-width: 6px;
  border-left-color: var(--blue) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}

/* 内容容器 */
.hist-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hist-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hist-row2 {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 6px;
  margin-top: 2px;
}

.hist-time {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hist-row-signal {
  display: flex;
  align-items: center;
}

.hist-signal {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hist-target {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hist-score {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.hist-price-diff {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

.hist-price-diff.up {
  color: var(--up);
  background: rgba(0, 212, 170, 0.12);
}

.hist-price-diff.down {
  color: var(--down);
  background: rgba(255, 77, 106, 0.12);
}


.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

/* ─── 主图区域 ──────────────────────────── */
#main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-base);
  min-height: 0;
}

#chart-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  /* 允许小屏幕换行 */
}

.price-label {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  user-select: none;
  margin-right: -10px;
  /* 紧贴右侧数值 */
}

#stock-symbol {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
}

#stock-name {
  font-size: 13px;
  color: var(--text-secondary);
}

#stock-price {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-mono);
}

#stock-change {
  font-size: 14px;
  font-family: var(--font-mono);
}

#period-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.period-tab {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.period-tab:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.period-tab.active {
  background: var(--blue);
  color: #fff;
}

/* 指标标签 */
#indicator-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
}

.ind-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.ind-tag.active {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(59, 130, 246, 0.1);
}

#chart-container {
  flex: 1;
  position: relative;
  min-height: 0;
}

#chart {
  width: 100%;
  height: 100%;
}

/* 指标面板 */
#indicators-panel {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--bg-panel);
}

.ind-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ind-name {
  font-size: 10px;
  color: var(--text-muted);
}

.ind-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

/* ─── 右侧分析面板 ──────────────────────── */
#panel {
  grid-area: panel;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* 信号卡片 */
#signal-card {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--bg-panel), var(--bg-card));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#signal-glow {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.08;
  filter: blur(30px);
  transition: background 0.5s;
}

#signal-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

#signal-icon {
  font-size: 22px;
}

#signal-text {
  font-size: 18px;
  font-weight: 700;
}

#signal-score-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#signal-summary {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* 评分条 */
#score-bar-bg {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-hover);
  position: relative;
  overflow: hidden;
}

#score-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease, background 0.5s;
}

#score-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}

/* 价格目标 */
#price-targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.pt-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 8px 10px;
  border: 1px solid var(--border);
}

.pt-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.pt-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

/* 分析报告 */
#report-section {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#report-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.8;
  background: var(--bg-card);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* 多空理由 */
.reasons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reason-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.reason-dot {
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 6px;
}

.reason-dot.bull {
  background: var(--up);
}

.reason-dot.bear {
  background: var(--down);
}

.reason-dot.cond {
  background: var(--hold);
}

/* 卖出时机用橙色 */

/* 新闻卡片 */
.news-item {
  display: block;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  text-decoration: none;
  transition: border-color var(--transition);
}

.news-item:hover {
  border-color: var(--blue);
}

.news-title {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 4px;
}

.news-meta {
  display: flex;
  justify-content: space-between;
}

.news-pub {
  font-size: 10px;
  color: var(--blue);
  font-weight: 600;
}

.news-time {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* 报告区域：去内层 padding，由 #report-wrap 控制 */
#report-section {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#report-wrap {
  display: flex;
  flex-direction: column;
}


#history-panel {
  grid-area: history;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  pointer-events: auto;
}

#history-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
}

#history-list {
  flex: 1;
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  overscroll-behavior: contain;
}

#history-list::-webkit-scrollbar {
  width: 4px;
}

#history-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ─── 加载 & 状态 ───────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 26, 0.7);
  z-index: 5;
}



.hist-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  cursor: default;
}

.hist-item:hover {
  transform: translateX(4px);
  background: var(--bg-hover);
  border-color: var(--border-light);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}

.hist-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hist-time {
  font-size: 11px;
  color: var(--text-muted);
}

.hist-signal {
  font-size: 13px;
  font-weight: 700;
}

.hist-row2 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hist-target {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.hist-hold-days {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  max-width: 100%;
  white-space: normal;
}

.hist-score {
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
}

.hist-price-diff {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}

.hist-price-diff.up {
  background: rgba(0, 212, 170, 0.1);
  color: var(--up);
}

.hist-price-diff.down {
  background: rgba(255, 77, 106, 0.1);
  color: var(--down);
}

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-secondary);
  margin-top: 12px;
  font-size: 13px;
}

/* 空状态 */
#empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 12px;
  font-size: 14px;
}

#empty-state svg {
  opacity: 0.3;
}

/* risk badge */
.risk-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.risk-LOW {
  background: rgba(0, 212, 170, 0.1);
  color: var(--up);
  border: 1px solid rgba(0, 212, 170, 0.2);
}

.risk-MEDIUM {
  background: rgba(245, 158, 11, 0.1);
  color: var(--hold);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.risk-HIGH {
  background: rgba(255, 77, 106, 0.1);
  color: var(--down);
  border: 1px solid rgba(255, 77, 106, 0.2);
}

/* 连接状态 */
#ws-status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.ws-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.ws-dot.connected {
  background: var(--up);
  animation: pulse 2s infinite;
}

.ws-dot.connecting {
  background: var(--hold);
}

.ws-dot.disconnected {
  background: var(--down);
}

/* 触发按钮与头部动作按钮 */
#trigger-btn,
.header-btn {
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition), background-color var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

#trigger-btn {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
  font-weight: 700;
  padding: 4px 16px;
  letter-spacing: 0.5px;
  font-size: 12px;
}

#bull-finder-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  margin-left: 8px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

#bull-records-btn {
  background: var(--bg-hover);
  margin-left: 8px;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

#trigger-btn:hover,
.header-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

#bull-records-btn:hover {
  background: var(--border-light);
  opacity: 1;
}

#trigger-btn:disabled,
.header-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── 动画 ──────────────────────────────── */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@media (max-width: 1200px) {
  #app {
    grid-template-columns: 160px 1fr 380px 240px;
  }
}

@media (max-width: 900px) {
  #app {
    grid-template-columns: 140px 1fr 300px 0px;
    grid-template-areas:
      "header  header header header"
      "buy-alert buy-alert buy-alert buy-alert"
      "sidebar main   panel  history";
  }

  #history-panel {
    display: none !important;
  }
}

/* ─── 手机端适配 (max-width: 768px) ───────────────────────── */
@media (max-width: 768px) {

  html,
  body {
    width: 100vw;
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    /* 原生平滑滚动 */
  }

  #app {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
  }

  #header {
    flex-wrap: wrap;
    padding: 10px;
    height: auto;
    gap: 8px;
    justify-content: flex-start;
  }

  .buy-alert {
    flex-wrap: nowrap;
    align-items: stretch;
    padding: 8px 0 8px 10px;
    gap: 8px;
  }

  .buy-alert-main {
    flex: 0 0 auto;
  }

  .buy-alert-chip {
    max-width: none;
  }

  #search-wrap {
    min-width: 100%;
    order: 2;
  }

  /* 修复手机端隐藏的问题并重新排版 */
  .header-ctrl,
  #freq-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 45%;
    gap: 4px;
    margin-top: 4px;
    order: 3;
  }

  .header-ctrl select,
  #freq-select {
    width: 100%;
    padding: 6px 4px;
    font-size: 12px;
  }

  .debug-toggle {
    display: flex;
    width: 100%;
    margin-top: 6px;
    margin-bottom: 6px;
    order: 4;
  }

  #trigger-btn,
  #bull-finder-btn,
  #bull-records-btn {
    display: inline-flex;
    flex: 1 1 30%;
    order: 5;
    padding: 10px 4px;
    font-size: 12px;
    margin-left: 0;
  }

  #header-right {
    display: none;
  }

  #sidebar {
    width: 100%;
    height: 165px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  #sidebar-title {
    padding: 7px 10px 6px;
    font-size: 10px;
  }

  #watchlist {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding: 8px 18px;
    overscroll-behavior-x: contain;
    touch-action: pan-y;
    /* 手机端隐藏横向滚动条，保持整洁 */
    scrollbar-width: none;
  }

  #watchlist::-webkit-scrollbar {
    display: none;
  }

  /* 手机端监控列表卡片 */
  .wl-item {
    min-width: 110px;
    max-width: 155px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 0;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
  }

  /* 第一行：代码 + 价格 */
  .wl-row1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .wl-symbol {
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
  }

  .wl-price {
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* 信号徽章单独占一行 */
  .wl-signal-badge {
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    align-self: flex-start;
    white-space: nowrap;
    border: 1px solid;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 第二行：名称 + 涨跌幅 */
  .wl-row2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    overflow: hidden;
  }

  .wl-name {
    font-size: 10px;
    max-width: 60px;
  }

  .wl-change {
    font-size: 10px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* 移除按钮在手机端始终显示（hover不易触发） */
  .wl-item .wl-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    font-size: 11px;
    flex-shrink: 0;
  }

  /* 信号徽章独立行在手机端展示 */
  .wl-row-signal {
    display: block;
    min-height: 0;
  }

  /* 主图表区域 手机端紧凑化 */
  #main {
    height: auto;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }

  #chart-header {
    padding: 8px 10px;
    gap: 6px;
  }

  #stock-symbol {
    font-size: 16px;
  }

  #stock-price {
    font-size: 18px;
  }

  .price-label {
    font-size: 11px;
    margin-right: -4px;
    padding: 2px 4px;
  }

  #stock-change {
    font-size: 13px;
  }

  #period-tabs {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    margin-top: 4px;
  }

  .period-tab {
    padding: 4px 6px;
    font-size: 11px;
    flex: 1;
    text-align: center;
  }

  #indicator-tags {
    padding: 4px 10px;
  }

  /* 修复图表面积过小导致堆叠、K线变形 */
  #chart-container {
    height: 350px !important;
    min-height: 350px;
    flex: none !important;
  }

  #indicators-panel {
    gap: 12px;
    padding: 8px 10px;
    justify-content: flex-start;
  }

  #panel {
    border-left: none;
    height: auto !important;
    min-height: unset !important;
    overflow: visible !important;
    flex: none !important;
  }

  #report-section {
    overflow-y: visible !important;
    height: auto !important;
    flex: none !important;
  }

  #history-section {
    overflow-y: visible !important;
    height: auto !important;
  }

  #price-targets {
    grid-template-columns: repeat(2, 1fr);
  }

  .glass-panel {
    width: 95vw !important;
    height: 90vh !important;
    max-height: 90vh;
  }

  .modal-body {
    padding: 10px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
    font-size: 11px;
  }
}

/* ─── 调试模式开关 ───────────────────────── */
.debug-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  margin-left: 8px;
}

.debug-toggle input {
  display: none;
}

.debug-slider {
  width: 34px;
  height: 18px;
  background: var(--border);
  border-radius: 9px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.debug-slider::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.debug-toggle input:checked+.debug-slider {
  background: var(--blue);
}

.debug-toggle input:checked+.debug-slider::after {
  transform: translateX(16px);
}

.debug-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── 调试浮层面板 ───────────────────────── */
.debug-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 560px;
  max-height: 70vh;
  background: rgba(10, 14, 26, 0.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.debug-panel.hidden {
  display: none;
}

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  flex-shrink: 0;
}

.debug-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.debug-clear-btn,
.debug-close-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
}

.debug-clear-btn:hover {
  color: var(--text-primary);
  border-color: var(--blue);
}

.debug-close-btn {
  font-size: 14px;
  font-weight: bold;
}

.debug-close-btn:hover {
  color: var(--down);
  border-color: var(--down);
}

.debug-body {
  overflow-y: auto;
  flex: 1;
  padding: 0;
}

.debug-section {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.debug-section:last-child {
  border-bottom: none;
}

.debug-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.debug-status {
  font-size: 10px;
  margin-left: 6px;
  color: var(--up);
}

.debug-pre {
  margin: 0;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 8px;
  line-height: 1.6;
}

.debug-stream-pre {
  color: #10b981;
  max-height: 240px;
  border: 1px solid rgba(0, 212, 170, 0.15);
}


/* ─── 弹窗与表格样式 ─────────────────────────────── */

body.modal-open {
  overflow: hidden !important;
}

/* 弹窗遮罩 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

/* 毛玻璃面板 */
.glass-panel {
  background: rgba(22, 29, 47, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  width: 400px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .glass-panel {
  transform: translateY(20px);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 16px;
  margin: 0;
  color: #fff;
}

.close-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  transition: color var(--transition);
}

.close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
}

.modal-footer button {
  padding: 8px 16px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
}

.modal-footer button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-footer button:active {
  transform: translateY(1px);
}

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  /* 避免文字被挤成一列 */
}

.data-table td.wrap-cell {
  white-space: normal;
  /* 允许核心逻辑等长文本折行 */
  line-height: 1.6;
}

.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(15, 20, 35, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 var(--border);
}

.data-table tbody tr {
  transition: background 0.2s;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

/* 分页器 */
.pagination {
  display: flex;
  align-items: center;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s;
}

.pagination button:not(:disabled):hover {
  background: var(--bg-hover);
  border-color: var(--blue);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 弹窗内加载转圈 */
.modal-spinner {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: #10b981;
  animation: spin 0.7s linear infinite;
}

/* 按钮内小转圈（开始扫描loading态） */
.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  margin-right: 4px;
  vertical-align: middle;
}

/* 通用按钮样式 */
.btn-primary {
  padding: 6px 12px;
  background: var(--btn-bg, var(--blue));
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline-blue {
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--blue);
  color: var(--blue);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-outline-blue:hover {
  background: rgba(59, 130, 246, 0.2);
}

.btn-outline-gray {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-outline-gray:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-hover);
}

/* 模块标题通用样式 */
.panel-header {
  margin-top: 0;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}


/* 自定义下拉框样式 */
.custom-dropdown {
  position: relative;
  width: 120px;
  user-select: none;
}

.custom-dropdown-trigger {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 4px 8px;
  /* 稍微减小内边距 */
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
  overflow: hidden;
}

.custom-dropdown-trigger span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-dropdown-trigger:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.custom-dropdown-trigger.active {
  border-color: var(--blue);
}

.custom-dropdown-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e222d;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  z-index: 2000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: none;
}

.custom-dropdown-options.show {
  display: block;
}

.custom-dropdown-option {
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.custom-dropdown-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.custom-dropdown-option.selected {
  background: var(--blue);
  color: #fff;
}

.market-multi-options {
  min-width: 118px;
}

.market-multi-option {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.market-option-check {
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 11px;
  line-height: 1;
  flex: 0 0 14px;
}

.market-multi-option.selected .market-option-check {
  border-color: currentColor;
  color: #fff;
}

/* ─── 分析面板快捷动作按钮 ───────────────── */
#debate-action-bar {
  padding: 0 16px 12px;
  gap: 10px;
}

#debate-action-bar button {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
}

#btn-debate {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
}

#btn-debate:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.3));
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

#btn-backtest-quick {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

#btn-backtest-quick:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.25));
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

#debate-action-bar button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.5) contrast(0.8);
}

/* ─── 手机端最终覆盖：以手机浏览器为主要运行目标 ───────────────── */
@media (max-width: 920px) {

  html,
  body {
    width: 100%;
    max-width: 100%;
    height: auto !important;
    min-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-x: none;
  }

  body {
    font-size: 13px;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
  }

  #app,
  #app.main-hidden {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
    padding-bottom: env(safe-area-inset-bottom);
  }

  #app.main-hidden #main {
    display: none !important;
  }

  #header {
    height: auto !important;
    overflow: visible;
    position: static;
  }

  .buy-alert {
    width: 100%;
    flex: 0 0 auto;
    padding: 8px 0 8px 10px;
    gap: 8px;
  }

  .buy-alert-main {
    min-width: 0;
    flex: 0 0 auto;
  }

  .buy-alert-chip {
    max-width: none;
  }

  .header-row {
    height: auto !important;
    min-height: 0;
    padding: 8px 10px;
    gap: 8px;
  }

  #header-row-1 {
    flex-wrap: wrap;
    align-items: center;
  }

  #header-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    padding-bottom: 10px;
  }

  .header-row>div[style*="flex: 1"] {
    display: none !important;
  }

  #logo {
    min-width: 0;
    font-size: 15px;
  }

  #logo svg {
    width: 20px;
    height: 20px;
  }

  #search-wrap {
    order: 2;
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  #search-input {
    height: 40px;
    font-size: 14px;
  }

  #search-results {
    max-height: 50dvh;
    z-index: 3000;
  }

  #header-right {
    display: none !important;
  }

  #freq-wrap,
  .header-ctrl {
    order: 0;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    margin: 0;
    gap: 5px;
  }

  #freq-wrap .custom-dropdown,
  .header-ctrl .custom-dropdown {
    flex: 1 1 auto;
    width: auto !important;
  }

  #freq-label,
  .header-ctrl>span {
    font-size: 11px;
  }

  .custom-dropdown {
    width: 100% !important;
    min-width: 0;
  }

  .custom-dropdown-trigger {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .custom-dropdown-options {
    max-height: min(46dvh, 320px);
    overflow-y: auto;
  }

  #header-model-ctrl,
  #trigger-btn,
  #header-tools-select {
    order: 0;
    grid-column: 1 / -1;
  }

  #trigger-btn {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    font-size: 14px;
  }

  #sidebar {
    width: 100%;
    height: auto !important;
    max-height: 190px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  #sidebar-title {
    min-height: 38px;
    padding: 8px 10px;
  }

  #watchlist {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 18px 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-y;
    scroll-padding-inline: 18px;
  }

  #watchlist::-webkit-scrollbar {
    display: none;
  }

  .wl-item {
    width: 138px;
    min-width: 138px;
    max-width: 150px;
    min-height: 104px;
    border: 1px solid var(--border);
    border-left-width: 1px;
    border-radius: 8px;
    padding: 9px 10px;
    gap: 5px;
  }

  .wl-content {
    width: 100%;
  }

  .wl-name,
  .wl-symbol {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wl-row1,
  .wl-row2 {
    gap: 6px;
  }

  .wl-remove {
    display: flex;
  }

  #main {
    display: none !important;
  }

  #chart-header {
    padding: 9px 10px;
    gap: 7px;
  }

  #stock-symbol {
    font-size: 17px;
  }

  #stock-name {
    max-width: 48vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #stock-price {
    font-size: 20px;
  }

  #period-tabs {
    width: 100%;
    margin: 4px 0 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  #period-tabs::-webkit-scrollbar {
    display: none;
  }

  .period-tab {
    min-width: 52px;
    min-height: 32px;
    flex: 1 0 auto;
    padding: 6px 8px;
  }

  #indicators-bar {
    align-items: stretch !important;
    gap: 8px;
    padding: 6px 10px !important;
  }

  #indicator-tags {
    flex: 1;
    min-width: 0;
    padding: 0 !important;
  }

  #toggle-indicators-btn {
    flex-shrink: 0;
    min-height: 30px;
    padding: 5px 8px !important;
  }

  #chart-container {
    height: min(58dvh, 430px) !important;
    min-height: 320px !important;
    flex: none !important;
  }

  #panel {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    flex: none !important;
    overflow: visible !important;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }

  #panel-stock-title {
    padding: 10px 12px 0 !important;
    flex-wrap: wrap;
    gap: 6px;
  }

  #panel-record-time {
    margin-left: 0 !important;
  }

  #signal-card {
    padding: 14px 12px;
  }

  #signal-text {
    font-size: 17px;
  }

  #price-targets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #debate-action-bar {
    padding: 0 12px 12px;
  }

  #report-section {
    height: auto !important;
    min-height: 0;
    flex: none !important;
    overflow: visible !important;
  }

  #report-wrap {
    padding: 12px !important;
    gap: 12px !important;
  }

  #report-text {
    padding: 12px;
    font-size: 13px;
    line-height: 1.7;
  }

  #history-panel {
    display: flex !important;
    width: 100%;
    height: auto !important;
    max-height: none;
    min-height: 0;
    overflow: visible;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }

  #history-header {
    min-height: 40px;
    padding: 10px 12px;
  }

  #history-list {
    max-height: 320px;
    padding: 12px;
    overflow-y: auto;
  }

  .hist-item {
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 12px;
  }

  .debug-panel {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 72dvh;
  }

  .modal-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .glass-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    height: auto !important;
    max-height: 92dvh !important;
    border-radius: 14px 14px 0 0;
  }

  #records-modal .glass-panel {
    height: 92dvh !important;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-header h2 {
    padding-right: 34px;
    font-size: 16px;
    line-height: 1.35;
  }

  .modal-body {
    padding: 12px !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 12px 16px !important;
    gap: 10px !important;
  }

  .modal-footer button {
    min-height: 40px;
  }

  .modal-body [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .modal-body [style*="overflow-y:auto"],
  .modal-body [style*="overflow-y: auto"] {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 560px;
  }

  .data-table th,
  .data-table td {
    padding: 9px 7px;
    font-size: 12px;
  }
}

/* ─── 页面浮层层级 ────────────────────────────────
 * 顶部下拉菜单需要覆盖主内容区；弹窗则必须覆盖顶部导航与下拉菜单。
 */
#header {
  position: relative;
  z-index: 2000;
}

#header .custom-dropdown-options {
  z-index: 2100;
}

.modal-overlay {
  overscroll-behavior: contain;
  z-index: 10000;
}

#backtest-modal {
  z-index: 10001 !important;
}

#confirm-modal {
  z-index: 10002 !important;
}

@media (max-width: 480px) {
  #header-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #header-model-ctrl,
  #trigger-btn,
  #header-tools-select {
    grid-column: 1 / -1;
  }

  #chart-container {
    height: 330px !important;
    min-height: 300px !important;
  }

  #price-targets {
    gap: 7px;
  }

  .pt-item {
    padding: 8px;
  }
}

/* ─── 统一界面层：分析工作台风格 ───────────────────────── */
body,
button,
input,
select,
textarea {
  letter-spacing: 0;
}

button:focus-visible,
input:focus-visible,
.custom-dropdown-trigger:focus-visible {
  outline: 2px solid rgba(79, 140, 255, 0.55);
  outline-offset: 2px;
}

#header {
  background: rgba(17, 21, 27, 0.98);
  backdrop-filter: none;
  box-shadow: none;
}

#header-row-1 {
  border-bottom-color: var(--border);
}

#header-row-2 {
  background: var(--bg-dark);
}

.header-row {
  gap: 12px;
}

#logo {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  padding-right: 12px;
  border-right: 1px solid var(--border);
}

#search-input,
input[type="text"],
input[type="number"] {
  background: var(--bg-dark) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

#search-input:focus,
input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--blue) !important;
}

#search-results,
.custom-dropdown-options {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}

.custom-dropdown-trigger {
  min-height: 30px;
  background: var(--bg-card);
  border-color: var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
}

.custom-dropdown-trigger:hover,
.custom-dropdown-trigger.active {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.custom-dropdown-option.selected {
  background: rgba(79, 140, 255, 0.18);
  color: var(--text-primary);
}

.btn,
.btn-primary,
.btn-outline-blue,
.btn-outline-gray,
#trigger-btn,
#debate-action-bar button,
#records-header-actions button,
.modal-footer button,
.pagination button,
#toggle-indicators-btn {
  min-height: 30px;
  padding: 6px 12px !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius) !important;
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  font-size: 12px;
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn,
.btn-primary,
.btn-outline-blue,
.btn-outline-gray {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-small {
  min-height: 28px;
  padding: 4px 9px !important;
  font-size: 12px;
}

.btn-primary,
#trigger-btn,
#btn-start-bull,
#btn-resume-bull,
#btn-resume-reanalyze {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}

.btn-danger,
#btn-stop-bull,
#btn-stop-reanalyze,
#btn-confirm-ok {
  background: rgba(239, 91, 109, 0.14) !important;
  border-color: rgba(239, 91, 109, 0.5) !important;
  color: #ff9aa7 !important;
}

.btn-secondary,
#btn-debate,
#btn-backtest-quick,
#btn-confirm-cancel {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

.btn:hover,
.btn-primary:hover,
.btn-outline-blue:hover,
.btn-outline-gray:hover,
#trigger-btn:hover,
#debate-action-bar button:hover:not(:disabled),
#records-header-actions button:hover,
.modal-footer button:hover,
.pagination button:not(:disabled):hover,
#toggle-indicators-btn:hover {
  background: var(--border-light) !important;
  border-color: var(--border-light) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  transform: none !important;
}

#trigger-btn {
  padding-inline: 18px !important;
  font-size: 13px;
}

#trigger-btn.is-ready:not(:disabled) {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
  cursor: pointer;
}

#trigger-btn.is-loading,
#trigger-btn:disabled {
  background: var(--bg-hover) !important;
  border-color: var(--border-light) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
  opacity: 1;
}

#trigger-btn.is-ready:not(:disabled):hover {
  background: var(--border-light) !important;
  border-color: var(--border-light) !important;
  color: var(--text-primary) !important;
}

#sidebar,
#panel,
#history-panel {
  background: var(--bg-panel);
}

#sidebar-title,
#history-header,
#chart-header {
  background: var(--bg-dark);
  border-color: var(--border);
}

#sidebar-title>span,
#history-header>span {
  font-weight: 650;
  letter-spacing: 0;
}

.sidebar-btn {
  background: transparent;
  border-color: var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
}

.wl-item {
  border-left-width: 2px;
  gap: 10px;
}

.wl-item:hover,
.wl-item.active {
  background: var(--bg-card);
}

.wl-item.active {
  border-color: rgba(79, 140, 255, 0.55);
  border-left-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(79, 140, 255, 0.16);
}

.wl-remove {
  width: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius);
  font-size: 11px;
}

#panel-stock-title {
  padding: 12px 16px 8px !important;
  margin-bottom: 0 !important;
  border-bottom: 1px solid var(--border);
}

#panel-stock-name {
  font-size: 17px !important;
  font-weight: 700 !important;
}

#panel-record-time,
#panel-stock-symbol {
  border-radius: var(--radius) !important;
  background: var(--bg-card) !important;
}

#signal-card {
  background: var(--bg-panel);
  box-shadow: none;
  border-bottom: 1px solid var(--border);
}

#signal-glow,
#signal-icon {
  display: none !important;
}

#signal-label {
  gap: 10px;
  margin-bottom: 8px;
}

#signal-text {
  font-size: 18px;
  font-weight: 700;
}

#score-bar-bg {
  height: 7px;
  background: var(--bg-dark);
}

#score-bar {
  box-shadow: none;
}

#bear-score-bar {
  background: var(--down) !important;
  box-shadow: none !important;
}

#bull-progress-bar {
  height: 100%;
  width: 0;
  background: var(--blue) !important;
  box-shadow: none !important;
  transition: width 0.3s ease;
}

.bull-status-panel {
  display: block;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
}

.bull-progress-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 10px;
}

.bull-progress-title {
  color: var(--text-muted);
  font-size: 12px;
}

#bull-progress-text {
  color: var(--text-primary);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bull-found-stat {
  color: var(--green);
  font-size: 12px;
  white-space: nowrap;
}

.bull-progress-track {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-card);
}

.bull-progress-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.bull-progress-metrics span {
  min-width: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.bull-progress-metrics b {
  display: block;
  margin-top: 2px;
  color: var(--text-primary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.bull-progress-note {
  margin: 10px 0 0;
  color: var(--warning);
  font-size: 12px;
  line-height: 1.4;
}

.progress-bar-bg,
#score-bar-bg {
  border: 1px solid var(--border);
}

.switch-ui,
#switch-ui-auto::after,
#switch-ui-wd::after,
#pending-actions-section .pulse-orange {
  box-shadow: none !important;
}

.risk-badge,
.score-pill,
.signal-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
}

#price-targets {
  gap: 10px;
  margin-top: 12px;
}

.pt-item {
  background: var(--bg-dark);
  border-color: var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.pt-label {
  color: var(--text-secondary);
  font-size: 11px;
}

.pt-val {
  font-size: 14px;
}

#debate-action-bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

#report-wrap {
  gap: 12px !important;
}

#history-notice,
#intelligence-card,
#report-text,
#psychological-play,
#bear-argument-box,
.reason-item {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: none !important;
}

#report-text {
  line-height: 1.75 !important;
}

#psychological-play {
  color: var(--text-secondary) !important;
  font-style: normal !important;
}

.section-title,
.panel-header {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 8px;
}

.reason-item {
  padding: 9px 10px;
  color: var(--text-secondary);
}

.hist-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  box-shadow: none;
  margin-bottom: 8px;
  padding: 12px;
}

.hist-item:hover,
.hist-item.active {
  background: var(--bg-hover);
  transform: none;
  box-shadow: none;
}

.hist-item.active {
  border-color: var(--border-light);
}

.hist-time,
.time-cell {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.hist-signal {
  border-radius: 999px;
  padding: 2px 8px;
}

.hist-signal-note {
  display: inline-block;
  margin-left: 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.modal-overlay {
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(2px);
}

.glass-panel {
  overscroll-behavior: contain;
  background: var(--bg-panel) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 8px !important;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.46) !important;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.modal-header {
  min-height: 54px;
  border-bottom-color: var(--border);
  background: var(--bg-dark);
}

.modal-header h2 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
}

.close-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 20px;
}

.close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  overscroll-behavior: contain;
  background: var(--bg-panel);
}

.modal-footer {
  border-top: 1px solid var(--border) !important;
  background: var(--bg-dark) !important;
}

#confirm-modal {
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  padding: 16px;
}

#confirm-modal .confirm-dialog {
  width: min(340px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom)) !important;
  overflow: hidden;
}

#confirm-modal .confirm-dialog-header {
  flex: 0 0 auto;
  min-height: 0;
  padding: 16px 20px 8px;
  border-bottom: none;
}

#confirm-modal .confirm-dialog-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding-right: 0;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text-primary);
}

#confirm-modal .confirm-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px 20px 24px !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#confirm-msg {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#confirm-modal .confirm-dialog-footer {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px !important;
}

#confirm-modal .confirm-dialog-footer button {
  cursor: pointer;
}

#confirm-modal #btn-confirm-ok {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

#confirm-modal #btn-confirm-ok:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}

@media (max-width: 920px) {
  #confirm-modal {
    align-items: center;
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  }

  #confirm-modal .confirm-dialog {
    width: min(360px, 100%) !important;
    max-width: 100% !important;
    max-height: calc(100vh - 32px - env(safe-area-inset-bottom)) !important;
    max-height: calc(100dvh - 32px - env(safe-area-inset-bottom)) !important;
  }

  #confirm-modal .confirm-dialog-header {
    padding: 14px 16px 8px;
  }

  #confirm-modal .confirm-dialog-body {
    padding: 10px 16px 20px !important;
  }

  #confirm-modal .confirm-dialog-footer {
    gap: 10px;
    padding: 12px 16px !important;
  }

  #confirm-modal .confirm-dialog-footer button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 42px;
  }
}

#records-modal .glass-panel {
  width: min(1040px, 96vw) !important;
}

.records-modal-panel {
  overflow: hidden;
}

.records-modal-header {
  display: grid !important;
  grid-template-columns: auto 170px minmax(0, 1fr);
  grid-template-rows: minmax(32px, auto) auto;
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  min-height: 138px;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  overflow: visible;
}

.records-modal-header h2 {
  flex: 0 0 auto;
}

.reanalyze-progress {
  grid-column: 2;
  grid-row: 1;
  flex: 0 0 170px;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.records-header-actions {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  height: auto;
  min-height: 78px;
  flex: none;
  margin-left: 0 !important;
  min-width: 0;
  flex-wrap: wrap !important;
  align-content: flex-start;
  overflow: visible;
  padding: 4px 40px 2px 0;
}

.records-header-actions > * {
  flex: 0 0 auto;
}

.records-header-actions .custom-dropdown-trigger {
  position: relative;
  z-index: 11001;
}

.records-header-actions .custom-dropdown-options.show {
  z-index: 11002;
}

#btn-reanalyze-records {
  min-width: 92px;
  justify-content: center;
}

@media (max-width: 920px) {
  .records-modal-header {
    grid-template-columns: auto minmax(100px, 1fr);
    grid-template-rows: 32px 190px;
    min-height: 250px;
    padding: 12px 40px 12px 16px;
    gap: 8px;
  }

  .reanalyze-progress {
    grid-column: 2;
    flex-basis: auto;
  }

  .records-header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 190px;
    gap: 8px !important;
  }
}

#records-modal #reanalyze-score-filter {
  flex: 0 0 96px;
  width: 96px !important;
  min-width: 96px;
}

#records-modal #reanalyze-score-filter .custom-dropdown-trigger,
#records-modal #reanalyze-score-filter .custom-dropdown-option {
  white-space: nowrap;
}

#records-modal #reanalyze-score-filter .custom-dropdown-options {
  min-width: 96px;
}

#backtest-modal .glass-panel {
  width: min(760px, 95vw) !important;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.symbol-cell {
  min-width: 88px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-weight: 700;
}

.name-cell {
  min-width: 80px;
  font-weight: 650;
}

.record-reason {
  max-width: 350px;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.record-mobile-symbol {
  display: none;
}

.bull-record-mobile-row {
  display: none;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  text-align: right;
}

.score-pill.high {
  color: var(--up);
  background: rgba(34, 197, 139, 0.11);
  border: 1px solid rgba(34, 197, 139, 0.24);
}

.score-pill.mid {
  color: var(--hold);
  background: rgba(225, 163, 63, 0.11);
  border: 1px solid rgba(225, 163, 63, 0.24);
}

.score-pill.low {
  color: var(--down);
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.signal-pill.strong-buy,
.signal-pill.buy {
  color: var(--up);
}

.signal-pill.sell,
.signal-pill.strong-sell {
  color: var(--down);
}

.signal-pill.hold {
  color: var(--hold);
}

#bt-summary-card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  border-radius: var(--radius) !important;
}

.metric-item {
  text-align: center;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
}

.metric-label,
.period-label,
.muted-text {
  color: var(--text-muted);
  font-size: 12px;
}

.metric-hint {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.25;
}

.period-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: left;
}

.period-value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.period-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 4px 0;
  line-height: 1.35;
}

.period-line {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
}

.period-range {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.45;
}

.period-drawdown {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

#bt-evaluation,
#bt-signals-list,
#bt-batch-result .batch-row {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
}

#bt-evaluation {
  color: var(--text-secondary) !important;
}

.result-row,
.batch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child {
  border-bottom: 0;
}

.batch-row {
  border-bottom: 0;
  margin-bottom: 8px;
}

.modal-body button:not(.close-btn) {
  min-height: 30px;
  padding: 6px 12px !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius) !important;
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

.modal-body button.btn-primary {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}

.modal-body button.btn-danger {
  background: rgba(239, 91, 109, 0.14) !important;
  border-color: rgba(239, 91, 109, 0.5) !important;
  color: #ff9aa7 !important;
}

.modal-body #bt-symbol-results .bt-sr-item {
  min-height: 0;
  padding: 8px 10px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
}

.modal-body #bt-symbol-results .bt-sr-item:hover {
  background: var(--bg-hover) !important;
}

@media (max-width: 920px) {
  #logo {
    border-right: 0;
    padding-right: 0;
  }

  #debate-action-bar {
    padding: 10px 12px;
  }

  .record-actions,
  .result-row,
  .batch-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ─── 首页评分优先布局 ───────────────────────── */
@media (min-width: 921px) {
  #app {
    grid-template-rows: 78px calc(100vh - 78px);
    grid-template-columns: 220px 430px minmax(420px, 1fr) 260px;
    grid-template-areas:
      "header header header header"
      "sidebar panel main history";
  }

  #app.main-hidden {
    grid-template-columns: 220px minmax(520px, 1fr) 280px;
    grid-template-areas:
      "header header header"
      "sidebar panel history";
  }

  #app.main-hidden #panel {
    border-right: 1px solid var(--border);
  }

  #header-row-1 {
    height: 44px;
  }

  #header-row-2 {
    height: 34px;
    gap: 14px;
  }

  #search-wrap {
    max-width: 360px;
  }

  #sidebar-title,
  #history-header {
    height: 34px;
    padding: 0 12px;
  }

  #watchlist {
    padding: 6px;
  }

  #main {
    border-left: 1px solid var(--border);
  }

  #chart-header {
    min-height: 50px;
    padding: 8px 14px;
    gap: 10px;
  }

  #stock-symbol {
    font-size: 17px;
  }

  #stock-price {
    font-size: 20px;
  }

  #history-list {
    padding: 10px;
  }
}

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

#signal-card {
  padding: 16px 18px;
}

#signal-label {
  align-items: flex-start;
  margin-bottom: 10px;
}

#signal-text {
  line-height: 1.2;
}

#signal-score-wrap {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: end;
  gap: 10px 14px;
  margin: 0 0 10px;
}

#score-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#score-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
}

#score-secondary {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

#score-value {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 800;
  line-height: 0.95;
  text-align: left;
}

#score-bar-bg {
  height: 9px;
  margin-bottom: 7px;
}

#signal-summary {
  margin-bottom: 8px;
  line-height: 1.55;
}

#hold-period {
  margin-top: 0 !important;
}

#price-targets {
  margin-top: 10px;
}

#report-wrap {
  padding: 12px 14px !important;
}

#intelligence-card {
  margin-bottom: 0 !important;
}

.score-audit-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.score-audit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.score-audit-head .section-title {
  margin: 0;
}

.score-audit-cache {
  min-height: 18px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 18px;
  text-align: right;
}

.score-audit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.score-audit-item {
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.score-audit-item-wide {
  grid-column: 1 / -1;
}

.score-audit-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.2;
}

.score-audit-value {
  display: block;
  min-width: 0;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.score-audit-detail {
  display: none;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 8px 10px;
}

.score-audit-detail:not(:empty) {
  display: block;
}

.wl-item {
  min-height: 76px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: var(--radius);
}

.wl-item.active {
  border-color: rgba(79, 140, 255, 0.55);
  border-left-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(79, 140, 255, 0.16);
}

.wl-row1,
.wl-row2 {
  gap: 8px;
}

.wl-symbol {
  font-size: 12px;
}

.wl-name {
  max-width: 92px;
}

.wl-right {
  gap: 6px;
}

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

.wl-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.wl-score.high {
  color: var(--up);
  border-color: rgba(34, 197, 139, 0.34);
  background: rgba(34, 197, 139, 0.1);
}

.wl-score.mid {
  color: var(--hold);
  border-color: rgba(225, 163, 63, 0.34);
  background: rgba(225, 163, 63, 0.1);
}

.wl-score.low {
  color: var(--down);
  border-color: rgba(239, 91, 109, 0.34);
  background: rgba(239, 91, 109, 0.08);
}

.wl-signal-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 7px;
}

.wl-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.35;
}

.wl-detail-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 6px;
  align-items: start;
  overflow-wrap: anywhere;
}

.watch-detail-label {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.watch-detail-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  #signal-score-wrap {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  #score-value {
    font-size: 40px;
  }

  .score-audit-grid {
    grid-template-columns: 1fr;
  }

  .wl-item {
    min-height: 102px;
  }

  .wl-score {
    min-width: 38px;
  }
}

/* ─── 首页评分台账重构 ───────────────────────── */
@media (min-width: 921px) {
  #app,
  #app.main-hidden {
    grid-template-rows: 78px 0 calc(100vh - 78px);
    grid-template-columns: 158px minmax(520px, 1fr);
    grid-template-areas:
      "header header"
      "buy-alert buy-alert"
      "sidebar panel";
  }

  #app.has-buy-alert,
  #app.main-hidden.has-buy-alert {
    grid-template-rows: 78px 42px calc(100vh - 120px);
  }

  #main,
  #history-panel,
  #app.main-hidden #main {
    display: none !important;
  }
}

#panel {
  min-width: 0;
  border-left: 1px solid var(--border);
  border-right: none;
}

#score-board {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--bg-panel);
}

#score-board-header {
  height: 38px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
}

#score-board-count {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

#score-board-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.score-board-empty {
  padding: 20px 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.score-board-loading,
.score-board-more {
  width: 100%;
  padding: 10px 12px 4px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.score-board-more {
  cursor: pointer;
}

.score-row {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: 10px;
  row-gap: 6px;
  padding: 10px 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.score-row:hover,
.score-row.active {
  background: var(--bg-hover);
  border-bottom-color: var(--border-light);
}

.score-row-main {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.score-row-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.score-row-title-left {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score-row-title-right {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.score-row-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row-symbol,
.score-row-time,
.score-row-price {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
}

.score-row-price {
  color: var(--text-secondary);
  font-size: 11px;
}

.score-row-timing {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.35;
  white-space: normal;
}

.score-plan-line {
  display: block;
}

.score-row-audit {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.35;
  white-space: normal;
}

.score-row-audit span {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.score-row-signal {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 82px;
}

.score-row-score {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  justify-self: end;
  min-width: 44px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.score-row-score.high {
  color: var(--up);
  border-color: rgba(34, 197, 139, 0.34);
  background: rgba(34, 197, 139, 0.08);
}

.score-row-score.mid {
  color: var(--hold);
  border-color: rgba(225, 163, 63, 0.34);
  background: rgba(225, 163, 63, 0.08);
}

.score-row-score.low {
  color: var(--down);
  border-color: rgba(239, 91, 109, 0.34);
  background: rgba(239, 91, 109, 0.08);
}

.score-row-score.none {
  color: var(--text-muted);
}

.score-row-backtest,
.hist-backtest-btn {
  min-width: 38px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 22px;
  cursor: pointer;
  white-space: nowrap;
}

.score-row-backtest {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  justify-self: end;
  align-self: end;
}

.score-row-backtest:hover,
.hist-backtest-btn:hover {
  border-color: var(--blue);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.hist-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#panel-stock-title,
#signal-card,
#debate-action-bar,
#report-section {
  display: none !important;
}

#sidebar {
  background: var(--bg-dark);
}

#sidebar-title {
  height: 38px;
  padding: 0 8px;
}

#sidebar-title>span {
  font-size: 12px;
}

#sidebar-actions {
  gap: 4px;
}

.sidebar-btn {
  padding: 2px 6px;
  font-size: 11px;
}

#watchlist {
  padding: 4px;
}

.wl-empty {
  padding: 14px 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.wl-item {
  min-height: 38px;
  padding: 6px 7px;
  gap: 6px;
  border-left-width: 2px;
  border-radius: 4px;
}

.wl-content {
  gap: 1px;
}

.wl-row1,
.wl-row2 {
  gap: 6px;
  margin: 0;
}

.wl-symbol {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wl-name {
  max-width: 96px;
  font-size: 11px;
}

.wl-score {
  min-width: 72px;
  min-height: 20px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
}

.wl-row-signal,
.wl-right {
  display: none !important;
}

.wl-checkbox {
  width: 14px;
  height: 14px;
  border-width: 1px;
}

.wl-item.select-mode {
  padding-left: 7px;
}

@media (max-width: 920px) {
  html,
  body {
    overflow: hidden;
    overscroll-behavior-x: none;
  }

  #app,
  #app.main-hidden {
    display: grid;
    grid-template-rows: auto 0 minmax(112px, 24vh) minmax(0, 1fr);
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "buy-alert"
      "sidebar"
      "panel";
    height: 100vh;
    overflow: hidden;
  }

  #app.has-buy-alert,
  #app.main-hidden.has-buy-alert {
    grid-template-rows: auto 42px minmax(112px, 24vh) minmax(0, 1fr);
  }

  #main,
  #history-panel,
  #app.main-hidden #main {
    display: none !important;
  }

  #sidebar,
  #panel {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-left: none;
  }

  #score-board {
    height: 100%;
    min-height: 0;
  }

  #score-board-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }

  #watchlist {
    display: flex;
    gap: 8px;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 18px 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-y;
    scroll-padding-inline: 18px;
  }

  #watchlist.is-swiping {
    scroll-behavior: auto;
  }

  .score-row {
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 8px;
  }

  .score-row-title {
    align-items: flex-start;
  }

  .score-row-title-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }

  .score-row-signal {
    max-width: 72px;
  }

  .score-row-time {
    display: inline;
  }
}

/* ─── 手机端筛选优先工作台 ───────────────────────── */
#mobile-shell {
  display: none;
}

@media (max-width: 920px) {
  :root {
    --mobile-bg: #f7f8fb;
    --mobile-surface: #ffffff;
    --mobile-ink: #18202b;
    --mobile-muted: #7b8491;
    --mobile-line: #e7eaf0;
    --mobile-blue: #2563d9;
    --mobile-blue-soft: #edf3ff;
    --mobile-green: #15945b;
    --mobile-red: #d94b5c;
    --mobile-orange: #c97b15;
  }

  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--mobile-bg);
    max-width: 100vw;
    overflow-x: hidden;
    color: var(--mobile-ink);
  }

  #app,
  #app.main-hidden,
  #app.has-buy-alert,
  #app.main-hidden.has-buy-alert {
    display: block;
    width: 100vw;
    height: auto;
    min-height: 100svh;
    overflow: visible;
    background: var(--mobile-bg);
  }

  #header,
  #watchlist-buy-alert,
  #sidebar,
  #main,
  #panel,
  #history-panel,
  #debug-panel {
    display: none !important;
  }

  #mobile-shell {
    display: flex;
    width: 100%;
    max-width: 100vw;
    overflow: visible;
    min-height: 100svh;
    flex-direction: column;
    padding: max(18px, env(safe-area-inset-top)) 16px calc(118px + env(safe-area-inset-bottom));
    background: var(--mobile-bg);
    color: var(--mobile-ink);
  }

  .mobile-topbar,
  .mobile-filter-header,
  .mobile-section-title,
  .mobile-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
  }

  .mobile-topbar {
    position: relative;
    align-items: center;
    margin-bottom: 22px;
  }

  #mobile-shell[data-active-view="monitor"] .mobile-topbar {
    margin-bottom: 16px;
  }

  #mobile-shell[data-active-view="monitor"] .mobile-manage-button {
    align-self: flex-end;
  }

  .mobile-eyebrow {
    display: block;
    color: var(--mobile-muted);
    font-size: 11px;
    letter-spacing: .04em;
    line-height: 1.4;
  }

  .mobile-topbar h1,
  .mobile-section-title h2,
  .mobile-sheet-header h2 {
    margin-top: 3px;
    color: var(--mobile-ink);
    font-size: 26px;
    font-weight: 760;
    letter-spacing: -.04em;
    line-height: 1.15;
  }

  .mobile-topbar-actions {
    display: none;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    position: absolute;
    top: 0;
    right: 16px;
  }

  .mobile-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--mobile-green);
    font-size: 12px;
    white-space: nowrap;
  }

  .mobile-status-dot::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mobile-green);
    content: '';
  }

  .mobile-icon-button,
  .mobile-text-button,
  .mobile-close-button,
  .mobile-sort-button {
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background: var(--mobile-surface);
    color: var(--mobile-blue);
    font-size: 12px;
    font-weight: 650;
  }

  .mobile-icon-button {
    min-width: 58px;
  }

  .mobile-icon-button.is-refreshing {
    color: var(--mobile-muted);
    cursor: progress;
  }

  .mobile-text-button,
  .mobile-sort-button {
    min-height: 32px;
    border: 0;
    background: transparent;
    padding: 0;
  }

  .mobile-view {
    display: none;
    min-width: 0;
    min-width: 0;
    flex: 1;
    flex-direction: column;
  }

  .mobile-view.active {
    display: flex;
  }

  /* 固定的“加入监控”栏高 94px，位于底部导航上方；额外留出空间，确保最后一条记录可完整滚动到浮层上方。 */
  #mobile-screen-view {
    padding-bottom: 64px;
  }

  .mobile-filter-header {
    align-items: center;
    margin-bottom: 14px;
  }

  .mobile-filter-header h2 {
    margin-bottom: 3px;
    color: var(--mobile-ink);
    font-size: 16px;
    font-weight: 720;
  }

  .mobile-filter-header span,
  .mobile-section-title small {
    color: var(--mobile-muted);
    font-size: 12px;
  }

  .mobile-filter-chips {
    display: flex;
    gap: 8px;
    margin: 0 -16px 16px;
    overflow-x: auto;
    padding: 2px 16px 4px;
    scrollbar-width: none;
  }

  .mobile-filter-chips::-webkit-scrollbar {
    display: none;
  }

  .mobile-filter-chip {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--mobile-line);
    border-radius: 11px;
    background: var(--mobile-surface);
    color: #4d5764;
    font-size: 13px;
    font-weight: 620;
    white-space: nowrap;
  }

  .mobile-filter-chip.is-active {
    border-color: #cbdcff;
    background: var(--mobile-blue-soft);
    color: var(--mobile-blue);
  }

  .mobile-result-summary {
    display: block;
    max-width: 100%;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    margin-bottom: 18px;
    padding: 15px 16px;
    border: 1px solid var(--mobile-line);
    border-radius: 15px;
    background: var(--mobile-surface);
  }

  .mobile-result-summary > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }

  .mobile-result-summary strong {
    color: var(--mobile-blue);
    font-family: var(--font-mono);
    font-size: 25px;
    line-height: 1;
  }

  .mobile-result-summary span,
  .mobile-summary-detail {
    color: var(--mobile-muted);
    font-size: 12px;
  }

  .mobile-summary-detail {
    display: flex;
    justify-content: flex-start;
    margin-top: 10px;
    gap: 12px;
  }

  .mobile-summary-detail b {
    color: var(--mobile-ink);
    font-family: var(--font-mono);
    font-size: 14px;
  }

  .mobile-list-heading {
    display: flex;
    max-width: 100%;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--mobile-ink);
    font-size: 14px;
    font-weight: 720;
  }

  .mobile-list-heading::after {
    display: none;
  }

  .mobile-record-list,
  .mobile-watchlist,
  .records-watchlist,
  .mobile-action-list,
  .mobile-tool-list {
    overflow: hidden;
    border: 1px solid var(--mobile-line);
    border-radius: 15px;
    background: var(--mobile-surface);
  }

  .mobile-watch-buy-alert {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(21, 148, 91, .28);
    border-radius: 15px;
    background: #f0fbf6;
  }

  .mobile-watch-buy-alert-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: #127a4b;
    font-size: 13px;
  }

  .mobile-watch-buy-alert-title span {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #15945b;
    color: #fff;
    font-size: 11px;
  }

  .mobile-watch-buy-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .mobile-watch-buy-chip {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity score"
      "advice advice";
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 7px 8px;
    border: 1px solid rgba(21, 148, 91, .2);
    border-radius: 10px;
    background: #fff;
    color: var(--mobile-ink);
    text-align: left;
    min-width: 0;
  }

  .mobile-watch-buy-chip > span {
    grid-area: identity;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
  }

  .mobile-watch-buy-chip strong {
    font-size: 13px;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .mobile-watch-buy-chip small {
    color: var(--mobile-muted);
    font-family: var(--font-mono);
    font-size: 10px;
  }

  .mobile-watch-buy-chip b {
    grid-area: score;
    color: #127a4b;
    font-family: var(--font-mono);
    font-size: 15px;
  }

  .mobile-watch-buy-chip em {
    grid-area: advice;
    color: #127a4b;
    font-size: 11px;
    font-style: normal;
    white-space: normal;
    max-width: none;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }

  #mobile-monitor-task-notice {
    gap: 4px;
    margin: 0 0 12px;
    padding: 11px 12px;
    border-color: #f1d59b;
    border-radius: 12px;
    background: #fff8e8;
  }

  #mobile-monitor-task-notice .monitor-task-notice-heading strong {
    color: #9a5d0a;
    font-size: 13px;
  }

  #mobile-monitor-task-notice .monitor-task-notice-progress {
    color: var(--mobile-ink);
    font-size: 11px;
  }

  #mobile-monitor-task-notice small {
    color: #8a6a35;
    font-size: 11px;
  }

  .mobile-manage-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid var(--mobile-line);
    border-radius: 999px;
    background: var(--mobile-surface);
    color: var(--mobile-blue);
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-manage-button[aria-pressed="true"] {
    border-color: #cbdcff;
    background: var(--mobile-blue-soft);
  }

  .mobile-manage-button:disabled {
    color: var(--mobile-muted);
    opacity: .55;
  }

  .mobile-watchlist-actions {
    position: fixed;
    right: 16px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 16px;
    z-index: 35;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 10px 11px;
    border: 1px solid var(--mobile-line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 12px 30px rgba(31, 49, 76, .18);
  }

  .mobile-watchlist-select-actions {
    display: grid;
  }

  .mobile-watchlist-select-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--mobile-muted);
    font-size: 12px;
    white-space: nowrap;
  }

  .mobile-watchlist-selected-count {
    overflow: hidden;
    color: var(--mobile-muted);
    font-size: 12px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-watchlist-select-all input,
  .mobile-watch-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--mobile-blue);
  }

  .mobile-delete-selection-button {
    min-width: 72px;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--mobile-red);
    border-radius: 10px;
    background: var(--mobile-red);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-delete-selection-button:disabled {
    border-color: #e4e7ec;
    background: #eef0f3;
    color: #a3aab5;
  }

  .mobile-record-list {
    margin-bottom: 16px;
  }

  .mobile-record-row {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr) 46px 12px;
    grid-template-rows: auto auto;
    gap: 5px 10px;
    min-height: 90px;
    padding: 14px 92px 14px 15px;
    border: 0;
    border-bottom: 1px solid var(--mobile-line);
    background: var(--mobile-surface);
    color: var(--mobile-ink);
    text-align: left;
  }

  .mobile-record-row:last-child,
  .mobile-watch-row:last-child,
  .mobile-action-list button:last-child,
  .mobile-tool-list button:last-child {
    border-bottom: 0;
  }

  .mobile-record-row:active,
  .mobile-watch-row:active,
  .mobile-action-list button:active,
  .mobile-tool-list button:active {
    background: #f4f7fd;
  }

  .mobile-record-main {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 7px;
  }

  .mobile-record-identity {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 7px;
  }

  .mobile-record-name {
    overflow: hidden;
    font-size: 15px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-record-symbol,
  .mobile-record-change {
    color: var(--mobile-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    white-space: nowrap;
  }

  .mobile-inline-score {
    flex: 0 0 auto;
    color: var(--mobile-blue);
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 760;
    line-height: 1;
  }

  .mobile-inline-score.mid {
    color: var(--mobile-orange);
  }

  .mobile-inline-score.low {
    color: var(--mobile-red);
  }

  .mobile-record-score {
    display: none;
  }

  .mobile-record-reason {
    position: absolute;
    right: 92px;
    bottom: 28px;
    left: 15px;
    grid-column: auto;
    min-width: 0;
    overflow: hidden;
    color: var(--mobile-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-inline-signal {
    margin-right: 6px;
    color: var(--mobile-blue);
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-inline-signal.sell,
  .mobile-inline-signal.strong-sell {
    color: var(--mobile-red);
  }

  .mobile-record-score {
    position: absolute;
    top: 14px;
    right: 32px;
    align-self: center;
    width: 46px;
    min-width: 0;
    color: var(--mobile-blue);
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 760;
    line-height: 1;
    text-align: right;
  }

  .mobile-record-score.mid {
    color: var(--mobile-orange);
  }

  .mobile-record-score.low {
    color: var(--mobile-red);
  }

  .mobile-record-score.none {
    color: var(--mobile-muted);
  }

  .mobile-record-signal {
    position: absolute;
    top: 48px;
    right: 32px;
    color: var(--mobile-blue);
    font-size: 11px;
    white-space: nowrap;
  }

  .mobile-record-signal.strong_sell,
  .mobile-record-signal.sell,
  .mobile-record-signal.strong-sell {
    color: var(--mobile-red);
  }

  .mobile-record-change {
    position: absolute;
    bottom: 14px;
    left: 15px;
    grid-column: auto;
    grid-row: auto;
  }

  .mobile-row-arrow {
    position: relative;
    position: absolute;
    top: 36px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-top: 1.5px solid #aab3bf;
    border-right: 1.5px solid #aab3bf;
    transform: rotate(45deg);
  }

  .mobile-list-state {
    padding: 48px 20px;
    color: var(--mobile-muted);
    font-size: 13px;
    text-align: center;
  }

  .mobile-list-state.is-error {
    color: var(--mobile-red);
  }

  .mobile-batch-bar {
    position: fixed;
    right: auto;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 16px;
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    z-index: 30;
    display: block;
    min-height: 94px;
    padding: 10px 12px 10px 16px;
    border: 1px solid var(--mobile-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(31, 49, 76, .10);
  }

  .mobile-batch-bar > div {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--mobile-muted);
    font-size: 12px;
  }

  .mobile-batch-bar .mobile-primary-button {
    display: block;
    width: 100%;
    margin-top: 8px;
  }

  .mobile-batch-bar strong {
    color: var(--mobile-blue);
    font-family: var(--font-mono);
    font-size: 23px;
  }

  .mobile-primary-button,
  .mobile-secondary-button {
    min-height: 44px;
    padding: 0 20px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 720;
  }

  .mobile-primary-button {
    min-width: 0;
    background: var(--mobile-blue);
    color: #fff;
  }

  .mobile-primary-button:disabled {
    opacity: .55;
  }

  .mobile-secondary-button {
    width: 100%;
    margin-top: 16px;
    border: 1px solid #cbdcff;
    background: var(--mobile-blue-soft);
    color: var(--mobile-blue);
  }

  .mobile-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
  }

  .mobile-market-brief {
    margin-top: 18px;
    padding: 17px;
    border: 1px solid #d8e3f4;
    border-radius: 16px;
    background: #f7faff;
  }

  .mobile-market-brief.tone-cold,
  .mobile-market-brief.tone-weak {
    border-color: #f1d7bd;
    background: #fffaf3;
  }

  .mobile-market-brief.tone-warm,
  .mobile-market-brief.tone-strong {
    border-color: #cce8dc;
    background: #f4fbf7;
  }

  .mobile-market-brief.tone-unavailable {
    border-color: var(--mobile-line);
    background: var(--mobile-surface);
  }

  .mobile-market-brief-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-market-brief-heading span {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .09);
    color: var(--mobile-blue);
    font-size: 12px;
    font-weight: 750;
  }

  .mobile-market-brief.tone-cold .mobile-market-brief-heading span,
  .mobile-market-brief.tone-weak .mobile-market-brief-heading span {
    background: #fff0dd;
    color: #a6530a;
  }

  .mobile-market-brief.tone-warm .mobile-market-brief-heading span,
  .mobile-market-brief.tone-strong .mobile-market-brief-heading span {
    background: #e1f5ea;
    color: #14734c;
  }

  .mobile-market-brief-heading strong {
    color: var(--mobile-ink);
    font-family: var(--font-mono);
    font-size: 20px;
  }

  .mobile-market-brief h3 {
    margin: 14px 0 7px;
    color: var(--mobile-ink);
    font-size: 18px;
    line-height: 1.35;
  }

  .mobile-market-brief p {
    margin: 0;
    color: #536276;
    font-size: 13px;
    line-height: 1.75;
  }

  .mobile-market-brief-indexes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 14px 0 12px;
  }

  .mobile-market-brief-indexes span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    padding: 9px 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .72);
    color: var(--mobile-muted);
    font-size: 11px;
    text-align: center;
  }

  .mobile-market-brief-indexes b {
    color: var(--mobile-ink);
    font-family: var(--font-mono);
    font-size: 13px;
  }

  .mobile-market-brief > small {
    display: block;
    padding-top: 11px;
    border-top: 1px solid rgba(148, 163, 184, .25);
    color: var(--mobile-muted);
    font-size: 12px;
    line-height: 1.55;
  }

  .mobile-metric-card {
    display: flex;
    min-height: 118px;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid var(--mobile-line);
    border-radius: 15px;
    background: var(--mobile-surface);
  }

  .mobile-metric-card span,
  .mobile-metric-card small {
    color: var(--mobile-muted);
    font-size: 12px;
  }

  .mobile-metric-card strong {
    color: var(--mobile-blue);
    font-family: var(--font-mono);
    font-size: 30px;
  }

  .mobile-action-list button,
  .mobile-tool-list button {
    display: flex;
    width: 100%;
    min-height: 70px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--mobile-line);
    background: var(--mobile-surface);
    color: var(--mobile-ink);
    text-align: left;
  }

  .mobile-action-list button span,
  .mobile-tool-list button {
    font-size: 14px;
    font-weight: 700;
  }

  .mobile-action-list button small,
  .mobile-tool-list button small {
    color: var(--mobile-muted);
    font-size: 12px;
    font-weight: 400;
  }

  .mobile-watch-row {
    display: flex;
    width: 100%;
    align-items: stretch;
    gap: 10px;
    min-height: 72px;
    padding: 12px 10px 12px 15px;
    border-bottom: 1px solid var(--mobile-line);
    background: var(--mobile-surface);
    color: var(--mobile-ink);
    text-align: left;
  }

  .mobile-watch-row-actions {
    display: flex;
    align-self: stretch;
    min-height: 0;
    flex: 0 0 70px;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 6px;
    padding: 0;
  }

  .mobile-watch-row-main {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
  }

  .mobile-watch-checkbox {
    display: none;
    flex: 0 0 auto;
  }

  .mobile-watch-row.is-selecting .mobile-watch-checkbox {
    display: block;
  }

  .mobile-watch-row.is-selecting .mobile-watch-row-actions {
    display: none;
  }

  .mobile-watch-row-main > b,
  .mobile-watch-row-main > .mobile-row-arrow {
    display: none;
  }

  .mobile-watch-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
  }

  .mobile-watch-card-header {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }

  .mobile-watch-identity {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 7px;
  }

  .mobile-watch-identity strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-watch-identity small {
    flex-shrink: 0;
  }

  .mobile-watch-price,
  .mobile-watch-score {
    color: var(--mobile-blue);
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
  }

  .mobile-watch-score {
    padding: 3px 6px;
    border: 1px solid rgba(201, 123, 21, .4);
    border-radius: 999px;
    color: var(--mobile-orange);
    font-size: 12px;
    font-weight: 750;
  }

  .mobile-watch-backtest {
    min-height: 26px;
    padding: 2px 6px;
    border-color: var(--mobile-line);
    color: var(--mobile-muted);
    font-size: 10px;
  }

  .mobile-watch-row-main > span:first-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-watch-time {
    color: var(--mobile-muted);
    font-family: var(--font-mono);
    font-size: 11px;
  }

  .mobile-watch-time.old {
    color: var(--mobile-red);
  }

  .mobile-watch-prompt {
    font-size: 11px;
    font-style: normal;
    line-height: 1.35;
  }

  .mobile-watch-prompt.buy {
    color: #127a4b;
    font-weight: 400;
  }

  .mobile-watch-prompt.wait,
  .mobile-watch-prompt.stale {
    color: var(--mobile-red);
  }

  .mobile-watch-prompt.neutral,
  .mobile-watch-prompt.pending {
    color: var(--mobile-muted);
  }

  .mobile-watch-detail {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 3px;
    color: var(--mobile-muted);
    font-size: 11px;
    line-height: 1.45;
  }

  .mobile-watch-detail-line {
    display: block;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .mobile-watch-detail .watch-detail-label {
    color: var(--mobile-muted);
    font-size: inherit;
    font-weight: 400;
    white-space: normal;
  }

  .mobile-watch-detail .watch-detail-label::after {
    content: '：';
  }

  .mobile-watch-detail .watch-detail-value {
    color: var(--mobile-muted);
    font-size: inherit;
  }

  .mobile-watch-row strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-watch-row small {
    color: var(--mobile-muted);
    font-family: var(--font-mono);
    font-size: 11px;
  }

  .mobile-watch-row-main b {
    color: var(--mobile-blue);
    font-family: var(--font-mono);
    font-size: 21px;
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 68px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--mobile-line);
    background: rgba(255, 255, 255, .98);
  }

  .mobile-nav-item {
    min-height: 68px;
    border: 0;
    background: transparent;
    color: #7b8491;
    font-size: 13px;
    font-weight: 650;
  }

  .mobile-nav-item.is-active {
    color: var(--mobile-blue);
  }

  .mobile-nav-item.is-active::before {
    display: block;
    width: 20px;
    height: 3px;
    margin: 0 auto 8px;
    border-radius: 3px;
    background: var(--mobile-blue);
    content: '';
  }

  .mobile-sheet {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    max-height: 88svh;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--mobile-line);
    border-radius: 22px 22px 0 0;
    background: var(--mobile-surface);
    box-shadow: 0 -12px 34px rgba(31, 49, 76, .14);
  }

  .mobile-sheet-handle {
    width: 38px;
    height: 4px;
    margin: 0 auto;
    border-radius: 4px;
    background: #d9dee7;
  }

  .mobile-sheet-header {
    align-items: center;
  }

  .mobile-close-button {
    color: var(--mobile-muted);
  }

  .mobile-sheet-section,
  .mobile-sheet-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .mobile-sheet-label {
    color: var(--mobile-muted);
    font-size: 12px;
    font-weight: 650;
  }

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

  .mobile-option-grid button {
    min-height: 42px;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background: #fbfcfe;
    color: #566170;
    font-size: 13px;
  }

  .mobile-option-grid button.is-selected {
    border-color: #bcd0ff;
    background: var(--mobile-blue-soft);
    color: var(--mobile-blue);
    font-weight: 700;
  }

  .mobile-sheet-field input {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background: #fbfcfe;
    color: var(--mobile-ink);
    font-size: 14px;
  }

  .mobile-sheet-apply {
    width: 100%;
    margin-top: 2px;
  }

  .mobile-detail-symbol {
    display: block;
    margin-top: 5px;
    color: var(--mobile-muted);
    font-family: var(--font-mono);
    font-size: 12px;
  }

  .mobile-detail-score {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: end;
    gap: 10px;
    padding: 18px 0;
    border-bottom: 1px solid var(--mobile-line);
  }

  #mobile-detail-score-value {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  #mobile-detail-score-label {
    grid-column: 2;
    grid-row: 1;
  }

  #mobile-detail-short-score {
    grid-column: 2;
    grid-row: 2;
    color: var(--mobile-text);
    font-weight: 650;
  }

  #mobile-detail-signal {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .mobile-detail-score strong {
    color: var(--mobile-blue);
    font-family: var(--font-mono);
    font-size: 54px;
    line-height: .9;
  }

  .mobile-detail-score span,
  .mobile-detail-score b {
    color: var(--mobile-muted);
    font-size: 12px;
  }

  .mobile-detail-score b {
    color: var(--mobile-blue);
  }

  .mobile-detail-reason {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-detail-reason span,
  .mobile-detail-meta span {
    color: var(--mobile-muted);
    font-size: 12px;
  }

  .mobile-detail-reason p {
    color: var(--mobile-ink);
    font-size: 15px;
    line-height: 1.6;
  }

  .mobile-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--mobile-line);
    border-bottom: 1px solid var(--mobile-line);
  }

  .mobile-detail-meta div {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-detail-meta strong {
    color: var(--mobile-ink);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content,
  .records-modal-panel {
    width: 100% !important;
    max-width: none !important;
    max-height: 90svh !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 22px 22px 0 0 !important;
    background: var(--mobile-surface) !important;
    color: var(--mobile-ink);
  }

  .modal-header,
  .modal-footer {
    border-color: var(--mobile-line) !important;
  }

  .modal-header h2 {
    color: var(--mobile-ink) !important;
    font-size: 19px !important;
  }

  .records-header-actions {
    order: 3;
    width: 100%;
    margin: 0 !important;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .records-modal-header {
    flex-wrap: wrap;
  }

  .records-modal-panel .data-table {
    min-width: 720px;
  }

  .records-modal-panel .modal-body > div {
    overflow-x: auto !important;
  }

  #backtest-modal .modal-body,
  #bull-modal .modal-body {
    padding: 16px !important;
  }
}

/* ─── 移动端统一组件层：弹窗、表单、记录卡片 ─────────────── */
@media (max-width: 920px) {
  button,
  input {
    -webkit-tap-highlight-color: transparent;
  }

  /* 移动端所有自定义下拉菜单都使用浅色工作台主题，避免弹出层沿用桌面深色背景。 */
  .custom-dropdown-options {
    background: var(--mobile-surface) !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 10px !important;
    box-shadow: 0 14px 30px rgba(31, 49, 76, .16) !important;
    color: var(--mobile-ink);
  }

  .custom-dropdown-option {
    color: var(--mobile-muted) !important;
  }

  .custom-dropdown-option:hover,
  .custom-dropdown-option.selected {
    background: var(--mobile-blue-soft) !important;
    color: var(--mobile-blue) !important;
  }

  .market-option-check {
    border-color: #cbd3df;
  }

  .market-multi-option.selected .market-option-check {
    border-color: var(--mobile-blue);
    color: var(--mobile-blue);
  }

  #header .custom-dropdown-options {
    z-index: 2100;
  }

  #records-modal .custom-dropdown-options {
    z-index: 11002;
  }

  /* 移动端保留全局分析设置：频率、K线天数、周期、引擎和模型。 */
  #header {
    display: flex !important;
    flex-direction: column;
    background: var(--mobile-surface) !important;
    border-bottom: 1px solid var(--mobile-line);
    box-shadow: none;
  }

  #header-row-1 {
    display: none !important;
  }

  #header-row-2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    padding: 10px 16px 12px;
    background: var(--mobile-surface) !important;
  }

  #header-row-2 > #freq-wrap,
  #header-row-2 > .header-ctrl {
    min-width: 0;
    min-height: 38px;
    color: var(--mobile-muted);
  }

  #header-row-2 #freq-label,
  #header-row-2 .header-ctrl > span {
    color: var(--mobile-muted) !important;
    font-size: 11px;
  }

  #header-row-2 .custom-dropdown-trigger {
    min-height: 38px;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 10px;
    background: #fbfcfe !important;
    color: var(--mobile-ink) !important;
  }

  #header-row-2 #header-model-ctrl,
  #header-row-2 > #trigger-btn,
  #header-row-2 > #header-tools-select {
    grid-column: 1 / -1;
  }

  #header-row-2 > #trigger-btn {
    width: 100%;
    min-height: 42px;
    margin: 0;
    border: 0 !important;
    border-radius: 11px !important;
    background: var(--mobile-blue) !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 720;
  }

  /* 工具入口已在“更多”页面提供，监控页顶部不重复展示。 */
  #header-row-2 > #header-tools-select {
    display: none !important;
  }

  /* 配置只在监控列表页展示，避免页面顶部长期占用首屏空间。 */
  #header {
    display: none !important;
  }

  .mobile-settings-card {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--mobile-line);
    border-radius: 15px;
    background: var(--mobile-surface);
  }

  .mobile-settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }

  .mobile-settings-header h3 {
    margin-top: 3px;
    color: var(--mobile-ink);
    font-size: 17px;
    font-weight: 760;
  }

  .mobile-settings-note {
    flex: 0 0 auto;
    padding-top: 4px;
    color: var(--mobile-muted);
    font-size: 11px;
  }

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

  .mobile-settings-group-label {
    grid-column: 1 / -1;
    margin-top: 2px;
    color: var(--mobile-ink);
    font-size: 12px;
    font-weight: 720;
  }

  .mobile-settings-group-label-next {
    margin-top: 4px;
  }

  .mobile-setting-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
  }

  .mobile-setting-field-wide {
    grid-column: 1 / -1;
  }

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

  .mobile-setting-help {
    color: var(--mobile-muted);
    font-size: 10px;
    line-height: 1.45;
  }

  .mobile-setting-dropdown {
    width: 100% !important;
  }

  .mobile-setting-dropdown .custom-dropdown-trigger {
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 10px;
    background: #fbfcfe !important;
    color: var(--mobile-ink) !important;
    font-size: 12px;
  }

  .mobile-action-list button,
  .mobile-tool-list button {
    position: relative;
    padding-right: 46px;
  }

  .mobile-action-list button::after,
  .mobile-tool-list button::after {
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    border-top: 1.5px solid #aab3bf;
    border-right: 1.5px solid #aab3bf;
    content: '';
    transform: translateY(-50%) rotate(45deg);
  }

  .mobile-filter-chip:focus-visible,
  .mobile-option-grid button:focus-visible,
  .mobile-primary-button:focus-visible,
  .mobile-secondary-button:focus-visible,
  .mobile-manage-button:focus-visible,
  .mobile-delete-selection-button:focus-visible,
  .mobile-nav-item:focus-visible,
  .mobile-icon-button:focus-visible,
  .mobile-text-button:focus-visible,
  .mobile-close-button:focus-visible,
  .mobile-record-row:focus-visible,
  .mobile-watch-row:focus-visible,
  .mobile-action-list button:focus-visible,
  .mobile-tool-list button:focus-visible {
    outline: 3px solid rgba(37, 99, 217, .22);
    outline-offset: 2px;
  }

  .mobile-sheet,
  .modal-content.glass-panel {
    border-color: var(--mobile-line) !important;
    background: var(--mobile-surface) !important;
    color: var(--mobile-ink) !important;
  }

  .mobile-sheet {
    gap: 16px;
  }

  .mobile-sheet-header h2 {
    font-size: 20px;
    letter-spacing: -.025em;
  }

  .mobile-sheet-handle {
    background: #d1d7e0;
  }

  .modal-overlay {
    align-items: flex-end !important;
    justify-content: center;
    padding: 0 !important;
    background: rgba(24, 32, 43, .38) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .modal-content.glass-panel,
  .records-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 92svh !important;
    overflow: hidden !important;
    border: 1px solid var(--mobile-line) !important;
    border-bottom: 0 !important;
    border-radius: 22px 22px 0 0 !important;
    box-shadow: 0 -12px 34px rgba(31, 49, 76, .14) !important;
    transform: translateY(0);
  }

  .modal-overlay.hidden .glass-panel {
    transform: translateY(20px);
  }

  .modal-header {
    min-height: 62px;
    padding: 16px 16px 12px !important;
    border-bottom: 1px solid var(--mobile-line) !important;
    background: var(--mobile-surface) !important;
  }

  .modal-header h2,
  .modal-header h2[style] {
    color: var(--mobile-ink) !important;
    font-size: 19px !important;
    font-weight: 760 !important;
    letter-spacing: -.025em;
  }

  .close-btn,
  .close-btn[style] {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    margin-left: auto !important;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background: #f7f8fb;
    color: var(--mobile-muted) !important;
    font-size: 18px;
    line-height: 1;
  }

  .close-btn:active {
    background: var(--mobile-blue-soft);
    color: var(--mobile-blue) !important;
  }

  .modal-body {
    min-height: 0;
    padding: 16px !important;
    overflow-y: auto !important;
    background: var(--mobile-surface) !important;
    color: var(--mobile-ink);
  }

  .modal-footer {
    min-height: 64px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid var(--mobile-line) !important;
    background: var(--mobile-surface) !important;
  }

  .modal-footer button,
  .modal-footer button[style] {
    min-height: 42px;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 10px !important;
    background: #f7f8fb !important;
    color: #4d5764 !important;
    font-size: 13px;
    font-weight: 700;
    box-shadow: none !important;
    transform: none !important;
  }

  .modal-footer button:active {
    background: var(--mobile-blue-soft) !important;
    border-color: #cbdcff !important;
    color: var(--mobile-blue) !important;
  }

  .modal-spinner {
    border-color: #dfe5ee !important;
    border-top-color: var(--mobile-blue) !important;
  }

  /* 全市场寻牛 */
  #bull-modal .modal-content {
    max-height: 86svh !important;
  }

  #bull-modal .modal-body > p {
    margin-bottom: 18px !important;
    color: var(--mobile-muted) !important;
    font-size: 13px !important;
    line-height: 1.6;
  }

  #bull-modal .input-group {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  #bull-modal .input-group > div {
    display: flex !important;
    align-items: stretch !important;
    flex-direction: column;
    gap: 6px !important;
  }

  #bull-modal .input-group label,
  #bull-modal .input-group > span {
    color: var(--mobile-muted) !important;
    font-size: 12px !important;
  }

  #bull-modal #bull-count,
  #bull-modal #bull-concurrency {
    width: 100% !important;
    min-height: 44px;
    padding: 0 11px !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 10px !important;
    background: #fbfcfe !important;
    color: var(--mobile-ink) !important;
    font-size: 14px !important;
  }

  #bull-modal #bull-preparing-panel,
  #bull-modal #bull-status-panel {
    margin-top: 12px !important;
    padding: 14px !important;
    border: 1px solid var(--mobile-line);
    border-radius: 12px;
    background: #f7f8fb !important;
    color: var(--mobile-muted) !important;
  }

  #bull-modal .progress-bar-bg {
    height: 7px !important;
    background: #e9edf3 !important;
  }

  #bull-modal .bull-progress-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 10px;
  }

  #bull-modal #bull-progress-text,
  #bull-modal .bull-progress-metrics b {
    color: var(--mobile-ink) !important;
  }

  #bull-modal #bull-progress-bar {
    background: var(--mobile-blue) !important;
  }

  #bull-modal .modal-footer {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #bull-modal #btn-stop-bull,
  #bull-modal #btn-resume-bull,
  #bull-modal #btn-start-bull {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    border: 0 !important;
    border-radius: 11px !important;
    background: var(--mobile-blue) !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 720;
  }

  #bull-modal #btn-stop-bull {
    background: #d94b5c !important;
  }

  /* 寻牛记录：手机端由宽表格转成信息卡 */
  #records-modal {
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100%;
    align-items: stretch !important;
  }

  #records-modal .records-modal-panel {
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
  }

  #records-modal .records-modal-header {
    display: flex !important;
    min-height: 0 !important;
    align-items: center;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 14px 16px 12px !important;
  }

  #records-modal .records-modal-header h2 {
    order: 1;
    margin: 0 !important;
  }

  #records-modal #reanalyze-progress {
    order: 2;
    min-width: 0;
    color: var(--mobile-muted);
    font-size: 11px;
  }

  #records-modal .records-modal-header > .close-btn {
    order: 3;
  }

  #records-modal #records-header-actions {
    order: 4;
    display: flex !important;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0;
    flex-shrink: 0;
    padding: 2px 0 8px;
    overflow: visible;
  }

  #records-modal #records-header-actions > button,
  #records-modal #records-header-actions > button[style] {
    min-height: 40px;
    flex: 1 1 calc(50% - 4px);
    border: 1px solid var(--mobile-line) !important;
    border-radius: 10px !important;
    background: #f7f8fb !important;
    color: #4d5764 !important;
    font-size: 12px !important;
    font-weight: 700;
  }

  #records-modal #records-header-actions > button[onclick*="clearAll"] {
    border-color: #f3c9cf !important;
    background: #fff5f6 !important;
    color: var(--mobile-red) !important;
  }

  #records-modal #records-header-actions > div {
    display: flex !important;
    min-width: 0;
    flex: 1 1 calc(50% - 4px);
    align-items: center;
    gap: 6px !important;
  }

  #records-modal #records-header-actions > div[style*="height: 16px"] {
    display: none !important;
  }

  #records-modal #records-header-actions > div > span {
    flex: 0 0 auto;
    color: var(--mobile-muted) !important;
    font-size: 11px !important;
  }

  #records-modal #records-header-actions .custom-dropdown {
    min-width: 0;
    width: auto !important;
    flex: 1 1 auto;
  }

  #records-modal #records-header-actions .custom-dropdown-trigger {
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 10px;
    background: #fbfcfe !important;
    color: var(--mobile-ink) !important;
    font-size: 12px;
  }

  #records-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 !important;
    background: var(--mobile-bg);
  }

  #records-modal .modal-body > div {
    min-height: 0;
    height: 100%;
    padding: 0 16px !important;
    background: var(--mobile-bg);
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #records-modal .records-modal-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title close"
      "progress progress"
      "actions actions";
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 8px 10px !important;
    padding: calc(14px + env(safe-area-inset-top)) 16px 12px !important;
  }

  #records-modal .records-modal-header h2 {
    grid-area: title;
  }

  #records-modal #reanalyze-progress {
    grid-area: progress;
    min-width: 0;
    width: 100%;
    flex: none;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    text-overflow: clip;
    line-height: 1.45;
  }

  #records-modal .records-modal-header > .close-btn {
    position: static !important;
    grid-area: close;
    justify-self: end;
    align-self: start;
    margin: 0 !important;
  }

  #records-modal #records-header-actions {
    grid-area: actions;
  }

  #records-modal .modal-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }

  #records-modal .data-table {
    display: block;
    min-width: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
  }

  #records-modal .data-table thead {
    display: none;
  }

  #records-modal .data-table tbody {
    display: block;
    padding: 0;
  }

  #records-modal .bull-record-desktop-row {
    display: none !important;
  }

  #records-modal .bull-record-mobile-row {
    display: block;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
    background: transparent;
  }

  #records-modal .bull-record-mobile-row > td {
    display: block;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
  }

  #records-modal .bull-record-watch-row {
    border-bottom: 1px solid var(--mobile-line);
  }

  #records-modal .mobile-watch-row-main {
    min-height: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
  }

  #records-modal .bull-record-mobile-row:last-child .bull-record-watch-row {
    border-bottom: 0;
  }

  #records-modal .bull-record-delete-action {
    border-color: #f3c9cf;
    color: var(--mobile-red);
  }

  #records-modal .modal-footer {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }

  #records-modal .pagination {
    gap: 5px;
  }

  #records-modal .pagination button {
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--mobile-line);
    border-radius: 9px;
    background: #f7f8fb;
    color: #4d5764;
  }

  /* 回测中心 */
  #backtest-modal .modal-content {
    max-height: 94svh !important;
  }

  #backtest-modal .modal-body {
    gap: 14px !important;
  }

  #backtest-modal .modal-body > div:first-child {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px !important;
    align-items: stretch !important;
  }

  #backtest-modal #bt-symbol-search-wrap,
  #backtest-modal .modal-body > div:first-child > div:nth-child(2) {
    display: flex !important;
    align-items: stretch !important;
    flex-direction: column;
    gap: 6px !important;
  }

  #backtest-modal #bt-symbol-search-wrap label,
  #backtest-modal .modal-body > div:first-child > div:nth-child(2) label {
    color: var(--mobile-muted) !important;
    font-size: 12px !important;
  }

  #backtest-modal #bt-symbol-input,
  #backtest-modal #bt-pattern-select {
    width: 100% !important;
  }

  #backtest-modal #bt-symbol-input {
    min-height: 44px;
    padding: 0 11px !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 10px !important;
    background: #fbfcfe !important;
    color: var(--mobile-ink) !important;
    font-size: 14px !important;
  }

  #backtest-modal #bt-pattern-select .custom-dropdown-trigger {
    min-height: 44px;
    padding: 0 11px;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background: #fbfcfe;
    color: var(--mobile-ink);
  }

  #backtest-modal .modal-body > div:first-child > button,
  #backtest-modal .modal-body > div:first-child > button[style] {
    width: 100%;
    min-height: 44px;
    border: 0 !important;
    border-radius: 11px !important;
    background: var(--mobile-blue) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 720;
  }

  #backtest-modal .modal-body > div:first-child > button.btn-secondary {
    border: 1px solid var(--mobile-line) !important;
    background: #f7f8fb !important;
    color: #4d5764 !important;
  }

  #backtest-modal #bt-summary-card {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 12px !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 14px !important;
    background: var(--mobile-surface) !important;
  }

  #backtest-modal #bt-period-cards {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  #backtest-modal .period-card,
  #backtest-modal #bt-evaluation,
  #backtest-modal #bt-signals-list,
  #backtest-modal #bt-batch-result {
    border-color: var(--mobile-line) !important;
    border-radius: 12px !important;
    background: #f7f8fb !important;
    color: var(--mobile-ink) !important;
    box-shadow: none !important;
  }

  #backtest-modal #bt-evaluation {
    color: var(--mobile-green) !important;
  }

  #backtest-modal #bt-signals-list {
    max-height: 220px !important;
  }

  /* 通用确认弹窗：保留危险操作语义，但取消旧玻璃拟态 */
  #confirm-modal {
    align-items: center !important;
    padding: 16px !important;
  }

  #confirm-modal .confirm-dialog {
    width: min(360px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    max-height: calc(100dvh - 32px - env(safe-area-inset-bottom)) !important;
    border: 1px solid var(--mobile-line) !important;
    border-bottom: 1px solid var(--mobile-line) !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 46px rgba(31, 49, 76, .16) !important;
  }

  #confirm-modal .confirm-dialog-header {
    min-height: 0;
    padding: 17px 16px 7px !important;
    border-bottom: 0 !important;
  }

  #confirm-modal .confirm-dialog-header h2 {
    color: var(--mobile-ink) !important;
    font-size: 18px !important;
  }

  #confirm-modal .confirm-dialog-body {
    padding: 8px 16px 18px !important;
  }

  #confirm-modal #confirm-msg {
    color: var(--mobile-muted) !important;
    font-size: 14px;
    line-height: 1.65;
  }

  #confirm-modal .confirm-dialog-footer {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid var(--mobile-line) !important;
  }

  #confirm-modal .confirm-dialog-footer button {
    min-height: 44px;
    border-radius: 10px !important;
    background: #f7f8fb !important;
    color: #4d5764 !important;
  }

  #confirm-modal #btn-confirm-ok {
    border-color: #f3c9cf !important;
    background: #fff5f6 !important;
    color: var(--mobile-red) !important;
  }
}
