/* ==========================================================
   《向天再借500年》 · 赛博朋克 + 中医古风
   ========================================================== */
:root {
  --bg-0: #05060d;
  --bg-1: #0a0d1a;
  --ink: #e8e1c8;          /* 古纸墨色 */
  --ink-dim: #a8a08a;
  --gold: #d4af37;          /* 中医金 */
  --gold-soft: #f0d97a;
  --jade: #36ffd0;          /* 赛博青 */
  --jade-deep: #00bda5;
  --crimson: #ff4d6d;
  --blood: #ff1f3d;
  --neon-purple: #b266ff;
  --neon-pink: #ff44aa;
  --line: rgba(212,175,55,0.25);
  --panel: rgba(10, 14, 26, 0.72);
  --panel-soft: rgba(20, 24, 38, 0.6);
  --shadow-glow: 0 0 30px rgba(54, 255, 208, 0.15);
}

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

html, body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: 'Noto Serif SC', 'ZCOOL XiaoWei', 'Microsoft YaHei', serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

/* ============ 背景层 ============ */
.bg-stars, .bg-bagua, .bg-grid, .bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
.bg-stars {
  background:
    radial-gradient(2px 2px at 20% 30%, #fff8, transparent),
    radial-gradient(1px 1px at 80% 60%, #fff6, transparent),
    radial-gradient(1px 1px at 40% 80%, #fffa, transparent),
    radial-gradient(2px 2px at 60% 20%, #fff7, transparent),
    radial-gradient(1px 1px at 90% 90%, #fff8, transparent),
    radial-gradient(1px 1px at 15% 70%, #fff5, transparent),
    radial-gradient(ellipse at 50% 50%, #0a1530 0%, #05060d 60%, #000 100%);
  animation: starTwinkle 8s ease-in-out infinite;
}
@keyframes starTwinkle { 0%,100%{opacity:1;} 50%{opacity:0.7;} }

.bg-grid {
  background-image:
    linear-gradient(rgba(54,255,208,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54,255,208,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 80%);
}

.bg-bagua {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><circle cx='100' cy='100' r='90' fill='none' stroke='%23d4af37' stroke-width='0.5' opacity='0.18'/><circle cx='100' cy='100' r='70' fill='none' stroke='%2336ffd0' stroke-width='0.4' opacity='0.15'/><circle cx='100' cy='100' r='50' fill='none' stroke='%23d4af37' stroke-width='0.4' opacity='0.15'/><path d='M100 10 A45 45 0 0 1 100 100 A45 45 0 0 0 100 190 A90 90 0 0 1 100 10' fill='none' stroke='%23d4af37' stroke-width='0.5' opacity='0.2'/></svg>");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 1200px 1200px;
  animation: rotateBagua 240s linear infinite;
  opacity: 0.5;
}
@keyframes rotateBagua { from{transform:rotate(0);} to{transform:rotate(360deg);} }

.bg-glow {
  background:
    radial-gradient(circle at 20% 20%, rgba(178,102,255,0.18), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(54,255,208,0.18), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(212,175,55,0.12), transparent 60%);
}

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(5,6,13,0.95), rgba(5,6,13,0.6));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-seal {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--crimson), #8a0d24);
  color: #fff8e0;
  font-family: 'Ma Shan Zheng', 'ZCOOL XiaoWei', serif;
  font-size: 28px;
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(255,77,109,0.6), inset 0 0 8px rgba(0,0,0,0.4);
  transform: rotate(-4deg);
  border: 1px solid rgba(255,255,255,0.15);
}
.brand-cn {
  font-family: 'Ma Shan Zheng', serif;
  font-size: 26px;
  color: var(--gold-soft);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(212,175,55,0.4);
}
.brand-cn .num {
  color: var(--jade);
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  margin: 0 4px;
  text-shadow: 0 0 12px rgba(54,255,208,0.7);
}
.brand-en {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 6px;
  color: var(--ink-dim);
  margin-top: 2px;
}

.nav { display: flex; gap: 6px; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 8px;
  color: var(--ink-dim);
  border: 1px solid transparent;
  transition: all .25s ease;
}
.nav-item i { font-size: 18px; }
.nav-item span { font-family: 'ZCOOL XiaoWei', serif; letter-spacing: 2px; }
.nav-item:hover { color: var(--gold-soft); background: rgba(212,175,55,0.06); }
.nav-item.active {
  color: var(--jade);
  border-color: rgba(54,255,208,0.4);
  background: linear-gradient(180deg, rgba(54,255,208,0.08), rgba(54,255,208,0.02));
  box-shadow: 0 0 14px rgba(54,255,208,0.2);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }
.title-badge {
  padding: 6px 14px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: 'Ma Shan Zheng', serif;
  color: var(--gold-soft);
  font-size: 14px;
  letter-spacing: 2px;
  background: rgba(212,175,55,0.06);
}
.user-tag {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--jade);
  background: rgba(54,255,208,0.06);
  display: inline-flex; align-items: center; gap: 6px;
}
.user-tag.hidden, .reset-btn.hidden { display: none; }

.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.auth-tab {
  flex: 1;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink-dim);
  transition: all .2s;
}
.auth-tab.active {
  color: var(--jade);
  border-color: rgba(54,255,208,0.5);
  background: rgba(54,255,208,0.08);
}
.auth-err {
  min-height: 18px;
  font-size: 12px;
  color: var(--blood);
  text-align: center;
  letter-spacing: 1px;
  margin-top: 4px;
}
.reset-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-dim);
  transition: all .25s;
}
.reset-btn:hover { color: var(--blood); border-color: var(--blood); }

/* ============ 主体 ============ */
.main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }
.tab-pane { display: none; animation: fadeIn .4s ease; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }

.page-title {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.page-title .cn {
  font-family: 'Ma Shan Zheng', serif;
  font-size: 32px;
  color: var(--gold-soft);
  letter-spacing: 4px;
}
.page-title .en {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 6px;
  color: var(--jade);
}
.sub-title {
  text-align: center;
  font-family: 'ZCOOL XiaoWei', serif;
  color: var(--ink-dim);
  font-size: 16px;
  letter-spacing: 4px;
  margin: 28px 0 16px;
}

/* ============ Pulse 核心倒计时 ============ */
.pulse-wrap {
  position: relative;
  display: grid; place-items: center;
  height: 480px;
  margin-bottom: 32px;
}
.pulse-rings {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.18);
}
.ring1 { width: 460px; height: 460px; border-color: rgba(212,175,55,0.25); animation: rotateRing 60s linear infinite; }
.ring2 { width: 380px; height: 380px; border-color: rgba(54,255,208,0.18); animation: rotateRing 90s linear infinite reverse; }
.ring3 { width: 300px; height: 300px; border-color: rgba(178,102,255,0.18); animation: rotateRing 45s linear infinite; }
@keyframes rotateRing { from{transform:rotate(0);} to{transform:rotate(360deg);} }

.ring-bagua {
  position: absolute;
  width: 460px; height: 460px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='%23d4af37' opacity='0.5'><text x='50' y='8' font-size='5' text-anchor='middle' font-family='serif'>☰</text><text x='85' y='15' font-size='5' text-anchor='middle' font-family='serif'>☱</text><text x='95' y='52' font-size='5' text-anchor='middle' font-family='serif'>☲</text><text x='85' y='90' font-size='5' text-anchor='middle' font-family='serif'>☳</text><text x='50' y='98' font-size='5' text-anchor='middle' font-family='serif'>☴</text><text x='15' y='90' font-size='5' text-anchor='middle' font-family='serif'>☵</text><text x='6' y='52' font-size='5' text-anchor='middle' font-family='serif'>☶</text><text x='15' y='15' font-size='5' text-anchor='middle' font-family='serif'>☷</text></g></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  animation: rotateRing 180s linear infinite;
  opacity: 0.7;
}

.pulse-core {
  position: relative;
  text-align: center;
  z-index: 2;
}
.pulse-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 8px;
  color: var(--jade);
  margin-bottom: 16px;
  text-shadow: 0 0 8px rgba(54,255,208,0.5);
}
.pulse-time {
  font-family: 'Orbitron', 'Noto Serif SC', sans-serif;
  font-size: 56px;
  font-weight: 900;
  color: var(--gold-soft);
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  text-shadow: 0 0 20px rgba(212,175,55,0.5), 0 0 40px rgba(212,175,55,0.2);
  letter-spacing: 2px;
}
.pulse-time .seg {
  display: inline-block;
  min-width: 1.8ch;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(212,175,55,0.5));
}
.pulse-time .seg.ms { font-size: 24px; color: var(--jade); -webkit-text-fill-color: var(--jade); margin-left: 4px; }
.pulse-time em {
  font-family: 'Ma Shan Zheng', serif;
  font-style: normal;
  font-size: 22px;
  color: var(--ink-dim);
  margin: 0 6px;
  font-weight: 400;
}
.pulse-seconds {
  margin-top: 12px;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--ink-dim);
}
.pulse-meta {
  margin-top: 20px;
  display: flex; gap: 28px; justify-content: center; flex-wrap: wrap;
}
.meta-item { text-align: center; }
.meta-label { display: block; font-size: 11px; letter-spacing: 3px; color: var(--ink-dim); }
.meta-val {
  display: inline-block;
  margin-top: 4px;
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.meta-val.realm { font-family: 'Ma Shan Zheng', serif; color: var(--gold-soft); letter-spacing: 2px; }
.meta-val.coin { color: var(--gold-soft); }

.pulse-toggle { margin-top: 18px; display: flex; gap: 8px; justify-content: center; }
.t-btn {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-dim);
  transition: all .2s;
}
.t-btn:hover { color: var(--gold-soft); }
.t-btn.active { color: var(--jade); border-color: rgba(54,255,208,0.5); background: rgba(54,255,208,0.06); }

