/* 地圖工坊網頁：沿用 MapleSpell 面板的深色石板底、藍色主色與微軟正黑體，
   品牌紫只用在背景光暈與商標，避免搶走主色。 */
:root {
  color-scheme: dark;
  --bg: #0a0d13;
  --card: #111620;
  --elevated: #151b27;
  --hover: #1a2130;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.14);
  --text: #f1f5f9;
  --soft: #cbd5e1;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #3b82f6;
  --accent-hi: #60a5fa;
  --accent-bg: rgb(59 130 246 / 0.16);
  --violet: #8b5cf6;
  --green: #34d399;
  --green-bg: rgb(52 211 153 / 0.12);
  --amber: #fbbf24;
  --amber-bg: rgb(251 191 36 / 0.12);
  --red: #f87171;
  --red-bg: rgb(248 113 113 / 0.12);
  --star: #fcd34d;
  --radius: 14px;
  --shadow: 0 1px 0 0 rgb(255 255 255 / 0.03) inset, 0 18px 40px -24px rgb(0 0 0 / 0.8);
  font:
    14px/1.6 "Microsoft JhengHei UI",
    "Microsoft JhengHei",
    "Noto Sans TC",
    system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}
[hidden] {
  display: none !important;
}
::selection {
  background: rgb(59 130 246 / 0.35);
}
html {
  scrollbar-color: #2a3344 transparent;
}

