﻿/* ========== 鍏ㄥ眬閲嶇疆 ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  max-width: 100vw;
}
/* 全局防御性规则：防止 flex/grid 子项按内容撑开导致横向溢出 */
.app, .app > *, .topbar, .teams-grid, .team-panel, .team-slots, .action-panel,
.seg-tabs, .seg-btn, .results-section, .results-grid, .analysis-section,
.analysis-grid, .hero-card, .quick-tips, .recommend-btn, .clear-btn,
.modal, .modal-content, .hero-list, .hero-item, .slot, .slot * {
  min-width: 0;
  max-width: 100%;
}

:root {
  /* 涓婚鑹?*/
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* 鏂囧瓧鑹?*/
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* 鍝佺墝鑹?*/
  --brand-orange: #f59e0b;
  --brand-red: #ef4444;
  --brand-pink: #ec4899;
  --brand-purple: #a855f7;
  --brand-blue: #3b82f6;
  --brand-cyan: #06b6d4;
  --brand-green: #10b981;

  /* 闃佃惀鑹?*/
  --enemy-color: #ef4444;
  --enemy-bg: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%);
  --ally-color: #3b82f6;
  --ally-bg: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);

  /* 闃村奖 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow-orange: 0 0 30px rgba(245, 158, 11, 0.3);
  --shadow-glow-blue: 0 0 30px rgba(59, 130, 246, 0.3);

  /* 鍦嗚 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;

  /* 杩囨浮 */
  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;
  --t-slow: 0.4s ease;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at top left, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #0f172a 0%, #020617 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ========== 椤堕儴鐘舵€佹爮 ========== */
.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

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

.logo {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.version {
  font-size: 0.8em;
  color: var(--text-muted);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 8px var(--brand-green);
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-pill.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}
.status-pill.error .dot {
  background: var(--brand-red);
  box-shadow: 0 0 8px var(--brand-red);
}

/* ========== 鏍囬鍖?========== */
.hero-section {
  text-align: center;
  padding: 32px 20px 28px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 2.4em;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05em;
}

/* ========== 浣嶇疆閫夋嫨鍣紙鍒嗘鎺у埗鍣級============ */
.role-section {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.segmented-control {
  display: inline-flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
  box-shadow: var(--shadow-md);
  gap: 2px;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--r-md);
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
}

.seg-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.seg-btn.active {
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-red));
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.seg-icon {
  font-size: 1.1em;
}

/* ========== 鍙屾柟闃靛缃戞牸 ========== */
.teams-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  margin-bottom: 28px;
  align-items: start;
}

/* ========== 闃靛闈㈡澘 ========== */
.team-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.team-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.enemy-panel::before {
  background: linear-gradient(90deg, transparent, var(--enemy-color), transparent);
}

.ally-panel::before {
  background: linear-gradient(90deg, transparent, var(--ally-color), transparent);
}

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

.team-header h2 {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-icon {
  font-size: 0.9em;
}

.enemy-panel .team-header h2 {
  color: var(--enemy-color);
}

.ally-panel .team-header h2 {
  color: var(--ally-color);
}

.team-count {
  font-size: 0.85em;
  color: var(--text-muted);
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

/* ========== 妲戒綅 ========== */
.team-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.slot {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
  text-align: center;
  padding: 6px;
  gap: 2px;
  min-width: 0;       /* 关键：允许 grid/flex 子项收缩到内容最小尺寸以下 */
  overflow: hidden;   /* 防止内部溢出撑大 */
}

.slot:hover {
  background: var(--surface-hover);
  border-color: var(--brand-orange);
  transform: translateY(-2px);
}

.slot.placeholder {
  cursor: default;
  border-style: dotted;
  border-color: rgba(255, 255, 255, 0.08);
  opacity: 0.5;
}

.slot.placeholder:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.slot-icon {
  font-size: 1.2em;
  color: var(--text-dim);
  line-height: 1;
}

.slot-label {
  color: var(--text-dim);
  font-size: 0.7em;
  font-weight: 500;
}

.slot.filled {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  border: 2px solid var(--enemy-color);
  color: white;
  font-weight: 600;
  cursor: pointer;
  border-style: solid;
}

.slot.ally-slot.filled {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  border-color: var(--ally-color);
}

.slot.filled:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.slot.filled .slot-label,
.slot.filled .slot-icon {
  color: white;
}

.slot.filled .slot-icon {
  display: none; /* 宸查€夋椂涓嶆樉绀?+ */
}

.slot .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75em;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  z-index: 2;
}

.slot.filled:hover .remove-btn {
  display: flex;
}

/* ========== 闃靛鍒嗘瀽鍗＄墖 ========== */
.team-analysis {
  margin-top: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  animation: slideDown 0.3s ease;
}

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

.archetype-badge {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-red));
  color: white;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 8px;
}

