/* ═══════════════════════════════════════════════════════════
   Cassandra Design System
   Dark Academia × Financial Precision
   ═══════════════════════════════════════════════════════════ */

/* ── Google Fonts ────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;800&family=Inter:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;600;700&display=swap");

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  /* Background */
  --bg-primary: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
  --bg-solid: #0f0f0f;

  /* Accent — Gold */
  --accent: #c5a059;
  --accent-light: #d4b36e;
  --accent-dark: #a88840;
  --accent-glow: 0 0 20px rgba(197, 160, 89, 0.35);
  --accent-glow-strong: 0 0 30px rgba(197, 160, 89, 0.5);

  /* Taiwan Color Logic */
  --up: #ef4444;
  --up-bg: rgba(239, 68, 68, 0.12);
  --down: #22c55e; /* canonical 跌綠（2026-07-18 對齊 AGENTS.md，原 #10b981 為 drift） */
  --down-bg: rgba(34, 197, 94, 0.12);

  /* Surfaces */
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.08);

  /* Borders */
  --border: rgba(197, 160, 89, 0.15);
  --border-strong: rgba(197, 160, 89, 0.3);

  /* Text */
  --text: #e8e4de;
  --text-dim: #8a8275;
  --text-muted: #5a554d;

  /* Signal Colors */
  --signal-strong: #10b981;
  --signal-warning: #f59e0b;
  --signal-danger: #ef4444;
  --signal-info: #6366f1;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Typography */
  --font-heading: "Playfair Display", "Georgia", serif;
  --font-body: "Noto Sans TC", "Inter", sans-serif;
  --font-mono: "SF Mono", "Menlo", monospace;

  /* Transition */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  padding: var(--space-lg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ── Container ───────────────────────────────────────────── */
.container {
  max-width: 640px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────── */
.header {
  text-align: center;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.header-avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto var(--space-md) auto;
  border: 2px solid var(--accent);
  box-shadow: var(--accent-glow);
  transition: box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #050505;
}

.header-avatar-wrapper:hover {
  box-shadow: var(--accent-glow-strong);
}

.header-avatar-img {
  width: 170%;
  height: 170%;
  object-fit: cover;
  object-position: center 0%;
  transform: translateY(12px);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* GIF 激活態：適配直式圖片(270×480) */
.header-avatar-img.gif-active {
  width: 173%;
  height: 173%;
  object-position: center 35%;
  transform: translateY(16px);
}

/* 淡出/淡入過渡 */
.header-avatar-img.avatar-fade-out {
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.header-avatar-img.avatar-fade-in {
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

/* 點擊觸發動畫 */
.header-avatar-wrapper.avatar-pulse {
  animation: avatarBounce 0.6s ease-out;
  box-shadow: 0 0 35px rgba(197, 160, 89, 0.6), 0 0 70px rgba(245, 158, 11, 0.2);
}

@keyframes avatarBounce {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.12); }
  50%  { transform: scale(0.95); }
  75%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
}

.pro-badge {
  display: inline-block;
  font-size: 0.55em;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.15em 0.6em;
  border-radius: 6px;
  background: linear-gradient(135deg, #c5a059, #e8c97a, #c5a059);
  background-size: 200% 100%;
  color: #0a0a0a;
  vertical-align: middle;
  position: relative;
  top: -2px;
  box-shadow:
    0 0 12px rgba(197, 160, 89, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: proShimmer 3s ease-in-out infinite;
}

@keyframes proShimmer {
  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

/* Admin Tier Badge */
.pro-badge.admin-tier-badge {
  background: linear-gradient(135deg, #e74c3c, #ff6b6b, #e74c3c);
  background-size: 200% 100%;
  color: #fff;
  box-shadow:
    0 0 12px rgba(231, 76, 60, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: proShimmer 3s ease-in-out infinite;
}

/* ── Simulate Bar ───────────────────────────────────────── */
.sim-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(231, 76, 60, 0.06);
  border: 1px solid rgba(231, 76, 60, 0.15);
  border-radius: 10px;
  margin: 4px var(--space-md) 0;
}

.sim-bar-label {
  font-size: 0.7rem;
  color: #e74c3c;
  font-weight: 600;
  margin-right: 4px;
}

.sim-btn {
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #888;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sim-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sim-btn.active {
  color: #fff;
}

.sim-btn.active[data-sim="admin"] {
  background: linear-gradient(135deg, #e74c3c, #ff6b6b);
  border-color: #e74c3c;
}

.sim-btn.active[data-sim="ultra"] {
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  border-color: #6366f1;
}

.sim-btn.active[data-sim="pro"] {
  background: linear-gradient(135deg, #c5a059, #e8c97a);
  border-color: #c5a059;
  color: #0a0a0a;
}

.sim-btn.active[data-sim="elite"] {
  background: linear-gradient(135deg, #c23152, #e94560);
  border-color: #e94560;
  color: #fff;
}

.header .subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.header .version {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: var(--space-xs);
}

/* ── Input Section ───────────────────────────────────────── */
.input-section {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  align-items: stretch;
}
.input-section .autocomplete-wrap {
  flex: 1 1 250px;
  min-width: 200px;
}
.input-section .btn-go {
  flex: 0 0 auto;
}
.input-section .btn-scan {
  flex: 1 1 auto;
}

.stock-input {
  flex: 1;
  padding: 0.85rem 1.2rem;
  background: var(--surface);
  border: 2px solid rgba(197, 160, 89, 0.45);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  outline: none;
  box-shadow:
    0 0 8px rgba(197, 160, 89, 0.12),
    inset 0 0 6px rgba(197, 160, 89, 0.06);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.stock-input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 12px rgba(197, 160, 89, 0.25),
    0 0 0 3px rgba(197, 160, 89, 0.12);
}

.stock-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-body);
  letter-spacing: 0;
}

/* ── Autocomplete ────────────────────────────────────────── */
.autocomplete-wrap {
  flex: 1;
  position: relative;
}

.autocomplete-wrap .stock-input {
  width: 100%;
}

.autocomplete-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 264px;
  overflow-y: auto;
  background: rgba(26, 26, 26, 0.96);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.autocomplete-list.open {
  display: block;
}

.ac-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ac-item:last-child {
  border-bottom: none;
}

.ac-item:hover,
.ac-item.active {
  background: var(--surface-hover);
}

.ac-item .ac-code {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-light);
  min-width: 4.5em;
  letter-spacing: 1px;
}

.ac-item .ac-name {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.ac-item .ac-match {
  color: var(--accent);
  font-weight: 600;
}

.btn-go {
  padding: 0.85rem 1.8rem;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border: none;
  border-radius: var(--radius);
  color: #0a0a0a;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    opacity var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  white-space: nowrap;
}

.btn-go:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: var(--accent-glow);
}

.btn-go:active {
  transform: translateY(0);
}

.btn-go:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Loading ─────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-dim);
}

.loading .spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.95rem;
}

/* ── Error ───────────────────────────────────────────────── */
.error {
  text-align: center;
  padding: var(--space-lg);
  color: var(--signal-danger);
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Result ──────────────────────────────────────────────── */
.result {
  display: none;
}

.result.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Stock Info Bar ──────────────────────────────────────── */
.stock-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.stock-bar .code {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stock-bar .name {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.stock-bar .price {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
}

.stock-bar .date {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: right;
}

/* ── Score Section ───────────────────────────────────────── */
.score-section {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.score-trio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.score-mini {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  position: relative;
}

.score-mini.buy {
  border-color: var(--up);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.score-mini.sell {
  border-color: var(--down);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.mini-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.score-mini.buy .mini-value {
  color: var(--up);
}

.score-mini.sell .mini-value {
  color: var(--down);
}

.mini-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

/* ── Prediction Section ─────────────────────────────────── */
.prediction-section {
  margin-bottom: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
}

.prediction-section h3 {
  margin: 0;
  font-family: var(--font-heading);
  color: var(--accent);
  font-size: 0.95rem;
}

.prediction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.prediction-outlook {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.prediction-outlook.accelerating {
  color: var(--up);
  background: rgba(239, 68, 68, 0.08);
}

.prediction-outlook.decelerating {
  color: var(--down);
  background: rgba(16, 185, 129, 0.08);
}

.prediction-outlook.stable {
  color: var(--accent);
  background: rgba(197, 160, 89, 0.08);
}

.prediction-signals {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pred-signal {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 3px var(--space-sm);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
}

.pred-icon {
  font-size: 1rem;
}

.pred-label {
  flex: 1;
  color: var(--text-secondary);
}

.pred-dir {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pred-dir.bullish {
  color: var(--up);
}

.pred-dir.bearish {
  color: var(--down);
}

.pred-dir.warning,
.pred-dir.recovering {
  color: var(--accent);
}

.score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--border);
  margin-bottom: var(--space-sm);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  position: relative;
}

.score-circle::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color var(--transition);
  pointer-events: none;
}

.score-circle.bullish {
  border-color: var(--up);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.15);
}

.score-circle.bullish::after {
  border-color: rgba(239, 68, 68, 0.1);
}

.score-circle.bearish {
  border-color: var(--down);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

.score-circle.bearish::after {
  border-color: rgba(16, 185, 129, 0.1);
}

.score-circle.neutral {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

.score-circle.neutral::after {
  border-color: rgba(197, 160, 89, 0.1);
}

.score-value {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.score-outlook {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-sm);
}

.score-outlook.bullish {
  color: var(--up);
}

.score-outlook.bearish {
  color: var(--down);
}

.score-outlook.neutral {
  color: var(--accent);
}

/* ── Multi-Timeframe Section ────────────────────────────── */
.tf-section {
  margin-bottom: var(--space-lg);
}

.tf-section h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.05em;
}

.tf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: var(--space-sm);
}

.tf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-xs);
  text-align: center;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.tf-card:hover {
  border-color: var(--border-strong);
}

.tf-card .tf-icon {
  display: none;
}

.tf-card .tf-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.tf-card .tf-score {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
}

.tf-card .tf-outlook {
  font-size: 0.65rem;
  font-weight: 600;
}

.tf-card.bullish {
  border-color: rgba(239, 68, 68, 0.3);
}

.tf-card.bullish .tf-score {
  color: var(--up);
}

.tf-card.bullish .tf-outlook {
  color: var(--up);
}

.tf-card.bearish {
  border-color: rgba(16, 185, 129, 0.3);
}

.tf-card.bearish .tf-score {
  color: var(--down);
}

.tf-card.bearish .tf-outlook {
  color: var(--down);
}

.tf-card.neutral {
  border-color: rgba(197, 160, 89, 0.3);
}

.tf-card.neutral .tf-score {
  color: var(--accent);
}

.tf-card.neutral .tf-outlook {
  color: var(--accent);
}

.tf-card.no-data {
  opacity: 0.4;
}

.tf-card.no-data .tf-score {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.tf-resonance {
  background: rgba(197, 160, 89, 0.05);
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
}

.tf-resonance .tf-res-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.tf-resonance .tf-res-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.tf-resonance .tf-composite {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── PARM Dimension Bar ──────────────────────────────────── */
.parm-section {
  margin-bottom: var(--space-lg);
}

.parm-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
}

.parm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.parm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.parm-card:hover {
  border-color: var(--border-strong);
}

.parm-card .parm-letter {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.parm-card .parm-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.parm-card .parm-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
}

.parm-card .parm-max {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
}

.parm-card .parm-bar {
  height: 3px;
  border-radius: 2px;
  margin-top: var(--space-sm);
  background: var(--border);
  overflow: hidden;
}

.parm-card .parm-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease-out;
}

.parm-card .parm-desc {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  letter-spacing: 0.04em;
}

/* ── Signal Alerts ───────────────────────────────────────── */
.alerts {
  margin-bottom: var(--space-lg);
}

.alerts h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
}

.alert-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border);
  transition:
    border-color var(--transition),
    background var(--transition);
}

.alert-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.alert-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.alert-label {
  font-weight: 600;
  flex: 1;
  font-size: 0.9rem;
}

.alert-level {
  font-size: 0.7rem;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alert-level.strong {
  background: rgba(239, 68, 68, 0.12);
  color: var(--up);
}

.alert-level.medium,
.alert-level.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--signal-warning);
}

.alert-level.high {
  background: rgba(239, 68, 68, 0.15);
  color: var(--signal-danger);
}

.alert-level.opportunity {
  background: rgba(99, 102, 241, 0.12);
  color: var(--signal-info);
}

.no-alert {
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-sm) 0;
  font-family: var(--font-heading);
}

/* ── Chart Table ─────────────────────────────────────────── */
.chart-section {
  margin-bottom: var(--space-xl);
}

.chart-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: var(--space-md);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease;
}

.chart-toggle:hover {
  opacity: 0.8;
}

.chart-toggle .toggle-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 0.7rem;
}

.chart-section.collapsed .chart-toggle .toggle-arrow {
  transform: rotate(-90deg);
}

.chart-section .chart-wrap {
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease;
  max-height: 600px;
  opacity: 1;
  overflow: auto;
}

.chart-section.collapsed .chart-wrap {
  max-height: 0;
  opacity: 0;
  border: none;
}

.chart-wrap {
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.chart-table th {
  background: rgba(14, 14, 26, 0.97);
  color: var(--accent);
  padding: 0.6rem 0.7rem;
  text-align: right;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-strong);
  position: sticky;
  top: 0;
  z-index: 2;
}

.chart-table th:first-child {
  text-align: left;
}

.chart-table td {
  padding: 0.45rem 0.7rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.chart-table td:first-child {
  text-align: left;
  color: var(--text-dim);
  font-family: var(--font-body);
}

.chart-table tr:hover td {
  background: var(--surface-hover);
}

.chart-table tr:last-child td {
  border-bottom: none;
}

.price-up {
  color: var(--up);
  font-weight: 600;
}

.price-down {
  color: var(--down);
  font-weight: 600;
}

/* ── Mini Candlestick ────────────────────────────────────── */
.candle-cell {
  width: 36px;
  padding: 4px 0 !important;
  text-align: center !important;
}

.candle-wrap {
  position: relative;
  width: 18px;
  height: 48px;
  margin: 0 auto;
}

.candle-wick {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--text-dim);
}

.candle-body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  min-height: 2px;
  border-radius: 1.5px;
}

.candle-body.up {
  background: var(--up);
}

.candle-body.down {
  background: var(--down);
}

.candle-body.doji {
  background: var(--text-dim);
}

/* ── Footer ──────────────────────────────────────────────── */
/* ── Pivot Section ───────────────────────────────────────── */
.pivot-section {
  margin-top: var(--space-xl);
}

.pivot-section h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.pivot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
}

.pivot-item {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.pivot-item:hover {
  background: var(--surface-hover);
}

.pivot-item .pivot-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.pivot-item .pivot-price {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.pivot-item.resistance .pivot-label {
  color: var(--up);
}

.pivot-item.support .pivot-label {
  color: var(--down);
}

.pivot-item.center .pivot-label {
  color: var(--accent);
}

.pivot-item.center {
  border-color: var(--accent-dark);
  background: rgba(197, 160, 89, 0.06);
}

.pivot-current {
  margin-top: var(--space-sm);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-body);
}

.pivot-current span {
  color: var(--accent-light);
  font-weight: 600;
}

/* ── Auth Gate ───────────────────────────────────────────── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  background: var(--bg-primary);
}

.gate-message {
  text-align: center;
  color: var(--text-secondary);
}

.gate-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.gate-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.25);
}

.gate-logo h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.gate-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.btn-google-login {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.btn-google-login:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.15);
}

.google-icon {
  flex-shrink: 0;
}

/* Gate status screens */
.gate-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.gate-status h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-primary);
}

.gate-status p {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 300px;
  text-align: center;
  line-height: 1.6;
}

.gate-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-xs);
}