/* 危机状态 */
body.crisis .pulse-time { color: var(--blood); -webkit-text-fill-color: var(--blood); animation: heartbeat 1.2s ease-in-out infinite; }
body.crisis .ring1 { border-color: var(--blood); animation: heartbeat 1.2s infinite; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px var(--blood)); }
  20% { transform: scale(1.05); filter: drop-shadow(0 0 30px var(--blood)); }
  40% { transform: scale(1); }
}
.crisis-overlay {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(255,31,61,0.25) 100%);
  animation: crisisPulse 1s ease-in-out infinite;
}
.crisis-overlay.hidden { display: none; }
.crisis-overlay .crisis-text {
  position: absolute; top: 90px; left: 50%; transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif; font-size: 18px; letter-spacing: 8px;
  color: var(--blood); text-shadow: 0 0 12px var(--blood);
}
@keyframes crisisPulse { 0%,100% {opacity:1;} 50%{opacity:0.4;} }

/* ============ 卡片 ============ */
.dash-cards {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 20px;
}
@media (max-width: 860px) { .dash-cards { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow-glow);
}
.card::before {
  content: '';
  position: absolute; top: -1px; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.card h3 {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--gold-soft);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.card h3 i { color: var(--jade); }

.modifier-list { list-style: none; }
.modifier-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(168,160,138,0.2);
  font-size: 14px;
}
.modifier-list li:last-child { border-bottom: none; }
.modifier-list li.empty { color: var(--ink-dim); justify-content: center; padding: 16px 0; }
.mod-name { color: var(--ink); }
.mod-val { font-family: 'Orbitron', sans-serif; font-weight: 700; }
.mod-val.bad { color: var(--blood); }
.mod-val.good { color: var(--jade); }

