/* OptionPulse 专业暗黑金融终端样式 */
:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #101522;
  --bg-card: #151b2d;
  --bg-hover: #1c243c;
  --border-color: #222b45;
  --border-highlight: #2f3b5e;
  
  --text-primary: #f0f3fa;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --call-color: #10b981;
  --call-bg: rgba(16, 185, 129, 0.08);
  --call-border: rgba(16, 185, 129, 0.25);
  
  --put-color: #ef4444;
  --put-bg: rgba(239, 68, 68, 0.08);
  --put-border: rgba(239, 68, 68, 0.25);
  
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.2);
  --cyan: #06b6d4;
  --purple: #a855f7;
  --orange: #f97316;
  
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 16px 20px;
}

/* 顶部导航栏 */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

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

.logo-badge {
  font-size: 20px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.35);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text .tag {
  font-size: 11px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.brand-text .subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

/* 标的切换 */
.underlying-selector {
  display: flex;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.underlying-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.underlying-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.underlying-btn .code-pill {
  font-size: 10px;
  opacity: 0.75;
  font-family: var(--font-mono);
}

/* 控制按钮 */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  color: var(--call-color);
  font-weight: 600;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--call-color);
  box-shadow: 0 0 8px var(--call-color);
  animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-refresh:hover {
  background: var(--bg-hover);
  border-color: var(--border-highlight);
}

.btn-external {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: #60a5fa;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-external:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.vlab-icon {
  font-size: 13px;
}

/* 宏观指标卡片 Banner */
.macro-banner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.spot-card, .metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
}

.spot-card {
  background: linear-gradient(135deg, #101522 0%, #151b2d 100%);
  border-left: 3px solid #2563eb;
}

.spot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.spot-name {
  font-weight: 600;
  font-size: 13px;
}

.spot-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.spot-body {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.spot-price {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.spot-change {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.spot-change.up {
  color: var(--call-color);
  background: rgba(16, 185, 129, 0.15);
}

.spot-change.down {
  color: var(--put-color);
  background: rgba(239, 68, 68, 0.15);
}

.spot-footer {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.spot-footer b {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 2px;
}

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

.text-gold { color: var(--gold); }
.text-cyan { color: var(--cyan); }
.text-purple { color: var(--purple); }
.text-orange { color: var(--orange); }
.text-green { color: var(--call-color); }

/* 月份切换栏 */
.month-tabs-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.month-tabs {
  display: flex;
  gap: 6px;
}

.month-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.month-tab:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.month-tab.active {
  background: var(--bg-card);
  border-color: var(--border-highlight);
  color: var(--gold);
  font-weight: 700;
  box-shadow: 0 0 10px var(--gold-glow);
}

.table-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.atm-color { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.itm-color { background: rgba(59, 130, 246, 0.4); }
.otm-color { background: rgba(100, 116, 139, 0.2); }

/* 平值陷阱与时间价值雷达 */
.radar-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-hint {
  font-size: 12px;
  color: var(--gold);
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.radar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  transition: all 0.2s;
  position: relative;
}

.radar-card.is-atm-card {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(21, 27, 45, 1) 100%);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.12);
}

.radar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.radar-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-atm {
  background: #f59e0b;
  color: #000;
}

.badge-otm {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}

.badge-recom {
  background: var(--call-color);
  color: #000;
}

.radar-strike {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
}

.radar-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  min-height: 28px;
}

.radar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 11px;
}

.radar-stat-item {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
}

/* T 型报价矩阵 */
.t-quote-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.t-quote-header {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.t-title-call {
  color: var(--call-color);
  text-align: left;
  padding-left: 8px;
}

.t-title-strike {
  color: var(--gold);
}

.t-title-put {
  color: var(--put-color);
  text-align: right;
  padding-right: 8px;
}

.t-table-container {
  overflow-x: auto;
  max-height: 580px;
}

.t-quote-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
}

.t-quote-table th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.t-quote-table th.th-strike {
  text-align: center;
  background: #182035;
  color: var(--gold);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.t-quote-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(34, 43, 69, 0.6);
  white-space: nowrap;
  transition: background 0.15s;
}

.t-quote-table tr:hover td {
  background: var(--bg-hover) !important;
  cursor: pointer;
}

/* Call 侧单元格 */
.td-call-last { font-weight: 700; color: var(--text-primary); }
.td-call-extrinsic { color: var(--gold); }
.td-call-yield { color: #38bdf8; font-weight: 600; }

/* 中间行权价单元格 */
.td-strike {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text-primary);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  position: relative;
}

/* Put 侧单元格 */
.td-put-yield { color: #38bdf8; font-weight: 600; }
.td-put-extrinsic { color: var(--gold); }
.td-put-last { font-weight: 700; color: var(--text-primary); }

/* 平值行特效 (ATM Row) */
.t-quote-table tr.row-atm td {
  background: rgba(245, 158, 11, 0.08);
}

.t-quote-table tr.row-atm .td-strike {
  background: #f59e0b;
  color: #000;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* 实值行着色 (ITM) */
.itm-call { background: rgba(16, 185, 129, 0.04); }
.itm-put { background: rgba(239, 68, 68, 0.04); }

/* 底部双板块 */
.bottom-split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.screener-card, .simulator-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
}

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

.card-title {
  font-size: 13px;
  font-weight: 700;
}

.card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.screener-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  background: var(--bg-card);
  padding: 3px;
  border-radius: 6px;
}

.screener-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.screener-tab.active {
  background: var(--bg-secondary);
  color: var(--gold);
}

.screener-content { display: none; }
.screener-content.active { display: block; }

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.rec-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-highlight);
}

.rec-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rec-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
}

.rec-type-call { background: var(--call-color); color: #000; }
.rec-type-put { background: var(--put-color); color: #fff; }

.rec-name {
  font-size: 12px;
  font-weight: 600;
}

.rec-details {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* 模拟器 Canvas */
.canvas-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}

#pnlCanvas {
  display: block;
  width: 100%;
  height: auto;
}

.sim-stats {
  display: flex;
  justify-content: space-around;
  font-size: 11px;
  background: var(--bg-card);
  padding: 8px;
  border-radius: 6px;
}

.sim-stats b {
  font-family: var(--font-mono);
  color: var(--gold);
}

/* 页脚 */
.app-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

/* 响应式调整 */
@media (max-width: 1024px) {
  .macro-banner {
    grid-template-columns: 1fr 1fr;
  }
  .radar-grid {
    grid-template-columns: 1fr 1fr;
  }
  .bottom-split-section {
    grid-template-columns: 1fr;
  }
}