.btn-gate-logout {
  margin-top: var(--space-md);
  padding: 8px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-gate-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

.gate-error {
  color: var(--red);
  font-size: 0.85rem;
}

/* ── User bar (header 右上) ──────────────────────────────── */
.user-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.user-name {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.btn-logout {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

.header-top200-link {
  padding: 4px 12px;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(197, 160, 89, 0.08);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.header-top200-link:hover {
  background: rgba(197, 160, 89, 0.18);
  border-color: var(--gold);
}

.footer {
  text-align: center;
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-heading);
  letter-spacing: 0.06em;
}

/* ── Admin Button & Badge ────────────────────────────────── */
.btn-admin {
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-admin:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.admin-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
}

/* ── Admin Modal ─────────────────────────────────────────── */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  backdrop-filter: blur(6px);
}

.admin-modal-content {
  background: #1a1f2e;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent);
  margin: 0;
}

.admin-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.admin-modal-close:hover {
  color: var(--red);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Admin User List ─────────────────────────────────────── */
.admin-user-list {
  overflow-y: auto;
  padding: 6px 8px;
}

.admin-loading,
.admin-empty,
.admin-error {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-xl);
  font-size: 0.85rem;
}

/* Toolbar: search + sort */
.admin-toolbar {
  padding: 4px 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-search-wrap {
  width: 100%;
}

.admin-search {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.admin-search:focus {
  border-color: var(--accent);
}

.admin-search::placeholder {
  color: #555;
}

.admin-sort-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.admin-sort-label {
  font-size: 0.7rem;
  color: #666;
  margin-right: 2px;
}

.admin-sort-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #888;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-sort-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-sort-btn.active {
  background: rgba(201, 164, 74, 0.12);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.admin-stats {
  font-size: 0.68rem;
  color: #555;
  text-align: right;
}

/* Card: two-row layout */
.admin-user-card {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.admin-user-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

.admin-user-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.admin-user-detail {
  min-width: 0;
}

.admin-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.admin-user-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.admin-user-name {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-tags {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.admin-user-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-left: 46px;
  flex-wrap: wrap;
  gap: 4px;
  overflow: hidden;
}

.admin-user-meta {
  display: flex;
  gap: 10px;
  font-size: 0.65rem;
  color: #555;
  flex-wrap: wrap;
  min-width: 0;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.admin-status-tag {
  font-size: 0.63rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.admin-status-tag.pending {
  background: rgba(212, 175, 55, 0.15);
  color: var(--accent);
}

.admin-status-tag.approved {
  background: rgba(0, 200, 83, 0.12);
  color: #4caf50;
}

.admin-status-tag.blocked {
  background: rgba(244, 67, 54, 0.12);
  color: var(--red);
}

.admin-role-tag {
  font-size: 0.63rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(156, 39, 176, 0.15);
  color: #ba68c8;
  font-weight: 600;
}

.admin-tier-tag {
  font-size: 0.63rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.admin-tier-tag.pro {
  background: rgba(201, 164, 74, 0.15);
  color: #e8c97a;
}

.admin-tier-tag.ultra {
  background: rgba(239, 68, 68, 0.15);
  color: #f59e0b;
}

.admin-tier-tag.elite {
  background: rgba(233, 69, 96, 0.15);
  color: #ff6b81;
  font-weight: 700;
}

.btn-approve,
.btn-block {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 8px;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.btn-approve:hover {
  background: rgba(0, 200, 83, 0.12);
  border-color: #4caf50;
  color: #4caf50;
}

.btn-block:hover {
  background: rgba(244, 67, 54, 0.12);
  border-color: var(--red);
  color: var(--red);
}

.btn-upgrade,
.btn-downgrade {
  padding: 3px 8px;
  border-radius: var(--radius);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s;
}

.btn-upgrade {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.08);
  color: #a78bfa;
}

.btn-upgrade:hover {
  background: rgba(99, 102, 241, 0.2);
}

.btn-upgrade.elite {
  border-color: rgba(233, 69, 96, 0.4);
  background: rgba(233, 69, 96, 0.1);
  color: #ff6b81;
}

.btn-upgrade.elite:hover {
  background: rgba(233, 69, 96, 0.25);
}

.btn-downgrade {
  border-color: rgba(201, 164, 74, 0.3);
  background: rgba(201, 164, 74, 0.08);
  color: var(--accent);
}

.btn-downgrade:hover {
  background: rgba(201, 164, 74, 0.2);
}

/* ── Admin Toast Notification ────────────────────────────── */
.admin-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  pointer-events: none;
}

.admin-toast-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transform: translateX(120%);
  opacity: 0;
  animation: toastIn 0.4s ease forwards;
  pointer-events: auto;
  max-width: 320px;
}

.admin-toast-item.fade-out {
  animation: toastOut 0.4s ease forwards;
}

.admin-toast-item .toast-title {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.admin-toast-item .toast-body {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.toast-highlight {
  color: var(--accent);
  font-weight: 700;
}

.toast-pending {
  color: var(--red);
  font-weight: 700;
}

@keyframes toastIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* ── In-App Browser Guidance ─────────────────────────────── */
.gate-status.inapp h2 {
  color: var(--accent);
}

.btn-copy-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: var(--space-md);
}

.btn-copy-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.gate-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  body {
    padding: var(--space-md);
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .header-avatar-wrapper {
    width: 90px;
    height: 90px;
  }

  .input-section {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .input-section .autocomplete-wrap {
    flex: 1 1 100%;
    min-width: 0;
  }
  .input-section .btn-go {
    flex: 1 1 100%;
    font-size: 1rem;
  }
  .input-section .btn-scan {
    flex: 1 1 calc(50% - 4px);
    font-size: 0.75rem;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .score-trio {
    gap: var(--space-sm);
  }

  .score-mini {
    width: 90px;
    height: 90px;
  }

  .mini-value {
    font-size: 1.5rem;
  }

  .mini-label {
    font-size: 0.55rem;
  }

  .score-circle {
    width: 130px;
    height: 130px;
  }

  .score-value {
    font-size: 2.2rem;
  }

  .prediction-section {
    padding: var(--space-md);
  }

  .prediction-outlook {
    font-size: 1.1rem;
  }

  .parm-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .parm-card {
    padding: var(--space-sm) 2px;
  }

  .parm-card .parm-letter {
    font-size: 1rem;
  }

  .parm-card .parm-name {
    font-size: 0.55rem;
  }

  .parm-card .parm-value {
    font-size: 0.82rem;
  }

  .parm-card .parm-desc {
    font-size: 0.5rem;
  }

  .pivot-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }

  .pivot-item {
    padding: var(--space-sm) 2px;
  }

  .pivot-item .pivot-label {
    font-size: 0.62rem;
  }

  .pivot-item .pivot-price {
    font-size: 0.78rem;
  }

  .chart-table {
    font-size: 0.72rem;
  }

  .chart-table th,
  .chart-table td {
    padding: 0.35rem 0.5rem;
  }

  /* ── Admin 使用者管理手機版佈局優化 ──────────────── */
  .admin-modal-content {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius);
  }

  .admin-modal-header {
    padding: 8px 10px;
    gap: 4px;
  }

  .admin-modal-header h2 {
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .admin-modal-header .btn-report {
    font-size: 0.65rem;
    padding: 3px 6px;
    white-space: nowrap;
  }

  .admin-user-card {
    padding: 10px;
    gap: 6px;
  }

  .admin-user-row-top {
    flex-wrap: wrap;
    gap: 6px;
  }

  .admin-user-tags {
    flex-wrap: wrap;
    gap: 3px;
  }

  .admin-user-row-bottom {
    padding-left: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .admin-user-meta {
    font-size: 0.62rem;
    gap: 8px;
  }

  .admin-user-actions {
    gap: 3px;
  }

  .btn-approve,
  .btn-block,
  .btn-upgrade,
  .btn-downgrade {
    padding: 3px 6px;
    font-size: 0.62rem;
  }

  .admin-status-tag,
  .admin-role-tag,
  .admin-tier-tag {
    font-size: 0.58rem;
    padding: 1px 6px;
  }

  .admin-user-avatar,
  .admin-user-avatar-placeholder {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .admin-user-name {
    font-size: 0.8rem;
  }

  .admin-user-email {
    font-size: 0.65rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   Scanner — 批量潛力股掃描
   ═══════════════════════════════════════════════════════════ */

/* ── Scan Button ────────────────────────────────────────── */
.btn-scan {
  padding: 0.85rem 1.4rem;
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-scan:hover {
  background: rgba(197, 160, 89, 0.12);
  transform: translateY(-1px);
  box-shadow: var(--accent-glow);
}

.btn-scan:active {
  transform: translateY(0);
}

.btn-scan:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Scanner Section ────────────────────────────────────── */
.scanner-section {
  margin-bottom: var(--space-xl);
  animation: fadeIn 0.4s ease;
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.scanner-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.scanner-header h2 {
  margin: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scanner-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: var(--space-md);
  gap: 4px;
}

.scanner-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.scanner-header h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 700;
}

.scanner-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-rescan {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-dim);
}

.btn-rescan:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

/* ── Admin 強制更新按鈕 ──────────────────────────────────── */
.btn-admin-rescan {
  background: rgba(156, 39, 176, 0.08);
  border: 1px solid rgba(156, 39, 176, 0.3);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  color: #ba68c8;
  white-space: nowrap;

}

.btn-admin-rescan:hover {
  background: rgba(156, 39, 176, 0.18);
  border-color: #ba68c8;
  box-shadow: 0 0 10px rgba(156, 39, 176, 0.2);
  transform: translateY(-1px);
}

.btn-admin-rescan:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Admin Rescan Progress Modal ─────────────────────────── */
.admin-rescan-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}

.admin-rescan-modal-content {
  background: var(--surface);
  border: 1px solid rgba(156, 39, 176, 0.3);
  border-radius: var(--radius);
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(156, 39, 176, 0.1);
}

.admin-rescan-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.admin-rescan-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #ba68c8;
  font-family: var(--font-heading);
}

.admin-rescan-status {
  padding: var(--space-lg);
}

.rescan-csv-info {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.rescan-csv-tag {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

.rescan-csv-tag.csv {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a78bfa;
}

.rescan-csv-tag.cache {
  background: rgba(197, 160, 89, 0.1);
  border: 1px solid rgba(197, 160, 89, 0.3);
  color: var(--accent);
}

.rescan-csv-tag.status-ok {
  background: rgba(0, 200, 83, 0.1);
  border: 1px solid rgba(0, 200, 83, 0.3);
  color: #4caf50;
}

.rescan-csv-tag.status-need {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: var(--red);
}

.rescan-progress-wrap {
  margin-bottom: var(--space-md);
}

.rescan-step-label {
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: var(--space-sm);
  font-weight: 600;
  min-height: 1.4em;
  transition: opacity 0.2s ease;
}

.rescan-progress-footer {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-xs);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.rescan-log {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  max-height: 140px;
  overflow-y: auto;
  line-height: 1.6;
}

.rescan-log .log-line {
  opacity: 0;
  animation: logFade 0.3s ease forwards;
}

@keyframes logFade {
  to { opacity: 1; }
}

.rescan-log .log-line.success { color: #4caf50; }
.rescan-log .log-line.error { color: var(--red); }
.rescan-log .log-line.info { color: #a78bfa; }

.rescan-result {
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  border-top: 1px solid var(--border);
}

.rescan-result.success {
  color: #4caf50;
}

.rescan-result.error {
  color: var(--red);
}

.rescan-result .result-icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.rescan-result .result-msg {
  font-size: 0.85rem;
  font-weight: 600;
}

.rescan-result .result-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Scanner Tabs ───────────────────────────────────────── */
.scanner-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-primary);
  padding: var(--space-xs) 0;
}

.scanner-tab {
  flex: 1;
  padding: 0.65rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.scanner-tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.scanner-tab.active {
  background: rgba(197, 160, 89, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.15);
}

.scanner-tab .tab-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.scanner-tab.active .tab-count {
  background: rgba(197, 160, 89, 0.25);
}

/* ── Scanner List ───────────────────────────────────────── */
.scanner-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 60vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* scanner-list 捲軸美化 */
.scanner-list::-webkit-scrollbar {
  width: 5px;
}

.scanner-list::-webkit-scrollbar-track {
  background: transparent;
}

.scanner-list::-webkit-scrollbar-thumb {
  background: rgba(197, 160, 89, 0.25);
  border-radius: 4px;
}

.scanner-list::-webkit-scrollbar-thumb:hover {
  background: rgba(197, 160, 89, 0.45);
}

.scanner-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  font-style: italic;
}

/* ── Stock Card ─────────────────────────────────────────── */
.scan-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.75rem var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.scan-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateX(4px);
}

.scan-card .scan-rank {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 24px;
  text-align: center;
}

/* ── Score Wrap 容器（圓環 + 標籤 + Tooltip） ────────────── */
.scan-card .scan-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.scan-card .scan-score-label {
  font-size: 0.52rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
}

/* ── Score Tip 圖示 ─────────────────────────────────────── */
.score-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 0.52rem;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: help;
  transition: color 0.2s ease;
  line-height: 1;
  vertical-align: middle;
}

.score-tip:hover {
  color: var(--accent);
}

/* ── Score Tooltip 浮動說明 ─────────────────────────────── */
.score-tooltip {
  position: absolute;
  z-index: 9999;
  background: rgba(20, 20, 28, 0.96);
  border: 1px solid rgba(197, 160, 89, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.5;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  max-width: 260px;
}

.scan-card .scan-score {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 2px solid;
}

.scan-card .scan-score.tier-A {
  color: var(--up);
  border-color: var(--up);
  background: var(--up-bg);
}

.scan-card .scan-score.tier-B {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(197, 160, 89, 0.1);
}

.scan-card .scan-score.tier-C {
  color: var(--signal-info);
  border-color: var(--signal-info);
  background: rgba(99, 102, 241, 0.1);
}

.scan-card .scan-info {
  flex: 1;
  min-width: 0;
}

.scan-card .scan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.scan-card .scan-code {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-light);
}

.scan-card .scan-name {
  font-size: 0.85rem;
  color: var(--text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-card .scan-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.scan-card .scan-date-tag {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  opacity: 0.75;
}

.scan-card .scan-resonance {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

/* ── 分層揭露 — 右側欄位容器 ──────────────────────────── */
.scan-card .scan-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 60px;
}

/* ── 分層揭露 — 趨勢方向（Ultra+） ───────────────────── */
.scan-card .scan-outlook {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ── 分層揭露 — PARM 迷你進度條（Ultra+） ────────────── */
.scan-card .scan-parm-mini {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.scan-card .scan-parm-bar {
  display: flex;
  align-items: center;
  gap: 2px;
}
.scan-card .scan-parm-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 8px;
}
.scan-card .scan-parm-track {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.scan-card .scan-parm-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.scan-card .scan-parm-val {
  font-size: 0.56rem;
  font-family: var(--font-mono);
  min-width: 22px;
  text-align: right;
}

/* ── 分層揭露 — 共振分數（Elite+） ───────────────────── */
.scan-card .scan-composite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.scan-card .scan-composite-val {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--accent-light);
}
.scan-card .scan-composite-label {
  font-size: 0.52rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ── 分層揭露 — 鎖定標籤 ────────────────────────────── */
.scan-card .scan-locked {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: default;
  white-space: nowrap;
  opacity: 0.7;
}
.scan-card .scan-locked.ultra {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.15), rgba(197, 160, 89, 0.08));
  color: var(--accent);
  border: 1px solid rgba(197, 160, 89, 0.3);
}
.scan-card .scan-locked.elite {
  background: linear-gradient(135deg, rgba(194, 49, 82, 0.15), rgba(233, 69, 96, 0.08));
  color: #e94560;
  border: 1px solid rgba(233, 69, 96, 0.3);
}

/* ── 分數蓋牌 — 高分股遮蔽卡片 ──────────────────────── */
.scan-card.scan-masked {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.04), rgba(20, 20, 28, 0.6));
  border-color: rgba(197, 160, 89, 0.2);
  border-left: 3px solid rgba(197, 160, 89, 0.5);
  cursor: pointer;
  position: relative;
  /* 不設 overflow: hidden — 讓 flex 子元素正常撐高 */
}

/* 斜紋底紋（裝飾用） */
.scan-card.scan-masked::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(197, 160, 89, 0.03) 8px,
    rgba(197, 160, 89, 0.03) 16px
  );
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

/* 毛玻璃遮蔽層 — 覆蓋整張卡片 */
.scan-card.scan-masked::after {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(20, 20, 28, 0.35);
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  transform: translateZ(0);
  will-change: backdrop-filter;
}

.scan-card.scan-masked:hover {
  background: linear-gradient(135deg, rgba(197, 160, 89, 0.08), rgba(20, 20, 28, 0.5));
  border-color: rgba(197, 160, 89, 0.4);
  transform: translateX(4px);
}

/* 蓋牌：毛玻璃覆蓋整張卡片，所有內容都被模糊 */

/* 鎖定 overlay — hover 時疊在毛玻璃上 */
.scan-masked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 6;
  background: rgba(20, 20, 28, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
  pointer-events: auto;
}

.scan-card.scan-masked:hover .scan-masked-overlay {
  opacity: 1;
}

.scan-masked-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(197, 160, 89, 0.15);
  color: var(--accent);
  border: 1px solid rgba(197, 160, 89, 0.4);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scan-masked-btn:hover {
  background: rgba(197, 160, 89, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(197, 160, 89, 0.2);
}

.scan-masked-btn .scan-masked-lock {
  font-size: 0.95rem;
}

/* ── 蓋牌分界線 ──────────────────────────────────────── */
.scan-gate-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) 0;
  position: relative;
}

.scan-gate-divider::before,
.scan-gate-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 160, 89, 0.3), transparent);
}

.scan-gate-divider span {
  padding: 4px 16px;
  font-size: 0.72rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--accent);
  background: rgba(197, 160, 89, 0.08);
  border: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ── 新進標記 ──────────────────────────────────────────── */
.scan-card.is-new {
  border-left: 3px solid #4caf50;
  background: rgba(76, 175, 80, 0.04);
}

.scan-new-badge {
  display: inline-block;
  font-size: 0.68rem;
  margin-left: 4px;
  vertical-align: middle;
  animation: newPulse 2s ease-in-out infinite;
}

@keyframes newPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Scanner Loading ────────────────────────────────────── */
.scanner-loading {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.scanner-loading .scan-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-md);
}

.scanner-loading p {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.scanner-loading .scan-progress {
  margin-top: var(--space-md);
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.scan-progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--surface-2, rgba(255, 255, 255, 0.06));
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.scan-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #f0c060, var(--accent));
  background-size: 200% 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out;
  animation: scanBarShimmer 2s ease-in-out infinite;
}

@keyframes scanBarShimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.scan-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.scan-progress-pct {
  color: var(--accent);
  font-weight: 600;
}

.scan-progress-msg {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: var(--space-xs);
  min-height: 1.2em;
  transition: opacity 0.3s ease;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .btn-scan {
    padding: 0.7rem 1rem;
    font-size: 0.82rem;
  }

  .scanner-header h2 {
    font-size: 1.1rem;
  }

  .scanner-tab {
    padding: 0.55rem 0.5rem;
    font-size: 0.78rem;
  }

  .scan-card {
    padding: 0.6rem var(--space-sm);
    gap: var(--space-sm);
  }

  .scan-card .scan-score {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  .scan-card .scan-code {
    font-size: 0.9rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   Ultra Tier Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Ultra Badge (header) ────────────────────────────────── */
.pro-badge.ultra-badge {
  background: linear-gradient(135deg, #6366f1, #a78bfa, #ec4899, #6366f1);
  background-size: 300% 100%;
  box-shadow:
    0 0 16px rgba(99, 102, 241, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: ultraShimmer 3s ease-in-out infinite;
  color: #fff;
}

@keyframes ultraShimmer {
  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

/* Elite Tier Badge */
.pro-badge.elite-badge {
  background: linear-gradient(135deg, #c23152, #e94560, #ff6b81, #e94560);
  background-size: 300% 100%;
  box-shadow:
    0 0 16px rgba(233, 69, 96, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  animation: eliteShimmer 3s ease-in-out infinite;
  color: #fff;
  font-weight: 800;
}

@keyframes eliteShimmer {
  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

/* ── Ultra Section ───────────────────────────────────────── */
.ultra-section {
  margin-bottom: var(--space-lg);
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  position: relative;
  overflow: hidden;
}

.ultra-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #ec4899);
}

/* ── 收合功能 ── */
.ultra-section[data-collapsible] > *:not(.ultra-header) {
  transition:
    opacity 0.2s ease,
    max-height 0.3s ease;
  overflow: hidden;
}

.ultra-section.collapsed > *:not(.ultra-header) {
  display: none;
}

.ultra-section.collapsed {
  padding-bottom: 8px;
}

.ultra-section.collapsed .ultra-header {
  margin-bottom: 0;
}

.collapse-chevron {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: transform 0.25s ease;
  margin-left: 8px;
  user-select: none;
}

.ultra-section.collapsed .collapse-chevron {
  transform: rotate(-90deg);
}

/* ── 🔒 蓄能中狀態 ── */
.section-collecting .collapse-chevron {
  display: none;
}

.section-collecting .ultra-header {
  cursor: default;
}

.section-collecting.collapsed > *:not(.ultra-header) {
  display: block;
}

.section-collecting .ultra-tag::after {
  content: " · 蓄能中";
  font-size: 0.7rem;
  opacity: 0.7;
}

.collecting-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.collecting-icon {
  font-size: 1.6rem;
  opacity: 0.5;
}

.collecting-info {
  flex: 1;
}

.collecting-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 4px;
}

.collecting-detail {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.collecting-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collecting-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.collecting-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  transition: width 0.5s ease;
}

.collecting-pct {
  font-size: 0.72rem;
  color: var(--text-dim);
  width: 32px;
  text-align: right;
}

.collecting-countdown {
  font-size: 0.75rem;
  color: #a78bfa;
  margin-top: 6px;
}

.collecting-countdown strong {
  color: #c4b5fd;
}

/* ── 🔱 Trident 三叉戟 ── */
.trident-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  margin-bottom: 12px;
}

.trident-verdict.trident-buy {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

.trident-verdict.trident-sell {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.trident-verdict-emoji {
  font-size: 2rem;
}

.trident-verdict-info {
  flex: 1;
}

.trident-verdict-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.trident-verdict-action {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.trident-confidence-ring {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.trident-confidence-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.trident-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3;
}

.trident-ring-fg {
  fill: none;
  stroke: #6366f1;
  stroke-width: 3;
  stroke-linecap: round;
}

.trident-buy .trident-ring-fg {
  stroke: #10b981;
}

.trident-sell .trident-ring-fg {
  stroke: #ef4444;
}

.trident-confidence-ring span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Trident Hold Info（hold 狀態顯示收斂 + 天數）── */
.trident-hold-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 68px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.trident-hold-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trident-hold-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 500;
}

.trident-hold-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.trident-arm-grid {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.trident-arm-header {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.trident-arm-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr 1fr;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}

.trident-arm-row:last-child {
  border-bottom: none;
}

.trident-arm-frame {
  color: var(--text-dim);
  font-weight: 500;
}

.trident-arm-cell {
  text-align: center;
}

.guard-pass {
  color: #10b981;
  font-size: 0.78rem;
}

.guard-warn {
  color: #f59e0b;
  font-size: 0.78rem;
}

.guard-block {
  color: #ef4444;
  font-size: 0.78rem;
}

.trident-proximity {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.trident-prox-header {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.trident-prox-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.trident-prox-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trident-prox-side-label {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.trident-prox-side-label.buy-label {
  color: #ef4444;
}

.trident-prox-side-label.sell-label {
  color: #22c55e;
}

.trident-prox-label {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 8px;
}

.trident-prox-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trident-prox-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trident-prox-name {
  width: 14px;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.trident-prox-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.trident-prox-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.trident-prox-fill.buy {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.trident-prox-fill.sell {
  background: linear-gradient(90deg, #22c55e, #6ee7b7);
}

.trident-prox-val {
  width: 36px;
  text-align: right;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.trident-prox-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
  opacity: 0.7;
}

/* ── Resonance 共振判讀 ── */
.trident-resonance {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.resonance-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.resonance-tag.bull {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.resonance-tag.bear {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.resonance-tag.neutral {
  background: rgba(250, 204, 21, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(250, 204, 21, 0.2);
}

.prox-status {
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.75;
  margin-left: 4px;
}

.trident-followthru {
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.trident-followthru.ft-good {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.15);
}

.trident-followthru.ft-bad {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.15);
}

.trident-followthru.ft-neutral {
  background: rgba(99, 102, 241, 0.04);
}

.trident-ft-header {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.trident-ft-verdict {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
}

.trident-ft-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.trident-ft-reason {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.ultra-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.ultra-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  color: #a78bfa;
  font-size: 0.95rem;
}

.ultra-tag {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.15em 0.6em;
  border-radius: 4px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: #fff;
}

.elite-tag {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.15em 0.6em;
  border-radius: 4px;
  background: linear-gradient(135deg, #c23152, #e94560);
  color: #fff;
  box-shadow: 0 0 8px rgba(233, 69, 96, 0.3);
}

/* ── NEW Badge ─────────────────────────────────────────── */
.new-badge {
  display: inline-block;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.12em 0.5em;
  border-radius: 3px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  animation: newBadgePulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

@keyframes newBadgePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 12px rgba(245, 158, 11, 0.6); }
}

/* ── Trial Banner ──────────────────────────────────────── */
.trial-banner {
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.trial-banner.trial-active {
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(234,88,12,0.08));
  border: 1px solid rgba(245,158,11,0.35);
  color: #fbbf24;
}

.trial-banner.trial-exhausted {
  background: rgba(100,100,120,0.1);
  border: 1px solid rgba(100,100,120,0.25);
  color: #94a3b8;
}

.trial-banner .trial-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 180px;
}

.trial-banner .trial-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(245,158,11,0.18);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #f59e0b;
}

.trial-banner .trial-upgrade-btn {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.trial-banner .trial-upgrade-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 12px rgba(245,158,11,0.4);
}
.trial-banner .trial-upgrade-btn.trial-upgrade-subtle {
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.72rem;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 4px 12px;
}
.trial-banner .trial-upgrade-btn.trial-upgrade-subtle:hover {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-color: transparent;
}

/* ── trial-available: 有試用可用的引導 Banner ── */
.trial-banner.trial-available {
  background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(16,185,129,0.06));
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
}
.trial-banner.trial-available .trial-count {
  background: rgba(34,197,94,0.18);
  color: #22c55e;
}
.trial-banner .trial-try-btn {
  background: linear-gradient(135deg, #22c55e, #10b981);
  animation: trialPulse 2s ease-in-out infinite;
}
@keyframes trialPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50% { box-shadow: 0 0 12px 4px rgba(34,197,94,0.25); }
}

/* ── Post-Trial 升級推播氣泡 ── */
/* ── 除權息調整告警 ── */
.dividend-adjust-banner {
  background: rgba(255, 152, 0, 0.15);
  border: 1px solid rgba(255, 152, 0, 0.4);
  border-radius: 8px;
  color: #ffb74d;
  font-size: 12px;
  padding: 6px 12px;
  margin: 8px 0;
  text-align: center;
  line-height: 1.5;
}

.post-trial-nudge {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
  opacity: 0;
}
.post-trial-nudge.nudge-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.nudge-content {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(30,30,45,0.95), rgba(20,20,35,0.98));
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fbbf24;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
}
.nudge-content button {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s;
}
.nudge-content button:hover {
  transform: scale(1.05);
}

/* ── Strategy Simulation ────────────────────────────────── */
.strategy-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

/* Timeframe toggle row */
.strat-tf-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.strat-tf-btn {
  flex: 1;
  padding: 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: #777;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.strat-tf-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #bbb;
}

.strat-tf-btn.active {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.12),
    rgba(167, 139, 250, 0.1)
  );
  border-color: rgba(99, 102, 241, 0.35);
  color: #a78bfa;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.08);
}

.strat-tf-sub {
  font-size: 0.6rem;
  font-weight: 400;
  opacity: 0.65;
}

.strat-tab {
  flex: 1;
  padding: 7px 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #888;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.strat-tab.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c4b5fd;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
}

/* 布倉策略 active = 綠色調（台股紅漲綠跌，綠=進場=安全） */
.strat-tab.active[data-tab="entry"] {
  background: rgba(39, 174, 96, 0.15);
  border-color: rgba(39, 174, 96, 0.5);
  color: #6ee7a0;
  box-shadow: 0 0 10px rgba(39, 174, 96, 0.2);
}

/* 出場策略 active = 紅色調（出場=警覺） */
.strat-tab.active[data-tab="exit"] {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.5);
  color: #f87171;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.2);
}

.strat-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.strat-type-emoji {
  font-size: 1.1rem;
}

.strat-type-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #ddd;
}

.strat-desc {
  font-size: 0.75rem;
  color: #888;
  line-height: 1.5;
  margin-bottom: 12px;
}

.strat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.strat-row:last-of-type {
  border-bottom: none;
}

.strat-label {
  font-size: 0.75rem;
  color: #888;
  font-weight: 500;
}

.strat-value {
  font-size: 0.8rem;
  color: #ddd;
  font-weight: 700;
  font-family: var(--font-heading);
}

.strat-zone-val {
  color: #a78bfa;
}

.strat-target {
  color: #27ae60;
}

.strat-stop {
  color: #e74c3c;
}

.strat-confidence-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin-top: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}

.strat-confidence-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.strat-triggers-title {
  font-size: 0.72rem;
  color: #888;
  font-weight: 600;
  margin: 12px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.strat-triggers {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strat-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.03);
}

.strat-trigger-critical {
  background: rgba(231, 76, 60, 0.08);
  color: #e74c3c;
}

.strat-trigger-warning {
  background: rgba(243, 156, 18, 0.08);
  color: #f39c12;
}

.strat-trigger-info {
  background: rgba(52, 152, 219, 0.08);
  color: #6aa3d6;
}

.strategy-disclaimer {
  font-size: 0.65rem;
  color: #555;
  text-align: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ── Strategy: Personalization ──────────────────────────── */
.strat-personal {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(99, 102, 241, 0.2);
}

.strat-personal-title {
  font-size: 0.78rem;
  color: #a78bfa;
  font-weight: 700;
  margin-bottom: 10px;
}

.strat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.strat-input-label {
  font-size: 0.72rem;
  color: #888;
  min-width: 60px;
  white-space: nowrap;
}

.strat-input-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0 8px;
  transition: border-color 0.2s;
}

.strat-input-wrap:focus-within {
  border-color: rgba(99, 102, 241, 0.4);
}

.strat-input-prefix,
.strat-input-suffix {
  font-size: 0.68rem;
  color: #666;
  white-space: nowrap;
}

.strat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ddd;
  font-size: 0.78rem;
  font-family: var(--font-heading);
  padding: 6px 4px;
  min-width: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

.strat-input::-webkit-outer-spin-button,
.strat-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.strat-input::placeholder {
  color: #555;
}

.strat-calc-result {
  margin-top: 8px;
}

.strat-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.72rem;
  color: #888;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.strat-calc-row:last-child {
  border-bottom: none;
}

.strat-calc-val {
  font-weight: 700;
  font-family: var(--font-heading);
  color: #ddd;
}

.strat-calc-highlight {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 8px 10px !important;
  margin-bottom: 4px;
  border-left: 3px solid;
}

.strat-calc-warn {
  color: #f39c12;
  font-size: 0.72rem;
  padding: 6px 0;
}

/* ── Pattern Card ────────────────────────────────────────── */
.pattern-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
}

.pattern-emoji {
  font-size: 2rem;
  flex-shrink: 0;
}

.pattern-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.pattern-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Volume Grid ─────────────────────────────────────────── */
.vol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.vol-stat {
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
}

.vol-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.vol-stat-value {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.vol-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vol-signal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
}

.vol-signal.strong {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--up);
}

.vol-signal.warning {
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--signal-warning);
}

.vol-signal.info {
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--signal-info);
}

.vol-signal.caution {
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--signal-warning);
}

/* ── PARM History Canvas ─────────────────────────────────── */
#parmHistoryCanvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

/* ── Ultra Locked Teaser ─────────────────────────────────── */
/* ── Blur Locked Panel ──────────────────────────────────── */
.blur-locked-panel {
  margin-bottom: var(--space-lg);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.ultra-locked.blur-locked-panel {
  background: rgba(99, 102, 241, 0.03);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.elite-locked.blur-locked-panel {
  background: rgba(233, 69, 96, 0.03);
  border: 1px solid rgba(233, 69, 96, 0.15);
}

/* Blurred fake content */
.blur-preview-content {
  padding: 20px 18px;
  filter: blur(6px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
  transform: translateZ(0);
  will-change: filter;
}

.blur-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.blur-preview-label {
  font-size: 0.78rem;
  color: #888;
}

.blur-preview-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: #bbb;
}

.blur-preview-value.up {
  color: #e74c3c;
}

.blur-preview-value.down {
  color: #27ae60;
}

.blur-preview-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
}

.blur-preview-badge.entry {
  background: rgba(39, 174, 96, 0.15);
  color: #27ae60;
}

.blur-preview-badge.elite-badge {
  background: rgba(233, 69, 96, 0.15);
  color: #ff6b81;
}

.blur-preview-badge.signal {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.blur-preview-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  margin: 8px 0;
  overflow: hidden;
}

.blur-preview-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
}

.blur-preview-bar-fill.elite-fill {
  background: linear-gradient(90deg, #c23152, #e94560);
}

/* Glassmorphic overlay */
.blur-locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 12, 20, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2;
  text-align: center;
  padding: var(--space-lg);
  transform: translateZ(0);
  will-change: backdrop-filter;
}

/* ── Tier 贊助到期鎖定 Overlay ───────────────────────────── */
.tier-expired-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 16, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 50;
  border-radius: var(--radius);
  animation: fadeIn 0.5s ease;
  transform: translateZ(0);
  will-change: backdrop-filter;
}

.tier-expired-content {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  max-width: 360px;
}

.tier-expired-icon {
  font-size: 2.8rem;
  margin-bottom: var(--space-md);
  animation: iconFloat 3s ease-in-out infinite;
}

.tier-expired-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.tier-expired-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.tier-expired-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent), #d4a843);
  border: none;
  border-radius: var(--radius);
  color: #1a1a2e;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(197, 160, 89, 0.3);
}

.tier-expired-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(197, 160, 89, 0.45);
}

.tier-expired-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: var(--space-md);
  opacity: 0.7;
}

.blur-locked-icon {
  font-size: 2.2rem;
  margin-bottom: var(--space-sm);
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.ultra-locked-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  opacity: 0.7;
}

.ultra-locked-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: var(--space-xs);
}

.ultra-locked-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.ultra-locked-cta {
  margin-top: 14px;
  padding: 8px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.ultra-locked-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
}

.locked-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.locked-cta-group .ultra-locked-cta,
.locked-cta-group .elite-locked-cta {
  margin-top: 0;
}

.trial-cta-btn {
  padding: 10px 24px;
  border-radius: 12px;
  border: 2px solid rgba(255, 193, 7, 0.4);
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.15));
  color: #ffd54f;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  animation: trial-pulse 2s ease-in-out infinite;
  letter-spacing: 0.04em;
}
.trial-cta-btn:hover {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.3), rgba(255, 152, 0, 0.3));
  border-color: rgba(255, 193, 7, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3);
}
@keyframes trial-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(255, 193, 7, 0); }
}