.event-log { list-style: none; max-height: 240px; overflow-y: auto; padding-right: 4px; }
.event-log li {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(168,160,138,0.15);
  font-size: 13px;
  color: var(--ink);
  display: flex; gap: 10px;
  animation: slideIn .3s ease;
}
.event-log li time { color: var(--ink-dim); font-family: 'Orbitron', sans-serif; font-size: 11px; flex-shrink: 0; min-width: 60px; }
.event-log li .ev-good { color: var(--jade); }
.event-log li .ev-bad { color: var(--blood); }
@keyframes slideIn { from{opacity:0; transform:translateX(-8px);} to{opacity:1; transform:none;} }

.ghost-btn {
  margin-top: 14px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--gold-soft);
  background: rgba(212,175,55,0.05);
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.ghost-btn:hover { background: rgba(212,175,55,0.12); border-color: var(--gold); }

/* ============ 修炼任务卡 ============ */
.cultivation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.task-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex; gap: 14px;
  position: relative;
  transition: all .25s;
}
.task-card:hover { border-color: rgba(54,255,208,0.4); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(54,255,208,0.1); }
.task-card.challenge { background: linear-gradient(135deg, rgba(178,102,255,0.08), var(--panel)); border-color: rgba(178,102,255,0.3); }
.task-card.done { opacity: 0.6; }
.task-card.done::after {
  content: '已打卡'; position: absolute; top: 12px; right: 12px;
  background: var(--jade-deep); color: #001;
  padding: 2px 8px; border-radius: 4px; font-size: 10px; letter-spacing: 2px;
}

