
/* 版面：左邊固定一欄是山靈試色台與選中礦石的說明，右邊是依顏色分組的礦石色票牆。手機改成上下排。 */
:root {
  --paper: #F4EEDE; --panel: #FBF7EC; --ink: #1C1D1A; --muted: #6A655A; --line: #CDC4AF; --line-strong: #23211C;
  --stage-light: #F4EEDE; --stage-dark: #1C1D1A; --mark: #8A520F; --focus: #1F4E8C;
  --font-display: 'LXGW WenKai TC', 'Kaiti TC', 'BiauKai', 'Songti TC', serif;
  --font-body: 'Noto Sans TC', 'PingFang TC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #1C1D1A; --panel: #262723; --ink: #ECE5D5; --muted: #B0AA9A; --line: #45443D; --line-strong: #ECE5D5;
  --mark: #E0B46A; --focus: #8FB6E8; color-scheme: dark } }
:root[data-theme="dark"] {
  --paper: #1C1D1A; --panel: #262723; --ink: #ECE5D5; --muted: #B0AA9A; --line: #45443D; --line-strong: #ECE5D5;
  --mark: #E0B46A; --focus: #8FB6E8; color-scheme: dark }
*, *::before, *::after { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.65;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 56px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1320px; margin: 0 auto; display: grid; gap: 24px; }
header h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 4vw, 40px); line-height: 1.2; margin: 0; text-wrap: balance; }
header p { margin: 6px 0 0; color: var(--muted); max-width: 46em; }
.cols { display: grid; grid-template-columns: 372px minmax(0, 1fr); gap: 28px; align-items: start; }
.bench { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); display: grid; gap: 14px; max-height: calc(100vh - 24px); overflow-y: auto; padding-right: 2px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.box h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 8px; }
.stage { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stage > div { border-radius: 4px; padding: 12px 10px 8px; display: grid; gap: 8px; justify-items: center; border: 1px solid var(--line); }
.stage .on-light { background: var(--stage-light); }
.stage .on-dark { background: var(--stage-dark); }
.stage svg { display: block; }
.stage .big svg { width: 100%; max-width: 150px; height: auto; }
.stage .smalls { display: flex; gap: 12px; align-items: flex-end; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.seg button, .chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 3px 12px; font-size: 13px; line-height: 1.6; }
.seg button[aria-pressed="true"], .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg-label { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; margin: 12px 0 0; }
.slots { display: grid; gap: 6px; margin-top: 10px; }
.slot { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: transparent; border-radius: 4px; padding: 6px 8px; }
.slot[aria-pressed="true"] { border-color: var(--line-strong); box-shadow: inset 3px 0 0 var(--line-strong); }
.slot i { width: 34px; height: 34px; border-radius: 3px; border: 1px solid var(--line); display: block; }
.slot b { display: block; font-weight: 500; font-size: 13px; }
.slot span { font-size: 12px; color: var(--muted); }
.slot code, .hex { font-family: var(--font-mono); font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.plain { border: 1px solid var(--line); background: transparent; border-radius: 4px; padding: 4px 10px; font-size: 13px; }
.plain:hover, .chip:hover, .seg button:hover { border-color: var(--line-strong); }
#copied { font-size: 12px; color: var(--mark); min-height: 1.4em; }
.detail .zh { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.25; }
.detail .en { color: var(--muted); font-size: 13px; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 10px 0; font-size: 13px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.detail .note { margin: 8px 0 0; }
.cchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cchip { display: grid; grid-template-columns: 26px auto; gap: 8px; align-items: center; border: 1px solid var(--line); background: transparent; border-radius: 4px; padding: 4px 8px 4px 4px; text-align: left; }
.cchip i { width: 26px; height: 26px; border-radius: 2px; display: block; border: 1px solid var(--line); }
.cchip small { display: block; font-size: 11px; color: var(--muted); line-height: 1.3; }
.mohs { position: relative; height: 26px; margin: 4px 0 2px; }
.mohs .track { position: absolute; left: 0; right: 0; top: 4px; height: 6px; background: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 11.111%); border-bottom: 1px solid var(--line); }
.mohs .fill { position: absolute; top: 3px; height: 8px; background: var(--ink); border-radius: 2px; min-width: 4px; }
.mohs .ticks { position: absolute; left: 0; right: 0; top: 13px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 12px; border: 1px solid var(--mark); color: var(--mark); border-radius: 3px; padding: 0 6px; }
.tools { display: grid; gap: 10px; }
.tools .row input[type="search"], .tools select { border: 1px solid var(--line); background: var(--panel); border-radius: 4px; padding: 5px 10px; min-width: 0; }
.tools input[type="search"] { flex: 1 1 200px; }
.fam-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); }
#count { color: var(--muted); font-size: 13px; }
.group h3 { font-family: var(--font-display); font-size: 20px; margin: 22px 0 10px; display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.group h3 small { font-family: var(--font-body); font-weight: 400; font-size: 13px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px 10px; }
.card { display: grid; gap: 5px; text-align: left; background: transparent; border: 0; padding: 0; min-width: 0; }
.card { content-visibility: auto; contain-intrinsic-size: 132px 150px; }
.sw { position: relative; border-radius: 4px; display: grid; gap: 6px; padding: 10px 8px 6px; border: 1px solid var(--line); background: var(--panel); }
.sw svg { width: 100%; height: auto; display: block; }
.sw .dots { display: flex; gap: 4px; align-items: center; min-height: 12px; }
.sw .dots i { width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--line); display: block; }
.sw .dots i.mk { border-radius: 50%; margin-left: auto; }
.card[aria-current="true"] .sw { outline: 2px solid var(--line-strong); outline-offset: 2px; }
.card .nm { font-weight: 500; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.card .sub { font-size: 11.5px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.card .hbar { height: 3px; background: var(--line); border-radius: 2px; position: relative; }
.card .hbar b { position: absolute; top: 0; bottom: 0; background: var(--ink); border-radius: 2px; min-width: 3px; }
.about { border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 13.5px; max-width: 62em; }
.about h2 { font-family: var(--font-display); color: var(--ink); font-size: 18px; margin: 0 0 6px; }
.about ul { margin: 0; padding-left: 1.2em; }
.fab { display: none; }
@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .bench { position: static; max-height: none; overflow: visible; }
  .fab { display: block; position: fixed; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: 92px; padding: 8px 8px 4px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--stage-light); z-index: 5; }
  .fab svg { width: 100%; height: auto; display: block; }
}
@media (prefers-reduced-motion: no-preference) { .sw { transition: transform .12s; } .card:hover .sw { transform: translateY(-2px); } }

.lab-bar { max-width: 1180px; margin: 0 auto 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-bottom: 14px; border-bottom: 1px solid #CDC4AF; }
.lab-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.lab-brand svg { width: 40px; height: 27px; display: block; }
.lab-brand b { font: 700 24px/1 'LXGW WenKai TC', 'Kaiti TC', serif; letter-spacing: 0.1em; }
.lab-brand span { font: 400 14px/1 'LXGW WenKai TC', 'Kaiti TC', serif; letter-spacing: 0.3em; opacity: 0.7; }
.lab-bar nav { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-left: auto; font-size: 14px; letter-spacing: 0.12em; }
.lab-bar nav a { color: inherit; text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.lab-bar nav a:hover, .lab-bar nav a[aria-current="page"] { border-bottom-color: currentColor; }
.lab-foot { max-width: 1180px; margin: 40px auto 0; padding-top: 14px; border-top: 1px solid #CDC4AF; font-size: 14px; letter-spacing: 0.12em; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.lab-foot a { color: inherit; text-decoration: none; }
.lab-foot a:hover { text-decoration: underline; }