.trial-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid rgba(255, 193, 7, 0.4);
  color: #ffd54f;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
  text-align: center;
}
.trial-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.input-highlight {
  animation: input-glow 0.6s ease 3;
}
@keyframes input-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.5); }
}

/* ── Elite Locked Prompt ──────────────────────────────────── */
.elite-locked {
  margin-bottom: var(--space-lg);
  background: rgba(233, 69, 96, 0.03);
  border: 1px dashed rgba(233, 69, 96, 0.25);
  border-radius: var(--radius);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.elite-locked::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(233, 69, 96, 0.02),
    rgba(194, 49, 82, 0.04),
    rgba(233, 69, 96, 0.02)
  );
  pointer-events: none;
}

.elite-locked .ultra-locked-title {
  color: #ff6b81;
}

.elite-locked-cta {
  margin-top: 14px;
  padding: 8px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #c23152, #e94560);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 2px 12px rgba(233, 69, 96, 0.3);
}

.elite-locked-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.5);
}

/* ── Upgrade Modal ──────────────────────────────────────── */
.upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.upgrade-modal-content {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: linear-gradient(
    165deg,
    #1c1520 0%,
    #1a1125 30%,
    #18101e 60%,
    #1a0f14 100%
  );
  border: 1px solid rgba(245, 158, 11, 0.12);
  border-radius: 24px;
  padding: 32px 24px 28px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(245, 158, 11, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: upgradeSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes upgradeSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Glow orbs */
.upgrade-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.upgrade-glow-1 {
  width: 180px;
  height: 180px;
  top: -40px;
  right: -40px;
  background: radial-gradient(
    circle,
    rgba(245, 158, 11, 0.12),
    transparent 70%
  );
  animation: orbFloat1 6s ease-in-out infinite;
}

.upgrade-glow-2 {
  width: 140px;
  height: 140px;
  bottom: 30px;
  left: -30px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.1), transparent 70%);
  animation: orbFloat2 8s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(-15px, 15px);
  }
}

