/* ===== 基本面分析引擎 - 分组评分卡片样式 ===== */
/* 与现有亮色主题风格统一：圆角、卡片、红涨绿跌、工业金融风 */

.fundamental-engine {
  width: 100%;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.6;
}

/* ===== 综合评分卡 ===== */
.fe-score-card {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
  align-items: center;
}

.fe-score-left {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.fe-score-num {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-family: var(--font-d);
}
.fe-score-num.bull { color: var(--red); }
.fe-score-num.bear { color: var(--green); }
.fe-score-num.neutral { color: var(--cx); }

.fe-score-unit {
  font-size: 16px;
  font-weight: 500;
  margin-left: 2px;
  opacity: 0.6;
}

.fe-score-label {
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
}
.fe-score-label.bull { color: var(--red); }
.fe-score-label.bear { color: var(--green); }
.fe-score-label.neutral { color: var(--cx); }

.fe-resonance {
  font-size: 12px;
  color: var(--ink-dim);
  margin-top: 2px;
  font-weight: 500;
}

.fe-score-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fe-score-bar {
  position: relative;
  height: 28px;
}

.fe-bar-bg {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(to right, var(--green-bg), var(--amber-bg), var(--red-bg));
  border-radius: 999px;
  opacity: 0.6;
}

.fe-bar-fill {
  position: absolute;
  top: 6px;
  left: 0;
  height: 16px;
  border-radius: 999px;
  transition: width 0.6s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.fe-bar-mid {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 2px;
  height: 20px;
  background: var(--ink-dim);
  opacity: 0.4;
  border-radius: 2px;
  transform: translateX(-50%);
}

.fe-bar-labels {
  position: absolute;
  bottom: -4px;
  left: -4px;
  right: -4px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-dim);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* 组指示灯 */
.fe-group-dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grp-dot {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  transition: all 0.2s ease;
}

.grp-dot.dot-bull {
  color: var(--red);
  background: var(--red-bg);
  border-color: rgba(248,113,113,0.3);
}

.grp-dot.dot-bear {
  color: var(--green);
  background: var(--green-bg);
  border-color: rgba(52,211,153,0.3);
}

.grp-dot.dot-neutral {
  color: var(--cx);
  background: var(--amber-bg);
  border-color: rgba(251,191,36,0.3);
}

/* ===== 大白话 ===== */
.fe-plain {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.fe-plain-one {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.5;
}

.fe-plain-detail {
  font-size: 12.5px;
  color: var(--ink-dim);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fe-plain-detail b {
  color: var(--ink);
  font-weight: 600;
}

/* ===== 分组卡片网格 ===== */
.fe-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.fund-group-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.fund-group-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cx);
}

.fund-group-card.bull::before { background: var(--red); }
.fund-group-card.bear::before { background: var(--green); }
.fund-group-card.neutral::before { background: var(--cx); }

.fg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.fg-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.fg-dir {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.fg-dir.bull { color: var(--red); background: var(--red-bg); }
.fg-dir.bear { color: var(--green); background: var(--green-bg); }
.fg-dir.neutral { color: var(--cx); background: var(--amber-bg); }

.fg-score {
  font-size: 12px;
  color: var(--ink-dim);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.fg-score b.bull { color: var(--red); }
.fg-score b.bear { color: var(--green); }
.fg-score b.neutral { color: var(--cx); }

/* 因子行 */
.fg-indicators {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ind-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.ind-name {
  flex: 1;
  color: var(--ink);
  font-weight: 500;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ind-val {
  flex: 0 0 auto;
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ind-dir {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.ind-dir.bull { color: var(--red); background: var(--red-bg); }
.ind-dir.bear { color: var(--green); background: var(--green-bg); }
.ind-dir.neutral { color: var(--cx); background: var(--amber-bg); }

.ind-core {
  color: var(--amber);
  font-size: 11px;
  margin-left: 3px;
  vertical-align: middle;
}

.ind-item {
  margin-bottom: 2px;
}

.fg-indicators .ind-hidden {
  display: none !important;
}

.fund-group-card.expanded .fg-indicators .ind-hidden {
  display: block !important;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ind-exp {
  font-size: 11.5px;
  color: var(--ink-dim);
  line-height: 1.4;
  padding-left: 2px;
  margin-bottom: 8px;
  opacity: 0.85;
}

.fg-more {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--ink-dim);
  text-align: center;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.fg-more:hover {
  color: var(--blue);
}

.expand-hint {
  color: var(--blue);
  font-weight: 500;
}

/* ===== 响应式 ===== */
@media (max-width: 760px) {
  .fe-score-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .fe-score-left {
    min-width: auto;
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }

  .fe-score-num {
    font-size: 36px;
  }

  .fe-groups-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .fe-groups-grid {
    grid-template-columns: 1fr;
  }
}
