/* ═══════════════════════════════════════════
   妖灵孵化记 — 全局样式(原神风)
   浅色底 + 蓝金渐变 + 毛玻璃卡片 + 光效点缀
   ═══════════════════════════════════════════ */

:root {
  /* 五行色板 */
  --metal: #c9a227;
  --wood: #4e9e5a;
  --water: #3f8fd2;
  --fire: #d9534f;
  --earth: #a8823a;
  --physical: #7a7f8c;

  /* 原神风基础色 */
  --bg: #eaf1fa;
  --bg-grad: linear-gradient(160deg, #eaf1fa 0%, #f7f4ec 55%, #fdf8ef 100%);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.85);
  --border: rgba(160, 175, 200, 0.45);
  --text: #2d3442;
  --text-dim: #6b7488;
  --accent-blue: #3a7bd5;
  --accent-gold: #c9a227;
  --accent-grad: linear-gradient(120deg, #3a7bd5, #6fa8e8 45%, #c9a227);
  --shadow: 0 4px 18px rgba(80, 100, 150, 0.12);

  /* 性别色 */
  --male: #3f8fd2;
  --female: #d86a9c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ── 顶栏(毛玻璃) ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px; height: 56px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(80, 100, 150, 0.08);
}
.logo {
  font-size: 19px; margin: 0; white-space: nowrap;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs a {
  color: var(--text-dim); text-decoration: none;
  padding: 6px 10px; border-radius: 8px; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.tabs a:hover { background: rgba(58, 123, 213, 0.10); color: var(--accent-blue); }
.tabs a.active {
  background: var(--accent-grad);
  color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(58, 123, 213, 0.35);
}

/* ── 主内容区 ── */
#app { max-width: 1000px; margin: 0 auto; padding: 24px 20px 80px; }

.screen h2 {
  margin: 0 0 4px;
  font-size: 22px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hint { color: var(--text-dim); font-size: 14px; }

/* ── 通用组件 ── */
.card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.btn {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--glass-strong);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: transform .1s, box-shadow .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent-blue); box-shadow: 0 3px 10px rgba(58,123,213,.25); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--accent-grad);
  color: #fff; border: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 元素徽章 */
.elem-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff; font-size: 12px;
}

/* ═══ 通用 ═══ */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
.warn { color: #c05a2e; }
.badge-group { display: inline-flex; gap: 3px; align-items: center; }
.rare-tag { background: linear-gradient(120deg, #d4a017, #e8c04a); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; margin-left: 6px; }
h3 { margin: 4px 0 8px; font-size: 16px; }

/* ═══ 欢迎页 ═══ */
.welcome-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.welcome-card { text-align: center; padding: 40px 48px; max-width: 460px; }
.welcome-icon { font-size: 72px; }
.welcome-card h1 { font-size: 30px; margin: 8px 0; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-input { display: block; width: 100%; margin: 14px 0; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--glass-strong); font-size: 15px; color: var(--text); }

/* ═══ 主页 ═══ */
.player-card { display: flex; flex-direction: column; gap: 10px; }
.player-head { display: flex; gap: 14px; align-items: center; }
.player-avatar { font-size: 52px; }
.player-name { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.player-stats-row { display: flex; flex-direction: column; gap: 2px; }
.tech-row { display: flex; gap: 12px; flex-wrap: wrap; }
.tech-box { flex: 1; min-width: 220px; border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: rgba(255,255,255,.4); }
.tech-title { font-weight: 700; margin-bottom: 4px; }
.tech-box select { width: 100%; margin-top: 6px; padding: 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--glass-strong); }
.equip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.equip-box { flex: 1; min-width: 120px; border: 1px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; background: rgba(255,255,255,.4); font-size: 13px; }
.guide-list { display: flex; flex-direction: column; gap: 6px; }
.guide-item { color: var(--text-dim); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.guide-item:hover { background: rgba(58,123,213,.08); }
.guide-item.done { color: #4e9e5a; }
.shortcut-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 16px 0; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 4px; border-radius: 12px; background: var(--glass); border: 1px solid var(--border); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .1s; }
.shortcut:hover { transform: translateY(-2px); border-color: var(--accent-blue); }
.shortcut-icon { font-size: 30px; }

/* ═══ 怪物卡 ═══ */
.mcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 10px 0; }
.mcard { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--border); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mcard:hover { border-color: var(--accent-blue); box-shadow: var(--shadow); }
.mcard.selected { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(58,123,213,.35); }
.mcard-icon { font-size: 40px; width: 52px; text-align: center; }
.mcard-icon.big { font-size: 56px; width: 72px; }
.mcard-name { font-weight: 700; display: flex; align-items: center; }
.mcard-sub { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mcard-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }

/* ═══ 属性/技能 ═══ */
.stat-panel { margin: 8px 0; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stat-chip { text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,.45); border: 1px solid var(--border); }
.stat-chip-label { font-size: 12px; font-weight: 700; }
.stat-chip-value { font-size: 17px; font-weight: 700; }
.skill-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.skill-tag { display: inline-flex; gap: 3px; align-items: center; padding: 3px 10px; border-radius: 999px; background: rgba(58,123,213,.12); font-size: 12.5px; }
.skill-tag.learned { background: rgba(78,158,90,.18); border: 1px solid rgba(78,158,90,.4); }
.skill-tag.locked { background: rgba(0,0,0,.05); opacity: .7; }
.detail-card { margin-top: 14px; }
.detail-head { display: flex; gap: 14px; align-items: center; }
.detail-body { margin-top: 10px; }
.detail-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 10px; }
.tab-switch { display: flex; gap: 8px; margin-bottom: 8px; }

/* ═══ 孵化室 ═══ */
.egg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.egg-card { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.egg-icon { font-size: 60px; }
.temp-box { width: 100%; }
.temp-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.temp-box input[type=range] { width: 100%; accent-color: #d9534f; }
.temp-scale { font-size: 12px; }
.hatch-box { text-align: center; }
.hatch-icon { font-size: 64px; }

/* ═══ 繁殖室 ═══ */
.breed-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.preview-card { margin-top: 14px; }

/* ═══ 队伍 ═══ */
.team-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.slot-label { font-weight: 700; margin-bottom: 6px; }

/* ═══ 探索地图 ═══ */
.map-card { overflow-x: auto; }
.map-grid { display: inline-block; }
.map-row { display: flex; }
.map-rowlabel { width: 22px; text-align: center; font-size: 11px; align-self: center; }
.map-cell { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.55); display: flex; align-items: center; justify-content: center; font-size: 17px; cursor: default; transition: transform .08s; }
.map-cell.unknown { filter: brightness(.9); }
.map-cell.adjacent { cursor: pointer; box-shadow: inset 0 0 0 2px rgba(58,123,213,.55); }
.map-cell.adjacent:hover { transform: scale(1.08); z-index: 2; }
.map-cell.player { box-shadow: inset 0 0 0 3px #3a7bd5; font-size: 20px; }
.map-cell.boss { box-shadow: inset 0 0 0 2px #d4a017; }
.region-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-dim); }
.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

/* ═══ 战斗 ═══ */
.unit-row { display: flex; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.unit-row.ally { margin-top: 16px; }
.unit-card { width: 150px; padding: 10px; border-radius: 12px; background: var(--glass); border: 1px solid var(--border); text-align: center; position: relative; }
.unit-card.dead { opacity: .4; }
.unit-card.morphed { opacity: .55; border-style: dashed; }
.unit-card.boss { border-color: #d4a017; box-shadow: 0 0 10px rgba(212,160,23,.35); }
.unit-card.targetable { cursor: crosshair; box-shadow: 0 0 0 2px rgba(217,83,79,.6); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(217,83,79,.25); } }
.unit-icon { font-size: 34px; }
.unit-name { font-weight: 700; font-size: 13.5px; }
.unit-hpbar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.12); margin: 6px 0 2px; overflow: hidden; }
.unit-hpfill { height: 100%; background: linear-gradient(90deg, #4e9e5a, #7bc97f); transition: width .25s; }
.player-panel { margin: 10px 0; }
.skill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.skill-btn.selected { border-color: #d9534f; background: rgba(217,83,79,.1); }
.battle-log { max-height: 240px; overflow-y: auto; margin-top: 14px; }
.log-list { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.log-line { color: var(--text-dim); }
.battle-overlay { position: fixed; inset: 0; background: rgba(20,26,40,.55); display: flex; align-items: center; justify-content: center; z-index: 30; }
.result-card { min-width: 360px; max-height: 80vh; overflow-y: auto; }
.recruit-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.recruit-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }

/* ═══ 商店/酒馆 ═══ */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.shop-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.tavern-box { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; }
.tavern-icon { font-size: 60px; }

/* ═══ 五行百科 ═══ */
.wheel-wrap { display: flex; flex-direction: column; align-items: center; }
.wheel-svg { width: 100%; max-width: 380px; }
.wheel-node { cursor: pointer; }

/* ═══ 弹窗与 Toast ═══ */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,26,40,.5); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal-box { background: #f4f7fc; border-radius: 16px; min-width: 320px; max-width: 560px; max-height: 84vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px; }
.modal-body .mcard-grid { margin: 8px 0; }
.toast-layer { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; align-items: center; }
.toast { background: rgba(30,36,52,.92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13.5px; box-shadow: 0 6px 20px rgba(0,0,0,.35); animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

/* ═══ 登录/注册 ═══ */
.pwd-wrap { position: relative; }
.pwd-wrap .text-input { padding-right: 44px; }
.pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: transparent; font-size: 16px; padding: 4px 8px; cursor: pointer; }
.auth-err { color: #c0392b; font-size: 13px; min-height: 18px; margin: 4px 0; }

/* ═══ 审查补缺 ═══ */
.egg-head { text-align: center; }
.battle-screen { padding-bottom: 40px; }
.shop-item { display: flex; flex-direction: column; }