@keyframes orbFloat2 {
  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(12px, -12px);
  }
}

.upgrade-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: #555;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s;
  z-index: 2;
}

.upgrade-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Header */
.upgrade-header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.upgrade-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
}

.upgrade-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: conic-gradient(from 0deg, #f59e0b, #ef4444, #f59e0b) border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: ringRotate 4s linear infinite;
}

@keyframes ringRotate {
  to {
    transform: rotate(360deg);
  }
}

.upgrade-icon {
  font-size: 1.8rem;
  position: relative;
  z-index: 1;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.upgrade-title {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #f59e0b);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 6px;
  animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {
  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

.upgrade-subtitle {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
  letter-spacing: 0.02em;
}

/* Pricing Cards */
.upgrade-pricing {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.pricing-card {
  flex: 1;
  position: relative;
  padding: 18px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.pricing-card.active {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
  box-shadow: 0 4px 24px rgba(245, 158, 11, 0.12);
}

.pricing-card.best-value .pricing-badge {
  display: block;
}

.pricing-card.elite-plan {
  border-color: rgba(233, 69, 96, 0.3);
  background: rgba(233, 69, 96, 0.05);
}

.pricing-card.elite-plan.active {
  border-color: rgba(233, 69, 96, 0.5);
  background: rgba(233, 69, 96, 0.08);
  box-shadow: 0 4px 24px rgba(233, 69, 96, 0.15);
}

.pricing-badge {
  display: none;
  position: absolute;
  top: -9px;
  right: 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.pricing-card.elite-plan .pricing-badge,
.pricing-card.best-value .pricing-badge {
  display: block;
}

.elite-pricing-badge {
  background: linear-gradient(135deg, #c23152, #e94560) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(233, 69, 96, 0.4) !important;
}

.pricing-label {
  font-size: 0.7rem;
  color: #888;
  font-weight: 600;
  margin-bottom: 6px;
}

.pricing-amount {
  font-size: 0.85rem;
  color: #aaa;
  font-weight: 600;
}

.pricing-number {
  font-size: 1.7rem;
  font-weight: 800;
  color: #e8e0d8;
}

.pricing-card.active .pricing-number {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pricing-period {
  font-size: 0.66rem;
  color: #666;
  margin-top: 3px;
}

/* Divider */
.upgrade-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.upgrade-divider::before,
.upgrade-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(245, 158, 11, 0.15),
    transparent
  );
}

.upgrade-divider-text {
  font-size: 0.68rem;
  font-weight: 600;
  color: #777;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Feature Table */
.upgrade-features {
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.feature-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  transition: background 0.15s;
}

.feature-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.feature-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.feature-row.header-row {
  font-weight: 700;
  color: #888;
  border-bottom: none;
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.feature-row.ultra-only {
  background: rgba(245, 158, 11, 0.03);
}

.feature-row.ultra-only:hover {
  background: rgba(245, 158, 11, 0.06);
}

.feature-row.elite-only {
  background: rgba(233, 69, 96, 0.04);
}

.feature-row.elite-only:hover {
  background: rgba(233, 69, 96, 0.08);
}

.feature-elite {
  color: #ff6b81;
}

.feature-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 10px 4px;
  opacity: 0.7;
}

.feature-name {
  flex: 1;
  color: #bbb;
}

.feature-pro,
.feature-ultra,
.feature-elite {
  width: 60px;
  text-align: center;
  font-size: 0.8rem;
}

.feature-pro {
  color: #666;
}

.feature-ultra {
  color: #f59e0b;
}

/* Tier Badge Labels in header */
.tier-label-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tier-label-badge.pro-label {
  background: linear-gradient(135deg, #c5a059, #e8c97a);
  color: #0a0a0a;
}

.tier-label-badge.ultra-label {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
}

.tier-label-badge.elite-label {
  background: linear-gradient(135deg, #c23152, #e94560);
  color: #fff;
}

/* CTA Area */
.upgrade-cta-area {
  text-align: center;
  position: relative;
  z-index: 1;
}

.upgrade-cta-btn {
  position: relative;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.3);
}

.upgrade-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}

.upgrade-cta-btn:active {
  transform: translateY(0);
}

.cta-text {
  position: relative;
  z-index: 1;
}

.cta-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: ctaShine 3s ease-in-out infinite;
}

@keyframes ctaShine {
  0% {
    left: -100%;
  }

  50% {
    left: 150%;
  }

  100% {
    left: 150%;
  }
}

.upgrade-note {
  font-size: 0.66rem;
  color: #666;
  margin: 12px 0 0;
  line-height: 1.6;
}

/* Social Proof */
.upgrade-social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.1);
  position: relative;
  z-index: 1;
}

.social-proof-icon {
  font-size: 1rem;
}

.social-proof-text {
  font-size: 0.72rem;
  color: #c9a44a;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Admin Tier Tags ─────────────────────────────────────── */
.admin-tier-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.admin-tier-tag.pro {
  background: rgba(197, 160, 89, 0.12);
  color: var(--accent);
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.admin-tier-tag.ultra {
  background: rgba(99, 102, 241, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-upgrade {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.1);
  color: #a78bfa;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-upgrade:hover {
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.btn-downgrade {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid rgba(197, 160, 89, 0.4);
  border-radius: 6px;
  background: rgba(197, 160, 89, 0.1);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-downgrade:hover {
  background: rgba(197, 160, 89, 0.2);
}

/* ── Ultra Responsive ────────────────────────────────────── */
@media (max-width: 480px) {
  .vol-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pattern-card {
    gap: var(--space-sm);
  }

  .pattern-emoji {
    font-size: 1.5rem;
  }

  .pattern-name {
    font-size: 0.95rem;
  }

  .ultra-section {
    padding: var(--space-sm) var(--space-md);
  }
}

/* ── 淨力道指標 ──────────────────────────────────────────── */
.net-strength-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.8rem;
}

.net-strength-label {
  color: var(--text-muted);
}

.net-strength-value {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.net-strength-value.bullish {
  color: var(--up);
  background: rgba(39, 174, 96, 0.1);
}

.net-strength-value.bearish {
  color: var(--down);
  background: rgba(231, 76, 60, 0.1);
}

.net-strength-value.neutral {
  color: var(--accent);
  background: rgba(201, 164, 74, 0.1);
}

/* ── 法律免責聲明 ────────────────────────────────────────── */
.legal-footer {
  max-width: 600px;
  margin: var(--space-xl) auto var(--space-md);
  padding: 0 var(--space-md);
}

.legal-disclaimer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: var(--space-md);
  text-align: center;
}

.legal-disclaimer p {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.6;
  margin: 0 0 var(--space-xs);
  opacity: 0.7;
}

.legal-disclaimer strong {
  color: #f39c12;
  opacity: 1;
}

.legal-sub {
  font-size: 0.65rem !important;
  opacity: 0.5 !important;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════
   Help Tooltip — Bottom Sheet
   ═══════════════════════════════════════════════════════════ */

/* ── Help Icon (ⓘ) ──────────────────────────────────────── */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(197, 160, 89, 0.15);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 700;
  font-style: normal;
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}

.help-icon:hover {
  background: rgba(197, 160, 89, 0.3);
  transform: scale(1.15);
}

.help-icon:active {
  transform: scale(0.95);
}

/* ── Help Overlay ────────────────────────────────────────── */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.help-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Help Bottom Sheet ───────────────────────────────────── */
.help-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20001;
  max-height: 70vh;
  overflow-y: auto;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.5rem 2rem;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.help-sheet.open {
  transform: translateY(0);
}

.help-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 1rem;
}

.help-sheet-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
}

.help-sheet-title .help-emoji {
  font-size: 1.3rem;
}

.help-sheet-body {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
}

.help-sheet-body p {
  margin-bottom: 0.7rem;
}

.help-sheet-body strong {
  color: var(--accent);
  font-weight: 600;
}

/* ── Help Body Tags ──────────────────────────────────────── */
.help-sheet-body .help-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0.15rem;
}

.help-tag.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--up);
}

.help-tag.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--down);
}

.help-tag.yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.help-tag.gold {
  background: rgba(197, 160, 89, 0.15);
  color: var(--accent);
}

/* ── Help Scale Bar ──────────────────────────────────────── */
.help-scale {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.8rem 0;
}

.help-scale-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--down), #f59e0b, var(--up));
}

/* ── Help Sheet Responsive ───────────────────────────────── */
@media (min-width: 601px) {
  .help-sheet {
    max-width: 480px;
    left: 50%;
    transform: translate(-50%, 100%);
    border-radius: 20px 20px 0 0;
  }

  .help-sheet.open {
    transform: translate(-50%, 0);
  }
}

/* ═══════════════════════════════════════════════════════════
   Donation Banner & Query Prompt
   ═══════════════════════════════════════════════════════════ */

/* ── Donation Footer Banner ──────────────────────────────── */
.donate-banner {
  max-width: 480px;
  margin: var(--space-xl) auto var(--space-md);
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.donate-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(197, 160, 89, 0.03),
    rgba(197, 160, 89, 0.08),
    rgba(197, 160, 89, 0.03)
  );
  pointer-events: none;
}

.donate-emoji {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.donate-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.donate-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.donate-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-donate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.btn-donate.primary {
  background: linear-gradient(
    135deg,
    rgba(197, 160, 89, 0.2),
    rgba(197, 160, 89, 0.35)
  );
  color: var(--accent);
  border: 1px solid rgba(197, 160, 89, 0.4);
}

.btn-donate.primary:hover {
  background: linear-gradient(
    135deg,
    rgba(197, 160, 89, 0.3),
    rgba(197, 160, 89, 0.5)
  );
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(197, 160, 89, 0.2);
}

.btn-donate.secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-donate.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Donate Modal ─────────────────────────────────────── */
.donate-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  padding: 16px;
}

.donate-modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: rgba(35, 35, 38, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(201, 164, 74, 0.2);
  padding: 28px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.donate-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.donate-modal-close:hover {
  color: #e8e0d0;
}

.donate-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #c9a44a;
  margin-bottom: 16px;
  text-align: center;
}

.donate-bank-info {
  background: rgba(201, 164, 74, 0.06);
  border: 1px solid rgba(201, 164, 74, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.donate-bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.85rem;
}

.donate-bank-row span {
  color: #888;
}

.donate-bank-row strong {
  color: #e8e0d0;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.donate-form-divider {
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 14px;
  position: relative;
}

.donate-form-divider::before,
.donate-form-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 20%;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.donate-form-divider::before {
  left: 0;
}

.donate-form-divider::after {
  right: 0;
}

.donate-field {
  margin-bottom: 12px;
}

.donate-field label {
  display: block;
  font-size: 0.75rem;
  color: #999;
  margin-bottom: 4px;
}

.donate-field input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #e8e0d0;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.donate-field input:focus {
  border-color: rgba(201, 164, 74, 0.4);
}

.donate-field input::placeholder {
  color: #555;
}

.donate-submit-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #c9a44a, #b8933f);
  color: #1a1a1d;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.donate-submit-btn:hover {
  box-shadow: 0 0 12px rgba(201, 164, 74, 0.3);
}

.donate-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.donate-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: #666;
  margin-top: 14px;
}

/* ── Gentle Query Prompt ─────────────────────────────────── */
.query-prompt {
  margin: var(--space-md) 0;
  padding: var(--space-md) var(--space-lg);
  background: rgba(197, 160, 89, 0.06);
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  animation: promptSlide 0.4s ease;
  position: relative;
}

@keyframes promptSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.query-prompt-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
}

.query-prompt-text strong {
  color: var(--accent);
}

.query-prompt .btn-donate {
  flex-shrink: 0;
}

.btn-prompt-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
}

.btn-prompt-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Milestone Toast ──────────────────────────────────────── */
.milestone-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 30000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.milestone-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.milestone-toast-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(20, 16, 28, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(245, 158, 11, 0.08);
  min-width: 280px;
  max-width: 420px;
}

.milestone-emoji {
  font-size: 2rem;
  flex-shrink: 0;
  animation: milestoneEmojiBounce 0.6s ease-out;
}

@keyframes milestoneEmojiBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.milestone-text {
  flex: 1;
  font-size: 0.78rem;
  color: #ccc;
  line-height: 1.5;
}

.milestone-text strong {
  color: #f59e0b;
  font-size: 0.85rem;
}

