/* ============================================================
   Warcraft BIS · 简约科技感暗色主题
   移动端优先，桌面端自动扩展
   ============================================================ */

:root {
  --bg: #0a0e14;
  --bg-soft: #10161f;
  --bg-card: #141c28;
  --bg-card-hover: #1a2432;
  --border: #22303f;
  --border-glow: #e8c15a;
  --text: #e8eef4;
  --text-dim: #8fa3b8;
  --text-faint: #5b6f84;
  --accent: #e8c15a;
  --danger: #ff5c5c;
  --ok: #43d17c;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(232, 193, 90, .07), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(60, 130, 255, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 72px;
  overflow-x: hidden;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 20, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: none; cursor: pointer; color: var(--text); padding: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8c15a, #a97c1f);
  color: #0a0e14; font-weight: 800; font-size: 20px;
  box-shadow: 0 0 14px rgba(232, 193, 90, .35);
}
.brand-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: var(--text-dim); }
.version-badge {
  font-size: 12px; color: var(--accent);
  border: 1px solid rgba(232, 193, 90, .45);
  border-radius: 999px; padding: 4px 12px;
  background: rgba(232, 193, 90, .08);
}

/* ---------- 主容器 ---------- */
.app { max-width: var(--maxw); margin: 0 auto; padding: 16px; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 首页 Hero ---------- */
.hero { padding: 14px 4px 20px; }
.hero-title {
  font-size: 26px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(90deg, #fff, #e8c15a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 6px; font-size: 13px; color: var(--text-dim); }

/* ---------- 职业卡片网格 ---------- */
.class-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .class-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .class-grid { grid-template-columns: repeat(4, 1fr); } }

.class-card {
  position: relative; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px;
  cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-align: left; color: var(--text);
}
.class-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--cc); opacity: .9;
}
.class-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--cc); opacity: .08; transition: opacity .2s ease;
}
.class-card:hover, .class-card:active { transform: translateY(-3px); border-color: var(--cc); box-shadow: 0 0 18px rgba(0,0,0,.4), 0 0 12px color-mix(in srgb, var(--cc) 25%, transparent); }
.class-card:hover::after { opacity: .16; }
.class-icon {
  width: 46px; height: 46px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #0a0e14;
  background: linear-gradient(135deg, #fff, var(--cc));
  margin-bottom: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
img.class-icon {
  background: none;
  object-fit: cover;
  display: block;
}
.class-name { font-size: 16px; font-weight: 700; }
.class-en { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.class-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.class-meta .chip { font-size: 10px; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }

/* ---------- 职业页 / 专精列表 ---------- */
.sub-hero {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; margin-bottom: 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-left: 4px solid var(--cc);
  border-radius: var(--radius);
}
.sub-hero .class-icon { margin: 0; width: 52px; height: 52px; font-size: 25px; }
.sub-hero h2 { font-size: 21px; font-weight: 800; }
.sub-hero .class-en { font-size: 12px; color: var(--text-dim); }
.spec-count { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.spec-list { display: flex; flex-direction: column; gap: 12px; }
.spec-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  cursor: pointer; transition: transform .15s ease, border-color .15s ease;
  text-align: left; color: var(--text);
}
.spec-card:hover, .spec-card:active { transform: translateX(4px); border-color: var(--cc); }
.spec-icon {
  width: 44px; height: 44px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #0a0e14;
  background: linear-gradient(135deg, #fff, var(--cc));
}
.spec-info { flex: 1; min-width: 0; }
.spec-name { font-size: 16px; font-weight: 700; }
.spec-en { font-size: 11px; color: var(--text-dim); }
.spec-role {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim); flex: none;
}
.spec-role.tank { color: #7ea6ff; border-color: rgba(126,166,255,.4); }
.spec-role.healer { color: #43d17c; border-color: rgba(67,209,124,.4); }
.spec-role.dps { color: #ff7d5c; border-color: rgba(255,125,92,.4); }
.spec-arrow { color: var(--text-faint); font-size: 18px; }

/* ---------- 专精详情 ---------- */
.spec-hero { padding: 6px 2px 16px; }
.spec-hero h2 { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.spec-hero .breadcrumb { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.spec-hero .meta-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.meta-line .chip { font-size: 11px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); }
.meta-line .chip.hl { color: var(--accent); border-color: rgba(232,193,90,.4); background: rgba(232,193,90,.07); }

.status-banner {
  display: none; align-items: center; gap: 8px;
  font-size: 13px; padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 14px; border: 1px dashed rgba(255,180,80,.5);
  background: rgba(255,180,80,.08); color: #ffd79a;
}
.status-banner.show { display: flex; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px;
  position: sticky; top: 58px; z-index: 20;
  backdrop-filter: blur(10px);
}
.tab {
  flex: 1; padding: 9px 0; border: none; border-radius: 999px;
  background: transparent; color: var(--text-dim);
  font-size: 13px; cursor: pointer; transition: all .18s ease;
}
.tab.active { background: linear-gradient(135deg, #e8c15a, #b8860b); color: #0a0e14; font-weight: 700; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .25s ease; }

/* ---------- BIS 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
table.bis-table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 13px; }
.bis-table th, .bis-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.bis-table thead th {
  font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .6px;
  background: var(--bg-soft); position: sticky; top: 0;
}
.bis-table tbody tr:last-child td { border-bottom: none; }
.bis-table tbody tr:hover { background: rgba(255,255,255,.02); }
.bis-table .slot { font-weight: 700; color: var(--accent); white-space: nowrap; }
.bis-table .item-name { font-weight: 600; }
.item-name-cell { display: flex; align-items: center; gap: 10px; }
.item-name-cell .item-icon { width: 42px; height: 42px; border-radius: 8px; flex: none; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 2px 6px rgba(0,0,0,.35); }
.item-name-box { min-width: 0; }
.item-name-box .item-name { font-weight: 600; line-height: 1.35; }
.item-name-box .item-name-en { font-size: 11px; color: var(--text-faint); margin-top: 2px; word-break: break-all; }
.extras .gem { color: #b9a6ff; }
.extras .gem-icon { width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 2px; }
.bis-table .ilvl { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.source-tag { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.source-tag.raid { color: #ff9d7a; border: 1px solid rgba(255,157,122,.4); background: rgba(255,157,122,.08); }
.source-tag.mplus { color: #7ab8ff; border: 1px solid rgba(122,184,255,.4); background: rgba(122,184,255,.08); }
.source-tag.craft { color: #8ce3a8; border: 1px solid rgba(140,227,168,.4); background: rgba(140,227,168,.08); }
.source-tag.world { color: #e8d58a; border: 1px solid rgba(232,213,138,.4); background: rgba(232,213,138,.08); }
.extras { font-size: 11px; color: var(--text-dim); line-height: 1.6; }
.extras b { color: var(--text); }
.extras .gem { color: #b9a6ff; }
.extras .ench { color: #9fd8ff; }
.extras .emb { color: #ffb3d9; }
.note-line { margin-top: 12px; font-size: 12px; color: var(--text-dim); display: flex; gap: 8px; align-items: flex-start; }
.note-line::before { content: "ℹ"; flex: none; color: var(--accent); }

/* ---------- 毕业属性 ---------- */
.stats-priority {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.stats-priority h3 { font-size: 15px; margin-bottom: 12px; color: var(--accent); }
.prio-list { display: flex; flex-direction: column; gap: 10px; }
.prio-row { display: flex; align-items: flex-start; gap: 12px; }
.prio-idx {
  width: 24px; height: 24px; flex: none; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8c15a, #a97c1f); color: #0a0e14;
  font-weight: 800; font-size: 12px;
}
.prio-body { flex: 1; min-width: 0; }
.prio-stat { font-weight: 700; font-size: 14px; }
.prio-note { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.5; }
.stats-recommended { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .stats-recommended { grid-template-columns: repeat(3, 1fr); } }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
}
.stat-card .stat-key { font-size: 11px; color: var(--text-dim); }
.stat-card .stat-val { font-size: 18px; font-weight: 800; margin-top: 4px; }
.stat-card .stat-note { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ---------- 场景天赋 ---------- */
.talent-scenario { margin-bottom: 14px; }
.talent-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.talent-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.talent-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.talent-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cc); }
.talent-code {
  font-family: "Consolas", "JetBrains Mono", monospace; font-size: 11px;
  color: var(--accent); word-break: break-all;
  background: rgba(232,193,90,.07); border: 1px solid rgba(232,193,90,.25);
  padding: 6px 10px; border-radius: 6px; cursor: pointer; max-width: 100%;
}
.talent-code:hover { background: rgba(232,193,90,.14); }
.talent-body { padding: 14px 16px; }
.talent-desc { font-size: 13px; line-height: 1.7; }
.talent-notes { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.talent-notes .note { font-size: 12px; color: var(--text-dim); display: flex; gap: 8px; line-height: 1.55; }
.talent-notes .note::before { content: "▸"; color: var(--accent); flex: none; }

/* ---------- 数据说明页 ---------- */
.about-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 18px; margin-top: 8px;
}
.about-card h2 { font-size: 18px; margin-bottom: 14px; color: var(--accent); }
.about-card h3 { font-size: 14px; margin: 16px 0 8px; color: var(--text); }
.about-card p, .about-card li { font-size: 13px; color: var(--text-dim); line-height: 1.8; }
.about-card ul { padding-left: 18px; }
.about-card .kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.about-card .kv .k { color: var(--text-dim); }
.about-card .kv .v { color: var(--text); font-weight: 600; text-align: right; }

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around;
  background: rgba(10, 14, 20, .92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.nav-btn {
  background: none; border: none; color: var(--text-faint);
  font-size: 12px; padding: 6px 22px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color .15s ease;
}
.nav-btn::before { content: ""; font-size: 16px; }
.nav-btn[data-nav="home"]::before { content: "⌂"; }
.nav-btn[data-nav="about"]::before { content: "i"; font-weight: 800; font-size: 15px; border: 1.5px solid currentColor; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.nav-btn.active { color: var(--accent); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: rgba(20, 28, 40, .96); color: var(--text);
  border: 1px solid rgba(232,193,90,.4); border-radius: 999px;
  padding: 9px 18px; font-size: 12px; z-index: 100;
  box-shadow: var(--shadow); white-space: nowrap;
}

/* ---------- 加载 / 错误 ---------- */
.loading, .error-msg { text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: 14px; }
.error-msg { color: var(--danger); }
.spinner {
  width: 26px; height: 26px; margin: 0 auto 12px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center; padding: 36px 20px; color: var(--text-dim); font-size: 13px;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state .big { font-size: 30px; margin-bottom: 10px; }
