/* ============================================================
   palworld.ludbase.com 視覺系統（P3-001「野外圖鑑」方向）
   深海軍藍頁頭 + 天空/草地/日光配色 + Pal 收藏卡框語言
   ============================================================ */

:root {
  color-scheme: light;

  /* --- 色彩 token --- */
  --navy: #17324a; /* 深海軍藍：頁頭、主文字 */
  --navy-soft: #2c4a66;
  --sky: #3e9be0; /* 天空藍：品牌、鏈接、聚焦 */
  --sky-deep: #2478ba;
  --sky-wash: #eaf3fb;
  --meadow: #3d9b5f; /* 草地綠：確定資料、成功 */
  --meadow-deep: #2c7346;
  --meadow-wash: #e9f5ee;
  --sun: #f5a93b; /* 日光琥珀：CTA、強調、推斷 */
  --sun-deep: #d18318;
  --sun-wash: #fdf3e3;
  --ember: #d95845; /* 餘燼紅：風險、傳聞待驗 */
  --ember-wash: #fbecea;
  --violet: #7e5fc5; /* 社群經驗 */
  --violet-wash: #f1edf9;

  --bg: #f2f6fa; /* 天空微染底 */
  --paper: #ffffff;
  --ink: #1d2c3a;
  --muted: #5c6e7e;
  --line: #d8e2ea;
  --line-strong: #b9cad8;
  --soft: #edf3f8;

  /* 舊語義別名（表單/狀態沿用） */
  --accent: var(--sky-deep);
  --warn: #9a6a00;
  --ok: var(--meadow-deep);
  --bad: #b23c2c;

  /* --- 屬性色 token（Pal 元素） --- */
  --el-neutral: #8d97a3;
  --el-fire: #e2574c;
  --el-water: #3e9be0;
  --el-electric: #e8a91d;
  --el-grass: #57a639;
  --el-ground: #b07b3f;
  --el-dark: #4a4458;
  --el-dragon: #7c5cd6;
  --el-ice: #45b8cc;

  /* --- 形狀與層次 token --- */
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(23, 50, 74, 0.05), 0 4px 14px rgba(23, 50, 74, 0.06);
  --shadow-lift: 0 2px 4px rgba(23, 50, 74, 0.08), 0 10px 26px rgba(23, 50, 74, 0.12);
  --shadow-pop: 0 18px 40px rgba(23, 50, 74, 0.18);

  /* --- 字體 token --- */
  --font-body:
    "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Heiti TC",
    "Noto Sans TC", system-ui, -apple-system, sans-serif;
  --font-num: "SF Mono", "Cascadia Code", "Consolas", ui-monospace, monospace;

  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ---------- 字級 ---------- */

h1,
h2,
h3 {
  margin: 0 0 12px;
  line-height: 1.22;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-weight: 800;
}

h1 {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: 0.5px;
}

h2 {
  font-size: 25px;
}

h3 {
  font-size: 19px;
}

p {
  line-height: 1.75;
}

.eyebrow,
.meta {
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 13px;
  color: var(--sky-deep);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sky) 0 46%, #fff 46% 54%, var(--sun) 54% 100%);
  box-shadow: 0 0 0 2px rgba(62, 155, 224, 0.25);
}

.lede {
  color: var(--muted);
  font-size: 17px;
  max-width: 62ch;
}

/* ---------- 按鈕 ---------- */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--sun-deep);
  border-bottom-width: 3px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8b95c, var(--sun));
  color: var(--navy);
  font-weight: 700;
  padding: 0 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

button:hover,
.button:hover {
  filter: brightness(1.04);
  box-shadow: 0 4px 10px rgba(245, 169, 59, 0.35);
}

button:active,
.button:active {
  transform: translateY(1px);
  border-bottom-width: 1px;
}

button.secondary,
.button.secondary {
  border-color: var(--sky-deep);
  background: var(--paper);
  color: var(--sky-deep);
}

button.secondary:hover,
.button.secondary:hover {
  background: var(--sky-wash);
  box-shadow: 0 4px 10px rgba(62, 155, 224, 0.2);
}

button.ghost,
.button.ghost {
  border-color: var(--line-strong);
  border-bottom-width: 3px;
  background: var(--paper);
  color: var(--ink);
}