.milestone-close {
  background: none;
  border: none;
  color: #666;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.milestone-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Recent Analyses Tags ─────────────────────────────────── */
.recent-analyses {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: var(--space-md) 0;
  padding: 0;
}

.recent-label {
  font-size: 0.72rem;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

.recent-tags {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.recent-tags::-webkit-scrollbar {
  display: none;
}

.recent-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #bbb;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.recent-tag:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.recent-tag.hot {
  border-color: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.recent-tag.warm {
  border-color: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.recent-tag.cool {
  border-color: rgba(39, 174, 96, 0.2);
  color: #27ae60;
}

.recent-score {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  opacity: 0.7;
}
.supporter-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(197, 160, 89, 0.12);
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-left: 6px;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════
   ⚡ ACTION SIGNAL
   ═══════════════════════════════════════════════════════ */
.action-signal-card {
  background: rgba(45, 45, 48, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  border-left: 5px solid var(--accent);
  position: relative;
}

.action-signal-card.bullish {
  border-left-color: #e74c3c;
}

.action-signal-card.bearish {
  border-left-color: #27ae60;
}

.action-signal-card.neutral {
  border-left-color: #f39c12;
}

.action-signal-card.breakout {
  border-left-color: #c9a44a;
  background: rgba(201, 164, 74, 0.08);
}

.action-signal-card.risk {
  border-left-color: #e74c3c;
  background: rgba(231, 76, 60, 0.06);
}

.action-signal-level {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.action-signal-emoji {
  font-size: 1.6rem;
}

.action-signal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e8e0d0;
}

.action-signal-card.bullish .action-signal-title {
  color: #e74c3c;
}

.action-signal-card.bearish .action-signal-title {
  color: #27ae60;
}

.action-signal-card.neutral .action-signal-title {
  color: #f39c12;
}

.action-signal-card.breakout .action-signal-title {
  color: #c9a44a;
}

.action-signal-factors {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding-left: 4px;
}

.action-signal-factor {
  font-size: 0.82rem;
  color: #b8b0a0;
  line-height: 1.4;
}

.action-signal-factor::before {
  content: "• ";
  color: #605848;
}

.action-confidence {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.action-confidence-label {
  font-size: 0.78rem;
  color: #9a9a9a;
  min-width: 72px;
}

.action-confidence-bar {
  flex: 1;
  height: 6px;
  background: rgba(80, 80, 82, 0.5);
  border-radius: 3px;
  overflow: hidden;
}

.action-confidence-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.action-confidence-fill.high {
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.action-confidence-fill.mid {
  background: linear-gradient(90deg, #f39c12, #e67e22);
}

.action-confidence-fill.low {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.action-confidence-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e8e0d0;
  min-width: 36px;
  text-align: right;
}

.action-signal-disclaimer {
  font-size: 0.7rem;
  color: #666;
  margin-top: 6px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   ⏱ HOLDING ESTIMATE — 預估觀察天數
   ═══════════════════════════════════════════════════════ */
.holding-estimate-card {
  background: linear-gradient(145deg, rgba(45, 35, 28, 0.95), rgba(30, 25, 20, 0.98));
  border: 1px solid rgba(201, 164, 74, 0.2);
  border-radius: 12px;
  padding: 18px;
}

.holding-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.holding-period-display {
  display: flex;
  align-items: center;
  gap: 12px;
}

.holding-period-emoji {
  font-size: 2rem;
}

.holding-period-type {
  font-size: 0.82rem;
  color: #c9a44a;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.holding-period-range {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.holding-days-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: #e8e0d0;
  font-family: 'Georgia', serif;
}

.holding-days-sep {
  font-size: 1rem;
  color: #8a7e6e;
  margin: 0 2px;
}

.holding-days-unit {
  font-size: 0.85rem;
  color: #968a78;
  margin-left: 2px;
}

/* Confidence Ring */
.holding-confidence-ring {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.holding-confidence-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.holding-ring-bg {
  fill: none;
  stroke: rgba(80, 72, 58, 0.4);
  stroke-width: 3;
}

.holding-ring-fg {
  fill: none;
  stroke: var(--conf-color, #c9a44a);
  stroke-width: 3;
  stroke-linecap: round;
  animation: holdingRingDraw 1s ease-out forwards;
}

@keyframes holdingRingDraw {
  from { stroke-dasharray: 0, 100; }
}

.holding-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.holding-ring-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e8e0d0;
}

.holding-ring-label {
  font-size: 0.6rem;
  color: #968a78;
}

/* Day Range Bar */
.holding-bar-section {
  margin-bottom: 14px;
}

.holding-bar-track {
  position: relative;
  height: 8px;
  background: rgba(80, 72, 58, 0.3);
  border-radius: 4px;
  margin-bottom: 6px;
}

.holding-bar-fill {
  position: absolute;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #c9a44a, #e8c84a, #c9a44a);
  opacity: 0.8;
  animation: holdingBarGrow 0.8s ease-out forwards;
}

@keyframes holdingBarGrow {
  from { width: 0 !important; }
}

.holding-bar-avg {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: #e8e0d0;
  border-radius: 1px;
  z-index: 1;
}

.holding-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #8a7e6e;
}

.holding-bar-avg-label {
  color: #c9a44a;
  font-weight: 600;
}

/* Metrics Grid */
.holding-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.holding-metric {
  background: rgba(50, 42, 35, 0.6);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}

.holding-metric-label {
  display: block;
  font-size: 0.65rem;
  color: #8a7e6e;
  margin-bottom: 4px;
}

.holding-metric-value {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #d4c8aa;
}

.holding-method {
  font-size: 0.7rem;
  color: #7a6e5e;
  text-align: center;
  margin-bottom: 4px;
}

.holding-disclaimer {
  font-size: 0.65rem;
  color: #666;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   🏆 BACKTEST
   ═══════════════════════════════════════════════════════ */
.backtest-card {
  background: rgba(45, 45, 48, 0.7);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
}

.backtest-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #c9a44a;
  margin-bottom: 10px;
}

.backtest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.backtest-stat {
  text-align: center;
  padding: 10px;
  background: rgba(60, 60, 62, 0.5);
  border-radius: 10px;
}

.backtest-stat-label {
  font-size: 0.7rem;
  color: #9a9a9a;
  margin-bottom: 4px;
}

.backtest-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.backtest-stat-value.positive {
  color: #e74c3c;
}

.backtest-stat-value.negative {
  color: #27ae60;
}

.backtest-stat-value.neutral {
  color: #f39c12;
}

.backtest-disclaimer {
  font-size: 0.65rem;
  color: #555;
  margin-top: 8px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   📋 WATCHLIST
   ═══════════════════════════════════════════════════════ */
.watchlist-section {
  margin-top: 16px;
}

.watchlist-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  background: rgba(45, 45, 48, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(201, 164, 74, 0.15);
  color: #e8e0d0;
  font-size: 0.9rem;
  font-weight: 600;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
}

.watchlist-toggle:hover {
  background: rgba(201, 164, 74, 0.1);
}

.watchlist-toggle .wl-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: #9a9a9a;
}

.watchlist-panel {
  display: none;
  margin-top: 8px;
  background: rgba(35, 35, 38, 0.8);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(201, 164, 74, 0.1);
}

.watchlist-panel.open {
  display: block;
}

.watchlist-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  min-height: 20px;
}

.watchlist-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: rgba(201, 164, 74, 0.1);
  border: 1px solid rgba(201, 164, 74, 0.2);
  border-radius: 20px;
  font-size: 0.78rem;
  color: #e8e0d0;
  cursor: pointer;
  transition: all 0.15s;
}

.watchlist-chip:hover {
  background: rgba(201, 164, 74, 0.2);
}

.watchlist-chip .wl-remove {
  font-size: 0.65rem;
  color: #999;
  margin-left: 2px;
  cursor: pointer;
}

.watchlist-chip .wl-remove:hover {
  color: #e74c3c;
}

.watchlist-empty {
  font-size: 0.78rem;
  color: #666;
  text-align: center;
  padding: 8px;
}

.watchlist-actions {
  display: flex;
  gap: 8px;
}

.btn-watchlist-add {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  border: 1px dashed rgba(201, 164, 74, 0.3);
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-watchlist-add:hover {
  background: rgba(201, 164, 74, 0.08);
}

.btn-watchlist-report {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #c9a44a, #b8933f);
  color: #1a1a1d;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-watchlist-report:hover {
  transform: scale(1.02);
}

.wl-report-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 900;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
  overflow-y: auto;
}

.wl-report-overlay.open {
  display: flex;
}

.wl-report {
  background: rgba(35, 35, 38, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 20px;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid rgba(201, 164, 74, 0.15);
}

.wl-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.wl-report-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c9a44a;
}

.wl-report-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
}

.wl-report-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(60, 60, 62, 0.4);
  border-radius: 10px;
  margin-bottom: 6px;
}

.wl-report-score {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.wl-report-score.bullish {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.wl-report-score.bearish {
  background: rgba(39, 174, 96, 0.15);
  color: #27ae60;
}

.wl-report-score.neutral {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.wl-report-info {
  flex: 1;
}

.wl-report-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e8e0d0;
}

.wl-report-meta {
  font-size: 0.72rem;
  color: #9a9a9a;
}

.wl-report-loading {
  text-align: center;
  padding: 30px;
  color: #9a9a9a;
  font-size: 0.85rem;
}

.btn-star {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.2s;
  filter: grayscale(1) opacity(0.5);
}

.btn-star:hover {
  transform: scale(1.2);
  filter: grayscale(0.5) opacity(0.7);
}

.btn-star.active,
.btn-star.active:hover {
  filter: none;
}

.btn-star:active {
  transform: scale(0.8);
}

/* ═══════════════════════════════════════════════════════
   🔔 ALERT PANEL
   ═══════════════════════════════════════════════════════ */
.alert-bell {
  position: relative;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  filter: opacity(0.7);
  transition: all 0.2s;
}

.alert-bell:hover {
  filter: opacity(1);
  transform: scale(1.1);
}

.alert-bell-badge {
  position: absolute;
  top: 0;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.alert-bell-badge:empty {
  display: none;
}

.alert-panel {
  position: fixed;
  top: 0;
  right: -320px;
  width: 310px;
  height: 100vh;
  background: rgba(30, 30, 32, 0.96);
  backdrop-filter: blur(16px);
  border-left: 1px solid rgba(201, 164, 74, 0.12);
  z-index: 950;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.alert-panel.open {
  right: 0;
}

.alert-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(201, 164, 74, 0.1);
}

.alert-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c9a44a;
}

.alert-panel-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
}

.alert-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.alert-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: rgba(60, 60, 62, 0.3);
  border-radius: 10px;
  margin-bottom: 6px;
  border-left: 3px solid transparent;
}

.alert-item.bullish {
  border-left-color: #e74c3c;
}

.alert-item.bearish {
  border-left-color: #27ae60;
}

.alert-item.warning {
  border-left-color: #f39c12;
}

.alert-item.info {
  border-left-color: #3498db;
}

.alert-item-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.alert-item-content {
  flex: 1;
}

.alert-item-text {
  font-size: 0.8rem;
  color: #e8e0d0;
  line-height: 1.3;
}

.alert-item-time {
  font-size: 0.65rem;
  color: #666;
  margin-top: 3px;
}

.alert-empty {
  text-align: center;
  color: #555;
  font-size: 0.82rem;
  padding: 40px 20px;
}

.alert-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 940;
  display: none;
}

.alert-panel-overlay.open {
  display: block;
}

.alert-clear-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 6px;
}

.alert-clear-btn:hover {
  color: #e74c3c;
}

/* ═══════════════════════════════════════════════════════
   🔬 DISCOVERY RADAR v2
   ═══════════════════════════════════════════════════════ */
.discovery-section {
  margin-top: 16px;
}

.discovery-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a78bfa;
  font-size: 0.9rem;
  font-weight: 600;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
}

.discovery-toggle:hover {
  background: rgba(99, 102, 241, 0.15);
}

.discovery-toggle .discovery-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: #9a9a9a;
}

.discovery-panel {
  display: none;
  margin-top: 8px;
  background: rgba(35, 35, 38, 0.8);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.discovery-panel.open {
  display: block;
}

.discovery-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-discovery-trigger {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.1);
  color: #a78bfa;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-discovery-trigger:hover {
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.btn-discovery-trigger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-discovery-clear {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(231, 76, 60, 0.25);
  background: rgba(231, 76, 60, 0.08);
  color: #e74c3c;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-discovery-clear:hover {
  background: rgba(231, 76, 60, 0.18);
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.15);
}

.disc-ultra-tag {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.discovery-last-update {
  font-size: 0.7rem;
  color: #666;
  margin-left: auto;
}

.csv-file-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #a78bfa;
  white-space: nowrap;
}

.discovery-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 130vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-right: 4px;
}

.discovery-cards::-webkit-scrollbar {
  width: 4px;
}

.discovery-cards::-webkit-scrollbar-track {
  background: transparent;
}

.discovery-cards::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.25);
  border-radius: 4px;
}

.discovery-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.45);
}

.discovery-empty {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 0.82rem;
}

/* ── Signal Badge ────────────────────────────────── */
.disc-signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.disc-signal-badge.signal-hot {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.disc-signal-badge.signal-up {
  background: rgba(99, 102, 241, 0.1);
  color: #a78bfa;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.disc-signal-badge.signal-new {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.disc-signal-badge.signal-warn {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.disc-signal-badge.signal-default {
  background: rgba(255, 255, 255, 0.04);
  color: #888;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Discovery Card ──────────────────────────────── */
.disc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(60, 60, 62, 0.4);
  border-radius: 12px;
  border-left: 4px solid rgba(99, 102, 241, 0.4);
  transition: all 0.2s;
  position: relative;
}

.disc-card:hover {
  background: rgba(60, 60, 62, 0.55);
}

.disc-card.suggest-remove {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}

.disc-card.dismissed {
  opacity: 0.4;
  border-left-color: #555;
}

.disc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.disc-id {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background 0.2s;
}

.disc-id:hover {
  background: rgba(255, 255, 255, 0.08);
}

.disc-id:hover .disc-code {
  color: #ffcc00;
}

.disc-query-icon {
  font-size: 0.7rem;
  color: #666;
  transition:
    color 0.2s,
    transform 0.2s;
  flex-shrink: 0;
}

.disc-id:hover .disc-query-icon {
  color: #ffcc00;
  transform: translate(1px, -1px);
}

.disc-code {
  font-size: 1.05rem;
  font-weight: 800;
  color: #e8e0d0;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.disc-name {
  font-size: 0.88rem;
  color: #9a9a9a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disc-market {
  font-size: 0.6rem;
  color: #777;
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

/* ── Rank Info ────────────────────────────────────── */
.disc-rank-info {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.disc-rank {
  font-size: 1rem;
  font-weight: 800;
  color: #e8e0d0;
  font-family: var(--font-mono);
}

.disc-rank-trend {
  font-size: 0.85rem;
}

.rank-up {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ef4444;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.08);
}

.rank-down {
  font-size: 0.72rem;
  font-weight: 700;
  color: #27ae60;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(39, 174, 96, 0.08);
}

/* ── Discovery Score Bar ─────────────────────────── */
.disc-score-bar {
  position: relative;
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  overflow: hidden;
}

.disc-score-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
}

.disc-score-fill.bullish {
  background: linear-gradient(
    90deg,
    rgba(239, 68, 68, 0.2),
    rgba(239, 68, 68, 0.4)
  );
}

.disc-score-fill.bearish {
  background: linear-gradient(
    90deg,
    rgba(39, 174, 96, 0.2),
    rgba(39, 174, 96, 0.4)
  );
}

.disc-score-fill.neutral {
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.2),
    rgba(99, 102, 241, 0.4)
  );
}

.disc-score-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #d4d0c8;
  letter-spacing: 0.03em;
}

/* ── Metrics Row ─────────────────────────────────── */
.disc-metrics {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.disc-metric {
  font-size: 0.72rem;
  font-weight: 600;
  color: #999;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.disc-metric.up {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.disc-metric.down {
  color: #27ae60;
  background: rgba(39, 174, 96, 0.06);
}

.disc-metric.parm {
  color: #a78bfa;
  background: rgba(99, 102, 241, 0.08);
  font-weight: 700;
}

.disc-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.disc-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #b8b0a0;
}

.disc-tag.reason {
  border-color: rgba(99, 102, 241, 0.2);
  color: #a78bfa;
}

.disc-tag.trend {
  border-color: rgba(197, 160, 89, 0.2);
  color: var(--accent);
}

.disc-tag.warning {
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

.disc-tag.days {
  color: #888;
}

.disc-price {
  font-size: 0.78rem;
  font-weight: 600;
  color: #b8b0a0;
  flex-shrink: 0;
}

.disc-sparkline {
  width: 100%;
  height: 22px;
  margin: 0;
}

.disc-card-footer {
  display: flex;
  gap: 4px;
  align-items: center;
}

.disc-remove-reason {
  flex: 1;
  font-size: 0.7rem;
  color: #f59e0b;
  line-height: 1.3;
}

.btn-disc-action {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-disc-dismiss {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.btn-disc-dismiss:hover {
  background: rgba(231, 76, 60, 0.2);
}

.btn-disc-restore {
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, 0.2);
}

.btn-disc-restore:hover {
  background: rgba(39, 174, 96, 0.2);
}

.btn-disc-query {
  background: rgba(99, 102, 241, 0.1);
  color: #a78bfa;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-disc-query:hover {
  background: rgba(99, 102, 241, 0.2);
}

/* ── Discovery Filter Tabs ──────────────────────── */
.disc-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.disc-filter-btn {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #888;
  transition: all 0.2s;
}

.disc-filter-btn.active {
  background: rgba(99, 102, 241, 0.12);
  color: #a78bfa;
  border-color: rgba(99, 102, 241, 0.3);
}

.disc-filter-btn:hover {
  border-color: rgba(99, 102, 241, 0.2);
  color: #a78bfa;
}

.disc-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(231, 76, 60, 0.2);
  background: rgba(231, 76, 60, 0.08);
  color: #e74c3c;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 2px;
}

.disc-filter-clear:hover {
  background: rgba(231, 76, 60, 0.18);
  border-color: rgba(231, 76, 60, 0.4);
}

/* ══════════════════════════════════════════════════════════════
   🔻 Bearish Discovery Radar — 暗紅色系主題（Admin 專屬）
   ══════════════════════════════════════════════════════════════ */
.bearish-discovery-section {
  margin-top: 12px;
}

.bearish-toggle {
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.15), rgba(220, 20, 60, 0.08)) !important;
  border-color: rgba(220, 20, 60, 0.3) !important;
  color: #f87171 !important;
}

.bearish-toggle:hover {
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.25), rgba(220, 20, 60, 0.15)) !important;
  border-color: rgba(220, 20, 60, 0.5) !important;
}

.bearish-panel {
  border-color: rgba(220, 20, 60, 0.2) !important;
  background: rgba(30, 8, 12, 0.95) !important;
}

