/* ==========================================================
   Ellaidhoo · 印度洋潜水图鉴
   移动端优先 / 沉浸式水下风格
   ========================================================== */

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

:root {
  --c-deep:    #00111c;
  --c-mid:     #002a44;
  --c-blue:    #0a4d7c;
  --c-cyan:    #1ab2c8;
  --c-glow:    #7ee8d6;
  --c-sand:    #f4e7c1;
  --c-text:    #eaf6ff;
  --c-muted:   #8fb6cc;
  --c-line:    rgba(255,255,255,.08);
  --c-glass:   rgba(8, 36, 60, .55);
  --c-glass-2: rgba(20, 60, 90, .6);

  --safe:    #6cd3a2;
  --caution: #f6c062;
  --danger:  #ff6c6c;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;

  --shadow-soft: 0 18px 40px rgba(0, 16, 30, .55);
  --shadow-card: 0 12px 32px rgba(0, 8, 16, .35);

  --safe-area-top:    env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);

  --serif:  'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  --sans:   'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--c-deep);
  color: var(--c-text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, #08486f 0%, #023154 25%, #001a2c 55%, #000810 100%),
    var(--c-deep);
  background-attachment: fixed;
}

/* ----- 水下光斑（程序化）----- */
.caustics {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .35;
  background:
    radial-gradient(800px 300px at 20% 0%, rgba(126,232,214,.35), transparent 60%),
    radial-gradient(600px 240px at 80% 10%, rgba(107,189,255,.25), transparent 70%),
    radial-gradient(500px 200px at 50% 30%, rgba(126,232,214,.18), transparent 70%);
  filter: blur(8px);
  animation: drift 22s ease-in-out infinite alternate;
}

@keyframes drift {
  0%   { transform: translate3d(0,0,0)      scale(1); }
  50%  { transform: translate3d(-3%, 1%, 0) scale(1.05); }
  100% { transform: translate3d(2%, -1%, 0) scale(1.02); }
}

/* ----- 上浮气泡 ----- */
.bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bubbles span {
  position: absolute;
  bottom: -8vh;
  left: var(--x);
  width: calc(10px * var(--s, 1));
  height: calc(10px * var(--s, 1));
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.85), rgba(255,255,255,.15) 50%, rgba(255,255,255,0) 70%);
  box-shadow: 0 0 8px rgba(255,255,255,.25);
  animation: rise var(--d, 14s) linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: .8;
}

@keyframes rise {
  0%   { transform: translate3d(0, 0, 0) scale(.8); opacity: 0; }
  10%  { opacity: .8; }
  50%  { transform: translate3d(20px, -55vh, 0) scale(1); }
  100% { transform: translate3d(-10px, -120vh, 0) scale(1.2); opacity: 0; }
}

/* ----- 入场 splash ----- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(120% 100% at 50% 30%, #054269 0%, #001a2c 60%, #000408 100%);
  animation: splashFade 2.4s ease 0s forwards;
}
.splash-inner { text-align: center; transform: translateY(0); animation: splashUp 2.4s ease forwards; }
.splash-mark { font-family: var(--serif); font-size: 42px; letter-spacing: 8px; color: var(--c-glow); opacity: .8; }
.splash-title { font-family: var(--serif); font-size: 36px; margin: 18px 0 4px; color: var(--c-text); }
.splash-sub   { color: var(--c-muted); margin: 0; letter-spacing: 4px; font-size: 12px; }

@keyframes splashFade {
  0%   { opacity: 1; pointer-events: auto; }
  85%  { opacity: 1; }
  100% { opacity: 0; pointer-events: none; visibility: hidden; }
}
@keyframes splashUp {
  0%   { transform: translateY(20px); opacity: 0; }
  30%  { transform: translateY(0);    opacity: 1; }
  85%  { transform: translateY(0);    opacity: 1; }
  100% { transform: translateY(-30px); opacity: 0; }
}

/* ----- App 容器 ----- */
#app {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--safe-area-top) + 16px) 16px calc(var(--safe-area-bottom) + 110px);
  min-height: 100vh;
  animation: fadeIn .6s ease 1.6s both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ----- 通用元素 ----- */
h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .5px; }
h1 { font-size: 30px; margin: 0 0 8px; }
h2 { font-size: 22px; margin: 24px 0 12px; }
h3 { font-size: 17px; margin: 8px 0; font-family: var(--sans); font-weight: 600; }

a { color: var(--c-glow); text-decoration: none; }
button { font: inherit; color: inherit; }