button.ghost:hover,
.button.ghost:hover {
  border-color: var(--sky);
  color: var(--sky-deep);
  box-shadow: 0 4px 10px rgba(23, 50, 74, 0.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

/* ---------- 頁頭（深海軍藍官網殼） ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background:
    linear-gradient(180deg, rgba(62, 155, 224, 0.16), rgba(62, 155, 224, 0) 60%),
    var(--navy);
  border-bottom: 3px solid var(--sun);
  color: #fff;
}

.topbar,
.main,
.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
}

.brand {
  text-decoration: none;
  line-height: 1.25;
}

.brand strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  letter-spacing: 1px;
  color: #fff;
}

.brand strong::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sky) 0 44%, #fff 44% 56%, var(--sun) 56% 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85), 0 0 8px rgba(122, 188, 238, 0.8);
}

.brand span {
  display: block;
  color: #a9c3d8;
  font-size: 12.5px;
  letter-spacing: 0.5px;
}

.brand-tagline {
  font-style: normal;
}

.search {
  position: relative;
}

.search input {
  width: 100%;
  border: 1px solid var(--navy-soft);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px 18px;
}

.search input::placeholder {
  color: #8fabc2;
}

.search input:focus {
  background: rgba(255, 255, 255, 0.16);
}

.search-results {
  position: absolute;
  inset: calc(100% + 8px) 0 auto 0;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}

.search-results a {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.search-results a:hover {
  background: var(--sky-wash);
}

.search-results small {
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 0 10px;
}

.nav a {
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  color: #c7d9e8;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav a.active {
  color: var(--navy);
  background: var(--sun);
  border-color: var(--sun-deep);
}

/* ---------- 主欄與麵包屑 ---------- */

.main {
  padding: 24px 0 56px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--sky-deep);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--navy);
  font-weight: 600;
}

.breadcrumb .sep {
  user-select: none;
  color: var(--line-strong);
}

a:focus-visible,
button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2.5px solid var(--sky);
  outline-offset: 2px;
}

/* ---------- 頁首區（全站）與首頁地平線 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: start;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 85% -20%, rgba(122, 188, 238, 0.28), rgba(122, 188, 238, 0) 60%),
    var(--paper);
  box-shadow: var(--shadow-card);
}

.hero-home {
  padding: 44px 34px 58px;
  border: none;
  background:
    radial-gradient(60% 46% at 78% 12%, rgba(255, 214, 140, 0.55), rgba(255, 214, 140, 0) 70%),
    linear-gradient(180deg, #b9ddf6 0%, #dceffc 52%, #eef7fd 100%);
}

/* 地平線：遠山 + 草地雙層帶 */
.hero-home::before,
.hero-home::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  pointer-events: none;
}

.hero-home::before {
  bottom: 10px;
  height: 46px;
  border-radius: 100% 100% 0 0 / 200% 200% 0 0;
  background: #a9cfae;
  opacity: 0.7;
}

.hero-home::after {
  bottom: -14px;
  height: 42px;
  border-radius: 100% 100% 0 0 / 240% 240% 0 0;
  background: linear-gradient(180deg, #6cb47f, #4d9c63);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero > *,
.split > *,
.grid > *,
.panel,
.card {
  min-width: 0;
}

.actions,
.chips,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.section {
  margin-top: 36px;
}

.section > h2 {
  position: relative;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 56px;
  height: 2px;
  background: var(--sun);
}

.section.callout > h2,
.section.panel > h2 {
  border-bottom: none;
}

.section.callout > h2::after,
.section.panel > h2::after {
  content: none;
}

/* ---------- 卡片（Pal 收藏卡框語言） ---------- */

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--sky), #7abcee);
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--sky);
  box-shadow: var(--shadow-lift);
}

.card a.title {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--navy);
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
}

.card a.title::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card a.title:hover {
  color: var(--sky-deep);
}

.card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 14.5px;
}