.bearish-trigger-btn {
  background: linear-gradient(135deg, #8b0000, #dc143c) !important;
  color: #fff !important;
  border: none !important;
}

.bearish-trigger-btn:hover {
  background: linear-gradient(135deg, #a00000, #ef1443) !important;
  box-shadow: 0 0 20px rgba(220, 20, 60, 0.3) !important;
}

.bearish-trigger-btn:disabled {
  background: #444 !important;
  opacity: 0.6;
}

/* Bearish cards */
.bearish-card {
  border-left: 3px solid rgba(220, 20, 60, 0.5) !important;
  background: rgba(40, 10, 15, 0.6) !important;
}

.bearish-card:hover {
  border-left-color: #dc143c !important;
  background: rgba(50, 15, 20, 0.8) !important;
}

.bearish-warn {
  border-left-color: #f59e0b !important;
  background: rgba(50, 30, 10, 0.6) !important;
}

/* Bearish Score 色彩 */
.score-bearish-high {
  background: rgba(220, 20, 60, 0.2) !important;
  color: #ff4c6a !important;
  border: 1px solid rgba(220, 20, 60, 0.4) !important;
  font-weight: 700;
}

.score-bearish-mid {
  background: rgba(220, 100, 60, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  font-weight: 600;
}

.score-bearish-low {
  background: rgba(100, 60, 30, 0.15) !important;
  color: #d4a574 !important;
  border: 1px solid rgba(212, 165, 116, 0.2) !important;
}

/* Bearish filter buttons */
.bearish-filter.active {
  background: rgba(220, 20, 60, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(220, 20, 60, 0.35) !important;
}

.bearish-filter:hover {
  border-color: rgba(220, 20, 60, 0.25) !important;
  color: #f87171 !important;
}

/* Bearish action buttons */
.bearish-dismiss {
  background: rgba(220, 20, 60, 0.1);
  color: #f87171;
  border: 1px solid rgba(220, 20, 60, 0.2);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.bearish-dismiss:hover {
  background: rgba(220, 20, 60, 0.25);
}

.bearish-restore {
  background: rgba(39, 174, 96, 0.1);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, 0.2);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.bearish-restore:hover {
  background: rgba(39, 174, 96, 0.25);
}

/* Bearish sparkline */
.bearish-sparkline polyline {
  stroke: #dc143c !important;
}

/* Bearish progress bar */
.bearish-panel .disc-progress-fill {
  background: linear-gradient(90deg, #8b0000, #dc143c) !important;
}

/* ── Bearish Phase 2+3: Tabs, Performance, Tuning ── */
.bearish-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(220, 20, 60, 0.3);
  margin-bottom: 12px;
}

.bearish-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.bearish-tab:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(139, 0, 0, 0.1);
}

.bearish-tab.active {
  color: #ff6b6b;
  border-bottom-color: #dc143c;
  background: rgba(139, 0, 0, 0.15);
}

.bearish-dismissed-badge {
  background: rgba(139, 0, 0, 0.4);
  color: #ff6b6b;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: 8px;
}

/* Bearish Performance Cards */
.bearish-perf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.bearish-perf-cards .perf-card {
  background: rgba(139, 0, 0, 0.15);
  border: 1px solid rgba(220, 20, 60, 0.2);
}

/* Bearish Performance Table */
.bearish-perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 12px;
}

.bearish-perf-table th {
  background: rgba(139, 0, 0, 0.2);
  color: #ff6b6b;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(220, 20, 60, 0.3);
}

.bearish-perf-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(139, 0, 0, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

.bearish-perf-table tr:hover td {
  background: rgba(139, 0, 0, 0.1);
}

/* Bearish Tune Config */
.bearish-tune-config {
  margin-bottom: 12px;
}

.tune-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.tune-item {
  background: rgba(139, 0, 0, 0.12);
  border: 1px solid rgba(220, 20, 60, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tune-key {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.tune-val {
  color: #ff6b6b;
  font-weight: 600;
  font-size: 13px;
}

.tune-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 10px;
}

/* Bearish Tune Log */
.tune-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tune-log-item {
  background: rgba(139, 0, 0, 0.08);
  border: 1px solid rgba(220, 20, 60, 0.12);
  border-radius: 6px;
  padding: 8px 10px;
}

.tune-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.tune-log-round {
  font-weight: 600;
  color: #ff6b6b;
  font-size: 13px;
}

.tune-log-body {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin-bottom: 4px;
}

.tune-log-stats {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

.tune-log-dir {
  font-size: 12px;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 480px) {
  .disc-card-header {
    flex-wrap: wrap;
  }

  .disc-name {
    max-width: 100px;
  }

  .disc-card-footer {
    flex-wrap: wrap;
  }

  .disc-metrics {
    gap: 4px;
  }

  .disc-metric {
    font-size: 0.62rem;
    padding: 1px 5px;
  }
}

/* ── Market Pulse ───────────────────────────────── */
.pulse-section {
  margin: 12px 0;
}

.pulse-toggle {
  width: 100%;
  padding: 14px 18px;
  background: rgba(20, 20, 35, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  color: #d0d0dc;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s;
}

.pulse-toggle:hover {
  background: rgba(30, 30, 50, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
}

.pulse-sentiment {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
}

.pulse-panel {
  padding: 14px 0;
}

.pulse-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 0;
  color: #888;
  font-size: 0.85rem;
}

/* Gauge Section */
.pulse-gauge-section {
  text-align: center;
  margin-bottom: 18px;
}

.pulse-gauge-wrap {
  position: relative;
  width: 200px;
  height: 110px;
  margin: 0 auto;
  overflow: hidden;
}

.pulse-gauge-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    rgba(39, 174, 96, 0.3) 0deg,
    rgba(245, 158, 11, 0.3) 90deg,
    rgba(239, 68, 68, 0.3) 180deg
  );
  mask: radial-gradient(circle at center, transparent 60%, black 61%);
  -webkit-mask: radial-gradient(circle at center, transparent 60%, black 61%);
}

.pulse-gauge-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 3px;
  height: 68px;
  background: linear-gradient(to top, #e8e0d0, transparent);
  transform-origin: bottom center;
  border-radius: 2px;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.pulse-gauge-center {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e8e0d0;
  border: 2px solid rgba(20, 20, 35, 0.8);
}

.pulse-gauge-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #e8e0d0;
  margin-top: 8px;
}

.pulse-gauge-label {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 2px;
}

.pulse-gauge-sub {
  font-size: 0.7rem;
  color: #888;
  margin-top: 4px;
}

/* Grid Layout */
.pulse-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.pulse-box {
  background: rgba(30, 30, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
}

.pulse-box-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

/* Bull/Bear Bar */
.pulse-bullbear-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.pulse-bull-fill {
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  transition: width 0.6s;
}

.pulse-neutral-fill {
  background: rgba(255, 255, 255, 0.1);
}

.pulse-bear-fill {
  background: linear-gradient(90deg, #10b981, #27ae60);
  transition: width 0.6s;
}

.pulse-bullbear-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 600;
}

.pulse-bull-label {
  color: #ef4444;
}

.pulse-neutral-label {
  color: #888;
}

.pulse-bear-label {
  color: #27ae60;
}

/* PARM Bars */
.pulse-parm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pulse-parm-label {
  font-size: 0.78rem;
  font-weight: 800;
  width: 18px;
  text-align: center;
  color: #a78bfa;
}

.pulse-parm-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.pulse-parm-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.4),
    rgba(167, 139, 250, 0.6)
  );
}

.pulse-parm-val {
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
  color: #ccc;
  font-family: var(--font-mono);
}

/* Distribution */
.pulse-dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pulse-dist-tier {
  font-size: 0.78rem;
  font-weight: 800;
  min-width: 52px;
  text-align: center;
}

.pulse-dist-tier.tier-a {
  color: #ef4444;
}

.pulse-dist-tier.tier-b {
  color: #f59e0b;
}

.pulse-dist-tier.tier-c {
  color: #9ca3af;
}

.pulse-dist-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.pulse-dist-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s;
}

.pulse-dist-fill.tier-a {
  background: rgba(239, 68, 68, 0.4);
}

.pulse-dist-fill.tier-b {
  background: rgba(245, 158, 11, 0.4);
}

.pulse-dist-fill.tier-c {
  background: rgba(156, 163, 175, 0.4);
}

.pulse-dist-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: #999;
  min-width: 30px;
  text-align: right;
}

/* Extremes */
.pulse-extremes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pulse-extreme-box {
  background: rgba(30, 30, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
}

.pulse-extreme-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  margin-bottom: 6px;
}

.pulse-extreme-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
}

.pulse-extreme-item:hover {
  color: #ffcc00;
}

.pulse-extreme-code {
  font-weight: 700;
  font-family: var(--font-mono);
  color: #e8e0d0;
  min-width: 44px;
}

.pulse-extreme-name {
  color: #999;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pulse-extreme-score {
  font-weight: 800;
  font-family: var(--font-mono);
  min-width: 24px;
  text-align: right;
}

.pulse-extreme-tier {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.pulse-extreme-tier.tier-a {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.pulse-extreme-tier.tier-b {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.pulse-extreme-tier.tier-c {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

@media (max-width: 480px) {
  .pulse-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .pulse-extremes {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .pulse-extreme-box {
    padding: 8px 8px;
  }

  .pulse-extreme-item {
    gap: 4px;
    font-size: 0.68rem;
    padding: 3px 0;
  }

  .pulse-extreme-code {
    min-width: 36px;
    font-size: 0.68rem;
  }

  .pulse-extreme-tier {
    display: none;
  }

  .pulse-extreme-score {
    min-width: 20px;
    font-size: 0.7rem;
  }

  .pulse-gauge-wrap {
    width: 160px;
    height: 90px;
  }

  .pulse-gauge-bg {
    width: 160px;
    height: 160px;
  }

  .pulse-gauge-needle {
    height: 54px;
  }

  .pulse-gauge-value {
    font-size: 1.6rem;
  }
}

/* ── Discovery Tab Bar ──────────────────────────── */
.disc-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 3px;
}

.disc-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: #888;
  background: transparent;
  transition: all 0.2s;
}

.disc-tab.active {
  background: rgba(99, 102, 241, 0.15);
  color: #a78bfa;
}

.disc-tab:hover:not(.active) {
  color: #bbb;
  background: rgba(255, 255, 255, 0.04);
}

/* ── Performance Dashboard (new) ─────────────── */
.perf-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.perf-header h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: #e8e0d0;
  margin: 0;
  flex: 1;
}

.perf-elite-badge {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, #c23152, #e94560);
  color: #fff;
  letter-spacing: 0.08em;
}

.perf-refresh-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.perf-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}

.perf-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.perf-threshold-section {
  margin-top: 14px;
}

.perf-threshold-section h4,
.perf-signal-section h4,
.perf-table-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: #b8b0a0;
  margin: 0 0 10px;
}

.perf-signal-value {
  font-size: 0.78rem;
  font-weight: 800;
  font-family: var(--font-mono);
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
}

.perf-signal-count {
  font-size: 0.68rem;
  color: #666;
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.perf-locked,
.perf-empty {
  text-align: center;
  padding: 40px 20px;
  color: #888;
  font-size: 0.85rem;
  line-height: 1.8;
}

/* ── ⚔️ Conflict Alerts ──────────────────────── */
.conflict-section {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 12px;
}

.conflict-desc {
  font-size: 0.7rem;
  color: #999;
  margin-bottom: 10px;
}

.conflict-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conflict-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(251, 191, 36, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.78rem;
}

.conflict-item:hover {
  background: rgba(251, 191, 36, 0.15);
}

.conflict-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.conflict-code {
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fbbf24;
  min-width: 48px;
}

.conflict-name {
  color: #ccc;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conflict-detail {
  font-size: 0.68rem;
  color: #999;
  flex-shrink: 0;
}

/* ── 🔥 Industry Heatmap ──────────────────────── */
.heatmap-section {
  margin-top: 14px;
}

.heatmap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 0.75rem;
}

.heatmap-label {
  min-width: 60px;
  font-weight: 700;
  color: #ccc;
  flex-shrink: 0;
}

.heatmap-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.heatmap-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.heatmap-count {
  font-size: 0.68rem;
  color: #999;
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.heatmap-bs {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 48px;
  text-align: right;
  flex-shrink: 0;
}

.perf-stock-code {
  font-weight: 700;
  font-family: var(--font-mono);
}

.perf-stock-code:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .perf-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .perf-card-value {
    font-size: 1.1rem;
  }

  .perf-signal-label {
    min-width: 80px;
    font-size: 0.7rem;
  }
}

/* ── Performance Dashboard ──────────────────────── */
.perf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  color: #888;
  font-size: 0.85rem;
}

/* Summary Cards */
.perf-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.perf-card {
  background: rgba(30, 30, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  transition: all 0.2s;
}

.perf-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  background: rgba(30, 30, 50, 0.8);
}

.perf-card-label {
  font-size: 0.68rem;
  color: #888;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.perf-card-value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #e8e0d0;
}

.perf-card-value.positive {
  color: #ef4444;
}

.perf-card-value.negative {
  color: #27ae60;
}

.perf-card-value.hit-high {
  color: #f59e0b;
}

.perf-card-sub {
  font-size: 0.65rem;
  color: #666;
  margin-top: 4px;
}

/* Signal Section */
.perf-signal-section {
  margin-bottom: 16px;
}

.perf-signal-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #b8b0a0;
  margin-bottom: 8px;
}

.perf-signal-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perf-signal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.perf-signal-label {
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 100px;
  flex-shrink: 0;
}

.perf-signal-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.perf-signal-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.perf-signal-bar-fill.high {
  background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.perf-signal-bar-fill.medium {
  background: linear-gradient(90deg, #6366f1, #a78bfa);
}

.perf-signal-bar-fill.low {
  background: linear-gradient(90deg, #27ae60, #10b981);
}

.perf-signal-stats {
  display: flex;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 120px;
  justify-content: flex-end;
}

.perf-signal-hit {
  color: #f59e0b;
}

.perf-signal-return {
  color: #a78bfa;
}

/* Table Section */
.perf-table-section {
  margin-top: 4px;
}

.perf-table-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #b8b0a0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.perf-table-count {
  font-size: 0.68rem;
  color: #666;
  font-weight: 500;
}

.perf-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  background: rgba(20, 20, 35, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.perf-table th {
  padding: 10px 10px;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.perf-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #ccc;
}

.perf-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.perf-table .perf-stock-id {
  text-align: left;
  font-weight: 700;
  color: #e8e0d0;
  cursor: pointer;
}

.perf-table .perf-stock-id:hover {
  color: #ffcc00;
}

.perf-return-positive {
  color: #ef4444;
  font-weight: 700;
}

.perf-return-negative {
  color: #27ae60;
  font-weight: 700;
}

.perf-return-zero {
  color: #888;
}

/* Responsive */
@media (max-width: 480px) {
  .perf-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .perf-signal-row {
    flex-wrap: wrap;
  }

  .perf-signal-stats {
    width: 100%;
    justify-content: flex-start;
  }

  .perf-table {
    font-size: 0.68rem;
  }

  .perf-table th,
  .perf-table td {
    padding: 6px 6px;
  }
}

/* ── Auto-Tuner Dashboard ──────────────────────── */
.tune-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.btn-tune-trigger {
  padding: 8px 18px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.15),
    rgba(167, 139, 250, 0.1)
  );
  color: #a78bfa;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tune-trigger:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.25),
    rgba(167, 139, 250, 0.2)
  );
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-tune-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tune-last-update {
  font-size: 0.68rem;
  color: #666;
}

.tune-loading-inline {
  padding: 16px;
  color: #888;
  font-size: 0.8rem;
  text-align: center;
}

.tune-card {
  background: rgba(30, 30, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.tune-card:hover {
  border-color: rgba(99, 102, 241, 0.15);
}

.tune-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #b8b0a0;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tune-config-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.04);
}

.tune-config-label {
  font-size: 0.75rem;
  color: #999;
}

.tune-config-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e8e0d0;
  font-family: var(--font-mono);
}

.tune-reason {
  margin-top: 8px;
  font-size: 0.72rem;
  color: #888;
  font-style: italic;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.tune-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  margin: 10px 0 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.tune-signal-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.75rem;
  align-items: center;
}

.tune-signal-name {
  color: #ccc;
  font-weight: 600;
}

.tune-signal-stat {
  color: #888;
  font-family: var(--font-mono);
  text-align: right;
}

.tune-signal-hit {
  font-weight: 800;
  font-family: var(--font-mono);
  text-align: right;
  min-width: 40px;
}

.tune-signal-ret {
  color: #a78bfa;
  font-weight: 600;
  font-family: var(--font-mono);
  text-align: right;
  min-width: 50px;
}

.tune-change-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.75rem;
  align-items: center;
}

.tune-change-param {
  color: #e8e0d0;
  font-weight: 700;
}

.tune-change-arrow {
  color: #f59e0b;
  font-family: var(--font-mono);
  font-weight: 600;
}

.tune-change-reason {
  color: #888;
  font-size: 0.7rem;
}

.tune-no-change {
  padding: 6px 0;
  font-size: 0.75rem;
  color: #27ae60;
}

.tune-overall {
  font-size: 0.75rem;
  color: #ccc;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  margin-bottom: 6px;
}

.tune-empty {
  text-align: center;
  padding: 30px 0;
  color: #666;
  font-size: 0.82rem;
}

.tune-log-card {
  border-left: 3px solid rgba(99, 102, 241, 0.3);
}

@media (max-width: 480px) {
  .tune-signal-row {
    grid-template-columns: 1fr auto auto;
    gap: 6px;
    font-size: 0.68rem;
  }

  .tune-signal-stat {
    display: none;
  }

  .tune-change-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ═══════════════════════════════════════════════════════ */
/* ⚖️ COMPARE MODE                                       */
/* ═══════════════════════════════════════════════════════ */

.btn-compare {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-compare:hover {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.3);
}

.btn-compare.active {
  background: rgba(167, 139, 250, 0.25);
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.3);
}

.btn-compare:active {
  transform: scale(0.85);
}

/* Floating bottom bar */
.compare-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  width: min(500px, 92vw);
}

.compare-bar.visible {
  bottom: 16px;
}

.compare-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(20, 20, 35, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.compare-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid;
  border-radius: 20px;
  font-size: 0.72rem;
  color: #ccc;
  background: rgba(255, 255, 255, 0.04);
}

.compare-chip-x {
  cursor: pointer;
  opacity: 0.5;
  font-size: 0.6rem;
}

.compare-chip-x:hover {
  opacity: 1;
}

.compare-go-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.compare-go-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.compare-go-btn:not(:disabled):hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