.task-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(54,255,208,0.1));
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 22px;
  color: var(--gold-soft);
  flex-shrink: 0;
}
.task-card.challenge .task-icon { color: var(--neon-purple); border-color: rgba(178,102,255,0.4); }

.task-body { flex: 1; }
.task-body h4 {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--gold-soft);
  margin-bottom: 4px;
}
.task-body p { font-size: 12px; color: var(--ink-dim); margin-bottom: 8px; line-height: 1.5; }
.task-reward { font-size: 12px; color: var(--ink-dim); }
.task-reward .reward-life { color: var(--jade); font-family: 'Orbitron', sans-serif; }
.task-reward .reward-mod { color: var(--gold-soft); font-family: 'Orbitron', sans-serif; }
.task-reward .reward-coin { color: var(--neon-pink); }

.task-btn {
  align-self: flex-end;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--jade-deep), var(--jade));
  color: #001;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  transition: all .2s;
  box-shadow: 0 0 12px rgba(54,255,208,0.3);
}
.task-btn:hover { transform: scale(1.05); box-shadow: 0 0 18px rgba(54,255,208,0.6); }
.task-btn:disabled { background: #333; color: #888; cursor: not-allowed; box-shadow: none; }

.step-input { margin: 8px 0; }
.step-input input[type=range] {
  width: 100%; accent-color: var(--jade);
}
.step-num { font-family: 'Orbitron', sans-serif; font-size: 14px; color: var(--gold-soft); text-align: right; }

.water-cups { display: flex; gap: 4px; margin: 8px 0; }
.water-cup {
  flex: 1; height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  position: relative;
  background: rgba(54,255,208,0.05);
}
.water-cup.filled { background: linear-gradient(180deg, transparent 30%, var(--jade)); box-shadow: 0 0 8px rgba(54,255,208,0.5); }

.streak-bar { display: flex; gap: 4px; margin: 6px 0; }
.streak-bar span {
  flex: 1; height: 8px;
  background: rgba(178,102,255,0.1);
  border: 1px solid rgba(178,102,255,0.3);
  border-radius: 2px;
}
.streak-bar span.on { background: var(--neon-purple); box-shadow: 0 0 6px var(--neon-purple); }

/* ============ 丹房 ============ */
.merit-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .merit-bar { grid-template-columns: 1fr; } }
.merit-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.merit-item i { font-size: 28px; color: var(--gold-soft); }
.merit-label { font-size: 11px; letter-spacing: 3px; color: var(--ink-dim); }
.merit-val { font-family: 'Orbitron', sans-serif; font-size: 22px; font-weight: 700; color: var(--gold-soft); }

.potion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.potion {
  background: linear-gradient(180deg, var(--panel), var(--panel-soft));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  position: relative;
  transition: all .25s;
}
.potion:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 10px 30px rgba(212,175,55,0.15); }
.potion-emoji { font-size: 44px; margin-bottom: 8px; filter: drop-shadow(0 0 12px rgba(212,175,55,0.5)); }
.potion h4 {
  font-family: 'Ma Shan Zheng', serif;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--gold-soft);
  margin-bottom: 4px;
}
.potion .potion-desc { font-size: 12px; color: var(--ink-dim); min-height: 36px; margin-bottom: 10px; line-height: 1.5; }
.potion .potion-cost {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  background: rgba(178,102,255,0.1);
  border: 1px solid rgba(178,102,255,0.3);
  border-radius: 999px;
  font-size: 11px;
  color: var(--neon-purple);
  letter-spacing: 1px;
}
.potion .potion-buy {
  display: block; width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, var(--gold), #a17e1d);
  color: #1a1208;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 2px;
  transition: all .2s;
}
.potion .potion-buy:hover { box-shadow: 0 0 16px var(--gold); }
.potion .potion-buy:disabled { background: #333; color: #888; cursor: not-allowed; }

.active-potions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.active-potions .empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-dim);
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.active-potion {
  padding: 12px 14px;
  background: rgba(54,255,208,0.06);
  border: 1px solid rgba(54,255,208,0.3);
  border-radius: 8px;
  font-size: 13px;
}
.active-potion .ap-name { color: var(--jade); font-family: 'ZCOOL XiaoWei', serif; letter-spacing: 1px; }
.active-potion .ap-time { font-family: 'Orbitron', sans-serif; font-size: 11px; color: var(--ink-dim); margin-top: 2px; }