.muted { color: var(--c-muted); font-size: 13px; }
.tiny  { color: var(--c-muted); font-size: 11px; line-height: 1.5; }

/* 玻璃卡 */
.glass {
  background: var(--c-glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

/* ==========================================================
   首页 Hero
   ========================================================== */
.hero {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  max-height: 78vh;
  background:
    linear-gradient(180deg, rgba(0,16,30,0) 30%, rgba(0,16,30,.7) 75%, rgba(0,8,15,.95) 100%),
    radial-gradient(120% 90% at 50% 20%, #0a6f9a 0%, #033b5e 35%, #00131f 75%);
  box-shadow: var(--shadow-soft);
}
.hero img.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  animation: heroZoom 18s ease-in-out infinite alternate;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 30% at 50% 0%, rgba(126,232,214,.25), transparent 70%),
    linear-gradient(180deg, rgba(0,16,30,0) 50%, rgba(0,8,15,.85) 100%);
  pointer-events: none;
}
@keyframes heroZoom { from { transform: scale(1.03); } to { transform: scale(1.08); } }

.hero-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 22px 26px;
  z-index: 2;
}
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 6px;
  color: var(--c-glow);
  text-transform: uppercase;
  margin: 0 0 6px;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(32px, 8vw, 46px);
  line-height: 1.05;
  margin: 0 0 10px;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.hero-desc {
  color: rgba(234,246,255,.85);
  font-size: 14px;
  max-width: 28em;
  margin: 0;
}

/* 入口大卡 */
.entries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 8px;
}
.entry {
  appearance: none; border: 0; cursor: pointer;
  text-align: left;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--c-glass);
  border: 1px solid var(--c-line);
  color: var(--c-text);
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .25s ease, background .25s ease;
}
.entry:active { transform: scale(.97); }
.entry .entry-emoji { font-size: 28px; line-height: 1; }
.entry .entry-title { font-size: 14px; font-weight: 600; }
.entry .entry-sub { font-size: 11px; color: var(--c-muted); }
.entry--danger { background: linear-gradient(160deg, rgba(255,108,108,.18), rgba(20,40,60,.55)); border-color: rgba(255,108,108,.35); }

/* 检查清单 */
.checklist {
  margin-top: 10px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--c-glass);
  border: 1px solid var(--c-line);
}
.checklist h3 { color: var(--c-glow); margin: 0 0 10px; font-size: 14px; letter-spacing: 2px; }
.checklist ol { margin: 0; padding-left: 20px; color: rgba(234,246,255,.85); font-size: 13px; }
.checklist li { margin: 6px 0; }

/* ==========================================================
   图鉴页
   ========================================================== */
.atlas-head { display: flex; flex-direction: column; gap: 12px; }

.search-row {
  position: relative;
}
.search-row input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: 999px;
  border: 1px solid var(--c-line);
  background: rgba(0,16,30,.55);
  color: var(--c-text);
  font-size: 14px;
  font-family: inherit;
}
.search-row input::placeholder { color: var(--c-muted); }
.search-row input:focus { outline: none; border-color: var(--c-cyan); box-shadow: 0 0 0 3px rgba(26,178,200,.15); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-muted); }

.tabs {
  display: flex; gap: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 2px 6px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  appearance: none; border: 1px solid var(--c-line);
  background: rgba(255,255,255,.04);
  color: var(--c-text);
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.tab .tab-emoji { margin-right: 4px; }
.tab.active {
  background: linear-gradient(135deg, var(--c-cyan), var(--c-glow));
  color: #002030;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(26,178,200,.35);
}

/* 物种网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}
@media (min-width: 540px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  appearance: none; border: 0; cursor: pointer;
  text-align: left;
  padding: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-glass);
  border: 1px solid var(--c-line);
  color: var(--c-text);
  display: flex; flex-direction: column;
  transition: transform .25s ease;
  position: relative;
}
.card:active { transform: scale(.97); }
.card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(180deg, rgba(0,16,30,0) 60%, rgba(0,8,15,.6) 100%),
    radial-gradient(60% 60% at 50% 50%, #064564 0%, #02263d 70%);
  background-size: cover;
  background-position: center;
  position: relative;
}
.card-image .card-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,.4);
  font-size: 36px;
}
.card-body {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.card-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.card-sci  { color: var(--c-muted); font-size: 11px; font-style: italic; }
.card-danger {
  position: absolute; left: 8px; top: 8px;
  display: flex; align-items: center; gap: 4px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,8,15,.6);
  backdrop-filter: blur(8px);
  font-weight: 600;
}
.card-danger.safe    { color: var(--safe);    border: 1px solid rgba(108,211,162,.5); }
.card-danger.caution { color: var(--caution); border: 1px solid rgba(246,192,98,.5); }
.card-danger.danger  { color: var(--danger);  border: 1px solid rgba(255,108,108,.5); }

.empty { padding: 40px 16px; text-align: center; color: var(--c-muted); }

/* ==========================================================
   详情浮层
   ========================================================== */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,8,15,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: bdrIn .25s ease; }