/* Overlay & Modal */
.compare-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.compare-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.compare-modal {
  background: rgba(22, 22, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: min(560px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.compare-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.compare-modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e8e8f0;
  margin: 0;
}

.compare-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

.compare-close:hover {
  color: #fff;
}

.compare-body {
  padding: 20px 24px;
}

/* Radar */
.compare-radar-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.compare-radar-wrap canvas {
  display: block;
  margin: 0 auto;
}

.compare-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Table */
.compare-table-wrap {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.compare-table th,
.compare-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.compare-table th {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.compare-table .compare-label {
  text-align: left;
  color: #999;
  font-weight: 600;
}

.compare-table td:not(.compare-label) {
  color: #e0e0e8;
  font-weight: 600;
}

/* Toast */
.compare-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 22px;
  background: rgba(30, 30, 50, 0.95);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 12px;
  color: #e0e0e8;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 1100;
}

.compare-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .compare-bar {
    width: 96vw;
  }

  .compare-bar-inner {
    padding: 8px 12px;
    gap: 8px;
  }

  .compare-chip {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .compare-go-btn {
    padding: 7px 14px;
    font-size: 0.72rem;
  }

  .compare-modal {
    border-radius: 16px;
  }

  .compare-body {
    padding: 16px;
  }

  .compare-radar-wrap canvas {
    width: 280px;
    height: 280px;
  }

  .compare-legend {
    gap: 10px;
    font-size: 0.7rem;
  }
}

/* ═══════════════════════════════════════════════════════ */
/* 📊 WATCHLIST DASHBOARD                                  */
/* ═══════════════════════════════════════════════════════ */

.btn-watchlist-dash {
  padding: 6px 14px;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-watchlist-dash:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.wl-dash-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.wl-dash-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.wl-dash-modal {
  background: rgba(16, 16, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  width: min(800px, 96vw);
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.wl-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wl-dash-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e8e8f0;
}

.wl-dash-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wl-dash-timer {
  font-size: 0.68rem;
  color: #666;
  font-variant-numeric: tabular-nums;
}

.wl-dash-refresh,
.wl-dash-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.wl-dash-refresh:hover,
.wl-dash-close:hover {
  color: #fff;
}

.wl-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 18px 20px 24px;
}

.wl-dash-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 40px;
  color: #888;
  font-size: 0.85rem;
}

/* Dashboard Card */
.wl-dash-card {
  background: rgba(22, 22, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.wl-dash-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.wl-dash-card.bullish {
  border-left: 3px solid rgba(231, 76, 60, 0.4);
}

.wl-dash-card.bearish {
  border-left: 3px solid rgba(39, 174, 96, 0.4);
}

.wl-dash-card.neutral {
  border-left: 3px solid rgba(136, 136, 136, 0.3);
}

.dash-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.dash-ring {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.dash-score {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #e8e8f0;
}

.dash-stock-info {
  min-width: 0;
}

.dash-code {
  font-weight: 800;
  font-size: 0.85rem;
  color: #e0e0e8;
}

.dash-name {
  font-size: 0.68rem;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-outlook {
  font-size: 0.7rem;
  margin-top: 2px;
}

.dash-card-mid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 2px;
}

.dash-price {
  font-weight: 700;
  font-size: 0.82rem;
  color: #d0d0dc;
}

.dash-net {
  font-size: 0.7rem;
  font-weight: 600;
}

/* PARM mini bars */
.dash-parm-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dash-parm-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-parm-key {
  width: 12px;
  font-size: 0.55rem;
  font-weight: 800;
  color: #888;
  text-align: center;
}

.dash-parm-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.dash-parm-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.dash-parm-val {
  width: 18px;
  font-size: 0.55rem;
  color: #888;
  text-align: right;
}

@media (max-width: 480px) {
  .wl-dash-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
  }

  .wl-dash-modal {
    border-radius: 16px;
  }

  .wl-dash-header {
    padding: 14px 16px;
  }
}

/* ═══════════════════════════════════════════════════════ */
/* 🔔 NOTIFICATION TOGGLE                                  */
/* ═══════════════════════════════════════════════════════ */

.notif-toggle-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #888;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.2s;
}

.notif-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #bbb;
}

.notif-toggle-btn.notif-on {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2),
    rgba(167, 139, 250, 0.2)
  );
  border-color: rgba(167, 139, 250, 0.3);
  color: #a78bfa;
}

/* ═══════════════════════════════════════════════════════ */
/* 📈 STRATEGY PERFORMANCE TRACKING                        */
/* ═══════════════════════════════════════════════════════ */

.btn-record-pred {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-record-pred:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.3);
}

