@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-main: #0B0F19;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-card-active: rgba(127, 29, 29, 0.35);
  --border-glow: rgba(255, 255, 255, 0.12);
  --border-active: rgba(239, 68, 68, 0.5);
  
  --text-main: #F9FAFB;
  --text-muted: #D1D5DB;
  --text-dim: #9CA3AF;
  
  --yellow-price: #F59E0B;
  --green-vwap: #10B981;
  --pink-volume: #EC4899;
  
  --bear-red: #EF4444;
  --bear-dark: #DC2626;
  --bear-glow: rgba(239, 68, 68, 0.35);
  --accent-purple: #8B5CF6;
  --accent-blue: #3B82F6;
  
  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-blur: blur(16px);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --shadow-glow-red: 0 0 25px rgba(239, 68, 68, 0.35);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 16px; /* 提高基礎字級 */
  background-image: 
    radial-gradient(circle at 20% 15%, rgba(239, 68, 68, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 40%);
}

/* Header Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
  padding: 1.25rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #EF4444, #F59E0B);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: #FFF;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.brand-text h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  background: linear-gradient(to right, #F9FAFB, #EF4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.nav-tags {
  display: flex;
  gap: 0.6rem;
}

.tag {
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--border-glow);
  background: rgba(255, 255, 255, 0.05);
}

.tag.red { color: #FF6B6B; border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.18); }
.tag.yellow { color: #FBBF24; border-color: rgba(245, 158, 11, 0.4); }
.tag.green { color: #34D399; border-color: rgba(16, 185, 129, 0.4); }
.tag.pink { color: #F472B6; border-color: rgba(236, 72, 153, 0.4); }

/* Main Container */
.container {
  max-width: 1450px;
  margin: 0 auto;
  padding: 2rem;
}

/* Hero Banner */
.hero-banner {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-glow-red);
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #EF4444, #F59E0B, #DC2626);
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.35rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: #FFF;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.65;
  max-width: 950px;
  margin-bottom: 1.75rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 1.1rem;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--bear-red);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 盤中當沖放空即時決策導航儀 Section (字體顯著放大與高對比呈現) */
.nav-decision-section {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
}

.nav-dec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glow);
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.nav-dec-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--yellow-price);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.decision-flow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 992px) {
  .decision-flow-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .decision-flow-grid {
    grid-template-columns: 1fr;
  }
}

.flow-step-card {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.flow-step-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 4px;
  background: var(--bear-red);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.flow-step-card.s1::before { background: var(--yellow-price); }
.flow-step-card.s2::before { background: var(--bear-red); }
.flow-step-card.s3::before { background: #EC4899; }
.flow-step-card.s4::before { background: var(--green-vwap); }

.flow-step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: #9CA3AF;
  margin-bottom: 0.35rem;
  letter-spacing: 0.5px;
}

.flow-step-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: #FFFFFF;
}

.flow-step-desc {
  font-size: 1.05rem; /* 字級大幅提升 1.05rem */
  color: #F3F4F6;    /* 高亮極白色彩 */
  line-height: 1.6;
}

.flow-step-desc strong {
  color: #FCD34D;
  font-weight: 700;
}

/* 盤中即時乖離率極速對照計算工具 (大幅提升輸入與數值字體) */
.quick-bias-calc-box {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.75rem;
  align-items: center;
}

@media (max-width: 768px) {
  .quick-bias-calc-box {
    grid-template-columns: 1fr;
  }
}

.bias-input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.step-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #E5E7EB;
  margin-bottom: 0.5rem;
}

.select-input, .number-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.65);
  border: 1.5px solid var(--border-glow);
  color: #FFFFFF;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1.15rem; /* 大幅提升數值輸入框字體 */
  font-weight: 700;
  outline: none;
  transition: border 0.2s;
}