@keyframes bdrIn { from { opacity: 0; } to { opacity: 1; } }

.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92vh;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #053252 0%, #001a2c 80%);
  border-top: 1px solid var(--c-line);
  box-shadow: 0 -20px 60px rgba(0,0,0,.6);
  animation: sheetIn .35s cubic-bezier(.16,.78,.27,1.04);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.sheet-panel--full {
  top: 0; max-height: 100vh; border-radius: 0;
}
@keyframes sheetIn {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-line);
}
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-close {
  appearance: none; border: 0; background: rgba(255,255,255,.08);
  color: var(--c-text); width: 36px; height: 36px;
  border-radius: 50%; font-size: 22px; cursor: pointer;
  display: grid; place-items: center;
}
.sheet-close--float {
  position: absolute; top: 14px; right: 14px; z-index: 4;
  background: rgba(0,8,15,.6); backdrop-filter: blur(8px);
}
.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  flex: 1;
}
.sheet-foot {
  padding: 12px 20px calc(20px + var(--safe-area-bottom));
  border-top: 1px solid var(--c-line);
  font-size: 12px;
  color: rgba(234,246,255,.8);
  background: rgba(0,8,15,.4);
}

/* 详情内容 */
.detail-hero {
  position: relative;
  height: 46vh;
  min-height: 280px;
  background: #022;
  background-size: cover;
  background-position: center;
}
.detail-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,16,30,0) 30%, rgba(0,16,30,.55) 70%, #001a2c 100%);
}
.detail-hero-meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 22px 18px;
  z-index: 2;
}
.detail-cn { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin: 0; color: #fff; text-shadow: 0 4px 16px rgba(0,0,0,.6); }
.detail-en { color: var(--c-muted); font-size: 13px; margin: 6px 0 0; letter-spacing: 1px; }
.detail-sci { color: rgba(234,246,255,.6); font-size: 12px; font-style: italic; margin: 2px 0 0; }

.detail-banner {
  margin: 0;
  padding: 14px 22px;
  font-size: 13px;
  font-weight: 600;
  display: flex; gap: 10px; align-items: center;
}
.detail-banner.safe    { background: rgba(108,211,162,.12); color: var(--safe);    border-bottom: 1px solid rgba(108,211,162,.25); }
.detail-banner.caution { background: rgba(246,192,98,.10);  color: var(--caution); border-bottom: 1px solid rgba(246,192,98,.25); }
.detail-banner.danger  { background: rgba(255,108,108,.12); color: var(--danger);  border-bottom: 1px solid rgba(255,108,108,.30); }
.detail-banner .label-emoji { font-size: 18px; }

.detail-body { padding: 18px 22px 28px; }
.detail-section { margin-bottom: 18px; }
.detail-section h3 {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--c-glow);
  text-transform: uppercase;
  margin: 0 0 6px;
  font-weight: 600;
}
.detail-section p { margin: 0; font-size: 14.5px; line-height: 1.7; color: rgba(234,246,255,.92); }

