/* ==========================================================================
   晧脈元素庫 · Hao Element Matrix — 暗黑霓虹展覽級樣式表
   ========================================================================== */

:root {
  --bg-void: #050811;
  --bg-surface: rgba(11, 17, 32, 0.78);
  --bg-surface-strong: rgba(13, 21, 38, 0.92);
  --border-subtle: rgba(148, 163, 184, 0.18);
  --border-bright: rgba(148, 163, 184, 0.36);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-live: #00e676;
  --accent-cyan: #38bdf8;
  --accent-purple: #b388ff;
  --accent-amber: #ffd600;
  --radius-card: 16px;
  --radius-tile: 9px;

  /* 10 大化學族霓虹色票 */
  --fam-alkali-metal: #ff5252;
  --fam-alkaline-earth: #ffab40;
  --fam-transition-metal: #40c4ff;
  --fam-post-transition: #536dfe;
  --fam-metalloid: #69f0ae;
  --fam-reactive-nonmetal: #00e676;
  --fam-halogen: #ffd740;
  --fam-noble-gas: #e040fb;
  --fam-lanthanide: #ff6e40;
  --fam-actinide: #b388ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(0, 230, 118, 0.08), transparent 60%),
    radial-gradient(ellipse 70% 45% at 88% 8%, rgba(56, 189, 248, 0.09), transparent 58%),
    radial-gradient(ellipse 65% 50% at 50% 100%, rgba(179, 136, 255, 0.07), transparent 65%),
    var(--bg-void);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

/* 背景分子星網 Canvas */
#constellation-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* 展覽級天地左右留白容器 */
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 36px 44px 52px;
}

/* ==========================================================================
   頂部導覽與搜尋列
   ========================================================================== */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.2), rgba(56, 189, 248, 0.16));
  border: 1px solid rgba(0, 230, 118, 0.45);
  box-shadow: 0 0 22px rgba(0, 230, 118, 0.22);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-title-en {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  opacity: 0.9;
}

.brand-subtitle {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  width: 286px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 32px 9px 36px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.search-clear-btn {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-primary);
  font-size: 0.72rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.search-clear-btn.is-visible {
  display: inline-flex;
}

.progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.35);
  font-size: 0.8rem;
  font-weight: 600;
  color: #a7f3d0;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-live);
  box-shadow: 0 0 10px var(--accent-live);
  animation: pulseDot 2s ease-in-out infinite;
  flex-shrink: 0;
}

.view-switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.view-switch-pill:hover,
.view-switch-pill.is-active {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.14);
  color: #e0f2fe;
}

/* 篩選狀態條 */
.filter-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 0.8rem;
  color: #cbd5e1;
}

.filter-banner.is-visible {
  display: flex;
}

.filter-reset-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-reset-btn:hover {
  border-color: var(--accent-cyan);
  color: #e0f2fe;
}

/* ==========================================================================
   週期表主體 CSS Grid（18 欄 × 7 週期 + 鑭系 / 錒系）
   ========================================================================== */
.matrix-stage {
  position: relative;
}

.periodic-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 4px 2px 8px;
}

.periodic-grid {
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  grid-template-rows:
    repeat(3, minmax(78px, 86px))
    repeat(4, minmax(60px, 68px))
    14px
    repeat(2, minmax(60px, 68px));
  gap: 5px;
  min-width: 1060px;
  position: relative;
}

/* ==========================================================================
   上方中央放大資訊卡（grid-column: 3 / 13; grid-row: 1 / 4）
   ========================================================================== */
