/* ──── 海克斯增幅计算器样式 ──── */

:root {
  --bg-dark: #0a0e17;
  --bg-panel: #111827;
  --bg-card: #1a2332;
  --bg-hover: #243044;
  --border: #2a3a50;
  --border-glow: #4a6a8a;
  --text: #e2e8f0;
  --text-dim: #8899aa;
  --text-bright: #ffffff;
  --accent: #60a5fa;
  --accent2: #a78bfa;
  --silver: #c0d0e0;
  --gold: #ffd700;
  --prismatic: #ff44ff;
  --prismatic-glow: rgba(255, 68, 255, 0.3);
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-glow); }

/* ──── 头部 ──── */
.header {
  position: relative;
  padding: 40px 20px 30px;
  text-align: center;
  overflow: hidden;
}
.header-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  z-index: 0;
}
.header-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(96,165,250,0.15) 0%, transparent 70%);
}
.header-content {
  position: relative;
  z-index: 1;
}
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.logo-icon {
  font-size: 36px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}
h1 {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--prismatic));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  color: var(--text-dim);
  margin-top: 6px;
  font-size: 14px;
}
.version-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 12px;
  background: rgba(96,165,250,0.15);
  border: 1px solid rgba(96,165,250,0.3);
  border-radius: 20px;
  font-size: 11px;
  color: var(--accent);
}

/* ──── 主内容 ──── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}
.panel:hover {
  border-color: var(--border-glow);
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}
.panel-header h2 {
  font-size: 18px;
  font-weight: 700;
}

/* ──── 英雄选择 ──── */
.champion-search {
  margin-bottom: 16px;
}
.search-box {
  position: relative;
  margin-bottom: 10px;
}
.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s;
}
.search-box input:focus {
  border-color: var(--accent);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}
.filter-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 5px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.filter-btn.active {
  background: rgba(96,165,250,0.2);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.champion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}
.champ-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.champ-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateY(-2px);
}
.champ-card.selected {
  border-color: var(--gold);
  background: rgba(255,215,0,0.08);
}
.champ-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 4px;
}
.champ-card .champ-label {
  font-size: 11px;
  color: var(--text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80px;
}

.selected-champion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}
.selected-champion-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.champ-icon-big {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--gold);
}
.champ-name {
  font-size: 18px;
  font-weight: 700;
  display: block;
}
.champ-title {
  font-size: 13px;
  color: var(--text-dim);
}
.btn-change {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-change:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* 技能展示 */
.skills-display {
  margin-top: 16px;
}
.skills-title {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.skills-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0;
}
.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  padding: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.skill-item img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.skill-item .skill-label {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}
.skill-item .skill-tags {
  display: flex;
  gap: 2px;
  margin-top: 3px;
  flex-wrap: wrap;
  justify-content: center;
}
.skill-item .tag-badge {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(96,165,250,0.15);
  color: var(--accent);
}
.skill-item.ultimate {
  border-color: rgba(255,68,255,0.3);
}

/* ──── 增幅选择 ──── */
.augment-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.augment-search input {
  width: 200px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.augment-search input:focus {
  border-color: var(--accent);
}
.augment-tier-filter {
  display: flex;
  gap: 4px;
}
.tier-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.tier-btn.active {
  background: rgba(96,165,250,0.2);
  border-color: var(--accent);
  color: var(--accent);
}
.tier-btn.silver-btn:hover { border-color: var(--silver); color: var(--silver); }
.tier-btn.gold-btn:hover { border-color: var(--gold); color: var(--gold); }
.tier-btn.prismatic-btn:hover { border-color: var(--prismatic); color: var(--prismatic); }

.btn-random {
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(96,165,250,0.2), rgba(167,139,250,0.2));
  border: 1px solid var(--accent2);
  border-radius: var(--radius-sm);
  color: var(--accent2);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
  margin-left: auto;
}
.btn-random:hover {
  background: linear-gradient(135deg, rgba(96,165,250,0.3), rgba(167,139,250,0.3));
  box-shadow: 0 0 15px rgba(167,139,250,0.2);
}

.augment-selected-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.augment-slot {
  min-height: 100px;
  padding: 16px;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}
.augment-slot:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.augment-slot.empty .slot-placeholder {
  color: var(--text-dim);
  font-size: 14px;
}
.augment-slot.filled {
  border-style: solid;
  cursor: default;
}
.augment-slot.filled:hover {
  border-color: var(--border-glow);
}
.augment-slot .aug-tier-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 500;
}
.augment-slot .aug-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.augment-slot .aug-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.3;
}
.augment-slot .aug-remove {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239,68,68,0.15);
  border: none;
  color: var(--danger);
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.augment-slot.filled .aug-remove {
  display: flex;
}
.augment-slot .aug-remove:hover {
  background: rgba(239,68,68,0.3);
}