.card .chips {
  margin-top: auto;
  padding-top: 8px;
  position: relative;
  z-index: 1;
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(62, 155, 224, 0.3);
  border-radius: var(--radius-pill);
  background: var(--sky-wash);
  color: var(--sky-deep);
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Pal 收藏卡片庫（屬性色驅動） ---------- */

.el-chip {
  --el: var(--el-neutral);
  border-color: color-mix(in srgb, var(--el) 45%, #fff);
  background: color-mix(in srgb, var(--el) 14%, #fff);
  color: color-mix(in srgb, var(--el) 72%, #1d2c3a);
  font-weight: 700;
}

.pal-grid {
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 12px;
}

.pal-card {
  --el: var(--el-neutral);
  padding: 16px 14px 12px;
}

.pal-card::before {
  background: linear-gradient(90deg, var(--el), color-mix(in srgb, var(--el) 45%, #fff));
}

.pal-card:hover {
  border-color: color-mix(in srgb, var(--el) 60%, #fff);
}

.pal-num {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--muted);
}

.pal-card a.title {
  font-size: 16.5px;
  margin-bottom: 0;
}

.pal-en {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.5px;
}

.pal-card p {
  font-size: 13.5px;
}

/* 單 Pal 頁收藏 ID 卡 */
.pal-id-card {
  --el: var(--el-neutral);
  position: relative;
  overflow: hidden;
  border: 1.5px solid color-mix(in srgb, var(--el) 40%, var(--line));
  padding: 0;
}

.pal-id-card-body {
  padding: 14px 18px 12px;
  background:
    radial-gradient(130% 130% at 90% -30%, color-mix(in srgb, var(--el) 22%, #fff0), #fff0 60%),
    var(--paper);
}

.pal-id-card-body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--el), color-mix(in srgb, var(--el) 45%, #fff));
}

.pal-id-card h2 {
  margin: 6px 0 2px;
  font-size: 24px;
}

.pal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 2px;
}

.pal-stats div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 8px 10px;
}

.pal-stats span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.pal-stats strong {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  color: var(--navy);
}

.pal-id-card .share-card-foot {
  font-size: 12px;
  padding: 8px 18px;
}

/* ---------- 圖鑑真圖與排序篩選（PDX-01 / PDX-02） ---------- */

.pal-icon {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--el, var(--el-neutral)) 45%, #fff);
  background:
    radial-gradient(120% 120% at 30% 20%, #fff, color-mix(in srgb, var(--el, var(--el-neutral)) 16%, #fff));
  margin: 2px 0 8px;
}

.pal-card:hover .pal-icon {
  border-color: color-mix(in srgb, var(--el) 70%, #fff);
}

.pal-statline {
  display: flex;
  gap: 10px;
  margin: 2px 0 6px;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--muted);
}

.pal-id-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pal-icon-lg {
  width: 96px;
  height: 96px;
  flex: none;
  margin: 0;
}

.pal-controls {
  display: grid;
  gap: 10px;
}

.pal-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
}

.pal-controls-row label {
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.pal-controls-row select.field {
  min-width: 132px;
}

.pal-el-filter {
  align-items: center;
  gap: 6px;
}

.el-toggle {
  cursor: pointer;
  border-radius: 999px;
  padding: 4px 12px;
  border-width: 1.5px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.el-toggle:hover {
  transform: translateY(-1px);
}

.el-toggle.active {
  background: color-mix(in srgb, var(--el) 78%, #1d2c3a);
  color: #fff;
  border-color: color-mix(in srgb, var(--el) 78%, #1d2c3a);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--el) 40%, #fff0);
}

/* ---------- 配種圖形化（PDX-03）：圖卡 × 圖卡 → 圖卡 ---------- */

.breed-pal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.breed-pal img {
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--soft);
}

.breed-visual {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 14px;
}

.breed-op {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 800;
  color: var(--muted);
}

.breed-card {
  display: inline-grid;
  justify-items: center;
  gap: 2px;
  min-width: 104px;
  padding: 12px 14px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.breed-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.breed-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 50%;
  background: var(--soft);
}

.breed-card strong {
  font-size: 14px;
}

.breed-card small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.4px;
}

.footer-legal {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 狀態語義（色 + 框型 + 文字三重編碼） ---------- */

.status-ok {
  color: var(--ok);
  font-weight: 700;
}

.status-wait {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--warn);
  font-weight: 600;
}

.status-wait::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px dashed var(--warn);
  flex: none;
}

.status-bad {
  color: var(--bad);
  font-weight: 700;
}

/* ---------- 狀態徽章（statusText 詞表對應） ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1.5px solid;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}

.badge-current {
  color: var(--meadow-deep);
  border-color: var(--meadow);
  background: var(--meadow-wash);
}

.badge-waiting {
  color: var(--sun-deep);
  border-color: var(--sun);
  border-style: dashed;
  background: var(--sun-wash);
}

.badge-unconfirmed {
  color: var(--muted);
  border-color: var(--line-strong);
  border-style: dashed;
  background: var(--soft);
}

.badge-changed {
  color: var(--sky-deep);
  border-color: var(--sky);
  background: var(--sky-wash);
}

.badge-invalid {
  color: var(--bad);
  border-color: var(--ember);
  background: var(--ember-wash);
}

/* ---------- 分享卡（截圖即用視覺單元） ---------- */

.share-card {
  max-width: 960px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}

.share-card > .table-scroll {
  border-radius: 0;
}

.share-card table {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.share-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 160% at 90% -40%, rgba(122, 188, 238, 0.3), rgba(122, 188, 238, 0) 60%),
    linear-gradient(90deg, #f7fbfe, #eef6fc);
}

.share-card-head h3 {
  margin: 0;
  font-size: 21px;
}

.share-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--sky-deep);
  text-transform: uppercase;
}

.share-card-kicker::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sky) 0 46%, #fff 46% 54%, var(--sun) 54% 100%);
  box-shadow: 0 0 0 1.5px rgba(62, 155, 224, 0.3);
}

.share-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  padding: 10px 18px;
  border-top: 2px solid var(--sun);
  background: var(--navy);
  color: #a9c3d8;
  font-size: 12.5px;
}