.spotlight-card {
  grid-column: 3 / 13;
  grid-row: 1 / 4;
  z-index: 4;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) 134px;
  gap: 16px;
  align-items: stretch;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(7, 12, 24, 0.94));
  border: 1px solid color-mix(in srgb, var(--spot-color, #00e676) 44%, rgba(148, 163, 184, 0.22));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.55),
    0 0 32px color-mix(in srgb, var(--spot-color, #00e676) 14%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 14% 20%,
    color-mix(in srgb, var(--spot-color, #00e676) 18%, transparent),
    transparent 52%
  );
  pointer-events: none;
}

/* 左欄：放大全息元素磚 */
.holo-tile {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 11px;
  border-radius: 13px;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--spot-color, #00e676) 20%, rgba(15, 23, 42, 0.9)),
    rgba(6, 10, 22, 0.95)
  );
  border: 1.5px solid color-mix(in srgb, var(--spot-color, #00e676) 72%, rgba(255, 255, 255, 0.2));
  box-shadow:
    0 0 24px color-mix(in srgb, var(--spot-color, #00e676) 22%, transparent),
    inset 0 0 18px color-mix(in srgb, var(--spot-color, #00e676) 12%, transparent);
  overflow: hidden;
}

.holo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.holo-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--spot-color, #00e676) 80%, #ffffff);
}

.lock-badge {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.lock-badge.is-locked {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.lock-badge:hover {
  background: rgba(255, 255, 255, 0.24);
}

.holo-center {
  text-align: center;
  margin: 2px 0;
}

.holo-symbol {
  font-size: 2.85rem;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 0 20px color-mix(in srgb, var(--spot-color, #00e676) 55%, transparent);
}

.holo-name-zh {
  font-size: 0.96rem;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 2px;
}

.holo-name-en {
  font-size: 0.68rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.holo-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 5px;
}

/* 中欄：系統詳細介紹 */
.spot-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  gap: 6px;
}

.spot-header-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.spot-emblem {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--spot-color, #00e676) 14%, rgba(15, 23, 42, 0.9));
  border: 1px solid color-mix(in srgb, var(--spot-color, #00e676) 45%, rgba(255, 255, 255, 0.1));
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.spot-emblem svg {
  width: 28px;
  height: 28px;
}

.emblem-orbit {
  transform-origin: 24px 24px;
  animation: slowSpin 16s linear infinite;
}

.emblem-orbit-rev {
  transform-origin: 24px 24px;
  animation: slowSpin 24s linear infinite reverse;
}

.spot-meta-stack {
  min-width: 0;
  flex: 1;
}

.spot-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.status-pill.is-live {
  background: rgba(0, 230, 118, 0.16);
  border: 1px solid rgba(0, 230, 118, 0.52);
  color: #69f0ae;
}

.status-pill.is-dormant {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.32);
  color: #cbd5e1;
}

.sector-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--spot-color, #00e676) 85%, #ffffff);
  background: color-mix(in srgb, var(--spot-color, #00e676) 14%, rgba(15, 23, 42, 0.8));
  border: 1px solid color-mix(in srgb, var(--spot-color, #00e676) 36%, transparent);
}

.spot-title {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 800;
  line-height: 1.28;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.spot-subtitle {
  margin: 1px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.spot-desc {
  margin: 2px 0 0;
  font-size: 0.81rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.spot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.spot-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.spot-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

.spot-domain {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  color: var(--accent-cyan);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

/* 右欄：三顆直向對齊發光按鈕 */
.spot-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.action-btn {
  width: 100%;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn-primary {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--spot-color, #00e676) 86%, #ffffff),
    color-mix(in srgb, var(--spot-color, #00e676) 65%, #0ea5e9)
  );
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #03110a;
  box-shadow: 0 0 20px color-mix(in srgb, var(--spot-color, #00e676) 42%, transparent);
}

.action-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px color-mix(in srgb, var(--spot-color, #00e676) 62%, transparent);
}

.action-btn-primary.is-disabled {
  background: rgba(30, 41, 59, 0.72);
  border: 1px dashed rgba(148, 163, 184, 0.42);
  color: #94a3b8;
  box-shadow: none;
}

.action-btn-primary.is-disabled:hover {
  transform: none;
  border-color: rgba(148, 163, 184, 0.65);
  color: #cbd5e1;
}

.action-btn-secondary {
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

.action-btn-secondary:hover {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.14);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.18);
}

.action-btn-secondary.is-active {
  border-color: var(--accent-live);
  background: rgba(0, 230, 118, 0.16);
  color: #a7f3d0;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.22);
}

/* ==========================================================================
   週期表元素方格（三層視覺狀態）
   ========================================================================== */
.el-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 6px 5px;
  border-radius: var(--radius-tile);
  border: 1px solid color-mix(in srgb, var(--el-color) 32%, rgba(148, 163, 184, 0.2));
  background: rgba(12, 19, 36, 0.72);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  text-align: left;
  overflow: hidden;
  transition:
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.el-tile:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  z-index: 6;
}

.el-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1;
}

.el-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--el-color) 72%, #cbd5e1);
}

.el-live-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-live);
  box-shadow: 0 0 8px var(--accent-live), 0 0 14px var(--accent-live);
  animation: pulseDot 1.8s ease-in-out infinite;
}

.el-symbol {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.el-zh {
  font-size: 0.64rem;
  color: #cbd5e1;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 狀態 1：休眠元素（暗玻璃半透明骨架，滑鼠移入亮起） */
.el-tile.is-dormant {
  opacity: 0.44;
  background: rgba(9, 14, 28, 0.64);
}

.el-tile.is-dormant:hover {
  opacity: 0.96;
  transform: translateY(-2px) scale(1.05);
  z-index: 5;
  border-color: color-mix(in srgb, var(--el-color) 85%, #ffffff);
  background: color-mix(in srgb, var(--el-color) 16%, rgba(12, 19, 36, 0.94));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 16px color-mix(in srgb, var(--el-color) 35%, transparent);
}

/* 狀態 2：已點亮元素（高飽和霓虹邊框、呼吸發光光暈、掃描光澤、懸浮放大） */
.el-tile.is-lit {
  opacity: 1;
  background: linear-gradient(
    155deg,
    color-mix(in srgb, var(--el-color) 30%, rgba(10, 22, 30, 0.96)),
    rgba(6, 14, 24, 0.96)
  );
  border: 1.5px solid color-mix(in srgb, var(--el-color) 92%, #ffffff);
  box-shadow:
    0 0 18px color-mix(in srgb, var(--el-color) 42%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--el-color) 20%, transparent);
  animation: litBreath 3.2s ease-in-out infinite;
  z-index: 3;
}

.el-tile.is-lit::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -130%;
  width: 70%;
  height: 180%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
  transform: rotate(18deg);
  animation: sheenSweep 4.2s ease-in-out infinite;
  pointer-events: none;
}

.el-tile.is-lit .el-symbol {
  color: #ffffff;
  text-shadow: 0 0 12px color-mix(in srgb, var(--el-color) 75%, transparent);
}

.el-tile.is-lit:hover {
  transform: translateY(-3px) scale(1.09);
  z-index: 7;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.6),
    0 0 28px color-mix(in srgb, var(--el-color) 65%, transparent);
}

/* 狀態 3：已鎖定元素（白色內框 + 霓虹外光環） */
.el-tile.is-locked {
  opacity: 1 !important;
  z-index: 6;
  border-color: #ffffff !important;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.94),
    0 0 0 2px var(--el-color),
    0 0 24px color-mix(in srgb, var(--el-color) 68%, transparent) !important;
}

/* 篩選淡出 */
.el-tile.is-dimmed {
  opacity: 0.13 !important;
  filter: saturate(0.25);
}

.el-tile.is-dimmed:hover {
  opacity: 0.72 !important;
  filter: saturate(0.8);
}

/* 雷達隨機探勘光束高亮 */
.el-tile.is-radar-ping {
  opacity: 1 !important;
  z-index: 8;
  transform: scale(1.12);
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.34) !important;
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.85), inset 0 0 12px rgba(255, 255, 255, 0.5) !important;
}

/* 鑭系 / 錒系佔位指示格 */
.series-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-tile);
  border: 1px dashed color-mix(in srgb, var(--el-color) 42%, rgba(148, 163, 184, 0.25));
  background: rgba(15, 23, 42, 0.35);
  color: color-mix(in srgb, var(--el-color) 80%, #cbd5e1);
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.series-marker:hover {
  background: color-mix(in srgb, var(--el-color) 16%, rgba(15, 23, 42, 0.8));
  border-style: solid;
}

.series-marker span {
  font-size: 0.58rem;
  font-weight: 500;
  opacity: 0.82;
  margin-top: 2px;
}

/* ==========================================================================
   左下角：10 色互動領域色環（SVG Donut）
   ========================================================================== */
.family-wheel-slot {
  grid-column: 1 / 4;
  grid-row: 9 / 11;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 14px;
  background: rgba(10, 16, 30, 0.72);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  position: relative;
}

.wheel-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  justify-content: center;
}

.wheel-svg {
  width: 118px;
  height: 118px;
  flex-shrink: 0;
  overflow: visible;
}

.wheel-segment {
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
  transform-origin: 60px 60px;
  opacity: 0.84;
}

.wheel-segment:hover,
.wheel-segment.is-active {
  opacity: 1;
  transform: scale(1.06);
  filter: drop-shadow(0 0 6px currentColor);
}

.wheel-segment.is-dimmed {
  opacity: 0.26;
}

.wheel-center-btn {
  cursor: pointer;
}

.wheel-center-circle {
  fill: #091020;
  stroke: rgba(148, 163, 184, 0.35);
  stroke-width: 1.2;
  transition: fill 0.18s ease, stroke 0.18s ease;
}

.wheel-center-btn:hover .wheel-center-circle {
  fill: #13203b;
  stroke: var(--accent-cyan);
}

.wheel-center-text {
  fill: #f8fafc;
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.wheel-legend {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
  padding-right: 4px;
}

.wheel-legend-kicker {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wheel-legend-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
  margin-top: 2px;
}

.wheel-legend-sub {
  font-size: 0.64rem;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-top: 2px;
}

/* ==========================================================================
   鎖定期間輕量浮動提示條
   ========================================================================== */
.hover-pill {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(8, 13, 26, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.38);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
  font-size: 0.74rem;
  color: #f1f5f9;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: nowrap;
}

.hover-pill.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hover-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hover-pill-hint {
  color: var(--text-secondary);
  font-size: 0.68rem;
}

/* ==========================================================================
   清單視圖（含手機版自動切換）
   ========================================================================== */
.list-view {
  display: none;
}

.list-view.is-active {
  display: block;
}

.matrix-view.is-hidden {
  display: none;
}

.list-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.04em;
}

.list-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.list-project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-card);
  background: linear-gradient(155deg, rgba(14, 24, 42, 0.92), rgba(7, 12, 24, 0.94));
  border: 1px solid color-mix(in srgb, var(--el-color) 58%, rgba(255, 255, 255, 0.1));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 22px color-mix(in srgb, var(--el-color) 16%, transparent);
}

.list-project-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.list-symbol-badge {
  width: 58px;
  height: 58px;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--el-color) 20%, rgba(10, 16, 30, 0.95));
  border: 1.5px solid var(--el-color);
  flex-shrink: 0;
}

.list-symbol-badge strong {
  font-size: 1.45rem;
  line-height: 1;
  color: #ffffff;
}

.list-symbol-badge span {
  font-size: 0.65rem;
  color: #cbd5e1;
  margin-top: 2px;
}

.list-dormant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 10px;
}

.list-dormant-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(12, 19, 36, 0.72);
  border: 1px solid color-mix(in srgb, var(--el-color) 30%, rgba(148, 163, 184, 0.16));
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  color: var(--text-primary);
}

.list-dormant-card:hover {
  border-color: var(--el-color);
  background: color-mix(in srgb, var(--el-color) 12%, rgba(12, 19, 36, 0.92));
  transform: translateY(-1px);
}

.list-mini-sym {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: color-mix(in srgb, var(--el-color) 16%, rgba(15, 23, 42, 0.9));
  border: 1px solid color-mix(in srgb, var(--el-color) 45%, transparent);
  flex-shrink: 0;
}

/* ==========================================================================
   元素探勘區 · MINING ZONE（週期表下方 32px 間距）
   ========================================================================== */
.mining-zone {
  margin-top: 32px;
  padding: 24px 26px;
  border-radius: 20px;
  background:
    linear-gradient(165deg, rgba(13, 20, 36, 0.88), rgba(7, 11, 22, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  position: relative;
  overflow: hidden;
}

.mining-zone::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00e676, #38bdf8, #b388ff, transparent);
  opacity: 0.72;
}

.mining-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.mining-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-amber);
  text-transform: uppercase;
}

.mining-title {
  margin: 4px 0 0;
  font-size: 1.18rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mining-subtitle {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.radar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.58);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(179, 136, 255, 0.18));
  color: #e0f2fe;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.2);
  transition: all 0.2s ease;
}

.radar-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #7dd3fc;
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.4);
}

.radar-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.mining-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.vein-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 15px;
  background: rgba(9, 15, 29, 0.82);
  border: 1px solid color-mix(in srgb, var(--vein-color) 34%, rgba(148, 163, 184, 0.18));
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.vein-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--vein-color) 68%, #ffffff);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), 0 0 22px color-mix(in srgb, var(--vein-color) 16%, transparent);
}

.vein-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vein-codename {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--vein-color) 85%, #ffffff);
}

.vein-stage {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--vein-color) 16%, rgba(15, 23, 42, 0.9));
  border: 1px solid color-mix(in srgb, var(--vein-color) 42%, transparent);
  color: #f8fafc;
}

.vein-sector {
  margin: 6px 0 4px;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.vein-hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.vein-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vein-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.vein-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.vein-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--vein-color) 70%, #0f172a),
    var(--vein-color)
  );
  box-shadow: 0 0 12px color-mix(in srgb, var(--vein-color) 65%, transparent);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.vein-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.vein-energy {
  font-size: 0.74rem;
  color: #cbd5e1;
}