.arch-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-size: 0.8em;
  color: var(--text-secondary);
}

.arch-stat-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.arch-stat-value {
  color: var(--brand-orange);
  font-weight: 600;
}

/* ========== 涓棿鎿嶄綔闈㈡澘 ========== */
.action-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 60px;
}

.vs-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
}

.vs-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.vs-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-pink));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9em;
  letter-spacing: 1px;
  box-shadow: var(--shadow-glow-orange);
  flex-shrink: 0;
}

.recommend-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-red));
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-size: 1.05em;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-base);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  white-space: nowrap;
}

.recommend-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.recommend-btn:active {
  transform: translateY(0);
}

.recommend-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-base);
}

.clear-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.quick-tips {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 200px;
  font-size: 0.78em;
  color: var(--text-muted);
}

.tip-title {
  color: var(--brand-orange);
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 1.1em;
}

.tip-item {
  padding: 2px 0;
}

/* ========== 鎺ㄨ崘缁撴灉 ========== */
.results-section,
.analysis-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.4s ease;
}

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

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.results-header h2 {
  font-size: 1.4em;
  font-weight: 700;
}

.results-meta {
  font-size: 0.85em;
  color: var(--text-muted);
}

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

/* ========== 鑻遍泟鍗＄墖锛堥噸鍋氾級============ */
.hero-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: all var(--t-base);
  animation: cardIn 0.4s ease both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-card:nth-child(1) { animation-delay: 0.05s; }
.hero-card:nth-child(2) { animation-delay: 0.12s; }
.hero-card:nth-child(3) { animation-delay: 0.19s; }
.hero-card:nth-child(4) { animation-delay: 0.26s; }
.hero-card:nth-child(5) { animation-delay: 0.33s; }

.hero-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: var(--shadow-lg);
}

.hero-card.rank-1 {
  border: 2px solid var(--brand-orange);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.04));
  box-shadow: var(--shadow-glow-orange);
}

.hero-card.rank-1::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-orange), transparent);
  animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-red));
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.8em;
  z-index: 1;
}

.rank-badge.rank-2 {
  background: linear-gradient(135deg, #94a3b8, #475569);
}
.rank-badge.rank-3 {
  background: linear-gradient(135deg, #d97706, #92400e);
}

.hero-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.hero-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  font-size: 1.8em;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, var(--avatar-c1, #475569), var(--avatar-c2, #1e293b));
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "EmojiOne Color", "Twemoji", sans-serif;
  line-height: 1;
  overflow: hidden;
}

.hero-avatar.online img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--r-md) - 2px);
}

.hero-info {
  flex: 1;
  min-width: 0;
}

.hero-name {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 0.8em;
  color: var(--text-muted);
}

/* 鍒嗘暟鐜?*/
.score-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.score-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.score-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
}

.score-ring-fill {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--brand-orange);
  font-size: 1.05em;
  line-height: 1;
}

.score-label {
  font-size: 0.5em;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.hero-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tag {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-secondary);
}

.tag.type { background: var(--brand-purple); color: white; }
.tag.difficulty { background: var(--brand-red); color: white; }
.tag.phase { background: var(--brand-green); color: white; }
.tag.role { background: var(--brand-blue); color: white; }

.score-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0;
  display: flex;
}

.score-bar-segment {
  height: 100%;
  transition: width 0.8s ease;
}