/* ============ 排行榜 ============ */
.board-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.board-tab {
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink-dim);
}
.board-tab.active {
  color: var(--jade);
  border-color: rgba(54,255,208,0.5);
  background: rgba(54,255,208,0.08);
  box-shadow: 0 0 10px rgba(54,255,208,0.2);
}

.board-list { display: flex; flex-direction: column; gap: 8px; }
.board-row {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: all .2s;
}
.board-row.me { border-color: var(--jade); background: rgba(54,255,208,0.08); }
.board-row .rank {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--ink-dim);
  text-align: center;
}
.board-row.top1 .rank { color: var(--gold); text-shadow: 0 0 10px var(--gold); }
.board-row.top2 .rank { color: #c0c0c0; text-shadow: 0 0 10px #c0c0c0; }
.board-row.top3 .rank { color: #cd7f32; text-shadow: 0 0 10px #cd7f32; }
.board-row .name { font-family: 'ZCOOL XiaoWei', serif; font-size: 16px; letter-spacing: 1px; color: var(--gold-soft); }
.board-row .name .you { font-size: 11px; color: var(--jade); margin-left: 6px; padding: 1px 6px; border: 1px solid var(--jade); border-radius: 4px; }
.board-row .title { font-size: 11px; color: var(--ink-dim); letter-spacing: 2px; }
.board-row .val { font-family: 'Orbitron', sans-serif; font-size: 16px; color: var(--jade); }

.titles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.title-card {
  padding: 16px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.title-card .age-range {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.title-card .title-name {
  font-family: 'Ma Shan Zheng', serif;
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--gold-soft);
}
.title-card.legendary {
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(178,102,255,0.1));
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(212,175,55,0.25);
}
.title-card.legendary .title-name { color: var(--gold); text-shadow: 0 0 8px var(--gold); }

/* ============ Profile ============ */
.profile-card {
  display: flex; align-items: center; gap: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .profile-card { flex-direction: column; text-align: center; } }
.avatar-wrap { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.avatar {
  position: absolute; inset: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--crimson), #4a0612);
  border-radius: 50%;
  font-family: 'Ma Shan Zheng', serif;
  color: var(--gold-soft);
  font-size: 48px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.5), 0 0 20px rgba(255,77,109,0.3);
}
.avatar-ring {
  position: absolute; inset: 0;
  border: 2px solid var(--gold);
  border-radius: 50%;
  border-style: dashed;
  animation: rotateRing 30s linear infinite;
}
.profile-info { flex: 1; }
.profile-info .pi-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(168,160,138,0.2);
  font-size: 14px;
}
.profile-info .pi-row:last-child { border-bottom: none; }
.pi-label { color: var(--ink-dim); letter-spacing: 2px; }
.pi-value { color: var(--gold-soft); font-family: 'Orbitron', sans-serif; }

.formula-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.formula-card h3 {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--jade);
  margin-bottom: 12px;
}
.formula {
  font-family: 'Orbitron', monospace;
  font-size: 15px;
  color: var(--gold-soft);
  background: rgba(0,0,0,0.4);
  padding: 14px;
  border-radius: 6px;
  border-left: 3px solid var(--jade);
  white-space: pre-wrap;
  word-break: break-all;
}
.formula-note { margin-top: 10px; font-size: 12px; color: var(--ink-dim); line-height: 1.6; }

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,6,13,0.85);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-card {
  width: 100%; max-width: 500px;
  background: linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 32px;
  position: relative;
  box-shadow: 0 0 40px rgba(212,175,55,0.3);
  animation: oracleIn .5s cubic-bezier(.2,1,.4,1);
}
@keyframes oracleIn { from{opacity:0; transform:scale(.9) translateY(20px);} to{opacity:1; transform:none;} }

