/* Abyss Raid · 深渊讨伐 — 暗色深渊奇幻风 */
:root {
  --bg: #070312;
  --bg-2: #0d0620;
  --card: #120a2a;
  --card-2: #170d33;
  --border: #2c1c5e;
  --border-soft: #221547;
  --text: #ece6ff;
  --muted: #a293d1;
  --accent: #a855f7;
  --accent-2: #22d3ee;
  --gold: #fbbf24;
  --fire: #fb923c;
  --fire-deep: #ea580c;
  --water: #38bdf8;
  --water-deep: #0284c7;
  --wood: #4ade80;
  --wood-deep: #16a34a;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(168, 85, 247, .22), transparent 60%),
    radial-gradient(700px 420px at 5% 0%, rgba(34, 211, 238, .12), transparent 55%),
    linear-gradient(180deg, #0a0518 0%, var(--bg) 30%, #05010f 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 5, 24, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-orb {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c084fc, #7b2ff7 55%, #1a0b2e 100%);
  box-shadow: 0 0 24px rgba(168, 85, 247, .7), inset 0 0 12px rgba(255, 255, 255, .25);
  position: relative;
}
.brand-orb::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffb020;
  box-shadow: 13px 0 0 #ffb020;
}
.brand h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: .02em;
  background: linear-gradient(90deg, #e9d5ff, #a855f7 55%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 通用 ---------- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 20px 20px 40px; }
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .45);
}
.card h2 { margin: 0 0 8px; font-size: 1.3rem; }
.card h3 { margin: 18px 0 8px; font-size: 1.05rem; color: #d8b4fe; }
.muted { color: var(--muted); font-size: .92rem; }
.btn {
  cursor: pointer;
  border: 1px solid var(--border);
  background: #1c1038;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: .95rem;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { background: #271549; box-shadow: 0 0 14px rgba(168, 85, 247, .35); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, #7b2ff7, #4f46e5);
  border-color: #7b2ff7;
  font-weight: 700;
}
.btn-primary:hover { background: linear-gradient(135deg, #9333ea, #6366f1); }
.btn-ghost { background: transparent; }
.btn-small { padding: 5px 12px; font-size: .85rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .82rem;
  border: 1px solid var(--border);
  background: #1c1038;
  white-space: nowrap;
}
.badge-mode.mock { color: var(--gold); border-color: #92600a; }
.badge-mode.live { color: var(--ok); border-color: #166534; }
.badge.warn { color: var(--gold); border-color: #92600a; }
.badge.ok { color: var(--ok); border-color: #166534; }

/* ---------- Boss 区 ---------- */
.boss-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: center;
}
.beast-svg { width: 100%; height: auto; display: block; }
.beast-body { animation: floaty 5s ease-in-out infinite; transform-origin: 320px 220px; }
.eye { animation: eyeGlow 2.6s ease-in-out infinite; }
.rune { animation: twinkle 3.2s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@keyframes eyeGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}
@keyframes twinkle {
  0%, 100% { opacity: .95; }
  50% { opacity: .35; }
}
.boss-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.boss-name-row h2 { margin: 0; }
.boss-id { color: var(--accent-2); font-size: 1rem; }
.elem-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .88rem;
  font-weight: 700;
  border: 1px solid;
}
.elem-fire { color: var(--fire); border-color: var(--fire-deep); background: rgba(234, 88, 12, .14); box-shadow: 0 0 12px rgba(234, 88, 12, .25); }
.elem-water { color: var(--water); border-color: var(--water-deep); background: rgba(2, 132, 199, .14); box-shadow: 0 0 12px rgba(2, 132, 199, .25); }
.elem-wood { color: var(--wood); border-color: var(--wood-deep); background: rgba(22, 163, 74, .14); box-shadow: 0 0 12px rgba(22, 163, 74, .25); }
.hp-wrap { margin: 6px 0 16px; }
.hp-bar {
  height: 24px;
  border-radius: 999px;
  background: #1a0f33;
  border: 1px solid var(--border);
  overflow: hidden;
}
.hp-bar-small { height: 18px; }
.hp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #dc2626, #f97316 55%, #fbbf24);
  box-shadow: 0 0 16px rgba(249, 115, 22, .55);
  transition: width .6s ease;
}
.hp-text { margin-top: 6px; font-size: .92rem; color: var(--muted); text-align: right; }
.hp-text span { color: var(--text); font-weight: 700; }
.boss-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat {
  background: rgba(10, 5, 24, .6);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-wide { grid-column: 1 / -1; }
.stat-label { color: var(--muted); font-size: .82rem; }
.stat strong { font-size: 1.25rem; }
.stat .countdown { color: var(--gold); font-size: 1.35rem; letter-spacing: .03em; }
.stat-sub { color: var(--muted); font-size: .8rem; }

/* ---------- 排行榜 ---------- */
.table-wrap { overflow-x: auto; margin-top: 10px; }
.lb-table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 560px; }
.lb-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: .82rem;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.lb-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.lb-table tbody tr:hover { background: rgba(168, 85, 247, .07); }
.lb-table .rank { font-weight: 700; width: 52px; }
.lb-table .rank-1 { color: var(--gold); }
.lb-table .rank-2 { color: #e5e7eb; }
.lb-table .rank-3 { color: #d97706; }
.lb-table .pname { font-weight: 700; color: #d8b4fe; }
.lb-table .paddr { color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.lb-table .pscore { font-weight: 700; color: var(--gold); }

/* ---------- 战报流 ---------- */
.feed { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(10, 5, 24, .55);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: .92rem;
}
.feed-item.crit { border-color: rgba(251, 191, 36, .55); box-shadow: 0 0 14px rgba(251, 191, 36, .12); }
.feed-item.defeat { border-color: rgba(168, 85, 247, .6); background: rgba(123, 47, 247, .12); }
.feed-item.spawn { border-color: rgba(34, 211, 238, .5); background: rgba(34, 211, 238, .07); }
.feed-actor { font-weight: 700; color: #d8b4fe; }
.feed-dmg { font-weight: 700; color: #fdba74; }
.feed-crit { color: var(--gold); font-weight: 700; }
.feed-hp { color: var(--muted); margin-left: auto; font-size: .85rem; }
.feed-time { color: var(--muted); font-size: .82rem; }

/* ---------- Agent 接入区 ---------- */
.contract-box {
  background: rgba(10, 5, 24, .6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contract-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.contract-label { color: var(--muted); font-size: .9rem; }
.contract-addr {
  font-size: .9rem;
  word-break: break-all;
  color: #a5f3fc;
  background: rgba(34, 211, 238, .08);
  border: 1px solid rgba(34, 211, 238, .25);
  border-radius: 8px;
  padding: 4px 10px;
}
a.disabled { color: var(--muted); pointer-events: none; text-decoration: line-through; }
.prompt-card {
  border: 1px solid rgba(168, 85, 247, .45);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(123, 47, 247, .07);
}
.prompt-card h3 { margin-top: 0; }
.prompt-text {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0a0518;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 14px;
  max-height: 300px;
  overflow-y: auto;
  font-size: .88rem;
  line-height: 1.65;
  margin: 0 0 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.prompt-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.copy-feedback { color: var(--ok); font-size: .9rem; min-height: 1.2em; }
.steps { margin: 8px 0 0; padding-left: 22px; }
.steps li { margin-bottom: 6px; }
.steps code { color: #a5f3fc; background: rgba(34, 211, 238, .08); padding: 1px 6px; border-radius: 6px; }

/* ---------- 模拟器 ---------- */
.sim-arena {
  position: relative;
  background: radial-gradient(400px 200px at 50% 40%, rgba(123, 47, 247, .25), transparent 70%), rgba(10, 5, 24, .55);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  overflow: hidden;
}
.sim-beast-svg { width: 150px; height: auto; animation: floaty 4s ease-in-out infinite; }
.sim-float-layer { position: absolute; inset: 0; pointer-events: none; }
.dmg-float {
  position: absolute;
  top: 22%;
  font-weight: 800;
  font-size: 1.3rem;
  color: #fdba74;
  text-shadow: 0 0 10px rgba(249, 115, 22, .8);
  animation: floatUp 1.1s ease-out forwards;
}
.dmg-float.crit { color: var(--gold); font-size: 1.6rem; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(10px) scale(.8); }
  15% { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-46px) scale(1); }
}
.sim-boss-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 6px;
  font-weight: 700;
}
.elem-picker { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.elem-btn {
  flex: 1 1 120px;
  cursor: pointer;
  border-radius: 12px;
  padding: 12px 8px;
  font-size: 1.05rem;
  font-weight: 700;
  background: #1c1038;
  border: 2px solid var(--border);
  color: var(--text);
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}
.elem-btn:hover { transform: translateY(-1px); }
.elem-btn.selected.elem-fire { border-color: var(--fire); box-shadow: 0 0 16px rgba(234, 88, 12, .45); }
.elem-btn.selected.elem-water { border-color: var(--water); box-shadow: 0 0 16px rgba(2, 132, 199, .45); }
.elem-btn.selected.elem-wood { border-color: var(--wood); box-shadow: 0 0 16px rgba(22, 163, 74, .45); }
.sim-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sim-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 14px 0 8px;
  font-size: .92rem;
  color: var(--muted);
}
.sim-stats strong { color: var(--text); }
.sim-log { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.sim-log li {
  background: rgba(10, 5, 24, .55);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: .9rem;
}
.sim-log li.crit { border-color: rgba(251, 191, 36, .5); }
.sim-log li.defeat { border-color: rgba(168, 85, 247, .6); background: rgba(123, 47, 247, .12); }

/* ---------- 规则与页脚 ---------- */
.rules-list { margin: 8px 0 0; padding-left: 20px; }
.rules-list li { margin-bottom: 9px; }
.rules-list li::marker { color: var(--accent); }
.footer {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px 36px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .boss-card { grid-template-columns: 1fr; }
  .boss-stats { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 16px; }
  .brand h1 { font-size: 1.2rem; }
  .topbar-inner { padding: 10px 14px; }
  .wrap { padding: 14px 14px 30px; }
  .feed-hp { margin-left: 0; }
}