.select-input:focus, .number-input:focus {
  border-color: var(--bear-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.bias-live-result {
  background: rgba(0, 0, 0, 0.7);
  border: 1.5px solid var(--bear-red);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.bias-live-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.4rem; /* 2.4rem 超大顯眼數值 */
  font-weight: 800;
  color: var(--yellow-price);
}

.bias-live-hint {
  font-size: 1.1rem; /* 1.1rem 大字體提示 */
  font-weight: 700;
  color: #F9FAFB;
  margin-top: 0.4rem;
  line-height: 1.5;
}

/* 5 大放空型態量化速查對比矩陣 (Matrix Comparison Table) */
.matrix-section {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-glow);
  padding-bottom: 0.85rem;
}

.matrix-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--yellow-price);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.matrix-badge-pill {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #FF6B6B;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

.matrix-table-wrapper {
  margin-top: 1.25rem;
}

.table-scroll-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glow);
  background: rgba(6, 9, 17, 0.6);
}

.table-scroll-container::-webkit-scrollbar {
  height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
}

.table-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.4);
  border-radius: 4px;
}

.quant-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}

.quant-matrix-table th {
  background: rgba(15, 23, 42, 0.95);
  color: #F3F4F6;
  font-weight: 700;
  padding: 0.9rem 1.1rem;
  border-bottom: 2px solid var(--bear-red);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.quant-matrix-table td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-glow);
  color: #E5E7EB;
  vertical-align: middle;
  line-height: 1.5;
}

.matrix-row {
  cursor: pointer;
  transition: all 0.2s ease;
}

.matrix-row:hover {
  background: rgba(239, 68, 68, 0.14) !important;
}

.matrix-row.active {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.25), rgba(127, 29, 29, 0.12));
}

.matrix-row.active td:first-child {
  border-left: 4px solid var(--bear-red);
}

.m-pat-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: #FFFFFF;
  white-space: nowrap;
}

.m-pat-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #FF6B6B;
  margin-top: 3px;
  white-space: nowrap;
}

.m-count-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: #FCD34D;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

.m-bias-pos {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--yellow-price);
}

.m-bias-neg {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--bear-red);
}

.m-bias-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  display: block;
}

.m-rank-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
  white-space: nowrap;
}

.m-rank-badge.warn {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: #FBBF24;
}

/* Nav Tabs for Short Pattern Selection */
.tabs-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
  margin-bottom: 2rem;
  width: 100%;
}

@media (max-width: 1100px) {
  .tabs-container {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  color: var(--text-muted);
  padding: 0.8rem 0.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  text-align: center;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  box-sizing: border-box;
}

.tab-btn div {
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.tab-btn div:first-child {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

.tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: rgba(239, 68, 68, 0.4);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(127, 29, 29, 0.7));
  color: #FFF;
  border-color: var(--bear-red);
  box-shadow: var(--shadow-glow-red);
}

.tab-tag-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  white-space: nowrap !important;
}

/* Pattern Detail Layout (Grid 2 Column) */
.pattern-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: stretch; /* 確保左右兩側外框高度 100% 齊平 */
}

@media (max-width: 992px) {
  .pattern-layout {
    grid-template-columns: 1fr;
  }
}

/* SVG Chart Box */
.chart-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  height: 100%; /* 確保與右側等高 */
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.chart-disclaimer {
  font-size: 0.85rem;
  color: #9CA3AF;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.chart-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge {
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
}