/* ── 共用控制項 ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.25rem;
  padding: 0 0.95rem;
  border-radius: 10px;
  border: 0;
  background: var(--elevated);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--soft);
  font-weight: 600;
  font-size: 13px;
  transition:
    background 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}
.btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hi);
  color: #fff;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  padding: 0 0.6rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 1.5rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--elevated);
  color: var(--soft);
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip-all {
  background: var(--green-bg);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgb(52 211 153 / 0.28);
}
.chip-job {
  background: var(--amber-bg);
  color: var(--amber);
  box-shadow: inset 0 0 0 1px rgb(251 191 36 / 0.26);
}
.chip-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: 7px;
  background: linear-gradient(#1e2636, #161c28);
  box-shadow:
    inset 0 0 0 1px var(--line-strong),
    0 2px 0 #0b0f17;
  font:
    600 12px/1 ui-monospace,
    "Cascadia Code",
    Consolas,
    monospace;
  color: var(--text);
}

/* ── 頁框 ─────────────────────────────────── */
.glow {
  position: fixed;
  inset: -20vh -10vw auto;
  height: 70vh;
  pointer-events: none;
  background:
    radial-gradient(40% 60% at 18% 30%, rgb(139 92 246 / 0.16), transparent 70%),
    radial-gradient(35% 55% at 80% 10%, rgb(59 130 246 / 0.14), transparent 70%);
  z-index: -1;
}
main,
.topbar-inner,
.site-foot {
  width: min(calc(100% - 3rem), 76rem);
  margin-inline: auto;
}
main {
  flex: 1;
  padding: 2.5rem 0 4rem;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(10 13 19 / 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}
.brand img {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 10px rgb(139 92 246 / 0.55));
}
.brand-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.01em;
}
.brand-divider {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}
.brand-sub {
  color: var(--muted);
  font-weight: 600;
}
.nav-pills {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 12px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
.nav-pills button {
  height: 2rem;
  padding: 0 0.95rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav-pills button:hover {
  color: var(--text);
}
.nav-pills button[aria-pressed="true"] {
  background: var(--accent-bg);
  color: var(--accent-hi);
  box-shadow: inset 0 0 0 1px rgb(59 130 246 / 0.4);
}
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12px;
}

/* ── 標頭與搜尋 ─────────────────────────────── */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.hero-copy {
  max-width: 42rem;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent-hi);
  margin-bottom: 0.5rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #fff 30%, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 15px;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: min(100%, 25rem);
  padding: 0.35rem 0.35rem 0.35rem 2.6rem;
  border-radius: 12px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.15s;
}
.search:focus-within {
  box-shadow: inset 0 0 0 2px rgb(59 130 246 / 0.7);
}
.search-icon {
  position: absolute;
  left: 0.85rem;
  width: 18px;
  height: 18px;
  color: var(--dim);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 2.1rem;
  border: 0;
  background: transparent;
  outline: none;
}
.search input::placeholder {
  color: var(--dim);
}
.search input::-webkit-search-cancel-button {
  filter: grayscale(1) brightness(1.6);
}
.search button {
  height: 2.1rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.search button:hover {
  background: var(--accent-hi);
}

/* ── 大分類與職業篩選 ─────────────────────────── */
.filters:empty {
  display: none;
}
.filters {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.category-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.category {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  color: var(--soft);
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.category:hover {
  background: var(--elevated);
  transform: translateY(-1px);
}
.category-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 11px;
  background: var(--elevated);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 18px;
  flex: none;
}
.category-text {
  display: grid;
  min-width: 0;
}
.category-text strong {
  font-size: 15px;
  color: var(--text);
}
.category-text span {
  font-size: 12px;
  color: var(--dim);
}
.category-count {
  margin-left: auto;
  font:
    700 20px/1 ui-monospace,
    "Cascadia Code",
    Consolas,
    monospace;
  color: var(--dim);
}
.category[aria-pressed="true"] {
  background: linear-gradient(135deg, rgb(59 130 246 / 0.18), rgb(59 130 246 / 0.04));
  box-shadow: inset 0 0 0 1px rgb(59 130 246 / 0.55);
}
.category[aria-pressed="true"] .category-count {
  color: var(--accent-hi);
}
.category[data-kind="all-jobs"][aria-pressed="true"] {
  background: linear-gradient(135deg, rgb(52 211 153 / 0.16), rgb(52 211 153 / 0.03));
  box-shadow: inset 0 0 0 1px rgb(52 211 153 / 0.5);
}
.category[data-kind="all-jobs"][aria-pressed="true"] .category-count {
  color: var(--green);
}
.category[data-kind="job"][aria-pressed="true"] {
  background: linear-gradient(135deg, rgb(251 191 36 / 0.15), rgb(251 191 36 / 0.03));
  box-shadow: inset 0 0 0 1px rgb(251 191 36 / 0.45);
}
.category[data-kind="job"][aria-pressed="true"] .category-count {
  color: var(--amber);
}
.job-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.job-filter-label {
  color: var(--dim);
  font-size: 12px;
  margin-right: 0.25rem;
}
.job-filter button {
  height: 1.9rem;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.job-filter button:hover {
  color: var(--text);
}
.job-filter button[aria-pressed="true"] {
  background: var(--amber-bg);
  color: var(--amber);
  box-shadow: inset 0 0 0 1px rgb(251 191 36 / 0.45);
}
.status:not(:empty) {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
}

/* ── 地圖卡 ──────────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
}
.section-head h2 {
  font-size: 17px;
  font-weight: 700;
}
.section-head span {
  color: var(--dim);
  font-size: 12px;
}
.library + .library {
  margin-top: 2.25rem;
}
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1rem;
}
.map-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px var(--line),
    var(--shadow);
  text-align: left;
  color: inherit;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  animation: rise 0.28s ease both;
}
.map-card:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgb(96 165 250 / 0.45),
    0 22px 44px -22px rgb(37 99 235 / 0.55);
}
.map-card[aria-pressed="true"] {
  box-shadow:
    inset 0 0 0 2px var(--accent),
    var(--shadow);
}
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 1px 1px, rgb(148 163 184 / 0.16) 1px, transparent 0) 0 0 / 14px 14px,
    linear-gradient(160deg, #121a28, #0b1019);
  overflow: hidden;
}
.thumb canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgb(17 22 32 / 0.92));
  pointer-events: none;
}
.thumb-level {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 1;
  padding: 0.15rem 0.5rem;
  border-radius: 7px;
  background: rgb(10 13 19 / 0.72);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font:
    700 12px/1.4 ui-monospace,
    "Cascadia Code",
    Consolas,
    monospace;
  color: var(--accent-hi);
}
.thumb-sprite {
  position: absolute;
  right: 0.5rem;
  bottom: 0.2rem;
  z-index: 1;
  height: 62%;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.6));
}
.thumb-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 12px;
}
.card-body {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 1rem 1rem;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.card-mob {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.card-jobs {
  display: flex;
  gap: 0.3rem;
  min-width: 0;
  overflow: hidden;
}
.stars {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--dim);
  font-size: 12px;
  white-space: nowrap;
}
.stars b {
  color: var(--star);
  font-size: 13px;
}
.empty {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 3.5rem 1rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  text-align: center;
}
.empty strong {
  color: var(--text);
  font-size: 16px;
}
.pager {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ── 地圖詳情 ─────────────────────────────────── */
.detail {
  display: grid;
  gap: 1.25rem;
  animation: rise 0.25s ease both;
}
.back {
  justify-self: start;
}
.detail-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.4rem;
  border-radius: 18px;
  background:
    radial-gradient(60% 120% at 0% 0%, rgb(59 130 246 / 0.14), transparent 60%),
    var(--card);
  box-shadow:
    inset 0 0 0 1px var(--line),
    var(--shadow);
}
.detail-sprite {
  width: 4.5rem;
  height: 4.5rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--elevated);
  box-shadow: inset 0 0 0 1px var(--line);
}
.detail-sprite img {
  max-width: 86%;
  max-height: 86%;
  image-rendering: pixelated;
}
.detail-title {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 13px;
}
.detail-title h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
}
.level {
  font:
    700 13px/1 ui-monospace,
    "Cascadia Code",
    Consolas,
    monospace;
  color: var(--accent-hi);
}
.source {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.detail-score {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
  flex: none;
}
.detail-score strong {
  font:
    800 28px/1 ui-monospace,
    "Cascadia Code",
    Consolas,
    monospace;
  color: var(--star);
}
.detail-score span {
  font-size: 12px;
  color: var(--dim);
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  gap: 1.25rem;
  align-items: start;
}
.panel {
  border-radius: var(--radius);
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px var(--line),
    var(--shadow);
}
.viewer {
  padding: 0.9rem;
  display: grid;
  gap: 0.75rem;
}
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 11px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.route-tabs button {
  height: 1.9rem;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.route-tabs button:hover {
  color: var(--text);
}
.route-tabs button[aria-pressed="true"] {
  background: var(--elevated);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.route-tabs .tab-kind {
  color: var(--dim);
  margin-right: 0.35rem;
  font-weight: 500;
}
.viewer-hint {
  color: var(--dim);
  font-size: 12px;
}
.side {
  display: grid;
  gap: 1rem;
}
.info {
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.6rem;
}
.info > div:empty {
  display: none;
}
.info h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.info p {
  color: var(--soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.info-jobs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.info-jobs .chip {
  height: 1.8rem;
  font-size: 13px;
  padding: 0 0.7rem;
}
.keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.key-arrow {
  color: var(--dim);
  font-size: 12px;
}
.sequence {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.sequence li {
  position: relative;
  padding: 0.5rem 0.65rem 0.5rem 2.2rem;
  border-radius: 9px;
  background: var(--elevated);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.sequence li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.6rem;
  top: 0.55rem;
  width: 1.2rem;
  height: 1.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-hi);
  font-size: 11px;
  font-weight: 700;
}
.muted {
  color: var(--dim) !important;
}
.rate {
  display: flex;
  gap: 0.15rem;
}
.rate button {
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  transition:
    color 0.1s,
    transform 0.1s;
}
.rate button.lit {
  color: var(--star);
}
.rate button:hover:not(:disabled) {
  transform: scale(1.12);
}
.rate-note {
  color: var(--dim);
  font-size: 12px;
}
.callout {
  display: flex;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px rgb(59 130 246 / 0.3);
  color: #bfdbfe;
  font-size: 13px;
}
.callout b {
  color: #fff;
}

/* ── 播放器（preview.js 產生） ──────────────────── */
.player {
  display: grid;
  gap: 0.6rem;
}
.player-stage {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
  background: #0c1421;
}
.player-stage canvas,
.viewer > canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 11px;
}
.stage-label,
.stage-readout {
  position: absolute;
  padding: 0.2rem 0.55rem;
  border-radius: 7px;
  background: rgb(10 13 19 / 0.78);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 12px;
  font-weight: 600;
}
.stage-label {
  top: 0.6rem;
  left: 0.6rem;
  color: var(--accent-hi);
}
.stage-readout {
  right: 0.6rem;
  bottom: 0.6rem;
  color: var(--soft);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: pre;
}
.player-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.player-tools button {
  height: 2rem;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 9px;
  background: var(--elevated);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
}
.player-tools button:first-child {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
  min-width: 5.5rem;
}
.player-tools button:hover:not(:disabled) {
  filter: brightness(1.15);
}
.player-tools input[type="range"] {
  flex: 1;
  min-width: 8rem;
  accent-color: var(--accent);
}
.player-tools output {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.route-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  color: var(--muted);
  font-size: 12px;
}
.route-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.route-legend canvas {
  border-radius: 2px;
}

/* ── 我的投稿 ─────────────────────────────────── */
.subs {
  display: grid;
  gap: 0.85rem;
}
.sub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem 1.5rem;
  align-items: center;
  padding: 1.1rem 1.25rem;
  animation: rise 0.25s ease both;
}
.sub-title {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.sub-title h3 {
  font-size: 16px;
  font-weight: 700;
}
.sub-title .detail-meta {
  font-size: 12px;
}
.steps {
  display: flex;
  align-items: center;
  gap: 0;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.step i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #263042;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.step.done {
  color: var(--soft);
}
.step.done i {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.2);
}
.step.now i {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgb(251 191 36 / 0.2);
}
.step.now {
  color: var(--amber);
}
.step.fail i {
  background: var(--red);
  box-shadow: 0 0 0 3px rgb(248 113 113 / 0.2);
}
.step.fail {
  color: var(--red);
}
.step-line {
  width: 2.2rem;
  height: 2px;
  margin: 0 0.45rem;
  background: #263042;
  border-radius: 2px;
}
.step-line.done {
  background: var(--accent);
}
.sub-note {
  grid-column: 1 / -1;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: var(--red-bg);
  box-shadow: inset 0 0 0 1px rgb(248 113 113 / 0.28);
  color: #fecaca;
  font-size: 13px;
}
.sub-note.ok {
  background: var(--green-bg);
  box-shadow: inset 0 0 0 1px rgb(52 211 153 / 0.28);
  color: #a7f3d0;
}
.sub-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

/* ── 窄螢幕 ───────────────────────────────────── */
@media (max-width: 960px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  main,
  .topbar-inner,
  .site-foot {
    width: calc(100% - 2rem);
  }
  .brand-divider,
  .brand-sub {
    display: none;
  }
  .category-bar {
    grid-template-columns: 1fr;
  }
  .detail-head {
    flex-wrap: wrap;
  }
  .detail-score {
    justify-items: start;
  }
  .sub {
    grid-template-columns: 1fr;
  }
}

/* ── 審核頁（review.html） ─────────────────────── */
body.review main {
  width: min(calc(100% - 3rem), 64rem);
}
body.review header {
  margin-bottom: 1.5rem;
}
body.review header span {
  color: var(--accent-hi);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
body.review h1 {
  font-size: 1.9rem;
  font-weight: 800;
}
body.review #login,
body.review nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
body.review input,
body.review textarea {
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 9px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
body.review textarea {
  width: 100%;
  min-height: 4.5rem;
}
body.review button {
  height: 2.1rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 9px;
  background: var(--elevated);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--soft);
  font-weight: 600;
}
body.review button:hover,
body.review button[aria-pressed="true"] {
  background: var(--accent-bg);
  color: var(--accent-hi);
  box-shadow: inset 0 0 0 1px rgb(59 130 246 / 0.45);
}
body.review #rows {
  display: grid;
  gap: 1rem;
}
body.review article {
  display: grid;
  gap: 0.6rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px var(--line),
    var(--shadow);
}
body.review article small {
  color: var(--dim);
}
body.review article p {
  color: var(--soft);
  white-space: pre-line;
}
body.review article > canvas {
  width: 100%;
  height: auto;
  border-radius: 11px;
}
body.review form:not(#login) {
  display: grid;
  gap: 0.5rem;
}
body.review label {
  color: var(--muted);
  font-size: 13px;
}

/* ── 審核通過送 1 天、下載代碼、卡片統計 ─────────── */
.perk {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--amber-bg);
  box-shadow: inset 0 0 0 1px rgb(251 191 36 / 0.35);
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
}
.card-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.downloads {
  color: var(--dim);
  font-size: 12px;
  white-space: nowrap;
}
.code-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.7rem;
}
.code-box .code {
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  font: 700 16px/1.4 ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.12em;
  user-select: all;
}
.code-note {
  flex-basis: 100%;
  color: var(--dim);
  font-size: 12px;
}
.btn-small {
  height: 1.9rem;
  padding: 0 0.75rem;
  font-size: 12px;
}
.sub .code-box {
  margin-top: 0.7rem;
}
