/**
 * S0 需求研究 - 样式系统
 * 20+ 维度精细化规划展示
 */

:root {
  --color-research: #388bfd;
  --color-needs: #39d3c3;
  --color-painpoints: #f7853e;
  --color-personas: #d2a8ff;
  --color-behaviors: #3fb950;
}

.demand-container {
  max-width: 100%;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════ */
/* 1. 总体评分卡片组 */
/* ═══════════════════════════════════════════════════════════ */

.demand-header-section {
  display: flex;
  gap: 2px;
  margin-bottom: 32px;
  padding: 0 24px;
}

.demand-score-card {
  flex: 1;
  background: linear-gradient(135deg, rgba(57, 211, 195, 0.05) 0%, rgba(56, 139, 253, 0.05) 100%);
  border: 1px solid rgba(57, 211, 195, 0.2);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.demand-score-card.main {
  flex: 0 0 280px;
  background: linear-gradient(135deg, rgba(57, 211, 195, 0.08) 0%, rgba(56, 139, 253, 0.08) 100%);
  border: 2px solid rgba(57, 211, 195, 0.3);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.demand-score-card:hover {
  border-color: rgba(57, 211, 195, 0.4);
  background: linear-gradient(135deg, rgba(57, 211, 195, 0.08) 0%, rgba(56, 139, 253, 0.08) 100%);
}

.score-value {
  font-size: 64px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.score-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.score-status {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  border-radius: 6px;
  color: #3fb950;
  font-size: 12px;
  font-weight: 600;
}

/* 维度评分卡片 */
.demand-dimension-scores {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.dim-score {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.dim-score::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--dim-color);
}

.dim-score:hover {
  border-color: var(--dim-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.dim-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.dim-name {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}

.dim-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--dim-color);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════ */
/* 2. 标签页系统 */
/* ═══════════════════════════════════════════════════════════ */

.demand-detail-tabs {
  margin: 0 24px 32px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}

.tab-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-default);
  padding-bottom: 12px;
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(0, 212, 255, 0.05);
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(57, 211, 195, 0.1);
  color: var(--text-primary);
  border-bottom: 2px solid var(--color-research);
}

/* ═══════════════════════════════════════════════════════════ */
/* 3. 维度详细内容 */
/* ═══════════════════════════════════════════════════════════ */

.dimension-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-default);
}

.dim-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.dim-score-large {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-research);
  font-variant-numeric: tabular-nums;
}

.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metric-detail-item {
  background: rgba(0, 212, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.3s ease;
}

.metric-detail-item:hover {
  border-color: var(--border-default);
  background: rgba(57, 211, 195, 0.04);
}

.metric-row-1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.metric-icon {
  font-size: 20px;
  min-width: 24px;
}

.metric-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.metric-value-box {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.metric-value-box .value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.metric-value-box .unit {
  font-size: 12px;
  color: var(--text-muted);
}

.metric-value-box .trend {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.metric-value-box .trend.positive {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.1);
}

.metric-value-box .trend.negative {
  color: #ff6b9d;
  background: rgba(255, 107, 157, 0.1);
}

.metric-value-box .trend.stable {
  color: var(--text-muted);
  background: rgba(0, 212, 255, 0.05);
}

/* 进度条 */
.metric-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-research), var(--color-needs));
  transition: width 0.5s ease;
}

.threshold-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.metric-row-2 {
  margin-bottom: 12px;
}

.description {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.metric-implications {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.risk-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.risk-label.low {
  background: rgba(63, 185, 80, 0.1);
  color: #3fb950;
}

.risk-label.medium {
  background: rgba(247, 133, 62, 0.1);
  color: #f7853e;
}

.risk-label.high {
  background: rgba(255, 107, 157, 0.1);
  color: #ff6b9d;
}

.implication {
  flex: 1;
  color: var(--text-muted);
  padding: 0 8px;
  border-left: 2px solid var(--border-default);
}

/* ═══════════════════════════════════════════════════════════ */
/* 4. 洞察卡片 */
/* ═══════════════════════════════════════════════════════════ */

.demand-insights-section {
  margin: 32px 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.insight-card {
  background: linear-gradient(135deg, rgba(57, 211, 195, 0.04) 0%, rgba(56, 139, 253, 0.04) 100%);
  border: 1px solid rgba(57, 211, 195, 0.15);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.3s ease;
}

.insight-card:hover {
  border-color: var(--color-research);
  box-shadow: 0 4px 12px rgba(57, 211, 195, 0.15);
  transform: translateY(-2px);
}

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

.insight-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-research);
  color: var(--bg-default);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.insight-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.confidence {
  font-size: 13px;
  font-weight: 600;
  color: #3fb950;
}

.impact-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.impact-badge.high {
  background: rgba(255, 107, 107, 0.1);
  color: #ff6b9d;
}

.impact-badge.medium {
  background: rgba(247, 133, 62, 0.1);
  color: #f7853e;
}

.insight-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.insight-implication {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════ */
/* 5. 机会评估卡片 */
/* ═══════════════════════════════════════════════════════════ */

.demand-opportunities-section {
  margin: 32px 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}

.opportunities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.opportunity-card {
  background: linear-gradient(135deg, rgba(63, 185, 80, 0.08) 0%, rgba(57, 211, 195, 0.08) 100%);
  border: 1px solid rgba(63, 185, 80, 0.2);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.3s ease;
}

.opportunity-card:hover {
  border-color: var(--color-needs);
  box-shadow: 0 4px 16px rgba(57, 211, 195, 0.15);
  transform: translateY(-2px);
}

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

.opp-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-needs);
  color: var(--bg-default);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.opp-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.opp-actions {
  padding-top: 12px;
  border-top: 1px solid rgba(57, 211, 195, 0.1);
}

.action-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.action-tag {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(57, 211, 195, 0.1);
  border-radius: 4px;
  font-size: 12px;
  color: var(--color-needs);
  margin: 2px 4px 2px 0;
}

/* ═══════════════════════════════════════════════════════════ */
/* 6. 风险评估 */
/* ═══════════════════════════════════════════════════════════ */

.demand-risks-section {
  margin: 32px 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}

.risks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.risk-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: rgba(0, 212, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.risk-item.risk-high {
  border-left: 3px solid #ff6b9d;
  background: rgba(255, 107, 157, 0.04);
}

.risk-item.risk-medium {
  border-left: 3px solid #f7853e;
  background: rgba(247, 133, 62, 0.04);
}

.risk-item.risk-low {
  border-left: 3px solid #3fb950;
  background: rgba(63, 185, 80, 0.04);
}

.risk-icon {
  font-size: 24px;
  min-width: 32px;
  text-align: center;
}

.risk-content {
  flex: 1;
}

.risk-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.risk-severity {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.risk-mitigations {
  font-size: 12px;
  color: var(--text-muted);
}

.mitigation-tag {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(247, 133, 62, 0.1);
  border-radius: 4px;
  color: #f7853e;
  margin: 2px 4px 2px 0;
}

/* ═══════════════════════════════════════════════════════════ */
/* 响应式设计 */
/* ═══════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .demand-dimension-scores {
    grid-template-columns: repeat(3, 1fr);
  }

  .opportunities-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .demand-header-section {
    flex-direction: column;
    gap: 16px;
  }

  .demand-score-card.main {
    flex: 1;
  }

  .demand-dimension-scores {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .tab-buttons {
    flex-wrap: wrap;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none !important;
}