.btn-record-pred.active {
  background: rgba(251, 191, 36, 0.25);
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.btn-record-pred:active {
  transform: scale(0.85);
}

.strat-section {
  margin: 12px 0;
}

.strat-toggle {
  width: 100%;
  padding: 12px 18px;
  background: rgba(20, 20, 35, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  color: #d0d0dc;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.strat-toggle:hover {
  background: rgba(30, 30, 50, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

.strat-ultra-tag {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
  letter-spacing: 1px;
}

.strat-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.strat-panel-body {
  display: none;
  padding: 12px 0;
}

.strat-section.open .strat-panel-body {
  display: block;
}

.strat-footer {
  display: none;
  padding: 4px 0;
}

.strat-section.open .strat-footer {
  display: block;
}

.strat-clear-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #888;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.2s;
}

.strat-clear-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.strat-empty {
  text-align: center;
  padding: 30px;
  color: #666;
  font-size: 0.78rem;
  line-height: 1.5;
}

/* Stats row */
.strat-stats {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(22, 22, 38, 0.5);
  border-radius: 12px;
  margin-bottom: 12px;
}

.strat-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.strat-stat-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: #e0e0e8;
}

.strat-stat-val.hit-good {
  color: #27ae60;
}

.strat-stat-val.hit-mid {
  color: #f59e0b;
}

.strat-stat-val.hit-low {
  color: #ef4444;
}

.strat-stat-label {
  font-size: 0.6rem;
  color: #888;
  margin-top: 2px;
}

/* Record cards */
.strat-record {
  background: rgba(22, 22, 38, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: all 0.2s;
}

.strat-record.verified {
  border-left: 3px solid rgba(167, 139, 250, 0.3);
}

.strat-record-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.strat-rec-code {
  font-weight: 800;
  font-size: 0.78rem;
  color: #e0e0e8;
}

.strat-rec-name {
  font-size: 0.68rem;
  color: #999;
  flex: 1;
}

.strat-rec-date {
  font-size: 0.6rem;
  color: #666;
}

.strat-record-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.strat-prediction {
  display: flex;
  align-items: center;
  gap: 6px;
}

.strat-pred-score {
  font-weight: 800;
  font-size: 0.78rem;
  color: #a78bfa;
}

.strat-pred-outlook {
  font-size: 0.75rem;
}

.strat-pred-price {
  font-size: 0.72rem;
  color: #999;
}

.strat-result {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strat-result-price {
  font-size: 0.72rem;
  font-weight: 700;
}

.strat-hit {
  font-size: 0.65rem;
  font-weight: 700;
}

.strat-hit.yes {
  color: #27ae60;
}

.strat-hit.no {
  color: #ef4444;
}

.strat-verify-btn {
  padding: 4px 10px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 8px;
  color: #a78bfa;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.strat-verify-btn:hover {
  background: rgba(167, 139, 250, 0.2);
}

@media (max-width: 480px) {
  .strat-stats {
    gap: 8px;
    padding: 8px;
  }

  .strat-stat-val {
    font-size: 1rem;
  }
}
/* �w�w Donation Modal Extensions �w�w */
.donate-plan-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.donate-label {
  display: block;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}

.donate-label-sm {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: block;
}

.donate-plan-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.donate-plan-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.donate-plan-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.donate-plan-btn:active {
  transform: translateY(0);
}

.donate-plan-btn.active {
  background: rgba(201, 164, 74, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(201, 164, 74, 0.3);
}

.donate-plan-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.donate-plan-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Elite 菁英按鈕 — 暗黑版 */
.donate-plan-elite {
  width: 100%;
  background: linear-gradient(135deg, #1a1025 0%, #2d1b3d 50%, #1a1025 100%);
  border: 1.5px solid #c9a24c;
  border-radius: 10px;
  padding: 14px;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}
.donate-plan-elite::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(201, 162, 76, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.donate-plan-elite:hover {
  border-color: #f1c40f;
  background: linear-gradient(135deg, #221530 0%, #3a2450 50%, #221530 100%);
  box-shadow: 0 0 16px rgba(201, 162, 76, 0.25);
}
.donate-plan-elite .donate-plan-price {
  font-size: 1.35rem;
  color: #f1c40f;
}
.donate-plan-elite .donate-plan-desc {
  color: #c9a24c;
}

.donate-plan-elite.active {
  border-color: #f1c40f;
  background: linear-gradient(135deg, #221530 0%, #3a2450 50%, #221530 100%);
  box-shadow: 0 0 16px rgba(201, 162, 76, 0.4);
}

.donate-copy-btn {
  background: rgba(201, 164, 74, 0.15);
  border: 1px solid rgba(201, 164, 74, 0.3);
  color: var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.donate-copy-btn:hover {
  background: rgba(201, 164, 74, 0.25);
  transform: translateY(-1px);
}
.donate-copy-btn.copied {
  background: rgba(39, 174, 96, 0.2);
  border-color: #27ae60;
  color: #2ecc71;
}

.donate-custom-wrap {
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.donate-amount-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--submit);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 4px 0;
  font-family: "Inter", sans-serif;
  transition: border-color 0.3s;
}

.donate-amount-input:focus {
  outline: none;
  border-color: var(--submit);
}

.donate-amount-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 400;
}

.donate-amount-input.flash {
  animation: flashInput 0.3s ease;
}

@keyframes flashInput {
  0% {
    color: #fff;
    text-shadow: 0 0 10px var(--accent);
  }
  100% {
    color: var(--submit);
    text-shadow: none;
  }
}

.donate-bank-title {
  font-size: 0.85rem;
  color: #fff;
  opacity: 0.8;
  margin-bottom: 10px;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

.donate-row {
  display: flex;
  gap: 12px;
}

.donate-row .donate-field {
  flex: 1;
}

/* �w�w Bank Transfer Premium Button �w�w */
.btn-donate.bank-transfer {
  background: linear-gradient(
    135deg,
    rgba(197, 160, 89, 0.15),
    rgba(0, 0, 0, 0.4)
  );
  border: 1px solid rgba(197, 160, 89, 0.6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-donate.bank-transfer::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 215, 0, 0.2),
    transparent
  );
  transition: 0.5s;
}

.btn-donate.bank-transfer:hover {
  background: linear-gradient(
    135deg,
    rgba(197, 160, 89, 0.25),
    rgba(0, 0, 0, 0.5)
  );
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 15px rgba(197, 160, 89, 0.3);
  transform: translateY(-2px);
}

.btn-donate.bank-transfer:hover::before {
  left: 100%;
}

/* �w�w Daily Greeting Modal �w�w */
.greeting-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85); /* Darker backdrop */
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.greeting-modal {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: slideInUp 0.4s ease;
}

.greeting-header {
  margin-bottom: 20px;
}

.greeting-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
}

.greeting-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.greeting-title span {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.greeting-title strong {
  font-size: 1.5rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.beta-badge {
  background: rgba(167, 139, 250, 0.2);
  color: var(--accent);
  border: 1px solid rgba(167, 139, 250, 0.4);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

.greeting-content {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 25px;
}

.greeting-content p {
  margin-bottom: 12px;
}

.greeting-disclaimer {
  background: rgba(255, 50, 50, 0.05);
  border: 1px solid rgba(255, 50, 50, 0.1);
  padding: 12px;
  border-radius: 8px;
  margin-top: 15px;
  font-size: 0.85rem;
  text-align: left;
}

.greeting-disclaimer strong {
  color: #ff6b6b;
  display: block;
  margin-bottom: 4px;
}

.greeting-confirm-btn {
  background: var(--accent);
  color: #000;
  border: none;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 30px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
}

.greeting-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.5);
  background: #fff;
}

.greeting-modal-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ═══════════════════════════════════════════════════════ */
/* 🔬 DISCOVERY RADAR SCAN PROGRESS                       */
/* ═══════════════════════════════════════════════════════ */

.disc-scan-progress {
  width: 100%;
  max-width: 240px;
  margin-top: 4px;
}

.disc-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.disc-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #c084fc);
  border-radius: 3px;
  transition: width 0.4s ease;
  position: relative;
}

.disc-progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: discProgressShimmer 1.5s ease-in-out infinite;
}

@keyframes discProgressShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.disc-progress-label {
  font-size: 0.72rem;
  color: #a78bfa;
  font-weight: 600;
  animation: discProgressPulse 1.5s ease-in-out infinite;
}

@keyframes discProgressPulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════
   🌑 Dark Cassandra — Bearish Mode Theme
   Admin 專屬做空分析暗黑配色
   ═══════════════════════════════════════════════════════════ */

body.dark-mode {
  --bg-primary: linear-gradient(to bottom, #0d0d1a, #050510);
  --bg-solid: #08081a;
  --accent: #e94560;
  --accent-light: #ff6b81;
  --accent-dark: #c23152;
  --accent-glow: 0 0 20px rgba(233, 69, 96, 0.35);
  --accent-glow-strong: 0 0 30px rgba(233, 69, 96, 0.5);
  --surface: rgba(233, 69, 96, 0.03);
  --surface-hover: rgba(233, 69, 96, 0.06);
  --surface-active: rgba(233, 69, 96, 0.08);
  --border: rgba(233, 69, 96, 0.15);
  --border-strong: rgba(233, 69, 96, 0.3);
  --text: #e0d8e8;
  --text-dim: #8a7595;
  --text-muted: #5a4d65;
}

/* Mode Toggle Button */
.mode-toggle {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: var(--space-sm) 0;
  padding: 3px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.mode-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.mode-btn:hover {
  color: var(--text);
}

.mode-btn.active {
  color: #fff;
}

.mode-btn.active[data-mode="bullish"] {
  background: linear-gradient(135deg, #c5a059, #e8c97a);
  color: #0a0a0a;
  box-shadow: 0 0 12px rgba(197, 160, 89, 0.3);
}

.mode-btn.active[data-mode="bearish"] {
  background: linear-gradient(135deg, #e94560, #c23152);
  color: #fff;
  box-shadow: 0 0 12px rgba(233, 69, 96, 0.4);
}

/* Dark Mode: Adjust scoreCircle for bearish context */
body.dark-mode .score-circle.bearish {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.2);
}

body.dark-mode .score-circle.bearish::after {
  border-color: rgba(233, 69, 96, 0.1);
}

body.dark-mode .score-circle.bullish {
  border-color: var(--down);
}

/* Dark Mode: Button styles */
body.dark-mode .btn-go {
  background: linear-gradient(135deg, #c23152, #e94560);
  color: #fff;
}

body.dark-mode .btn-go:hover {
  box-shadow: 0 0 20px rgba(233, 69, 96, 0.4);
}

body.dark-mode .stock-input {
  border-color: rgba(233, 69, 96, 0.3);
  box-shadow:
    0 0 8px rgba(233, 69, 96, 0.08),
    inset 0 0 6px rgba(233, 69, 96, 0.04);
}

body.dark-mode .stock-input:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 12px rgba(233, 69, 96, 0.2),
    0 0 0 3px rgba(233, 69, 96, 0.1);
}

body.dark-mode .pro-badge {
  background: linear-gradient(135deg, #e94560, #ff6b81, #e94560);
  background-size: 200% 100%;
  box-shadow:
    0 0 12px rgba(233, 69, 96, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Dark Mode: Header accent */
body.dark-mode .header h1 {
  color: var(--accent);
}

/* Dark Mode: Loading spinner */
body.dark-mode .loading .spinner {
  border-color: var(--border);
  border-top-color: var(--accent);
}

/* Dark Mode header subtitle */
body.dark-mode .header .subtitle {
  color: var(--text-dim);
}

/* Dark Mode: Score outlook */
body.dark-mode .score-outlook.bearish {
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   贊助生命週期管理 — Admin UI + 到期通知
   ═══════════════════════════════════════════════════════════ */

/* 到期狀態標籤 */
.tier-expired {
  color: #e74c3c;
  font-size: 0.75rem;
  background: rgba(231, 76, 60, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}
.tier-expiring {
  color: #e67e22;
  font-size: 0.75rem;
  background: rgba(230, 126, 34, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulse-warning 2s ease-in-out infinite;
}
.tier-active {
  color: var(--gold-dim);
  font-size: 0.75rem;
}
@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 報表按鈕 */
.btn-report {
  background: var(--surface-2);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}
.btn-report:hover {
  background: var(--gold);
  color: var(--bg-dark);
}

/* 報表區塊 */
.tier-report-section {
  background: var(--surface-1);
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

/* ── 查詢統計面板 ───────────────────────────────────────── */
.query-stats-section {
  background: var(--surface-1);
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.qs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  color: #C5A059;
}

.qs-total {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
}

.qs-section {
  margin-bottom: 10px;
}

.qs-section h4 {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin: 0 0 4px;
}

/* ── 收摺切換 ── */
.qs-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  user-select: none;
  transition: color 0.2s;
}
.qs-toggle:hover {
  color: #C5A059;
}
.qs-arrow {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
  display: inline-block;
}
.qs-section.collapsed .qs-arrow {
  transform: rotate(-90deg);
}

/* 收摺動畫容器 */
.qs-collapsible {
  max-height: 600px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  opacity: 1;
}
.qs-section.collapsed .qs-collapsible {
  max-height: 0;
  opacity: 0;
}

/* 捲動容器 */
.qs-scroll-wrap {
  max-height: 300px;
  overflow-y: auto;
  border-radius: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(197,160,89,0.3) transparent;
}
.qs-scroll-wrap::-webkit-scrollbar {
  width: 5px;
}
.qs-scroll-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.qs-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(197,160,89,0.3);
  border-radius: 3px;
}
.qs-scroll-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(197,160,89,0.5);
}

.qs-table {
  border: 1px solid rgba(197,160,89,0.15);
  border-radius: 6px;
  overflow: hidden;
}

.qs-row {
  display: grid;
  grid-template-columns: 28px 1fr 44px 1fr;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.73rem;
  color: rgba(255,255,255,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  align-items: center;
}

.qs-row:last-child {
  border-bottom: none;
}

.qs-head {
  background: rgba(197,160,89,0.1);
  color: #C5A059;
  font-weight: 600;
  font-size: 0.7rem;
}

/* 可排序欄位 */
.qs-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}
.qs-sortable:hover {
  color: #fff;
}

/* 4 欄版（用戶排行） — 前 3 欄與 5 欄版對齊 */
.qs-row-4col {
  grid-template-columns: 28px 28% 44px 1fr;
}

/* 5 欄版（含查詢用戶） */
.qs-row-5col {
  grid-template-columns: 28px 28% 44px 80px 1fr;
}

.qs-users {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qs-rank {
  text-align: center;
  font-weight: 600;
  color: #C5A059;
}

.qs-count {
  text-align: center;
  font-weight: 600;
  color: #10b981;
}

.qs-time {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 報表統計格 */
.report-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.report-stat-card {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  border: 1px solid transparent;
}
.report-stat-card.pro { border-color: var(--gold-dim); }
.report-stat-card.ultra { border-color: #8e44ad; }
.report-stat-card.elite { border-color: #f1c40f; }
.report-stat-card.revenue { border-color: #2ecc71; }
.report-stat-number {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
  font-weight: 700;
}
.report-stat-label {
  font-size: 0.75rem;
  color: var(--gold-dim);
  margin-top: 4px;
}

/* 報表表格 */
.report-table-wrap {
  overflow-x: auto;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.report-table th,
.report-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--surface-2);
}
.report-table th {
  color: var(--gold);
  font-weight: 600;
  background: var(--surface-2);
}
.report-table td {
  color: var(--text-base);
}

/* ═══════════════════════════════════════════════════════════ */
/* 📊 TOP200 回測實驗室 Backtest Lab                          */
/* ═══════════════════════════════════════════════════════════ */

.backtest-lab-section {
  margin-top: 12px;
}
.backtest-lab-toggle {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.10)) !important;
  border-color: rgba(99,102,241,0.3) !important;
}
.backtest-lab-toggle:hover {
  border-color: rgba(99,102,241,0.5) !important;
}
.backtest-trigger-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
}
.backtest-trigger-btn:hover {
  background: linear-gradient(135deg, #818cf8, #a78bfa) !important;
}

/* 摘要卡片 */
.backtest-summary {
  padding: 8px 0;
}
.backtest-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.backtest-summary-card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
}
.backtest-summary-card .bt-period {
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.backtest-summary-card .bt-spread {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.backtest-summary-card .bt-spread.positive { color: #ef4444; }
.backtest-summary-card .bt-spread.negative { color: #22c55e; }
.backtest-summary-card .bt-spread.neutral  { color: #888; }
.backtest-summary-card .bt-winrate {
  font-size: 0.75rem;
  color: #aaa;
}
.backtest-summary-card .bt-winrate span {
  font-weight: 700;
  color: #d4d4d4;
}

/* 信賴度指標（卡片內） */
.backtest-summary-card .bt-significance {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.bt-sig-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
/* 刻意用藍/琥珀/灰，避開台股紅漲綠跌的價格語意 */
.bt-sig-badge.sig-strong { background: rgba(59,130,246,0.18);  color: #60a5fa; }
.bt-sig-badge.sig-weak   { background: rgba(245,158,11,0.18);  color: #fbbf24; }
.bt-sig-badge.sig-noise  { background: rgba(107,114,128,0.20); color: #9ca3af; }
.bt-significance .bt-sig-detail {
  font-size: 0.66rem;
  color: #888;
  font-variant-numeric: tabular-nums;
}
/* 信賴度圖例列 */
.backtest-sig-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 0.68rem;
  color: #888;
  margin-bottom: 12px;
}
.backtest-sig-legend .bt-sig-note {
  flex-basis: 100%;
  color: #777;
  line-height: 1.5;
  margin-top: 2px;
}

/* Meta 資訊列 */
.backtest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 12px;
}
.backtest-meta strong { color: #bbb; }

/* Spread 圖表 */
.backtest-chart-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ccc;
  margin-bottom: 8px;
  padding-top: 4px;
}
#backtestSpreadChart {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  background: var(--surface-2);
}

/* 每日明細表 */
.backtest-daily-table {
  margin-top: 12px;
  max-height: 400px;
  overflow-y: auto;
}
.backtest-daily-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}
.backtest-daily-table th {
  position: sticky;
  top: 0;
  background: var(--surface-1);
  color: #999;
  font-weight: 600;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.backtest-daily-table td {
  padding: 5px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: #bbb;
}
.backtest-daily-table tr:hover td {
  background: rgba(99,102,241,0.06);
}
.backtest-daily-table .bt-date { color: #888; text-align: left; }
.backtest-daily-table .bt-pos { color: #ef4444; font-weight: 600; }
.backtest-daily-table .bt-neg { color: #22c55e; font-weight: 600; }
.backtest-daily-table .bt-spread-cell {
  font-weight: 700;
  font-size: 0.78rem;
}

/* 群組色彩標記 */
.bt-group-a { color: #ef4444; }
.bt-group-b { color: #888; }
.bt-group-c { color: #22c55e; }

/* 圖例 */
.backtest-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
  font-size: 0.72rem;
  color: #888;
}
.backtest-legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.backtest-legend .leg-a::before { background: #ef4444; }
.backtest-legend .leg-b::before { background: #666; }
.backtest-legend .leg-c::before { background: #22c55e; }
.backtest-legend .leg-spread::before { background: #8b5cf6; }

/* ═══════════════════════════════════════════════════════════ */
/* 🎯 抄底狙擊站 Sniper Station                               */
/* ═══════════════════════════════════════════════════════════ */

.sniper-section {
  margin-top: 12px;
}

/* Toggle 按鈕（金橘色系，與回測實驗室紫色做區隔） */
.sniper-toggle {
  background: linear-gradient(135deg, rgba(217,119,6,0.15), rgba(245,158,11,0.10)) !important;
  border-color: rgba(217,119,6,0.3) !important;
  color: #f59e0b !important;
}
.sniper-toggle:hover {
  border-color: rgba(245,158,11,0.5) !important;
  background: linear-gradient(135deg, rgba(217,119,6,0.22), rgba(245,158,11,0.15)) !important;
}

/* Sniper 面板 */
.sniper-panel {
  border-color: rgba(217,119,6,0.15) !important;
}

/* ── 全域分析模式切換 Classic ↔ Hybrid ── */
.sniper-mode-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}

.sniper-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sniper-mode-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: rgba(100,116,139,0.3);
  border: 1px solid rgba(100,116,139,0.4);
  border-radius: 12px;
  transition: all 0.35s ease;
}

.sniper-mode-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active 狀態（Hybrid） */
.sniper-mode-toggle.active .sniper-mode-track {
  background: linear-gradient(135deg, rgba(56,189,248,0.3), rgba(139,92,246,0.25));
  border-color: rgba(56,189,248,0.5);
}
.sniper-mode-toggle.active .sniper-mode-thumb {
  left: 20px;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56,189,248,0.4);
}

.sniper-mode-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
  transition: color 0.3s ease;
  letter-spacing: 0.3px;
}
.sniper-mode-toggle.active .sniper-mode-label {
  color: #38bdf8;
}

.sniper-mode-hint {
  font-size: 0.68rem;
  color: #475569;
  margin-left: auto;
  transition: color 0.3s ease;
}

.sniper-mode-toggle:hover .sniper-mode-track {
  border-color: rgba(148,163,184,0.6);
}
.sniper-mode-toggle.active:hover .sniper-mode-track {
  border-color: rgba(56,189,248,0.7);
}

/* RWD 手機版 */
@media (max-width: 768px) {
  .sniper-mode-bar {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 8px 10px;
  }
  .sniper-mode-hint {
    width: 100%;
    margin-left: 52px;
    margin-top: -4px;
  }
}

/* 控制列 */
.sniper-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* 反轉策略按鈕 */
.sniper-invert-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid rgba(100,116,139,0.3);
  background: rgba(51,65,85,0.4);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.sniper-invert-btn:hover {
  background: rgba(51,65,85,0.6);
  color: #cbd5e1;
}
.sniper-invert-btn.active {
  background: rgba(245,158,11,0.15);
  border-color: rgba(245,158,11,0.4);
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245,158,11,0.15);
}
.sniper-invert-icon {
  display: inline-block;
  transition: transform 0.4s ease;
}
.sniper-invert-btn.active .sniper-invert-icon {
  transform: rotate(180deg);
}

.sniper-last-update {
  font-size: 0.7rem;
  color: #666;
  margin-left: auto;
}

/* 狙擊卡片 Grid */
.sniper-cards {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ===== 統一條列式行 (Sniper + Launchpad) ===== */
.sniper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(30, 30, 36, 0.6);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.sniper-row:hover {
  border-color: rgba(245,158,11,0.3);
  background: rgba(30, 30, 36, 0.9);
}
.launch-row:hover {
  border-color: rgba(56,189,248,0.3);
}

/* 左側：名稱 + 代碼 + Badge */
.sniper-row-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}
.sniper-row-name {
  font-weight: 700;
  color: #e2e8f0;
  font-size: 0.84rem;
  white-space: nowrap;
}
.sniper-row-code {
  font-size: 0.7rem;
  color: #d97706;
  font-family: 'Inter', monospace;
}
.launch-row .sniper-row-code {
  color: #38bdf8;
}
.sniper-row-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sniper-badge-grade {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
}
.sniper-badge-v2 {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  color: #c084fc;
  background: rgba(192,132,252,0.15);
  border: 1px solid rgba(192,132,252,0.3);
}

/* 右側：指標群 */
.sniper-row-metrics {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}
.sniper-row-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 52px;
}
.sniper-row-metric-label {
  font-size: 0.58rem;
  color: #475569;
}
.sniper-row-metric-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  font-family: 'Inter', monospace;
}
.sniper-score-val {
  color: #fbbf24;
  font-weight: 800;
}
.launch-score-accent {
  color: #38bdf8;
  font-weight: 800;
}
.launch-score-accent.grade-s {
  color: #ef4444;
}

/* V2 行高亮 */
.sniper-row.v2-row {
  border: 1px solid rgba(192,132,252,0.35);
  background: linear-gradient(145deg, rgba(30,30,36,0.8) 0%, rgba(15,23,42,0.95) 100%);
}
.sniper-row.v2-row:hover {
  border-color: rgba(192,132,252,0.6);
}

/* 守望中行 */
.sniper-row.watching-row {
  border-color: rgba(245,158,11,0.25);
  background: rgba(30,30,36,0.75);
}

/* S 級高亮 */
.sniper-row.grade-s {
  border-color: rgba(239,68,68,0.35);
}
.sniper-row.grade-s:hover {
  border-color: rgba(239,68,68,0.6);
}

/* 力道迷你進度條 */
.launch-thrust-mini {
  width: 48px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}
.launch-thrust-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.grade-s .launch-thrust-mini-fill {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

/* 顏色工具 */
.sniper-stat-pos { color: #ef4444; }
.sniper-stat-neg { color: #22c55e; }
.sniper-stat-vol { color: #818cf8; }

/* 空狀態 */
.sniper-empty {
  text-align: center;
  color: #64748b;
  padding: 24px;
  font-size: 0.82rem;
}
.sniper-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

/* RWD 響應式 */
@media (max-width: 768px) {
  .sniper-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 12px;
  }
  .sniper-row-metrics {
    justify-content: space-between;
  }
  .sniper-row-metric {
    align-items: center;
    min-width: 0;
  }
  .sniper-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .sniper-last-update {
    margin-left: 0;
    text-align: center;
  }
}

/* (V2 卡片樣式已由 .sniper-row.v2-row 取代) */

/* ═══════════════════════════════════════════════════════════ */
/* 🔀 Radar Tab 切換                                          */
/* ═══════════════════════════════════════════════════════════ */

.radar-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  margin-bottom: 14px;
}

.radar-tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.radar-tab:hover {
  color: #94a3b8;
  background: rgba(255,255,255,0.04);
}
.radar-tab.active[data-tab="sniper"] {
  color: #fbbf24;
  background: linear-gradient(135deg, rgba(217,119,6,0.2), rgba(245,158,11,0.12));
  box-shadow: 0 0 10px rgba(245,158,11,0.15);
}
.radar-tab.active[data-tab="launchpad"] {
  color: #fb923c;
  background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(251,146,60,0.15));
  box-shadow: 0 0 10px rgba(251,146,60,0.2);
}
.radar-tab.active[data-tab="sniperV3"] {
  color: #38bdf8;
  background: linear-gradient(135deg, rgba(56,189,248,0.18), rgba(99,102,241,0.15));
  box-shadow: 0 0 10px rgba(56,189,248,0.2);
}

.radar-panel { animation: radarFadeIn 0.3s ease; }

/* ═══════════════════════════════════════════════════════════ */
/* 📡 V3 共振雷達                                              */
/* ═══════════════════════════════════════════════════════════ */

.v3-subtitle {
  font-size: 0.76rem;
  color: #38bdf8;
  font-weight: 600;
}

/* 摘要統計列 */
.v3-summary { margin-bottom: 12px; }
.v3-stat-bar {
  display: flex;
  gap: 6px;
  padding: 3px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
}
.v3-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  border-radius: 6px;
  background: rgba(15,23,42,0.4);
}
.v3-stat-item.v3-stat-highlight {
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.2);
}
.v3-stat-label {
  font-size: 0.62rem;
  color: #64748b;
  margin-bottom: 2px;
}
.v3-stat-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: #e2e8f0;
  font-family: 'Inter', monospace;
}
.v3-stat-highlight .v3-stat-value {
  color: #38bdf8;
}
.v3-stat-value small {
  font-size: 0.58rem;
  color: #64748b;
  font-weight: 400;
}

/* 緊湊條列式清單 */
.v3-hit-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.v3-hit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(30, 30, 36, 0.6);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.v3-hit-row:hover {
  border-color: rgba(56,189,248,0.3);
  background: rgba(30, 30, 36, 0.9);
}
.v3-hit-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}
.v3-hit-name {
  font-weight: 700;
  color: #e2e8f0;
  font-size: 0.84rem;
  white-space: nowrap;
}
.v3-hit-code {
  font-size: 0.7rem;
  color: #38bdf8;
  font-family: 'Inter', monospace;
}
.v3-hit-cat {
  font-size: 0.62rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-hit-metrics {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}
.v3-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 60px;
}
.v3-metric-label {
  font-size: 0.58rem;
  color: #475569;
}
.v3-metric-value {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  font-family: 'Inter', monospace;
}
.v3-hot { color: #ef4444 !important; }
.v3-cold { color: #22c55e !important; }

/* V3 RWD */
@media (max-width: 768px) {
  .v3-hit-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .v3-hit-metrics {
    justify-content: space-between;
  }
  .v3-metric {
    align-items: center;
    min-width: 0;
  }
}
@keyframes radarFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════ */
/* 🚀 Launchpad 發動雷達站卡片                                  */
/* ═══════════════════════════════════════════════════════════ */

.launchpad-subtitle {
  font-size: 0.76rem;
  color: #fb923c;
  font-weight: 600;
}

/* (Launchpad 卡片樣式、推力條已由 .sniper-row.launch-row + .launch-thrust-mini 取代) */

/* ═══════════════════════════════════════════════════════════ */
/* 🔍 Sniper 滾動追蹤 — trigger_status 守望與今日標記            */
/* ═══════════════════════════════════════════════════════════ */

.sniper-trigger-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.56rem;
  font-weight: 700;
  margin-right: 4px;
}
.sniper-trigger-badge.today {
  color: #fbbf24;
  background: rgba(251,191,36,0.15);
  border: 1px solid rgba(251,191,36,0.3);
}
.sniper-trigger-badge.watching {
  color: #38bdf8;
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.25);
  animation: watchingPulse 2.5s ease-in-out infinite;
}
@keyframes watchingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* (watching-card 已由 .sniper-row.watching-row 取代) */

.sniper-trigger-date {
  font-size: 0.56rem;
  color: #64748b;
  font-family: 'Inter', monospace;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(100,116,139,0.1);
}

/* ── Discovery List Mobile Layout ── */
@media (max-width: 480px) {
  .disc-card {
    padding: 10px;
  }
  .disc-card-header {
    flex-wrap: wrap;
  }
  .disc-id {
    flex: 1 1 100%;
    flex-wrap: wrap;
    margin: 0;
  }
  .disc-code {
    font-size: 1.15rem;
  }
  .disc-name {
    font-size: 0.95rem;
  }
  .disc-rank-info {
    margin-left: auto;
  }
  .disc-metrics {
    gap: 6px;
  }
  .disc-card-footer {
    flex-wrap: wrap;
    justify-content: space-between;
  }
}