.vein-energy strong {
  color: color-mix(in srgb, var(--vein-color) 85%, #ffffff);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.mine-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--vein-color) 55%, rgba(255, 255, 255, 0.15));
  background: color-mix(in srgb, var(--vein-color) 16%, rgba(15, 23, 42, 0.9));
  color: #f8fafc;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.mine-btn:hover {
  background: color-mix(in srgb, var(--vein-color) 28%, rgba(15, 23, 42, 0.95));
  box-shadow: 0 0 16px color-mix(in srgb, var(--vein-color) 36%, transparent);
}

.mine-btn:active {
  transform: scale(0.94);
}

/* ==========================================================================
   頁尾與 Toast 通知
   ========================================================================== */
.site-footer {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.site-footer kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
}

.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  max-width: 340px;
  padding: 11px 15px;
  border-radius: 12px;
  background: rgba(10, 17, 32, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
  color: #f1f5f9;
  font-size: 0.8rem;
  line-height: 1.45;
  animation: toastIn 0.24s ease forwards;
}

.toast-item.is-leaving {
  animation: toastOut 0.22s ease forwards;
}

/* ==========================================================================
   動畫定義
   ========================================================================== */
@keyframes pulseDot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(1.28);
  }
}

@keyframes litBreath {
  0%, 100% {
    box-shadow:
      0 0 16px color-mix(in srgb, var(--el-color) 36%, transparent),
      inset 0 0 12px color-mix(in srgb, var(--el-color) 18%, transparent);
  }
  50% {
    box-shadow:
      0 0 26px color-mix(in srgb, var(--el-color) 58%, transparent),
      inset 0 0 18px color-mix(in srgb, var(--el-color) 28%, transparent);
  }
}

@keyframes sheenSweep {
  0%, 62% {
    left: -130%;
  }
  100% {
    left: 165%;
  }
}

@keyframes slowSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ==========================================================================
   RWD 響應式斷點
   ========================================================================== */
@media (max-width: 1180px) {
  .app-shell {
    padding: 28px 24px 44px;
  }

  .mining-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .mining-grid {
    grid-template-columns: 1fr;
  }

  .search-box {
    width: 100%;
    min-width: 220px;
    flex: 1;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 20px 16px 36px;
  }

  .top-header {
    gap: 14px;
    margin-bottom: 18px;
  }

  .header-controls {
    width: 100%;
  }

  .brand-title {
    font-size: 1.18rem;
  }

  .mining-zone {
    padding: 18px 16px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast-item {
    max-width: none;
  }
}

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