/* ============================================================
   平衡分析 Demo · 视觉升级补丁
   叠加在旧样式上，仅包含该 Demo 专属的视觉增强
   ============================================================ */

/* --- 页面头部升级 --- */
.page-header {
  position: relative;
  padding: 50px 0 36px !important;
  text-align: center;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 450px;
  height: 280px;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(167, 139, 250, 0.12), transparent 60%),
    radial-gradient(ellipse at 70% 50%, rgba(34, 211, 238, 0.08), transparent 60%);
  pointer-events: none;
}

.page-header h1 {
  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--cyan) 25%,
    var(--purple) 50%,
    var(--gold) 75%,
    var(--text-primary) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleShine 4s ease-in-out infinite;
  font-family: var(--font-display);
  font-size: 36px !important;
  position: relative;
}

.page-header p {
  position: relative;
}

/* --- 气质标签筛选栏 --- */
.temperament-filter {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.temp-filter-btn {
  padding: 4px 14px;
  font-size: 11px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: rgba(167, 139, 250, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.05em;
}

.temp-filter-btn:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.temp-filter-btn.active-nt { background: var(--nt-color-bg); border-color: rgba(34, 211, 238, 0.4); color: var(--nt-color); }
.temp-filter-btn.active-nf { background: var(--nf-color-bg); border-color: rgba(244, 114, 182, 0.4); color: var(--nf-color); }
.temp-filter-btn.active-sj { background: var(--sj-color-bg); border-color: rgba(167, 139, 250, 0.4); color: var(--sj-color); }
.temp-filter-btn.active-sp { background: var(--sp-color-bg); border-color: rgba(251, 191, 36, 0.4); color: var(--sp-color); }

/* --- 统计卡片增强：数据仪表盘风格 --- */
.stat-card {
  position: relative;
  padding: 20px;
  background: rgba(20, 18, 45, 0.5);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: var(--radius-lg);
  text-align: center;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 30px rgba(167, 139, 250, 0.08);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--stat-color, var(--purple)), transparent);
  opacity: 0.6;
}

.stat-card .s-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.2;
}

.stat-card .s-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  letter-spacing: 0.05em;
}

/* --- 图表容器增强 --- */
.chart-container {
  position: relative;
  background: rgba(20, 18, 45, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 16px;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple), var(--cyan), transparent);
  opacity: 0.4;
}

.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--purple), var(--cyan));
  border-radius: 2px;
}

/* --- 表格增强：数据分析风格 --- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(167, 139, 250, 0.2);
  background: rgba(20, 18, 45, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

td {
  padding: 8px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.08);
  color: var(--text-secondary);
  transition: background 0.2s;
}

tr:hover td {
  background: rgba(167, 139, 250, 0.05);
}

.td-high { color: #34D399; font-weight: 600; }
.td-mid { color: #FBBF24; font-weight: 500; }
.td-low { color: #F87171; font-weight: 500; }
.td-blue { color: #60A5FA; font-weight: 600; }
.td-red { color: #F87171; font-weight: 600; }
.td-group { font-size: 11px; color: var(--text-muted); }

/* --- 场景卡片增强 --- */
.scenario-card {
  padding: 20px;
  background: rgba(20, 18, 45, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.scenario-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.scenario-card.blue-ocean { border-color: rgba(52, 211, 153, 0.25); }
.scenario-card.red-ocean { border-color: rgba(248, 113, 113, 0.25); }
.scenario-card.balanced { border-color: rgba(251, 191, 36, 0.25); }

.scenario-card .sc-emoji {
  font-size: 2rem;
  margin-bottom: 8px;
}

.scenario-card .sc-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.scenario-card .sc-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.scenario-card .sc-rate {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* --- 纳什均衡表格特色 --- */
.nash-section {
  position: relative;
}

.nash-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 150px;
  background: radial-gradient(ellipse, rgba(251, 191, 36, 0.08), transparent 70%);
  pointer-events: none;
}

/* --- 按钮扫光 --- */
#btn-run, #btn-run-1000 {
  position: relative;
  overflow: hidden;
}

#btn-run::after, #btn-run-1000::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  transition: left 0.5s ease;
}

#btn-run:hover::after, #btn-run-1000:hover::after {
  left: 150%;
}

/* --- 棋风组卡片增强 --- */
.temp-card {
  position: relative;
  overflow: hidden;
  background: rgba(20, 18, 45, 0.5) !important;
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid rgba(167, 139, 250, 0.18) !important;
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

.temp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