.detail-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin: 6px 0 18px;
}
.stat {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.stat .stat-label { font-size: 10px; color: var(--c-muted); letter-spacing: 2px; text-transform: uppercase; }
.stat .stat-value { font-size: 13px; margin-top: 2px; color: var(--c-text); }

.attribution {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(234,246,255,.45);
}

/* ==========================================================
   危险物种速查
   ========================================================== */
.danger-fab {
  position: fixed;
  right: 18px; bottom: calc(22px + var(--safe-area-bottom));
  z-index: 40;
  appearance: none; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6c6c, #ff9f5c);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 32px rgba(255,108,108,.5), 0 0 0 4px rgba(255,108,108,.12);
  transition: transform .2s ease;
}
.danger-fab:active { transform: scale(.95); }
.danger-fab-icon { font-size: 16px; }

#dangerList {
  padding: 16px 16px 4px;
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
.danger-card {
  background: linear-gradient(160deg, rgba(255,108,108,.08), rgba(20,40,60,.55));
  border: 1px solid rgba(255,108,108,.28);
  border-radius: var(--r-md);
  padding: 14px;
  display: grid; grid-template-columns: 88px 1fr; gap: 14px;
  align-items: start;
}
.danger-card .danger-img {
  width: 88px; height: 88px;
  border-radius: 12px;
  background-size: cover; background-position: center;
  background-color: #022;
}
.danger-card h3 { margin: 0 0 4px; font-size: 16px; color: #fff; font-family: var(--sans); }
.danger-card .danger-en { font-size: 11px; color: var(--c-muted); margin-bottom: 6px; font-style: italic; }
.danger-card p { margin: 0; font-size: 12.5px; color: rgba(234,246,255,.85); line-height: 1.55; }
.danger-card .danger-distance { display: inline-block; margin-top: 6px; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: rgba(255,108,108,.2); color: #ffd1d1; }

/* ==========================================================
   游戏
   ========================================================== */
.game-shell { padding: 20px 18px 30px; }

.game-menu { display: grid; gap: 12px; padding: 30px 18px 0; }
.game-card {
  appearance: none; border: 0; cursor: pointer;
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--c-glass);
  border: 1px solid var(--c-line);
  color: var(--c-text);
  text-align: left;
  transition: transform .2s;
}
.game-card:active { transform: scale(.98); }
.game-card .game-emoji {
  font-size: 36px; line-height: 1;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(26,178,200,.25), rgba(126,232,214,.15));
}
.game-card h3 { margin: 0; font-size: 16px; font-family: var(--sans); }
.game-card p  { margin: 2px 0 0; font-size: 12.5px; color: var(--c-muted); }

/* 题目 */
.q-progress {
  display: flex; gap: 4px; margin-bottom: 18px;
}
.q-progress span {
  flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.08);
}
.q-progress span.done { background: var(--c-glow); }
.q-progress span.cur  { background: var(--c-cyan); }

.q-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background-color: #022;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.q-prompt {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 14px;
  text-align: center;
}

