/* ========================================
   本地模型速配 — Cyberpunk Terminal 美学
   ======================================== */

:root {
  --bg-deep: #0a0a0f;
  --bg-surface: #12121a;
  --bg-card: #1a1a26;
  --bg-card-hover: #22222f;
  --border: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 255, 170, 0.15);

  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #555568;

  --neon-green: #00ffaa;
  --neon-cyan: #00d4ff;
  --neon-pink: #ff3388;
  --neon-orange: #ff8844;
  --neon-yellow: #ffcc00;
  --neon-red: #ff2244;
  --neon-purple: #aa44ff;

  --tier-s: #00ffaa;
  --tier-a: #00d4ff;
  --tier-b: #ffcc00;
  --tier-c: #ff8844;
  --tier-d: #ff3388;
  --tier-f: #ff2244;

  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 12px;
  --radius-sm: 6px;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* 噪点纹理叠加 */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 背景光球 */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,255,170,0.08), transparent 70%);
  top: -200px; left: -100px;
  animation: orbFloat 20s ease-in-out infinite;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,212,255,0.06), transparent 70%);
  top: 40%; right: -150px;
  animation: orbFloat 25s ease-in-out infinite reverse;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,51,136,0.05), transparent 70%);
  bottom: -100px; left: 30%;
  animation: orbFloat 18s ease-in-out infinite 5s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ========== HERO ========== */
.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 24px 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(0, 255, 170, 0.08);
  border: 1px solid rgba(0, 255, 170, 0.2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--neon-green);
  margin-bottom: 32px;
  letter-spacing: 0.05em;
  transition: all 0.5s ease;
}
.hero-badge.detected {
  background: rgba(0, 255, 170, 0.12);
  border-color: rgba(0, 255, 170, 0.35);
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,255,170,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 8px rgba(0,255,170,0); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.title-line {
  display: block;
}
.title-line.accent {
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 500px;
  margin-inline: auto;
}

/* ========== 硬件面板（横向选择栏） ========== */
.hw-panel {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.hw-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  animation: fadeInUp 0.5s ease 0.2s both;
}

.hw-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hw-item-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  cursor: help;
  flex-shrink: 0;
}
.hw-item-icon svg {
  width: 18px;
  height: 18px;
}
.hw-item-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  line-height: 1;
}

.hw-sep {
  color: rgba(255,255,255,0.1);
  font-size: 1rem;
  user-select: none;
}

/* 下拉选择器 */
.hw-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 24px 5px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23555568' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-width: 80px;
}
.hw-select:hover {
  border-color: rgba(0, 255, 170, 0.25);
  background-color: rgba(255,255,255,0.06);
}
.hw-select:focus {
  border-color: var(--neon-green);
  box-shadow: 0 0 0 2px rgba(0, 255, 170, 0.1);
}
.hw-select option,
.hw-select optgroup {
  background: #1a1a26;
  color: var(--text-primary);
}
.hw-select optgroup {
  font-weight: 700;
  color: var(--neon-green);
}
.hw-select-wide {
  min-width: 160px;
  max-width: 240px;
}

.hw-cores-text {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.hw-note {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 12px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.hw-webgpu-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid rgba(0, 255, 170, 0.3);
  background: rgba(0, 255, 170, 0.08);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--neon-green);
}
.hw-webgpu-badge svg {
  width: 10px;
  height: 10px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 控制栏 ========== */
.controls {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto 32px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* 过滤按钮栏 */
.filter-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.filter-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}
.filter-btn.active {
  background: rgba(0, 255, 170, 0.1);
  color: var(--neon-green);
  box-shadow: 0 0 12px rgba(0, 255, 170, 0.08);
}

.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--border);
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
}
.toggle-btn:hover {
  color: var(--text-primary);
}
.toggle-btn.active {
  background: rgba(0, 255, 170, 0.1);
  color: var(--neon-green);
}

.stats-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.stat-item.tier-s .stat-num { color: var(--tier-s); }
.stat-item.tier-a .stat-num { color: var(--tier-a); }
.stat-item.tier-b .stat-num { color: var(--tier-b); }
.stat-item.tier-c .stat-num { color: var(--tier-c); }
.stat-item.tier-d .stat-num { color: var(--tier-d); }
.stat-item.tier-f .stat-num { color: var(--tier-f); }

/* ========== 模型卡片网格 ========== */
.models-grid {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px);
  position: relative;
  overflow: hidden;
}
.model-card.visible {
  animation: fadeInUp 0.5s ease forwards;
}
.model-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.model-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}
.model-card:hover::before {
  opacity: 1;
}