.share-card-foot strong {
  color: #e8f1f8;
  font-weight: 600;
}

.share-card-domain {
  margin-left: auto;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ---------- 角標條 ---------- */

.info-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 0;
}

.info-strip div {
  border: 1px solid var(--line);
  border-left: 4px solid var(--sky);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 10px 12px;
}

.info-strip span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.5px;
}

.info-strip strong {
  font-size: 13.5px;
  color: var(--navy-soft);
  font-weight: 600;
}

/* ---------- 走查流程導覽 ---------- */

.flow-hero-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.flow-hero-panel div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(234, 243, 251, 0.86)),
    var(--paper);
  padding: 12px;
  box-shadow: var(--shadow-card);
}

.flow-hero-panel span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.flow-hero-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-family: var(--font-num);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.flow-phase-board {
  display: grid;
  gap: 18px;
}

.flow-phase {
  --phase-color: var(--sky);
  border: 1px solid var(--line);
  border-left: 5px solid var(--phase-color);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f8fbfd);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.flow-phase-opening {
  --phase-color: var(--meadow);
}

.flow-phase-early {
  --phase-color: var(--sky);
}

.flow-phase-mid {
  --phase-color: var(--sun);
}

.flow-phase-breeding {
  --phase-color: var(--violet);
}

.flow-phase-late {
  --phase-color: var(--ember);
}

.flow-phase-terraria {
  --phase-color: var(--el-water);
}

.flow-phase-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.flow-phase-head h3 {
  margin: 0;
}

.flow-phase-head span {
  border: 1px solid color-mix(in srgb, var(--phase-color) 45%, #fff);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--phase-color) 13%, #fff);
  color: color-mix(in srgb, var(--phase-color) 74%, var(--navy));
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 800;
}

.flow-segment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 10px;
}

.flow-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.flow-card:hover {
  border-color: color-mix(in srgb, var(--phase-color) 52%, var(--line));
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.flow-card-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--navy);
  text-decoration: none;
}