.badge.bear { background: rgba(239, 68, 68, 0.25); color: #FF6B6B; border: 1px solid var(--bear-red); }

.svg-canvas-wrapper {
  width: 100%;
  height: 380px;
  background: radial-gradient(circle at 50% 30%, #0D1322 0%, #050811 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 8px 24px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

svg.chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  display: flex;
  gap: 1.75rem;
  margin-top: 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-line {
  width: 20px;
  height: 4px;
  border-radius: 2px;
}

/* Strategy Rules Card (細節手冊字級放大) */
.rules-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100%; /* 確保與左側等高 */
}

.rule-group {
  background: rgba(0, 0, 0, 0.4);
  border-left: 5px solid var(--green-vwap);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.1rem;
}

.rule-group.short { border-left-color: var(--green-vwap); }
.rule-group.stop { border-left-color: var(--yellow-price); }
.rule-group.profit { border-left-color: var(--bear-red); }

/* 左側走勢圖下方雙欄停損停利卡片網格 (自動貼底對齊) */
.chart-trade-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  margin-top: auto; /* 核心：自動頂至底部，與右欄底線完全水平齊平 */
  padding-top: 1.25rem;
}

@media (max-width: 680px) {
  .chart-trade-actions-grid {
    grid-template-columns: 1fr;
  }
}

.chart-trade-actions-grid .rule-group {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: rgba(13, 19, 34, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chart-trade-actions-grid .rule-group:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.chart-trade-actions-grid .rule-group.stop {
  border-left: 4px solid var(--yellow-price);
}

.chart-trade-actions-grid .rule-group.profit {
  border-left: 4px solid var(--bear-red);
}

.rule-group-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rule-list {
  list-style: none;
  font-size: 1.05rem; /* 字級大幅放大至 1.05rem */
  color: #F3F4F6;
  line-height: 1.6;
}

.rule-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.4rem;
}

.rule-list li::before {
  content: '🔻';
  position: absolute;
  left: 0;
  font-size: 0.8rem;
}

/* Bias Statistics Dashboard Card (乖離率指標卡片字體放大) */
.bias-stats-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  margin-top: 0.5rem;
}

.bias-header {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--yellow-price);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bias-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.bias-metric-item {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.bias-metric-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.35rem; /* 大字體刻度 */
  font-weight: 800;
}

.bias-metric-val.pos { color: var(--yellow-price); }
.bias-metric-val.neg { color: #FF6B6B; }

.bias-metric-lbl {
  font-size: 0.88rem;
  color: #D1D5DB;
  margin-top: 0.2rem;
  font-weight: 600;
}

.bias-interpretation {
  font-size: 1.02rem;
  color: #F3F4F6;
  line-height: 1.55;
  border-top: 1px dashed var(--border-glow);
  padding-top: 0.75rem;
}

/* Real Cases Gallery Section */
.real-cases-section {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
}

.cases-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glow);
  padding-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.cases-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cases-header {
  transition: all 0.25s ease;
  padding: 0.75rem 1rem;
  margin: -0.75rem -1rem 1rem -1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.cases-header:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(245, 158, 11, 0.35);
}

.gallery-toggle-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.3));
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #FBBF24;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.gallery-toggle-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(239, 68, 68, 0.5));
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
  color: #FFF;
  transform: translateY(-1px);
}

.gallery-toggle-btn.expanded {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10B981;
  color: #10B981;
}

/* 圖庫工具列 (年份篩選與搜尋) */
.cases-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #E5E7EB;
  white-space: nowrap;
}

.year-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.year-chip {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glow);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.year-chip:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
  color: #FFF;
}

.year-chip.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(127, 29, 29, 0.7));
  border-color: var(--bear-red);
  color: #FFF;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.cases-search-box {
  flex-grow: 1;
  max-width: 320px;
}

@media (max-width: 768px) {
  .cases-search-box {
    max-width: 100%;
    width: 100%;
  }
}

.cases-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-glow);
  color: #FFFFFF;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.cases-search-input:focus {
  border-color: var(--bear-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem;
  margin-bottom: 1.5rem;
}

.case-card {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.case-card:hover {
  transform: translateY(-5px);
  border-color: var(--bear-red);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.35);
}

.case-img-wrapper {
  width: 100%;
  height: 250px;
  background: #000;
  position: relative;
  overflow: hidden;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.case-card:hover .case-img {
  transform: scale(1.03);
}

.case-info {
  padding: 1rem 1.1rem;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--border-glow);
}

.case-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.98rem;
  color: #FF6B6B;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.case-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 載入更多走勢圖按鈕 */
.load-more-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0 2rem 0;
}

.load-more-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(245, 158, 11, 0.25));
  border: 1.5px solid var(--bear-red);
  color: #FFFFFF;
  padding: 0.85rem 2.2rem;
  border-radius: 30px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.25s ease;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.25);
}

.load-more-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.45), rgba(245, 158, 11, 0.45));
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
}

.load-more-remaining {
  font-size: 0.85rem;
  color: #FCD34D;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

/* Image Modal Lightbox */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 92vh;
  background: var(--bg-card);
  border: 1.5px solid var(--bear-red);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem 0.65rem 1.25rem;
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.4);
  position: relative;
  box-sizing: border-box;
}