/* 卡片顶部渐变条 */
.model-card.tier-s::before { background: linear-gradient(90deg, var(--tier-s), transparent); }
.model-card.tier-a::before { background: linear-gradient(90deg, var(--tier-a), transparent); }
.model-card.tier-b::before { background: linear-gradient(90deg, var(--tier-b), transparent); }
.model-card.tier-c::before { background: linear-gradient(90deg, var(--tier-c), transparent); }
.model-card.tier-d::before { background: linear-gradient(90deg, var(--tier-d), transparent); }
.model-card.tier-f::before { background: linear-gradient(90deg, var(--tier-f), transparent); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-tier {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
}
.card-tier.tier-s { color: var(--tier-s); text-shadow: 0 0 20px rgba(0,255,170,0.3); }
.card-tier.tier-a { color: var(--tier-a); text-shadow: 0 0 20px rgba(0,212,255,0.3); }
.card-tier.tier-b { color: var(--tier-b); text-shadow: 0 0 20px rgba(255,204,0,0.3); }
.card-tier.tier-c { color: var(--tier-c); text-shadow: 0 0 20px rgba(255,136,68,0.3); }
.card-tier.tier-d { color: var(--tier-d); text-shadow: 0 0 20px rgba(255,51,136,0.3); }
.card-tier.tier-f { color: var(--tier-f); text-shadow: 0 0 20px rgba(255,34,68,0.3); }

.card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.card-vendor, .card-arch {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
}

.card-name {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tag {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  white-space: nowrap;
}

.card-specs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
}
.spec-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}
.spec-label {
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.spec-val {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 500;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.card-status.tier-s { background: rgba(0,255,170,0.08); color: var(--tier-s); }
.card-status.tier-a { background: rgba(0,212,255,0.08); color: var(--tier-a); }
.card-status.tier-b { background: rgba(255,204,0,0.08); color: var(--tier-b); }
.card-status.tier-c { background: rgba(255,136,68,0.08); color: var(--tier-c); }
.card-status.tier-d { background: rgba(255,51,136,0.08); color: var(--tier-d); }
.card-status.tier-f { background: rgba(255,34,68,0.08); color: var(--tier-f); }

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.card-install {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  border: 1px solid var(--border);
}
.install-cmd {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--neon-green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--neon-green); }
.copy-btn.copied { color: var(--neon-green); }

/* ========== 层级列表 ========== */
.tier-list {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-row {
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateX(-20px);
  min-height: 64px;
}
.tier-row.visible {
  animation: slideInLeft 0.4s ease forwards;
}

@keyframes slideInLeft {
  to { opacity: 1; transform: translateX(0); }
}

.tier-label {
  width: 90px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  gap: 2px;
}
.tier-row.tier-s .tier-label { background: rgba(0,255,170,0.12); }
.tier-row.tier-a .tier-label { background: rgba(0,212,255,0.12); }
.tier-row.tier-b .tier-label { background: rgba(255,204,0,0.12); }
.tier-row.tier-c .tier-label { background: rgba(255,136,68,0.12); }
.tier-row.tier-d .tier-label { background: rgba(255,51,136,0.12); }
.tier-row.tier-f .tier-label { background: rgba(255,34,68,0.12); }

.tier-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  line-height: 1;
}
.tier-row.tier-s .tier-letter { color: var(--tier-s); }
.tier-row.tier-a .tier-letter { color: var(--tier-a); }
.tier-row.tier-b .tier-letter { color: var(--tier-b); }
.tier-row.tier-c .tier-letter { color: var(--tier-c); }
.tier-row.tier-d .tier-letter { color: var(--tier-d); }
.tier-row.tier-f .tier-letter { color: var(--tier-f); }

.tier-desc {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tier-models {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
}

.tier-chip {
  display: flex;
  flex-direction: column;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  cursor: default;
}
.tier-chip:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
.chip-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.chip-params {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tier-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== FOOTER ========== */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}
.site-footer a {
  color: var(--neon-green);
  text-decoration: none;
  transition: opacity 0.2s;
}
.site-footer a:hover { opacity: 0.7; }
.footer-note {
  margin-top: 8px;
  font-size: 0.68rem;
}

/* ========== 工具类 ========== */
.hidden { display: none !important; }

/* ========== 响应式 ========== */
@media (max-width: 640px) {
  .hero { padding: 60px 16px 32px; }
  .hw-bar { padding: 12px 16px; gap: 8px 12px; }
  .hw-select-wide { min-width: 120px; max-width: 180px; }
  .hw-sep { display: none; }
  .models-grid { grid-template-columns: 1fr; padding: 0 16px 48px; }
  .controls { padding: 0 16px; }
  .controls-row { flex-direction: column; align-items: stretch; }
  .filter-bar { justify-content: center; }
  .view-toggle { align-self: center; }
  .tier-label { width: 60px; }
  .tier-letter { font-size: 1.2rem; }
  .tier-desc { display: none; }
  .stats-bar { gap: 10px; justify-content: center; }
}

@media (max-width: 380px) {
  .hw-bar { flex-direction: column; align-items: stretch; }
  .hw-item { justify-content: space-between; }
  .hw-select-wide { max-width: 100%; }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* ========== 选中文本 ========== */
::selection {
  background: rgba(0, 255, 170, 0.2);
  color: var(--text-primary);
}