.flow-range {
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  padding: 4px 7px;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.flow-title {
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.flow-card p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.flow-topic-preview,
.flow-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flow-topic-chip,
.flow-topic-more {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  border: 1px solid rgba(62, 155, 224, 0.28);
  border-radius: var(--radius-pill);
  background: var(--sky-wash);
  color: var(--sky-deep);
  padding: 4px 9px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.flow-topic-chip:hover {
  border-color: var(--sky);
  background: #fff;
}

.flow-topic-more {
  border-color: var(--line-strong);
  background: var(--soft);
  color: var(--muted);
}

.flow-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.flow-source-list {
  display: grid;
  gap: 10px;
}

.flow-source-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 13px;
  box-shadow: var(--shadow-card);
}

.flow-source-item > strong {
  display: inline-flex;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--sun-wash);
  color: var(--sun-deep);
  padding: 5px 7px;
  font-family: var(--font-num);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.flow-source-item h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.flow-source-item code {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.flow-topic-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

/* ---------- 表格 ---------- */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  font-size: 14.5px;
}

th {
  background: var(--navy);
  color: #dce9f4;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--sun);
}

tbody tr:nth-child(even) {
  background: #f7fafc;
}

tbody tr:hover {
  background: var(--sky-wash);
}

tr:last-child td {
  border-bottom: 0;
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
}

/* ---------- 版面 ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.panel ul,
.hero ul {
  margin: 8px 0;
  padding-left: 4px;
  list-style: none;
}

.panel li,
.hero li {
  position: relative;
  padding-left: 20px;
  margin: 8px 0;
  line-height: 1.65;
}

.panel li::before,
.hero li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sky) 0 46%, #fff 46% 54%, var(--sun) 54% 100%);
  box-shadow: 0 0 0 1.5px rgba(62, 155, 224, 0.3);
}

/* ---------- 表單與工具 ---------- */

.search input,
.field,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 12px;
}

.field:hover,
select:hover,
textarea:hover {
  border-color: var(--sky);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* 工具表單產品面：panel 內 label 垂直排布、提交鍵通欄 */
.panel > label {
  display: block;
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
}

.panel > label > select,
.panel > label > .field,
.panel > label > input,
.panel > label > textarea {
  margin-top: 6px;
  font-weight: 400;
}

.panel button[type="submit"] {
  width: 100%;
  margin-top: 4px;
}

.result {
  border: 1px solid var(--line);
  border-left: 4px solid var(--sun);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffdf8, var(--paper));
  padding: 16px;
  min-height: 80px;
  box-shadow: var(--shadow-card);
}

.result::before {
  content: var(--result-label, "工具結果");
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--sun-deep);
}

.result h2 {
  font-size: 20px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line-strong);
}

.result > p:only-of-type {
  color: var(--muted);
}

.result table {
  box-shadow: none;
}

.result pre {
  margin: 0;
  overflow-x: auto;
  font-size: 13.5px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 12px;
  box-shadow: var(--shadow-card);
}

.metric span,
.quantity-field small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  color: var(--navy);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.import-box {
  min-height: 96px;
  margin-top: 12px;
}

/* ---------- 追蹤清單 ---------- */

.check-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.check-row:last-child {
  border-bottom: 0;
}

/* .panel > label 的表單版式不適用於清單勾選行 */
.panel > label.check-row {
  display: grid;
  margin: 0;
  font-weight: 400;
  color: var(--ink);
}

.check-row:has(input:checked) {
  background: linear-gradient(90deg, var(--meadow-wash), rgba(233, 245, 238, 0));
}

.check-row:has(input:checked) strong {
  color: var(--meadow-deep);
}

.check-row input {
  width: 19px;
  height: 19px;
  margin-top: 3px;
  accent-color: var(--meadow);
}

.quantity-row {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.quantity-row:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.quantity-row .check-row {
  border-bottom: 0;
  padding-bottom: 6px;
}

.quantity-field {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.checklist-phase {
  margin-top: 18px;
}

.progress {
  height: 14px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--soft);
  border: 1px solid var(--line);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--meadow), #6cc287);
  transition: width 0.3s ease;
}

/* ---------- 提示框與頁腳 ---------- */

.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--sky);
  background: var(--sky-wash);
  padding: 14px 16px;
  border-radius: var(--radius);
}

.warning {
  border-left-color: var(--sun-deep);
  background: var(--sun-wash);
}

.site-footer {
  border-top: 3px solid var(--sun);
  background: var(--navy);
  color: #a9c3d8;
}

.footer-inner {
  padding: 26px 0;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* ---------- 響應式 ---------- */

@media (max-width: 860px) {
  .topbar,
  .hero,
  .split {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar .search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .grid,
  .metric-grid,
  .info-strip,
  .form-grid,
  .flow-hero-panel,
  .flow-detail-grid {
    grid-template-columns: 1fr;
  }

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

  .flow-segment-grid {
    grid-template-columns: 1fr;
  }

  .flow-source-item {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  h1 {
    font-size: 30px;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero-home {
    padding: 30px 20px 64px;
  }

  .brand-tagline {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }

  .hero {
    padding: 20px;
  }
}