/* 品阶颜色 */
.tier-silver {
  border-color: var(--silver) !important;
}
.tier-silver .aug-tier-badge {
  background: rgba(192,208,224,0.15);
  color: var(--silver);
}
.tier-gold {
  border-color: var(--gold) !important;
}
.tier-gold .aug-tier-badge {
  background: rgba(255,215,0,0.15);
  color: var(--gold);
}
.tier-prismatic {
  border-color: var(--prismatic) !important;
  box-shadow: 0 0 12px rgba(255,68,255,0.15);
}
.tier-prismatic .aug-tier-badge {
  background: rgba(255,68,255,0.2);
  color: var(--prismatic);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}
.modal-content {
  position: relative;
  width: 480px;
  max-width: 95vw;
  max-height: 80vh;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 16px;
  flex-shrink: 0;
}
.modal-header input {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.btn-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}
.btn-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}
.picker-filter {
  padding: 10px 16px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}
.picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.picker-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  gap: 10px;
}
.picker-item:hover {
  background: var(--bg-hover);
}
.picker-item .picker-tier-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.picker-item .picker-name {
  font-size: 14px;
  font-weight: 500;
}
.picker-item .picker-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* ──── 计算结果 ──── */
.btn-calculate {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 2px;
}
.btn-calculate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(96,165,250,0.3);
}
.btn-calculate:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 排名 */
.ranking-section {
  margin-top: 24px;
}
.ranking-section h3, .matrix-section h3, .details-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 3px solid var(--accent);
}
.ranking-list {
  display: flex;
  gap: 10px;
}
.rank-card {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}
.rank-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.rank-card.rank-0::before { background: linear-gradient(90deg, #ffd700, #ff8c00); }
.rank-card.rank-1::before { background: linear-gradient(90deg, var(--silver), var(--accent)); }
.rank-card.rank-2::before { background: linear-gradient(90deg, #cd7f32, var(--warning)); }
.rank-card.rank-3::before { background: var(--border); }
.rank-card .rank-num {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.rank-card .rank-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.rank-card .rank-score {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.rank-card .rank-rec {
  font-size: 12px;
  line-height: 1.3;
}

/* 矩阵表格 */
.table-wrapper {
  overflow-x: auto;
}
.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  font-size: 13px;
}
.matrix-table th {
  padding: 10px 12px;
  text-align: center;
  font-weight: 600;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.matrix-table th:first-child {
  text-align: left;
  min-width: 80px;
}
.matrix-table th .tier-label {
  font-size: 10px;
  display: block;
  font-weight: 400;
  margin-top: 2px;
}
.matrix-table td {
  padding: 10px 12px;
  text-align: center;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.matrix-table td:first-child {
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}
.matrix-table tr:hover td {
  background: var(--bg-hover);
}
.boost-value {
  font-weight: 700;
  font-size: 14px;
}
.boost-desc {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.2;
}
.match-dots {
  margin-top: 4px;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 1px;
}
.dot.filled { background: var(--accent); }
.dot.half { background: var(--accent); opacity: 0.4; }
.dot.empty { background: var(--border); }

/* 详细分析卡片 */
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.detail-card {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.detail-card .detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.detail-card .detail-name {
  font-size: 16px;
  font-weight: 700;
}
.detail-card .detail-tier-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}
.detail-card .detail-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.4;
}
.detail-card .detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.detail-card .stat-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(96,165,250,0.1);
  border: 1px solid rgba(96,165,250,0.2);
  border-radius: 4px;
  color: var(--accent);
}
.detail-card .detail-boosts {
  font-size: 12px;
}
.detail-card .detail-boost-item {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.detail-card .detail-boost-item:last-child {
  border-bottom: none;
}
.detail-card .boost-skill-name {
  font-weight: 500;
  color: var(--text);
}
.detail-card .boost-pct {
  font-weight: 700;
  float: right;
}
.detail-card .boost-detail-text {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* 加载动画 */
.loading {
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ──── 底部 ──── */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 11px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.footer p {
  margin: 4px 0;
}

/* ──── 响应式 ──── */
@media (max-width: 768px) {
  .header { padding: 24px 16px 20px; }
  h1 { font-size: 22px; }
  .panel { padding: 16px; }
  .champion-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .champ-card img { width: 40px; height: 40px; }
  .champ-card .champ-label { font-size: 10px; }
  .augment-selected-row { grid-template-columns: repeat(2, 1fr); }
  .augment-slot { min-height: 80px; }
  .ranking-list { flex-direction: column; }
  .details-grid { grid-template-columns: 1fr; }
  .augment-controls { flex-direction: column; align-items: stretch; }
  .augment-search input { width: 100%; }
  .btn-random { margin-left: 0; }
  .skills-row { gap: 8px; }
  .skill-item { min-width: 50px; }
  .skill-item img { width: 30px; height: 30px; }
}