.q-options { display: grid; gap: 10px; }
.q-option {
  appearance: none; border: 1px solid var(--c-line);
  background: rgba(255,255,255,.04);
  color: var(--c-text);
  padding: 14px 16px;
  border-radius: var(--r-md);
  text-align: left;
  font-size: 14.5px;
  cursor: pointer;
  transition: all .2s;
}
.q-option:active { transform: scale(.98); }
.q-option.correct { background: rgba(108,211,162,.18); border-color: var(--safe); color: #d6f5e3; }
.q-option.wrong   { background: rgba(255,108,108,.18); border-color: var(--danger); color: #ffdada; }
.q-option.disabled { pointer-events: none; opacity: .7; }

/* 安全/危险二选一 */
.sd-stage { padding: 10px 0 0; }
.sd-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background-color: #022;
  background-size: cover;
  background-position: center;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.sd-name { font-size: 22px; font-family: var(--serif); font-weight: 700; text-align: center; margin: 0 0 4px; }
.sd-en   { text-align: center; color: var(--c-muted); font-size: 12px; font-style: italic; margin: 0 0 22px; }

.sd-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 8px;
}
.sd-btn {
  appearance: none; border: 0;
  padding: 18px;
  border-radius: var(--r-md);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: transform .15s;
}
.sd-btn:active { transform: scale(.97); }
.sd-btn.safe   { background: linear-gradient(135deg, #6cd3a2, #2fae87); color: #002618; }
.sd-btn.danger { background: linear-gradient(135deg, #ff6c6c, #ff8b3c); color: #2e0606; }

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.6;
}
.feedback.ok    { background: rgba(108,211,162,.12); border: 1px solid rgba(108,211,162,.4); color: #d6f5e3; }
.feedback.bad   { background: rgba(255,108,108,.12); border: 1px solid rgba(255,108,108,.4); color: #ffdada; }

/* 习性匹配 */
.match-stage { display: grid; gap: 18px; }
.match-fish-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.match-fish-row::-webkit-scrollbar { display: none; }
.match-fish {
  flex: 0 0 auto;
  width: 92px;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.04);
  padding: 8px;
  transition: all .2s;
}
.match-fish.selected { border-color: var(--c-cyan); background: rgba(26,178,200,.15); }
.match-fish.matched  { opacity: .35; pointer-events: none; }
.match-fish .match-fish-img {
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 10px;
  background-size: cover; background-position: center;
  background-color: #022;
}
.match-fish .match-fish-name { font-size: 11px; margin-top: 6px; line-height: 1.3; }

.match-traits { display: grid; gap: 10px; }
.match-trait {
  appearance: none;
  border: 1px solid var(--c-line);
  background: rgba(255,255,255,.04);
  color: var(--c-text);
  text-align: left;
  font-size: 13px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .2s;
}
.match-trait.matched { background: rgba(108,211,162,.18); border-color: var(--safe); color: #d6f5e3; }
.match-trait.wrong { animation: shake .35s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* 结果页 */
.result {
  text-align: center;
  padding: 32px 24px;
}
.result-badge {
  display: inline-grid; place-items: center;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-cyan), var(--c-glow));
  font-size: 60px;
  margin-bottom: 18px;
  box-shadow: 0 16px 40px rgba(26,178,200,.4);
}
.result h2 { margin: 0 0 8px; font-size: 26px; }
.result-score { font-size: 40px; font-family: var(--serif); color: var(--c-glow); margin: 12px 0; }
.result-msg { color: var(--c-muted); margin: 0 0 22px; }

.btn-primary {
  appearance: none; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c-cyan), var(--c-glow));
  color: #00121e;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(26,178,200,.4);
}
.btn-primary:active { transform: scale(.97); }

.btn-ghost {
  appearance: none;
  border: 1px solid var(--c-line);
  background: transparent;
  color: var(--c-text);
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  margin: 0 6px;
}

/* ==========================================================
   离线包卡片
   ========================================================== */
.offline-card {
  margin: 18px 0 14px;
  padding: 16px 18px 14px;
  border-radius: var(--r-md);
  background: var(--c-glass-2);
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .3s ease, background .3s ease;
}
.offline-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.offline-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(26,178,200,.18);
  font-size: 18px;
  flex-shrink: 0;
}
.offline-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.offline-title { font-size: 15px; font-weight: 600; }
.offline-sub {
  font-size: 12.5px; color: var(--c-muted); margin-top: 2px;
  line-height: 1.4;
}
.offline-badge {
  font-size: 13px; font-weight: 700;
  min-width: 44px; text-align: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}
.offline-bar {
  height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  margin: 6px 0 12px;
}
.offline-bar-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-glow));
  border-radius: 999px;
  transition: width .35s ease;
}
.offline-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.offline-btn {
  appearance: none; border: 1px solid var(--c-line);
  background: rgba(255,255,255,.04);
  color: var(--c-text);
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, opacity .2s ease;
}
.offline-btn:active { transform: scale(.97); }
.offline-btn:disabled { opacity: .55; cursor: not-allowed; }
.offline-btn--primary {
  border: 0;
  background: linear-gradient(135deg, var(--c-cyan), var(--c-glow));
  color: #00121e;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(26,178,200,.32);
}
.offline-hint {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: var(--c-muted);
  line-height: 1.55;
}

/* 状态色 */
.offline-card[data-status="ready"] {
  border-color: rgba(108,211,162,.45);
  background: linear-gradient(135deg, rgba(108,211,162,.12), var(--c-glass-2));
}
.offline-card[data-status="ready"] .offline-icon {
  background: rgba(108,211,162,.22);
}
.offline-card[data-status="ready"] .offline-badge {
  background: rgba(108,211,162,.22);
  color: var(--safe);
}
.offline-card[data-status="ready"] .offline-bar-fill {
  background: linear-gradient(90deg, var(--safe), var(--c-glow));
}
.offline-card[data-status="downloading"] .offline-badge {
  background: rgba(26,178,200,.2);
  color: var(--c-cyan);
}
.offline-card[data-status="partial"] {
  border-color: rgba(246,192,98,.4);
}
.offline-card[data-status="partial"] .offline-badge {
  background: rgba(246,192,98,.18);
  color: var(--caution);
}
.offline-card[data-status="none"] {
  border-color: rgba(255,255,255,.16);
}
.offline-card[data-status="unsupported"] { display: none; }

/* ==========================================================
   响应式微调
   ========================================================== */
@media (min-width: 720px) {
  .hero { aspect-ratio: 16 / 9; }
  .hero-title { font-size: 56px; }
  .danger-card { grid-template-columns: 120px 1fr; }
  .danger-card .danger-img { width: 120px; height: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