.oracle-glow {
  position: absolute; inset: -2px;
  background: linear-gradient(45deg, var(--gold), var(--jade), var(--neon-purple), var(--gold));
  background-size: 300% 300%;
  border-radius: 14px;
  z-index: -1;
  animation: oracleGlow 8s ease infinite;
  opacity: 0.5;
  filter: blur(8px);
}
@keyframes oracleGlow { 0%,100%{background-position:0% 50%;} 50%{background-position:100% 50%;} }

.oracle-title {
  text-align: center;
  margin-bottom: 8px;
}
.oracle-title .cn {
  display: block;
  font-family: 'Ma Shan Zheng', serif;
  font-size: 30px;
  letter-spacing: 6px;
  color: var(--gold-soft);
  text-shadow: 0 0 12px rgba(212,175,55,0.5);
}
.oracle-title .en {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 8px;
  color: var(--jade);
  margin-top: 4px;
}
.oracle-sub {
  text-align: center;
  color: var(--ink-dim);
  font-size: 13px;
  margin-bottom: 24px;
  letter-spacing: 2px;
}

.oracle-form { display: flex; flex-direction: column; gap: 12px; }
.oracle-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; letter-spacing: 2px;
  color: var(--ink-dim);
}
.oracle-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.oracle-form input, .oracle-form select {
  padding: 10px 12px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--gold-soft);
  font-size: 14px;
  font-family: 'Orbitron', sans-serif;
}
.oracle-form input:focus, .oracle-form select:focus {
  outline: none; border-color: var(--jade);
  box-shadow: 0 0 8px rgba(54,255,208,0.3);
}
.chk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
@media (max-width: 540px) { .chk-row { grid-template-columns: 1fr 1fr; } }
.chk {
  display: flex !important; flex-direction: row !important; align-items: center; gap: 6px !important;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 1px !important;
}
.chk:has(input:checked) { background: rgba(255,77,109,0.1); border-color: var(--crimson); color: var(--crimson); }
.chk input { width: 16px; height: 16px; accent-color: var(--crimson); }

.oracle-btn {
  margin-top: 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold), #b8902a);
  color: #1a1208;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 6px;
  font-family: 'Ma Shan Zheng', serif;
  transition: all .2s;
  box-shadow: 0 0 14px rgba(212,175,55,0.4);
}
.oracle-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(212,175,55,0.6); }

.modal-card.dying {
  text-align: center;
  border-color: var(--blood);
  box-shadow: 0 0 50px rgba(255,31,61,0.4);
}
.modal-card.dying h2 {
  font-family: 'Ma Shan Zheng', serif;
  font-size: 32px;
  letter-spacing: 6px;
  color: var(--blood);
  margin-bottom: 16px;
}
.modal-card.dying p { color: var(--ink); margin: 8px 0; line-height: 1.7; }
.modal-card.dying strong { color: var(--gold-soft); }
.dying-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ============ Toast ============ */
.toast-wrap {
  position: fixed; top: 90px; right: 24px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(54,255,208,0.15), var(--panel));
  border: 1px solid var(--jade);
  border-left: 4px solid var(--jade);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 6px 24px rgba(0,0,0,0.4), 0 0 12px rgba(54,255,208,0.2);
  animation: toastIn .3s ease, toastOut .4s ease 2.6s forwards;
  max-width: 320px;
}
.toast.bad { border-color: var(--blood); border-left-color: var(--blood); background: linear-gradient(135deg, rgba(255,31,61,0.15), var(--panel)); }
.toast.gold { border-color: var(--gold); border-left-color: var(--gold); background: linear-gradient(135deg, rgba(212,175,55,0.15), var(--panel)); }
@keyframes toastIn { from{transform:translateX(120%); opacity:0;} to{transform:none; opacity:1;} }
@keyframes toastOut { to{transform:translateX(120%); opacity:0;} }

/* 移动端 */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .nav { order: 3; width: 100%; justify-content: space-around; }
  .pulse-time { font-size: 36px; }
  .ring1 { width: 320px; height: 320px; }
  .ring2 { width: 260px; height: 260px; }
  .ring3 { width: 200px; height: 200px; }
  .ring-bagua { width: 320px; height: 320px; }
  .pulse-wrap { height: 380px; }
  .page-title .cn { font-size: 24px; }
  .main { padding: 20px 14px 60px; }
}