.modal-img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  max-height: 72vh;
  max-width: 84vw;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  background: #000;
  box-sizing: border-box;
}

.modal-img {
  max-width: 84vw;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
  transition: transform 0.15s ease-out;
  transform-origin: center center;
  user-select: none;
}

.modal-footer-bar {
  flex-shrink: 0;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.modal-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #FCD34D;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.25rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.modal-caption {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(239, 68, 68, 0.3);
  border: 1.5px solid var(--bear-red);
  color: #FFF;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.6);
  transform: scale(1.08);
}

/* 燈箱左右浮動切換按鈕 */
.modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
  user-select: none;
}

.modal-nav-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: var(--bear-red);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.modal-nav-btn.prev {
  left: 1rem;
}

.modal-nav-btn.next {
  right: 1rem;
}

@media (max-width: 768px) {
  .modal-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  .modal-nav-btn.prev { left: 0.5rem; }
  .modal-nav-btn.next { right: 0.5rem; }
}

/* Interactive Tools Section (2 Columns) */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

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

.tool-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.tool-header {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid var(--border-glow);
  padding-bottom: 0.85rem;
}

/* Interactive Decision Tree UI */
.step-item {
  margin-bottom: 1.25rem;
}

.result-banner {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(107, 114, 128, 0.15);
  border: 1.5px solid #6B7280;
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.25s ease;
}

.result-action {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #9CA3AF;
}

.result-desc {
  font-size: 1.05rem;
  color: #F3F4F6;
  margin-top: 0.3rem;
  font-weight: 600;
}

/* Risk Calculator Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.calc-output {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

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

.calc-res-box {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.calc-res-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.65rem;
  font-weight: 800;
  color: #FF6B6B;
}

.calc-res-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Pre-Trade Checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.05rem; /* 字級大幅放大 */
  color: #F3F4F6;
  cursor: pointer;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  font-weight: 500;
}

.check-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.check-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--bear-red);
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem;
  font-size: 0.95rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-glow);
}

/* 右下角全功能浮動快捷導航列 */
.floating-nav {
  position: fixed;
  right: 1.5rem;
  bottom: 2rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  border-radius: 30px;
  padding: 0.55rem 0.4rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.25);
  transition: all 0.3s ease;
}

.floating-nav-btn {
  background: transparent;
  border: none;
  color: #D1D5DB;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  outline: none;
}

.nav-btn-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.nav-btn-text {
  font-size: 0.62rem;
  font-weight: 700;
  margin-top: 2px;
  color: #9CA3AF;
  line-height: 1;
}

.floating-nav-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #FFF;
  transform: scale(1.1);
}

.floating-nav-btn:hover .nav-btn-text {
  color: #FCD34D;
}

.floating-nav-btn.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.45), rgba(127, 29, 29, 0.85));
  border: 1px solid var(--bear-red);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.floating-nav-btn.active .nav-btn-text {
  color: #FFF;
  font-weight: 800;
}

.floating-nav-btn.top-btn {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  margin-top: 0.2rem;
  padding-top: 0.2rem;
}

.floating-nav-btn.top-btn:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #F59E0B;
}

@media (max-width: 768px) {
  .floating-nav {
    right: 0.6rem;
    bottom: 1rem;
    padding: 0.35rem 0.25rem;
    transform: scale(0.88);
    transform-origin: bottom right;
  }
  .floating-nav-btn {
    width: 38px;
    height: 38px;
  }
}

/* 💡 免責聲明與風險提示 (低調自然版) */
.disclaimer-subtle {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.disclaimer-subtle p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}

.disclaimer-subtle p strong {
  color: #D1D5DB;
  font-weight: 600;
}

/* ==========================================================================
   ✨ 模組二 (盤感盲測訓練) 與 模組四 (動態走勢動畫與視覺體驗) 樣式
   ========================================================================== */