.score-bar-segment.counter { background: linear-gradient(90deg, #10b981, #34d399); }
.score-bar-segment.countered { background: linear-gradient(90deg, #ef4444, #f87171); }
.score-bar-segment.meta { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.score-bar-legend {
  display: flex;
  gap: 10px;
  font-size: 0.7em;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.score-bar-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.reasons {
  list-style: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.reasons li {
  font-size: 0.88em;
  padding: 4px 0;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}

.reasons li.positive { color: var(--text-primary); }
.reasons li.warning { color: #fbbf24; }
.reasons li.danger { color: #fca5a5; }
.reasons li.highlight {
  color: #f59e0b;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.08);
  border-left: 2px solid #f59e0b;
  padding-left: 8px;
  border-radius: 4px;
  margin-left: -8px;
}
.reasons li.combo {
  color: #fef3c7;
  font-weight: 600;
  background: rgba(251, 191, 36, 0.12);
  border-left: 2px solid #fbbf24;
  padding-left: 8px;
  border-radius: 4px;
  margin-left: -8px;
}
.reasons li.tips {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.06);
  border-left: 2px solid #10b981;
  padding-left: 8px;
  border-radius: 4px;
  margin-left: -8px;
  font-size: 0.85em;
  line-height: 1.5;
}
.reasons li.gear {
  color: #bfdbfe;
  font-size: 0.85em;
}
.reasons li.strategy {
  color: #e9d5ff;
  font-size: 0.9em;
}
.reasons li.phase {
  color: #fed7aa;
  font-size: 0.9em;
}
.reasons li.summoner {
  color: #94a3b8;
  font-size: 0.85em;
  font-style: italic;
}
.reasons {
  max-height: none;  /* 涓嶉檺鍒堕珮搴︼紝鍏ㄩ儴灞曠ず */
  overflow: visible;
}

.combo {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--r-sm);
  font-size: 0.82em;
  color: var(--text-muted);
  border-left: 3px solid var(--brand-orange);
}

.combo strong {
  color: var(--brand-orange);
}

/* ========== 闃靛鍒嗘瀽璇︽儏 ========== */
.analysis-section h2 {
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 16px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.analysis-item {
  background: var(--surface);
  padding: 12px;
  border-radius: var(--r-md);
  border-left: 3px solid var(--brand-orange);
}

.analysis-item.warn {
  border-left-color: var(--brand-red);
}

.analysis-item.good {
  border-left-color: var(--brand-green);
}

.analysis-item .label {
  font-size: 0.8em;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.analysis-item .value {
  font-size: 1.2em;
  color: var(--text-primary);
  font-weight: 700;
}

/* ========== 寮圭獥 ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.modal-header h3 {
  font-size: 1.1em;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2em;
  padding: 4px 10px;
  border-radius: 4px;
}

.modal-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.search-wrap {
  position: relative;
  padding: 16px 20px 0;
}

.search-input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 0.95em;
  transition: all var(--t-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-orange);
  background: var(--surface-hover);
}

.search-clear {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  color: var(--text-muted);
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.8em;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.search-clear.visible {
  display: flex;
}

.hero-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: var(--surface);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
}

.tab-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--brand-orange);
  color: white;
}

.hero-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.hero-item {
  background: var(--surface);
  padding: 10px 6px;
  border-radius: var(--r-md);
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast);
}

.hero-item:hover {
  background: var(--surface-hover);
  border-color: var(--brand-orange);
  transform: translateY(-2px);
}

.hero-item.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.hero-avatar.small {
  width: 40px;
  height: 40px;
  font-size: 1.3em;
  border-radius: var(--r-sm);
  margin: 0 auto 6px;
}

.hero-item-name {
  font-size: 0.82em;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 椤佃剼 ========== */
.footer {
  text-align: center;
  padding: 20px 16px;
  color: var(--text-dim);
  font-size: 0.82em;
  border-top: 1px solid var(--border);
  margin-top: 30px;
}

.footer p {
  margin: 2px 0;
}

/* ========== 鍝嶅簲寮?========== */
@media (max-width: 900px) {
  .teams-grid {
    grid-template-columns: 1fr;
  }

  .action-panel {
    padding-top: 0;
    order: -1;
  }

  .vs-divider {
    margin: 12px 0;
  }

  .quick-tips {
    max-width: 100%;
  }
}

/* 骞虫澘鍙婁互涓?(鈮?68px) */
@media (max-width: 768px) {
  .app {
    padding: 12px 14px 30px;
  }

  .hero-title {
    font-size: 1.8em;
  }

  .hero-subtitle {
    font-size: 0.95em;
  }

  .seg-btn {
    padding: 10px 12px;
    font-size: 0.85em;
  }

  .seg-text {
    display: none;
  }

  .seg-btn.active .seg-text {
    display: inline;
  }

  .team-slots {
    grid-template-columns: repeat(5, 1fr);
  }

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

  .analysis-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    max-height: 90vh;
    width: 95%;
  }

  .hero-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 澶ф墜鏈?(鈮?40px) */
@media (max-width: 640px) {
  .app {
    padding: 10px 12px 24px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .logo {
    font-size: 1.1em;
  }

  .hero-section {
    padding: 16px 8px 12px;
  }

  .hero-title {
    font-size: 1.5em;
  }

  .hero-subtitle {
    font-size: 0.85em;
  }

  .team-panel {
    padding: 12px;
  }

  .team-title {
    font-size: 1em;
  }

  .team-slots {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .slot-label {
    font-size: 0.65em;
  }

  .results-section, .analysis-section {
    padding: 14px;
  }

  .hero-card {
    padding: 12px;
  }

  .hero-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.3em;
  }

  .hero-name {
    font-size: 1em;
  }

  .score-ring {
    width: 52px;
    height: 52px;
  }

  .modal-content {
    max-height: 92vh;
  }

  .hero-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 灏忔墜鏈?(鈮?75px) */
@media (max-width: 375px) {
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app {
    padding: 8px 8px 20px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar {
    padding: 8px 10px;
  }

  .logo {
    font-size: 1em;
  }

  .version {
    font-size: 0.7em;
  }

  .hero-section {
    padding: 10px 4px 8px;
  }

  .hero-title {
    font-size: 1.2em;
    line-height: 1.3;
    word-break: break-word;
  }

  .hero-subtitle {
    font-size: 0.78em;
    line-height: 1.4;
    padding: 0 4px;
    word-break: break-word;
  }

  .segmented-control {
    width: 100%;
    max-width: 100%;
    padding: 3px;
    box-sizing: border-box;
  }

  .seg-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 7px 2px;
    font-size: 0.78em;
    gap: 3px;
    justify-content: center;
    box-sizing: border-box;
  }

  .seg-text {
    display: none !important;
  }

  .seg-btn.active .seg-text {
    display: inline !important;
  }

  .seg-icon {
    font-size: 1.1em;
  }

  .team-panel {
    padding: 10px 6px;
  }

  .team-title {
    font-size: 0.9em;
  }

  .team-slots {
    gap: 3px;
  }

  .slot {
    padding: 4px 1px;
    font-size: 0.72em;
  }

  .slot-label {
    font-size: 0.7em;
    word-break: break-all;
  }

  .vs-circle {
    width: 48px;
    height: 48px;
    font-size: 0.85em;
  }

  .recommend-btn {
    padding: 10px 14px;
    font-size: 0.9em;
    white-space: nowrap;
    width: auto;
    max-width: 100%;
  }

  .action-panel {
    flex-wrap: wrap;
    gap: 8px;
  }

  .clear-btn {
    padding: 7px 14px;
    font-size: 0.85em;
  }

  .results-section, .analysis-section {
    padding: 12px 10px;
  }

  .hero-card {
    padding: 10px;
  }

  .hero-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.1em;
  }

  .hero-name {
    font-size: 0.95em;
  }

  .score-ring {
    width: 46px;
    height: 46px;
  }

  .quick-tips {
    padding: 10px 12px;
    font-size: 0.85em;
  }

  .quick-tips li {
    margin: 4px 0;
  }
}


/* 灏忔墜鏈?鈮?20px) - 缂╁皬鎵€鏈夊厓绱犻伩鍏虫埅鍒?*/
@media (max-width: 360px) {
  /* 中等小手机 / iPhone SE 1代 (320) / 小米 / 华为低端 */
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
    font-size: 13px;
  }
  .app { padding: 4px 4px 16px; }
  .topbar { padding: 6px 8px; margin-bottom: 8px; }
  .logo { font-size: 0.95em; }
  .version { font-size: 0.7em; }
  .hero-section { padding: 10px 4px 8px; }
  .hero-title {
    font-size: 1.05em !important;
    line-height: 1.2;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }
  .hero-subtitle {
    font-size: 0.7em !important;
    line-height: 1.3;
    word-break: break-all;
  }
  /* 位置选择器：2 行布局 */
  .seg-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }
  .seg-btn {
    padding: 6px 4px !important;
    font-size: 0.72em !important;
    gap: 2px !important;
  }
  .seg-icon { font-size: 1.1em; }
  .seg-text { display: none !important; }
  .seg-btn.active .seg-text { display: inline !important; font-size: 0.85em; }
  /* 阵容区：单列堆叠 */
  .teams-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  .teams-grid > .action-panel {
    order: -1;
    padding-top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .team-panel { padding: 8px 6px; }
  .team-title { font-size: 0.85em; }
  .team-slots {
    gap: 4px;
    grid-template-columns: repeat(5, 1fr);
  }
  .slot {
    padding: 4px 1px !important;
    font-size: 0.55em !important;
    aspect-ratio: 1;
  }
  .slot-label {
    font-size: 0.7em;
    word-break: break-all;
    line-height: 1.1;
  }
  .vs-circle {
    width: 38px !important;
    height: 38px !important;
    font-size: 0.7em;
  }
  /* 推荐按钮：缩小让一行装下 */
  .recommend-btn {
    padding: 8px 12px !important;
    font-size: 0.85em !important;
    white-space: nowrap;
    max-width: 100%;
  }
  .clear-btn {
    padding: 6px 12px !important;
    font-size: 0.75em !important;
  }
  .action-panel { gap: 8px; }
  .quick-tips {
    padding: 8px 10px !important;
    font-size: 0.72em !important;
  }
  .quick-tips li { margin: 3px 0; }
  /* 结果区 */
  .results-section, .analysis-section { padding: 10px 6px; }
  .hero-card {
    padding: 10px !important;
    flex-wrap: wrap;
  }
  .hero-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 1em;
  }
  .hero-name { font-size: 0.9em; }
  .score-ring {
    width: 42px !important;
    height: 42px !important;
  }
  .score-num { font-size: 0.9em !important; }
  .reasons { font-size: 0.78em !important; }
  /* 英雄选择弹窗 */
  .modal-content {
    width: 98% !important;
    max-height: 92vh;
    padding: 12px !important;
  }
  .hero-list {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px;
  }
  .hero-item {
    padding: 4px !important;
  }
  .hero-item-name { font-size: 0.7em; }
}

@media (max-width: 320px) {
  /* 超小屏特化 */
  .hero-title { font-size: 0.95em !important; }
  .hero-subtitle { font-size: 0.65em !important; }
  .seg-btn { font-size: 0.65em !important; }
  .seg-tabs { gap: 3px !important; }
  .team-slots { gap: 2px !important; }
  .slot { font-size: 0.5em !important; padding: 3px 0px !important; }
  .recommend-btn { font-size: 0.78em !important; padding: 7px 10px !important; }
  .clear-btn { font-size: 0.7em !important; padding: 5px 10px !important; }
  .hero-avatar { width: 32px !important; height: 32px !important; }
  .score-ring { width: 38px !important; height: 38px !important; }
  .vs-circle { width: 34px !important; height: 34px !important; font-size: 0.6em; }
}
/* 闄嶄綆鍔ㄧ敾鍋忓ソ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}



/* ============ 🛡️ ban位推荐 ============ */
.ban-section { margin: 24px auto; max-width: 1200px; padding: 0 16px; }
.ban-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.ban-header h3 { margin: 0; font-size: 1.4em; color: #2c3e50; }
.ban-hint { font-size: 0.85em; color: #7f8c8d; background: #ecf0f1; padding: 4px 12px; border-radius: 12px; }
.ban-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.ban-card { display: flex; align-items: flex-start; gap: 12px; background: white; padding: 14px; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); border-left: 4px solid #e74c3c; transition: transform 0.2s, box-shadow 0.2s; }
.ban-card.is-picked { border-left-color: #ff4444; background: linear-gradient(90deg, #fff5f5 0%, white 30%); box-shadow: 0 2px 8px rgba(231,76,60,0.15); }
.ban-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.ban-rank { flex: 0 0 28px; height: 28px; background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 0.9em; }
.ban-info { flex: 1; min-width: 0; }
.ban-name { font-weight: 600; font-size: 1.05em; color: #2c3e50; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ban-tag { font-size: 0.7em; padding: 2px 8px; border-radius: 8px; font-weight: 500; }
.ban-tag.picked { background: #e74c3c; color: white; }
.ban-tag.meta { background: #f39c12; color: white; }
.ban-score { font-size: 0.8em; color: #7f8c8d; margin-top: 2px; }
.ban-reasons { list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.8em; color: #555; line-height: 1.5; }
.ban-reasons li { padding-left: 14px; position: relative; margin-bottom: 3px; word-break: break-word; }
.ban-reasons li::before { content: '▸'; position: absolute; left: 0; color: #e74c3c; }
@media (max-width: 768px) { .ban-list { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .ban-card { transition: none !important; } }

.radar-section {
  margin: 24px auto;
  max-width: 1200px;
  padding: 0 16px;
}
.radar-section h2 {
  color: #ffd700;
  margin-bottom: 16px;
  text-align: center;
}
.radar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 768px) {
  .radar-grid { grid-template-columns: 1fr; }
}
.radar-block {
  background: linear-gradient(135deg, rgba(20, 30, 48, 0.85), rgba(36, 59, 85, 0.85));
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.radar-block h3 {
  color: #fff;
  margin-bottom: 12px;
  font-size: 18px;
}
.radar-block canvas {
  display: block;
  margin: 0 auto;
  width: 100% !important;
  max-width: 360px;
  height: 360px !important;
  aspect-ratio: 1 / 1;
}
.radar-summary {
  margin-top: 12px;
  color: #ccc;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
}
.radar-summary .strong {
  color: #4ade80;
  font-weight: bold;
}
.radar-summary .weak {
  color: #f87171;
  font-weight: bold;
}
/* ========== v0.9.0 UI 缇庡寲澧炲己 ========== */

/* ---------- 1. 鍔犺浇楠ㄦ灦灞?---------- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-md);
}

.skeleton-card {
  height: 180px;
  margin-bottom: 16px;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 100%; }

/* ---------- 2. 鏅鸿兘鎺ㄨ崘杩涘害鏉?---------- */
.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.progress-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 32px 40px;
  min-width: 360px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.progress-title {
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.progress-step {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-bottom: 20px;
  min-height: 1.4em;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
  background-size: 200% 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
  animation: progressShine 2s linear infinite;
}

@keyframes progressShine {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.progress-percent {
  color: var(--text-secondary);
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}

/* ---------- 3. 绌虹姸鎬?---------- */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 4em;
  margin-bottom: 16px;
  opacity: 0.6;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.empty-title {
  font-size: 1.2em;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.empty-desc {
  font-size: 0.95em;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto 20px;
}

.empty-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 20px;
  color: var(--brand-orange);
  font-size: 0.9em;
}

/* ---------- 4. 寰氦浜?---------- */
.recommend-btn {
  position: relative;
  overflow: hidden;
}

.recommend-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 255, 255, 0.25) 0%,
              transparent 60%);
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
}

.recommend-btn:hover::after {
  opacity: 1;
}

.recommend-btn:active {
  transform: scale(0.97);
}

.slot {
  transition: transform var(--t-base), border-color var(--t-base), background var(--t-base);
}

.slot.filled {
  animation: slotPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slotPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.seg-btn {
  position: relative;
  transition: all var(--t-base);
}

.seg-btn:active {
  transform: scale(0.95);
}

/* hero-card 榧犳爣寰姩 */
.hero-card {
  will-change: transform;
}

/* ---------- 5. 绉诲姩绔搷搴斿紡 ---------- */
@media (max-width: 768px) {
  .app {
    padding: 12px 14px 32px;
  }

  .hero-title {
    font-size: 1.8em;
  }

  .hero-subtitle {
    font-size: 0.95em;
  }

  .topbar {
    padding: 10px 12px;
  }

  .logo {
    font-size: 1em;
  }

  .teams-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .team-panel {
    padding: 14px;
  }

  .team-header h2 {
    font-size: 1.1em;
  }

  .results-grid {
    grid-template-columns: 1fr !important;
  }

  .ban-list {
    grid-template-columns: 1fr !important;
  }

  .radar-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .radar-block canvas {
    width: 100% !important;
    max-width: 360px;
    height: auto !important;
  }

  .segmented-control {
    flex-wrap: wrap;
  }

  .seg-btn {
    flex: 1 0 18%;
    min-width: 60px;
    font-size: 0.85em;
    padding: 8px 6px;
  }

  .modal-content {
    width: 95vw;
    max-width: 95vw;
    max-height: 88vh;
  }

  .hero-list {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)) !important;
    gap: 8px;
  }

  .hero-item {
    padding: 8px 4px;
  }

  .progress-card {
    min-width: auto;
    width: calc(100vw - 48px);
    padding: 24px 20px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .ban-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .radar-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 1025px) {
  .results-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
  .radar-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 瑙﹀睆浼樺寲锛氶伩鍏?hover 鍗′綇 */
@media (hover: none) {
  .hero-card:hover,
  .recommend-btn:hover {
    transform: none;
  }
}

/* ---------- 6. 鍑忓皯鍔ㄦ晥鍋忓ソ ---------- */
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .progress-bar-fill,
  .empty-icon,
  .hero-card.rank-1::before {
    animation: none !important;
  }
  .slot.filled,
  .hero-card {
    animation: none !important;
  }
}