/* 🌙 OLED 純黑高對比看盤主題 */
body.theme-oled {
  --bg-main: #000000;
  --bg-card: rgba(8, 8, 12, 0.94);
  --bg-card-hover: rgba(18, 18, 24, 0.96);
  --glass-bg: rgba(0, 0, 0, 0.94);
  --border-glow: rgba(255, 255, 255, 0.18);
  background-color: #000000;
  background-image: 
    radial-gradient(circle at 20% 15%, rgba(239, 68, 68, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.10) 0%, transparent 40%);
}

body.theme-oled .navbar {
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid rgba(239, 68, 68, 0.4);
}

body.theme-oled .hero-banner {
  background: rgba(5, 5, 8, 0.95);
}

/* 頂部導覽列功能按鈕 */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.nav-action-btn.flashcard-btn,
.nav-action-btn.quiz-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #FCA5A5;
}

.nav-action-btn.flashcard-btn:hover,
.nav-action-btn.quiz-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

.nav-action-btn.theme-btn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #FDE68A;
}

@media (max-width: 900px) {
  .nav-tags {
    display: none;
  }
}

/* 📊 SVG 走勢圖動態演繹回放工具列 */
.chart-playback-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.playback-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.playback-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* 🔴 LIVE 霓虹呼吸發光演繹按鈕 */
.playback-btn.play.neon-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.28) 0%, rgba(185, 28, 28, 0.16) 100%);
  border: 1px solid rgba(239, 68, 68, 0.7);
  color: #FEE2E2;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4), inset 0 0 8px rgba(239, 68, 68, 0.2);
  animation: neon-breathe 2.4s infinite ease-in-out;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
}

@keyframes neon-breathe {
  0%, 100% {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35), inset 0 0 5px rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.75), 0 0 35px rgba(239, 68, 68, 0.3), inset 0 0 10px rgba(239, 68, 68, 0.35);
    border-color: rgba(254, 202, 202, 0.95);
    transform: translateY(-1.5px) scale(1.02);
  }
}

.playback-btn.play.neon-live-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.45) 0%, rgba(185, 28, 28, 0.3) 100%);
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.85), 0 0 45px rgba(239, 68, 68, 0.4);
  border-color: #FCA5A5;
  transform: translateY(-2px) scale(1.04);
}

/* 🔴 LIVE 專屬迷你膠囊 */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(239, 68, 68, 0.6);
  padding: 0.12rem 0.45rem;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #FCA5A5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* 🔴 閃爍動態光點 */
.live-dot {
  width: 7px;
  height: 7px;
  background-color: #EF4444;
  border-radius: 50%;
  box-shadow: 0 0 8px #EF4444;
  animation: live-blink 1.2s infinite ease-in-out;
  display: inline-block;
}

@keyframes live-blink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px #EF4444;
  }
  50% {
    opacity: 0.3;
    transform: scale(0.75);
    box-shadow: 0 0 2px #EF4444;
  }
}

/* 🟢 演繹播放中狀態 */
.playback-btn.play.neon-live-btn.playing {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28) 0%, rgba(4, 120, 87, 0.16) 100%);
  border-color: var(--green-vwap);
  color: #D1FAE5;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.55), inset 0 0 8px rgba(16, 185, 129, 0.25);
  animation: neon-playing-breathe 2s infinite ease-in-out;
}

@keyframes neon-playing-breathe {
  0%, 100% {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
    border-color: rgba(16, 185, 129, 0.6);
  }
  50% {
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.8), 0 0 35px rgba(16, 185, 129, 0.35);
    border-color: rgba(167, 243, 208, 0.95);
  }
}

.playback-btn.play.neon-live-btn.playing .live-pill {
  border-color: rgba(16, 185, 129, 0.7);
  color: #A7F3D0;
}

.playback-btn.play.neon-live-btn.playing .live-dot {
  background-color: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.playback-time-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--yellow-price);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  letter-spacing: 0.5px;
}

/* 📜 圖庫卡片工具 (⭐ 收藏按鈕 + ⚖️ 對比勾選) */
.case-card {
  position: relative;
}

.case-card-tools {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.4rem;
  z-index: 10;
}

.case-fav-btn {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #9CA3AF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.case-fav-btn:hover {
  background: rgba(245, 158, 11, 0.3);
  color: #F59E0B;
  transform: scale(1.15);
}

.case-fav-btn.active {
  background: rgba(245, 158, 11, 0.4);
  border-color: #F59E0B;
  color: #F59E0B;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.case-compare-chk {
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #9CA3AF;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.case-compare-chk.active {
  background: rgba(239, 68, 68, 0.35);
  border-color: var(--bear-red);
  color: #FCA5A5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.year-chip.fav-chip {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #FDE68A;
}

.year-chip.fav-chip.active {
  background: #F59E0B;
  color: #000;
  font-weight: 800;
}

/* 雙圖對照懸浮工具列 */
.compare-floating-bar {
  position: sticky;
  top: 80px;
  z-index: 90;
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.95));
  border: 1px solid var(--bear-red);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease;
}

.compare-bar-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compare-action-btn {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFF;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
}

.compare-action-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6);
}

.compare-clear-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-dim);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
}

.compare-clear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
}

/* 🎲 1,168 張走勢圖・隨機抽卡覆盤儀 (Trading Flashcards) Modal - 一屏全覽零滾輪 */
.flashcard-modal-content {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-lg);
  max-width: 1040px;
  width: 95%;
  max-height: 92vh;
  overflow: hidden;
  padding: 1.25rem 1.75rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 35px rgba(239, 68, 68, 0.3);
  box-sizing: border-box;
}

@media (max-width: 860px) {
  .flashcard-modal-content {
    overflow-y: auto;
    max-height: 90vh;
  }
}

.flashcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.75rem;
  padding-right: 3.8rem;
  margin-bottom: 0.85rem;
}

.flashcard-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FEE2E2;
}

.flashcard-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.flashcard-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flashcard-stat-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-sm);
}

.fc-lbl {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.fc-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 800;
  color: #F59E0B;
}

.flashcard-next-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(185, 28, 28, 0.5));
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #FEE2E2;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.flashcard-next-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.5), rgba(185, 28, 28, 0.7));
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.5);
}

.flashcard-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

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

.flashcard-img-pane {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flashcard-img-wrapper {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  max-height: 420px;
}

.flashcard-img {
  width: 100%;
  max-height: 420px;
  height: auto;
  object-fit: contain;
  display: block;
}

.flashcard-img-tools {
  display: flex;
  gap: 0.5rem;
}

.fc-tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glow);
  color: var(--text-main);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fc-tool-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.fc-tool-btn.fav.active {
  background: rgba(245, 158, 11, 0.3);
  border-color: #F59E0B;
  color: #F59E0B;
}

.flashcard-controls-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 380px;
}

.flashcard-prompt-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
}

.fc-prompt-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #FCD34D;
  margin-bottom: 0.5rem;
}

.fc-prompt-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: #E2E8F0;
  line-height: 1.45;
  padding-left: 0;
  margin: 0;
}

.fc-reveal-action-box {
  margin-top: auto;
}

.fc-reveal-btn {
  width: 100%;
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
  color: #FFFFFF;
  border: 1px solid rgba(248, 113, 113, 0.6);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35);
}

.fc-reveal-btn:hover {
  background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
  border-color: #FCA5A5;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.55);
}

.fc-revealed-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  height: 100%;
  animation: fadeIn 0.3s ease;
}

.fc-card-section {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
}

.fc-card-section.defense {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.fc-sec-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.fc-pattern-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: #F87171;
  line-height: 1.3;
}

.fc-next-big-btn {
  width: 100%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  margin-top: 0.2rem;
}

.fc-next-big-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.6);
}
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.6);
}

/* ⚖️ 雙圖並排深度對照燈箱 */
.compare-modal-content {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-lg);
  max-width: 1200px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  position: relative;
}

.compare-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

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

.compare-pane {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.compare-pane-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--yellow-price);
}

.compare-img-box img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
}

.compare-pane-desc {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* 🔍 單圖燈箱縮放與工具列 */
.modal-zoom-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.m-zoom-btn {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.m-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.m-zoom-btn.fav.active {
  background: rgba(245, 158, 11, 0.35);
  border-color: #F59E0B;
  color: #F59E0B;
}

.modal-img-wrapper.dragging {
  cursor: grabbing;
}

