/* ============ 夜航卡舍 · 主題 ============ */
:root {
  --rail-w: 84px;
  --gap: 18px;
  --r-xs: 10px; --r-sm: 14px; --r-md: 20px; --r-lg: 28px;
  --f-sans: "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Noto Serif TC", "Songti TC", serif;
  --f-display: "Cinzel", "Noto Serif TC", serif;
  --f-cond: "Oswald", "Noto Sans TC", sans-serif;
  --f-script: "Cormorant Garamond", "Noto Serif TC", serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --r-R: linear-gradient(135deg, #e6eef9, #8fa6c8 45%, #dfe8f5 70%, #7f95b8);
  --r-SR: linear-gradient(135deg, #f1dcff, #9b6fe0 40%, #e9c6ff 65%, #7a4fc4);
  --r-SSR: linear-gradient(135deg, #fff1c4, #e2b04f 30%, #fff6d8 50%, #c48a2c 70%, #ffe7a3);
  color-scheme: dark;
}
:root, [data-theme="night"] {
  --bg: #0c0d12; --bg-2: #13141b;
  --surface: rgba(23, 24, 33, .74); --surface-solid: #181922; --surface-2: rgba(255, 255, 255, .045); --surface-3: rgba(255, 255, 255, .08);
  --line: rgba(214, 186, 128, .16); --line-strong: rgba(214, 186, 128, .38); --line-soft: rgba(255, 255, 255, .07);
  --text: #eee7d5; --text-2: #b3ab99; --text-3: #7a7468;
  --gold: #d6b475; --gold-2: #9d7a3d; --gold-grad: linear-gradient(135deg, #f6e2ac, #d2a659 48%, #9a7134);
  --accent: #cf4c60; --accent-soft: rgba(207, 76, 96, .16);
  --primary-bg: linear-gradient(135deg, #f3dc9f, #cfa253 55%, #a87c37); --primary-text: #1d160b; --primary-shadow: 0 6px 22px rgba(214, 170, 90, .28);
  --paper: #dccda6; --paper-2: #c7b385; --ink: #2a2117; --ink-2: #5d4f3a;
  --seal: #b8914c; --seal-hi: #f7e7bf; --seal-lo: #6e5221;
  --back-filter: sepia(.45) saturate(1.4) hue-rotate(-18deg) brightness(1.02);
  --shadow-1: 0 2px 10px rgba(0, 0, 0, .35); --shadow-2: 0 22px 60px rgba(0, 0, 0, .55);
  --home-shade: rgba(8, 9, 13, .86); --home-shade-2: rgba(8, 9, 13, .7);
  --album-page: #f1ebdd; --album-page-2: #e4dccb; --pocket-empty: rgba(60, 50, 30, .07);
  --stage-bg: #08090c;
  color-scheme: dark;
}
[data-theme="day"] {
  --bg: #f3eee4; --bg-2: #e9e2d3;
  --surface: rgba(255, 252, 246, .8); --surface-solid: #fffcf6; --surface-2: rgba(70, 52, 22, .045); --surface-3: rgba(70, 52, 22, .08);
  --line: rgba(146, 113, 60, .2); --line-strong: rgba(146, 113, 60, .42); --line-soft: rgba(70, 52, 22, .08);
  --text: #29241e; --text-2: #675e52; --text-3: #9c9385;
  --gold: #a47b3a; --gold-2: #7a5a26; --gold-grad: linear-gradient(135deg, #c99b52, #a47b3a 50%, #7c5a28);
  --accent: #3b5a8f; --accent-soft: rgba(59, 90, 143, .12);
  --primary-bg: linear-gradient(135deg, #4a6ba3, #34507f 55%, #25395e); --primary-text: #fbf7ee; --primary-shadow: 0 6px 22px rgba(52, 80, 127, .28);
  --paper: #f3e8cb; --paper-2: #e3d2a8; --ink: #31271a; --ink-2: #6b5a40;
  --seal: #3b5a8f; --seal-hi: #eef2fa; --seal-lo: #25395e;
  --back-filter: hue-rotate(-14deg) saturate(.75) brightness(1.04);
  --shadow-1: 0 2px 10px rgba(90, 70, 40, .1); --shadow-2: 0 22px 60px rgba(90, 70, 40, .18);
  --home-shade: rgba(246, 241, 231, .88); --home-shade-2: rgba(246, 241, 231, .62);
  --album-page: #fbf8f1; --album-page-2: #efe8da; --pocket-empty: rgba(60, 50, 30, .06);
  --stage-bg: #e7e0d2;
  color-scheme: light;
}


/* 霧紫晨曦（colorion #577：#FCFDFD #E7D5E3 #767892 #A0B1DE #FDD3D9） */
:root[data-theme="lavender"] {
  --bg: #f4f1f6; --bg-2: #ebe4ee;
  --surface: rgba(252, 253, 253, .82); --surface-solid: #fcfdfd; --surface-2: rgba(118, 120, 146, .06); --surface-3: rgba(118, 120, 146, .11);
  --line: rgba(118, 120, 146, .2); --line-strong: rgba(118, 120, 146, .42); --line-soft: rgba(118, 120, 146, .09);
  --text: #393a50; --text-2: #686a84; --text-3: #9c9db2;
  --gold: #8590c6; --gold-2: #626a9e; --gold-grad: linear-gradient(135deg, #c8d1f0, #a0b1de 50%, #7c88bf);
  --accent: #e38c9c; --accent-soft: rgba(253, 211, 217, .45);
  --primary-bg: linear-gradient(135deg, #9095b9, #767892 55%, #5f6180); --primary-text: #fcfdfd; --primary-shadow: 0 6px 22px rgba(118, 120, 146, .3);
  --paper: #f6eef4; --paper-2: #e7d5e3; --ink: #393a50; --ink-2: #686a84;
  --seal: #8f97c4; --seal-hi: #fcfdfd; --seal-lo: #767892;
  --shadow-1: 0 2px 10px rgba(118, 120, 146, .12); --shadow-2: 0 22px 60px rgba(118, 120, 146, .22);
  --home-shade: rgba(250, 248, 251, .86); --home-shade-2: rgba(250, 248, 251, .62);
  --album-page: #fdfbfd; --album-page-2: #f1e9ef; --pocket-empty: rgba(118, 120, 146, .07);
  --stage-bg: #e9e3ec;
  --case-top: #f5f0f7; --case-bottom: #ebe3ef; --case-frame: #b9b3d4; --wood-1: #cfc6e4; --wood-2: #aaa1cb;
  --deco-filter: hue-rotate(-12deg) saturate(.65) brightness(1.12);
  --back-filter: hue-rotate(-8deg) saturate(.7) brightness(1.08);
  color-scheme: light;
}
/* 汽水珊瑚（colorion #521：#FFFFFF #75D2D7 #E95453 #F3A3A2 #A1DDE0） */
:root[data-theme="coral"] {
  --bg: #f4fafa; --bg-2: #e7f4f4;
  --surface: rgba(255, 255, 255, .85); --surface-solid: #ffffff; --surface-2: rgba(30, 110, 115, .05); --surface-3: rgba(30, 110, 115, .09);
  --line: rgba(70, 165, 170, .24); --line-strong: rgba(60, 150, 155, .5); --line-soft: rgba(30, 110, 115, .08);
  --text: #213739; --text-2: #4f6c6e; --text-3: #87a1a3;
  --gold: #3fb0b7; --gold-2: #2a8b91; --gold-grad: linear-gradient(135deg, #a1dde0, #75d2d7 50%, #3fa8af);
  --accent: #e95453; --accent-soft: rgba(233, 84, 83, .12);
  --primary-bg: linear-gradient(135deg, #f28d8c, #e95453 55%, #cf3e3d); --primary-text: #ffffff; --primary-shadow: 0 6px 22px rgba(233, 84, 83, .3);
  --paper: #fff5f4; --paper-2: #f3d3d2; --ink: #3a2526; --ink-2: #7a5355;
  --seal: #e95453; --seal-hi: #ffffff; --seal-lo: #b83a39;
  --shadow-1: 0 2px 10px rgba(40, 110, 115, .1); --shadow-2: 0 22px 60px rgba(40, 110, 115, .18);
  --home-shade: rgba(247, 253, 253, .86); --home-shade-2: rgba(247, 253, 253, .62);
  --album-page: #ffffff; --album-page-2: #edf7f7; --pocket-empty: rgba(30, 110, 115, .06);
  --stage-bg: #e2f1f1;
  --case-top: #eff9f9; --case-bottom: #e3f2f2; --case-frame: #8ed0d4; --wood-1: #b3e3e5; --wood-2: #7cc7cc;
  --deco-filter: hue-rotate(-85deg) saturate(.75) brightness(1.08);
  --back-filter: hue-rotate(-28deg) saturate(.95) brightness(1.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-sans); color: var(--text); background: var(--bg);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 700px at 85% -10%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .35 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  overflow: hidden;
  transition: background-color .5s var(--ease-soft), color .5s var(--ease-soft);
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::selection { background: color-mix(in srgb, var(--gold) 40%, transparent); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); }
svg { width: 1.15em; height: 1.15em; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.pad { padding: 18px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.6; word-break: break-word; }
.dim { opacity: .65; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.grow { flex: 1; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 側欄導覽 ============ */
.rail {
  position: fixed; z-index: 40; left: 14px; top: 14px; bottom: 14px; width: var(--rail-w);
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 30px;
  backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: var(--shadow-2);
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 8px; text-align: center; }
.brand .seal-svg { width: 46px; height: 46px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); transition: transform .6s var(--ease); }
.brand:hover .seal-svg { transform: rotate(-14deg) scale(1.06); }
.brand b { font-family: var(--f-serif); font-size: 12px; letter-spacing: .12em; }
.brand small { font-family: var(--f-display); font-size: 8.5px; letter-spacing: .28em; color: var(--text-3); }
.nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 62px; padding: 10px 0 8px; border-radius: 20px; color: var(--text-2);
  transition: background .3s var(--ease), color .3s;
}
.nav a .ni { display: grid; place-items: center; }
.nav a svg { width: 22px; height: 22px; transition: transform .4s var(--ease); }
.nav a .nt { font-size: 11.5px; letter-spacing: .1em; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a:hover svg { transform: translateY(-1px) scale(1.06); }
.nav a.on { color: var(--primary-text); background: var(--primary-bg); box-shadow: var(--primary-shadow); }
.theme-switch { border: 0; background: none; padding: 4px; border-radius: 99px; }
.ts-track { display: block; width: 52px; height: 30px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); position: relative; }
.ts-knob {
  position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary-text); display: grid; place-items: center;
  transition: transform .5s var(--ease); box-shadow: var(--shadow-1);
}
.ts-knob svg { position: absolute; width: 14px; height: 14px; transition: opacity .3s, transform .5s var(--ease); }
[data-tone="dark"] .ts-knob { transform: translateX(22px); }
[data-tone="dark"] .ts-knob svg:first-child, [data-tone="light"] .ts-knob svg:last-child { opacity: 0; transform: rotate(-90deg) scale(.5); }

/* ============ 頁面容器 ============ */
#view { position: fixed; inset: 0; }
.view-holder { position: absolute; inset: 0; transition: opacity .3s var(--ease-soft), transform .4s var(--ease); }
.view-holder.entering { opacity: 0; transform: translateY(10px); }
.view-holder.leaving { opacity: 0; pointer-events: none; }
.view { position: absolute; inset: 0; padding: 24px 24px 24px calc(var(--rail-w) + 38px); overflow: auto; }
.view.home { padding: 0; overflow: hidden; }

/* ============ 基本元件 ============ */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--shadow-1);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  font-weight: 500; letter-spacing: .04em; color: var(--text);
  transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s, opacity .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--primary-bg); color: var(--primary-text); border-color: transparent; box-shadow: var(--primary-shadow); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--accent); }
[data-tone="light"] .btn.danger { color: #b23a48; }
.btn.small { padding: 7px 14px; font-size: 13.5px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2); transition: background .2s, transform .2s var(--ease), border-color .2s;
}
.icon-btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.ghost:hover { background: var(--surface-2); }
.icon-btn.on { background: var(--primary-bg); color: var(--primary-text); }
.icon-btn svg { width: 18px; height: 18px; }

.field {
  width: 100%; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.field { resize: vertical; min-height: 44px; line-height: 1.6; }
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 16%, transparent); background: var(--surface-3); }
select.field { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a08a5c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select.field option { background: var(--surface-solid); color: var(--text); }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span { font-size: 13px; color: var(--text-2); letter-spacing: .03em; display: flex; align-items: center; gap: 6px; }
.fld > span em { font-style: normal; color: var(--text-3); font-size: 12px; }
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-row input[type=range] { flex: 1; }
.num { width: 78px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; text-align: center; outline: none; }
.num.wide { width: 100%; text-align: left; padding: 9px 12px; }
.num:focus { border-color: var(--gold); }
input[type=range] { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: var(--surface-3); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 99px; background: var(--surface-3); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--primary-bg); border: 2px solid var(--surface-solid); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 2px solid var(--surface-solid); }
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.18); }
.toggle { position: relative; flex-direction: row; align-items: center; gap: 10px; cursor: pointer; user-select: none; padding: 4px 0; }
/* 隱藏的勾選框留在開關本身的位置：否則點下去瀏覽器會為了把它捲進畫面而讓整頁往上跑 */
.toggle input, .mini-sw input { position: absolute; left: 0; top: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.sw { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); flex: none; transition: background .25s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .35s var(--ease), background .25s; }
input:checked + .sw { background: var(--primary-bg); border-color: transparent; }
input:checked + .sw::after { transform: translateX(16px); background: var(--primary-text); }
input:focus-visible + .sw { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 35%, transparent); }
.toggle > span { font-size: 14px; color: var(--text); }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 14px; border-radius: 99px; font-size: 13.5px; color: var(--text-2); transition: background .25s var(--ease), color .2s; }
.seg button svg { width: 15px; height: 15px; }
.seg button b { font-weight: 500; opacity: .7; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--primary-bg); color: var(--primary-text); box-shadow: var(--primary-shadow); }
.seg.small button { padding: 5px 12px; font-size: 13px; }

.tabs { display: flex; gap: 4px; padding: 6px; margin: 0; overflow-x: auto; border-bottom: 1px solid var(--line-soft); }
.tabs button { border: 0; background: none; padding: 9px 16px; border-radius: 99px; color: var(--text-2); font-size: 14px; white-space: nowrap; transition: background .25s var(--ease), color .2s; }
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button.on { color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.hint-bar { padding: 10px 18px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--text-3); min-height: 40px; transition: color .2s; }
.hint-bar.on { color: var(--gold); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: 13px; margin: 0 0 12px; }
.note svg { margin-top: 2px; color: var(--gold); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); backdrop-filter: blur(12px); }
.chip b { color: var(--text); font-weight: 600; }
.chip svg { width: 14px; height: 14px; }
.chip.gold { color: var(--gold); }
.rar-badge, .rar { display: inline-grid; place-items: center; min-width: 34px; padding: 1px 8px; border-radius: 99px; font-family: var(--f-display); font-weight: 700; font-size: 11px; letter-spacing: .06em; color: #20180a; font-style: normal; }
.r-R.rar-badge, .rar.r-R { background: var(--r-R); }
.r-SR.rar-badge, .rar.r-SR { background: var(--r-SR); color: #24103f; }
.r-SSR.rar-badge, .rar.r-SSR { background: var(--r-SSR); background-size: 200% 200%; animation: sheen 3s linear infinite; }
@keyframes sheen { to { background-position: 200% 0; } }

/* ============ 提示、對話框、星光 ============ */
#toast-root { position: fixed; z-index: 300; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 99px; max-width: min(560px, 90vw);
  background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); font-size: 14px;
  opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .3s var(--ease), transform .45s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; box-shadow: 0 0 10px var(--gold); }
.toast-ok .toast-dot { background: #6fcf97; box-shadow: 0 0 10px #6fcf97; }
.toast-warn .toast-dot { background: #f2b84b; box-shadow: 0 0 10px #f2b84b; }
.toast-error .toast-dot { background: #ef5d72; box-shadow: 0 0 10px #ef5d72; }
#fx-root { position: fixed; inset: 0; pointer-events: none; z-index: 250; }
.spark {
  position: absolute; width: 8px; height: 8px; margin: -4px; background: var(--c);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: spark .8s var(--ease) forwards; filter: drop-shadow(0 0 4px var(--c));
}
@keyframes spark { 0% { transform: translate(0, 0) scale(calc(var(--s) * 1.4)) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0) rotate(160deg); opacity: 0; } }

.modal-wrap { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 6, 10, .55); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
[data-tone="light"] .modal-backdrop { background: rgba(60, 50, 30, .25); }
.modal {
  position: relative; width: min(460px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(18px) scale(.96); transition: opacity .3s var(--ease), transform .5s var(--ease);
}
.modal.wide { width: min(980px, 100%); }
.modal-wrap.in .modal-backdrop { opacity: 1; }
.modal-wrap.in .modal { opacity: 1; transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px 24px; }
.modal-head h3 { margin: 0; font-family: var(--f-serif); font-size: 19px; letter-spacing: .06em; }
.modal-body { padding: 12px 24px 18px; overflow: auto; }
.modal-text { margin: 4px 0; color: var(--text-2); }
.modal-text b { color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }

/* ============ 卡片 ============ */
.tcg { position: relative; aspect-ratio: var(--ar, 2 / 3); perspective: 900px; user-select: none; -webkit-user-select: none; }
.tcg-inner {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  position: absolute; inset: 0; border-radius: 12px; overflow: hidden; background: #111;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform .6s var(--ease), box-shadow .4s;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.tcg.tilting .tcg-inner { transition: transform .08s linear; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.tcg-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tcg-frame { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.tcg-frame::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 3px; background: var(--r-R);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.tcg-frame::after { content: ""; position: absolute; inset: 6px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .28); }
.r-SR .tcg-frame::before { background: var(--r-SR); padding: 3.5px; }
.r-SSR .tcg-frame::before { background: var(--r-SSR); background-size: 200% 200%; animation: sheen 4s linear infinite; padding: 4px; }
.r-SSR .tcg-frame::after { border-color: rgba(255, 235, 180, .55); }
.tcg-glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; }
@keyframes holo { to { background-position: 300% 0; } }
.tcg-glare { background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .55), transparent 45%); mix-blend-mode: overlay; }
.tcg.tilting .tcg-glare { opacity: 1; }
.tcg-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 11px; display: flex; flex-direction: column; gap: 1px;
  background: linear-gradient(transparent, rgba(8, 8, 12, .82)); color: #fbf5e6;
}
.tcg-name b { font-family: var(--f-serif); font-size: 13px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.tcg-name small { font-family: var(--f-display); font-size: 9px; letter-spacing: .2em; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcg-stars { font-size: 8px; letter-spacing: 1px; color: #ffe1a0; text-shadow: 0 0 6px rgba(255, 210, 120, .7); }
.r-R .tcg-stars { color: #d6e2f5; text-shadow: none; }
.r-SR .tcg-stars { color: #e3c9ff; text-shadow: 0 0 6px rgba(190, 140, 255, .7); }
.tcg.big { width: min(400px, 100%); margin: 0 auto; }
.tcg.big .tcg-inner { border-radius: 18px; }
.tcg.big .tcg-name { padding: 40px 18px 16px; }
.tcg.big .tcg-name b { font-size: 19px; }

.tcg-back {
  position: relative; aspect-ratio: var(--ar, 2 / 3); border-radius: 12px; overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(214, 180, 117, .22), transparent 55%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(214, 180, 117, .07) 0 6deg, transparent 6deg 12deg),
    linear-gradient(160deg, #1b1d2b, #0d0e16 60%, #1b1424);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.tcg-back::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 3px; background: var(--r-SSR);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.tcg-back::after { content: ""; position: absolute; inset: 9px; border-radius: 8px; border: 1px solid rgba(214, 180, 117, .45); }
.back-pattern {
  position: absolute; inset: 16px; border-radius: 6px; opacity: .55;
  background:
    radial-gradient(circle at 0 0, transparent 9px, rgba(214, 180, 117, .5) 10px, transparent 11px) 0 0 / 22px 22px,
    radial-gradient(circle at 100% 100%, transparent 9px, rgba(214, 180, 117, .5) 10px, transparent 11px) 0 0 / 22px 22px;
  mask: radial-gradient(circle at 50% 50%, transparent 32%, #000 60%);
}
.back-ring { position: absolute; left: 50%; top: 50%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid rgba(214, 180, 117, .55); box-shadow: inset 0 0 0 6px rgba(214, 180, 117, .08), 0 0 30px rgba(214, 180, 117, .15); }
.back-seal { position: absolute; left: 50%; top: 50%; width: 38%; transform: translate(-50%, -50%); --seal: #c49a50; --seal-hi: #f1d79a; --seal-lo: #6e5221; }
.back-seal .seal-svg { width: 100%; height: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
.back-text { position: absolute; bottom: 7%; left: 0; right: 0; text-align: center; font-family: var(--f-display); font-size: 9px; letter-spacing: .32em; color: rgba(241, 215, 154, .75); }

/* ============ 首頁 ============ */
.home-stage { position: absolute; inset: 0; background: var(--stage-bg); }
.live-gl, .live-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.live-fx { pointer-events: none; }
.home-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--home-shade) 0%, transparent 34%), linear-gradient(0deg, var(--home-shade-2) 0%, transparent 34%), linear-gradient(270deg, color-mix(in srgb, var(--home-shade) 70%, transparent) 0%, transparent 36%); }
.home.is-empty .home-stage { background: radial-gradient(ellipse at 60% 40%, color-mix(in srgb, var(--gold) 14%, var(--bg)), var(--bg) 70%); }
.home-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; color: var(--text-2); z-index: 2; }
.home-empty p { font-family: var(--f-serif); font-size: 22px; color: var(--text); margin: 18px 0 4px; letter-spacing: .1em; }
.empty-orb { width: 120px; margin: 0 auto; animation: floaty 5s ease-in-out infinite; }
.empty-orb .seal-svg { width: 100%; height: auto; filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--gold) 40%, transparent)); }
@keyframes floaty { 50% { transform: translateY(-10px) rotate(-3deg); } }
.home-frame { position: absolute; inset: 16px 16px 16px calc(var(--rail-w) + 30px); pointer-events: none; border: 1px solid var(--line); border-radius: 22px; }
.home-frame .c { position: absolute; width: 10px; height: 10px; border: 1px solid var(--gold); transform: rotate(45deg); background: var(--bg); }
.home-frame .tl { top: -6px; left: 40px; } .home-frame .tr { top: -6px; right: 40px; } .home-frame .bl { bottom: -6px; left: 40px; } .home-frame .br { bottom: -6px; right: 40px; }
.home-top { position: absolute; top: 34px; left: calc(var(--rail-w) + 56px); right: 40px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; z-index: 3; }
.home-mark { display: flex; flex-direction: column; font-family: var(--f-serif); line-height: 1.2; }
.home-mark b { font-size: 17px; letter-spacing: .02em; }
.home-mark span { font-size: 12px; color: var(--text-2); }
.home-mark .dashes { display: block; width: 120px; height: 2px; margin-top: 8px; background: repeating-linear-gradient(90deg, var(--text-2) 0 3px, transparent 3px 7px); opacity: .6; }
.home-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.home-quote { position: absolute; z-index: 3; top: 21%; right: 6%; max-width: min(520px, 40vw); text-align: left; }
.quote-text { margin: 0; font-family: var(--f-serif); font-size: clamp(18px, 1.9vw, 27px); line-height: 1.9; letter-spacing: .06em; text-shadow: 0 2px 16px var(--home-shade); white-space: pre-wrap; }
.quote-text::before { content: "「"; color: var(--gold); margin-left: -.6em; }
.quote-text::after { content: "」"; color: var(--gold); }
.quote-text.typing::after { content: "▍"; color: var(--gold); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.quote-wave { display: flex; align-items: center; gap: 2px; height: 30px; margin-top: 18px; justify-content: flex-end; opacity: .7; }
.quote-wave i { width: 2px; border-radius: 2px; background: var(--text-2); height: calc(6px + (var(--i) * 7 % 19) * 1px); animation: wave 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * -73ms); }
@keyframes wave { 50% { transform: scaleY(.35); } }
.quote-dot { width: 22px; height: 22px; margin-left: 10px; border-radius: 50%; border: 2px solid var(--text-2); border-right-color: transparent; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.home-plate {
  position: absolute; z-index: 3; right: 44px; bottom: 54px; width: min(640px, calc(100vw - 520px)); min-width: 420px;
  display: grid; grid-template-columns: auto 1fr; color: var(--ink);
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .35));
}
.plate-seal { width: 120px; margin: 0 -44px 0 -40px; align-self: center; z-index: 2; transform: rotate(-8deg); transition: transform .8s var(--ease); }
.home-plate:hover .plate-seal { transform: rotate(4deg) scale(1.04); }
.plate-seal .seal-svg { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.plate-body {
  position: relative; padding: 22px 30px 18px 64px; border-radius: 18px 18px 18px 18px; text-align: right;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035' numOctaves='4'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .2 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"),
    linear-gradient(170deg, var(--paper), var(--paper-2));
  -webkit-mask: radial-gradient(circle at 0 18px, transparent 7px, #000 7.5px) 0 0 / 100% 36px repeat-y, linear-gradient(#000 0 0) 14px 0 / 100% 100% no-repeat;
  mask: radial-gradient(circle at 0 18px, transparent 7px, #000 7.5px) 0 0 / 100% 36px repeat-y, linear-gradient(#000 0 0) 14px 0 / 100% 100% no-repeat;
}
.plate-body::before { content: ""; position: absolute; inset: 9px 9px 9px 22px; border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 12px; pointer-events: none; }
.plate-name { font-family: var(--f-serif); font-weight: 900; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.2; letter-spacing: .04em; }
.plate-name .rar { vertical-align: middle; margin-right: 10px; font-size: 13px; transform: translateY(-3px); }
.plate-en { font-family: var(--f-cond); font-weight: 600; font-size: clamp(28px, 3.4vw, 52px); line-height: 1; letter-spacing: .01em; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate-meta { font-family: var(--f-display); font-size: 10.5px; letter-spacing: .14em; margin-top: 10px; color: var(--ink-2); line-height: 1.6; }
.plate-script {
  grid-column: 2; margin: -4px 26px 0 70px; padding: 10px 18px; display: flex; flex-direction: column;
  font-family: var(--f-script); font-style: italic; font-size: 19px; line-height: 1.25; color: color-mix(in srgb, var(--paper) 85%, var(--text));
  background: linear-gradient(90deg, color-mix(in srgb, var(--paper-2) 30%, transparent), transparent); border-radius: 0 0 14px 14px;
}
[data-tone="light"] .plate-script { color: var(--ink-2); background: linear-gradient(90deg, color-mix(in srgb, var(--paper-2) 70%, transparent), transparent); }
.home-menu { position: absolute; z-index: 3; left: calc(var(--rail-w) + 56px); bottom: 56px; display: flex; flex-direction: column; gap: 12px; }
.menu-big {
  display: flex; align-items: center; gap: 14px; padding: 10px 26px 10px 10px; min-width: 200px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(16px); box-shadow: var(--shadow-1);
  transition: transform .4s var(--ease), background .3s, box-shadow .3s;
}
.menu-big:hover { transform: translateX(6px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.menu-big .mb-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--surface-3); color: var(--gold); }
.menu-big .mb-ico svg { width: 22px; height: 22px; }
.menu-big b { display: block; font-family: var(--f-serif); font-size: 18px; letter-spacing: .2em; }
.menu-big small { display: block; font-family: var(--f-display); font-size: 9.5px; letter-spacing: .32em; color: var(--text-3); }
.menu-big.primary { background: var(--primary-bg); color: var(--primary-text); border-color: transparent; box-shadow: var(--primary-shadow); }
.menu-big.primary .mb-ico { background: rgba(0, 0, 0, .14); color: inherit; }
.menu-big.primary small { color: inherit; opacity: .7; }
.home-bg-btn { position: absolute; z-index: 3; top: 82px; right: 40px; background: var(--surface); backdrop-filter: blur(12px); }

/* 首頁背景挑選 */
.bg-picker .seg { margin-bottom: 14px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; max-height: 58vh; overflow: auto; padding: 4px; }
.bg-tile { position: relative; aspect-ratio: 2 / 3; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); transition: transform .3s var(--ease), box-shadow .3s; }
.bg-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-1); }
.bg-tile.on { outline: 2px solid var(--gold); outline-offset: 2px; }
.bg-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-tile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 7px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-tile em { position: absolute; top: 6px; right: 6px; font-style: normal; font-family: var(--f-display); font-size: 10px; padding: 1px 7px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #f5e3b5; }
.bg-tile.upload { display: grid; place-content: center; gap: 6px; color: var(--text-2); border-style: dashed; }
.bg-tile.upload svg { width: 26px; height: 26px; margin: 0 auto; }
.bg-tile.upload span { position: static; background: none; color: inherit; padding: 0; text-align: center; }
.filter-row { margin-bottom: 12px; }

/* ============ 召喚頁 ============ */
.view.gacha { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.banner-list { position: sticky; top: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.side-title { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 6px; font-family: var(--f-serif); font-size: 17px; letter-spacing: .14em; }
.banner-items { display: flex; flex-direction: column; gap: 6px; }
.banner-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 18px; border: 1px solid transparent; background: none; transition: background .25s, border-color .25s, transform .3s var(--ease); }
.banner-item:hover { background: var(--surface-2); transform: translateX(2px); }
.banner-item.on { background: var(--surface-3); border-color: var(--line-strong); }
.bi-seal { width: 34px; flex: none; }
.bi-seal .seal-svg { width: 100%; height: auto; }
.banner-item b { display: block; font-size: 14px; font-weight: 600; }
.banner-item small { display: block; font-family: var(--f-display); font-size: 9.5px; letter-spacing: .16em; color: var(--text-3); }
.side-foot { font-size: 12px; padding: 8px 4px 0; margin: 0; border-top: 1px solid var(--line-soft); }
.gacha-main { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.banner-hero {
  position: relative; min-height: 430px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--bg-2), var(--bg)); box-shadow: var(--shadow-2); isolation: isolate;
}
.hero-bg { position: absolute; inset: -30px; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(28px) saturate(1.2); opacity: .45; transform: scale(1.1); }
.banner-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--surface-solid) 22%, color-mix(in srgb, var(--surface-solid) 40%, transparent) 55%, transparent); }
.hero-outline {
  position: absolute; z-index: -1; left: 26px; top: 6px; font-family: var(--f-display); font-weight: 700; font-size: clamp(60px, 10vw, 150px);
  line-height: 1; letter-spacing: .02em; color: transparent; -webkit-text-stroke: 1px var(--line-strong); white-space: nowrap; pointer-events: none; opacity: .8;
}
.hero-art { position: absolute; right: 0; top: 0; bottom: 0; width: 52%; z-index: -1; clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; -webkit-mask: linear-gradient(90deg, transparent, #000 30%); mask: linear-gradient(90deg, transparent, #000 30%); animation: heroIn 1.2s var(--ease); }
@keyframes heroIn { from { opacity: 0; transform: scale(1.06) translateX(20px); } }
.hero-art:empty { display: none; }
.hero-art::after { content: ""; position: absolute; top: 0; bottom: 0; left: 15%; width: 2px; background: linear-gradient(transparent, var(--gold), transparent); transform: skewX(-21deg); opacity: .6; }
.hero-placeholder { position: absolute; right: 9%; top: 50%; transform: translateY(-50%) rotate(6deg); width: 190px; z-index: -1; animation: floaty 6s ease-in-out infinite; }
.hero-info { position: relative; padding: 110px 40px 32px; max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.hero-kicker { font-family: var(--f-display); letter-spacing: .3em; color: var(--gold); font-size: 12px; }
.hero-name { margin: -6px 0 0; font-family: var(--f-serif); font-weight: 900; font-size: clamp(30px, 3.6vw, 50px); letter-spacing: .06em; line-height: 1.15; text-shadow: 0 4px 24px var(--bg); }
.hero-rates { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.hero-rates .rar-badge { margin-left: 6px; }
.hero-rates .rar-badge:first-child { margin-left: 0; }
.pity { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.pity b { color: var(--gold); }
.pity-bar { width: min(340px, 100%); height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.pity-bar i { display: block; height: 100%; background: var(--gold-grad); border-radius: inherit; transition: width .8s var(--ease); }
.hero-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.hero-status i { width: 8px; height: 8px; border-radius: 50%; background: #6fcf97; box-shadow: 0 0 8px #6fcf97; }
.hero-status.warn i { background: #f2b84b; box-shadow: 0 0 8px #f2b84b; }
.hero-status.demo i { background: #8fa6c8; box-shadow: 0 0 8px #8fa6c8; }
.summon-btns { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.summon-btns .btn { padding: 14px 26px; font-size: 16px; font-family: var(--f-serif); letter-spacing: .14em; }
.summon-btns .btn svg { width: 19px; height: 19px; }
.multi-wrap { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.multi-wrap .icon-btn { width: 34px; height: 34px; font-size: 18px; }
.hero-recent { position: absolute; right: 18px; bottom: 16px; display: flex; gap: 6px; align-items: center; padding: 6px 8px 6px 14px; border-radius: 99px; background: var(--surface); backdrop-filter: blur(12px); border: 1px solid var(--line); max-width: 60%; overflow: hidden; }
.hero-recent:not(:has(button)) { display: none; }
.hero-recent small { font-size: 11px; color: var(--text-3); margin-right: 4px; white-space: nowrap; }
.mini { width: 30px; height: 45px; padding: 0; border-radius: 6px; overflow: hidden; border: 1.5px solid transparent; background: #000; flex: none; transition: transform .3s var(--ease); }
.mini:hover { transform: translateY(-3px) scale(1.08); }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini.r-SSR { border-color: #f5c86a; } .mini.r-SR { border-color: #bb8cf5; } .mini.r-R { border-color: #9fb7dc; }
.gacha-panel { overflow: hidden; }
.tab-body { padding: 20px 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; align-items: start; }
.span2 { grid-column: span 2; }
.sec { margin: 8px 0 -4px; font-family: var(--f-serif); font-size: 14px; letter-spacing: .14em; color: var(--gold); display: flex; align-items: center; gap: 10px; }
.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-grid .sec:first-child { margin-top: 0; }
.tab-body[data-ver="4"] .v3-only, .tab-body[data-ver="5"] .v3-only { display: none; }
.roll-out { padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--line-strong); margin: 0; }
.chars { display: flex; flex-direction: column; gap: 12px; }
.char-list { display: flex; flex-direction: column; gap: 12px; }
.char-item { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); }
.char-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.char-head b { font-family: var(--f-serif); letter-spacing: .1em; flex: 1; }
.char-body { display: flex; gap: 16px; }
.char-fields { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pos-grid { display: grid; grid-template-columns: repeat(5, 18px); gap: 4px; align-self: center; padding: 8px; border-radius: 12px; background: var(--surface-3); }
.pos-grid button { width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line); background: var(--surface-2); padding: 0; transition: background .2s, transform .2s; }
.pos-grid button:hover { transform: scale(1.15); }
.pos-grid button.on { background: var(--primary-bg); border-color: transparent; }
.refs { display: flex; flex-direction: column; gap: 16px; }
.ref-sec { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.ref-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ref-head .muted { font-size: 12px; }
.ref-row { display: flex; gap: 16px; align-items: flex-start; }
.ref-img { width: 92px; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; flex: none; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); border: 1px solid var(--line); }
.ref-img img { width: 100%; height: 100%; object-fit: cover; }
.ref-img.empty svg { width: 26px; height: 26px; }
.ref-ctl { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vibe-list { display: flex; flex-direction: column; gap: 12px; }

/* ============ 召喚演出 ============ */
.summon { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; align-items: center; color: #f4ecd8; opacity: 0; transition: opacity .45s var(--ease-soft); --rc: #c9d6f0; }
.summon.in { opacity: 1; }
.summon-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, #1b1830 0%, #07070c 70%); overflow: hidden; }
.summon-glow { position: absolute; left: 50%; top: 55%; width: 70vmin; height: 70vmin; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 55%, transparent), transparent 65%); filter: blur(10px); transition: background 1s; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: translate(-50%, -50%) scale(1.12); opacity: .75; } }
.sigil { position: absolute; left: 50%; top: 55%; width: min(92vmin, 820px); height: auto; transform: translate(-50%, -50%); opacity: .6; animation: spinC 60s linear infinite; }
@keyframes spinC { to { transform: translate(-50%, -50%) rotate(360deg); } }
.sigil .s-line { fill: none; stroke: var(--rc); stroke-width: 1.2; opacity: .7; transition: stroke 1s; }
.sigil .s-line.thin { stroke-width: .6; }
.sigil text { fill: var(--rc); font-size: 11px; font-family: serif; text-anchor: middle; dominant-baseline: middle; opacity: .8; transition: fill 1s; }
.sigil .s-runes.small text { font-size: 9px; }
.sigil .s-star { transform-origin: 200px 200px; animation: spinR 24s linear infinite; }
@keyframes spinR { to { transform: rotate(-360deg); } }
.summon-rays { position: absolute; left: 50%; top: 55%; width: 180vmax; height: 180vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 22%, transparent) 0 3deg, transparent 3deg 14deg); mask: radial-gradient(circle, #000 0, transparent 50%); opacity: 0; transition: opacity .8s; animation: spinC 30s linear infinite; }
.summon.ssr-burst .summon-rays { opacity: 1; }
.summon.ssr-burst .sigil { animation-duration: 6s; opacity: 1; }
.summon-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 55%, #fff, color-mix(in srgb, var(--rc) 60%, transparent) 40%, transparent 70%); opacity: 0; }
.summon-flash.go { animation: flash .9s var(--ease-soft); }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: .9; } 100% { opacity: 0; } }
.summon-top { position: relative; width: 100%; display: flex; justify-content: space-between; align-items: flex-start; padding: 26px 90px 0 40px; gap: 20px; }
.summon-title small { display: block; font-family: var(--f-display); letter-spacing: .32em; font-size: 11px; color: color-mix(in srgb, var(--rc) 80%, #fff); }
.summon-title b { font-family: var(--f-serif); font-size: 24px; letter-spacing: .12em; }
.summon-status { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); font-size: 13.5px; backdrop-filter: blur(10px); max-width: 60vw; }
.st-time { opacity: .6; font-variant-numeric: tabular-nums; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--rc); border-right-color: transparent; animation: spin .9s linear infinite; flex: none; }
.summon-close { position: absolute; top: 22px; right: 26px; color: #f4ecd8; z-index: 2; }
.summon-stage { position: relative; flex: 1; width: 100%; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 18px; padding: 10px 40px; perspective: 1400px; min-height: 0; }
@keyframes slotIn { from { opacity: 0; transform: translateY(40px) scale(.8); } }
.slot-flip { position: relative; aspect-ratio: 2 / 3; transform-style: preserve-3d; transition: transform 1s var(--ease); }
.slot.flipped .slot-flip { transform: rotateY(180deg); }
.slot-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.slot-face .tcg, .slot-face .tcg-back { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.slot-face.front { transform: rotateY(180deg); }
.slot.charging .slot-flip { animation: hover 2.2s ease-in-out infinite; }
.slot.charging .tcg-back { box-shadow: 0 0 0 1px rgba(255, 255, 255, .15), 0 0 40px color-mix(in srgb, var(--rc, #c9d6f0) 45%, transparent); }
@keyframes hover { 50% { transform: translateY(-10px) rotateY(10deg); } }
.slot.ready:not(.flipped) .slot-flip { animation: shake .5s ease-in-out infinite; }
@keyframes shake { 25% { transform: rotateZ(-2deg) scale(1.03); } 75% { transform: rotateZ(2deg) scale(1.03); } }
.slot.ready::before { content: ""; position: absolute; left: 50%; bottom: -20%; width: 160%; height: 160%; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--rc) 55%, transparent), transparent 60%); z-index: -1; filter: blur(8px); animation: fadeIn .5s; }
.slot.r-SSR.ready::before { background: radial-gradient(ellipse at 50% 70%, rgba(255, 220, 140, .7), rgba(255, 140, 200, .25) 40%, transparent 65%); }
@keyframes fadeIn { from { opacity: 0; } }
.slot.failed .tcg-back { filter: grayscale(1) brightness(.6); }
.slot.skipped { opacity: .22; filter: grayscale(1); }
.slot-label { position: absolute; left: 0; right: 0; bottom: -28px; text-align: center; font-size: 12px; color: #f0a0a8; }
.slot.flipped { cursor: pointer; }
.slot.flipped .tcg-inner { box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 20px 50px rgba(0, 0, 0, .6), 0 0 50px color-mix(in srgb, var(--rc) 35%, transparent); }
.summon-bottom { position: relative; min-height: 120px; width: 100%; display: flex; justify-content: center; padding: 18px 20px 30px; }
.summon-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; animation: rise .6s var(--ease) backwards .3s; }
.summon .btn { color: #f4ecd8; border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); }
.summon .btn.primary { color: #1d160b; background: linear-gradient(135deg, #f3dc9f, #cfa253 55%, #a87c37); }
.summon .muted { color: rgba(244, 236, 216, .6); font-size: 13px; }
.sum-count { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.name-card { display: flex; flex-direction: column; align-items: center; gap: 12px; animation: rise .6s var(--ease) backwards .2s; }
.nc-hint { margin: 0; font-family: var(--f-serif); letter-spacing: .3em; color: color-mix(in srgb, var(--rc) 70%, #fff); }
.nc-row { display: flex; gap: 10px; }
.summon .field { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); color: #f4ecd8; text-align: center; width: 240px; }
.summon .field::placeholder { color: rgba(244, 236, 216, .45); }

/* ============ 卡片詳情 ============ */
.detail-info { display: flex; flex-direction: column; gap: 14px; padding-top: 10px; }
.detail-head { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.detail-place { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-2); }
.detail-place svg { color: var(--gold); }
.detail-prompt { border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 8px 14px; }
.detail-prompt summary { cursor: pointer; font-size: 13px; color: var(--text-2); }
.detail-prompt p { margin: 8px 0; font-size: 13px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.detail-modal .modal { padding-top: 10px; }

/* ============ 卡冊 ============ */
.view.album { display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
.album-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.album-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.album-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-family: var(--f-serif); letter-spacing: .08em; transition: all .25s var(--ease); }
.album-tab i { width: 18px; height: 18px; border-radius: 50%; background: var(--leather); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .2); }
.album-tab small { font-family: var(--f-sans); font-size: 11px; color: var(--text-3); padding: 0 6px; border-radius: 99px; background: var(--surface-2); }
.album-tab.on { border-color: var(--line-strong); background: var(--surface-3); box-shadow: var(--shadow-1); }
.album-tab.add { padding: 8px 12px; }
.album-tools { display: flex; align-items: center; gap: 10px; }
.color-dots { display: flex; gap: 6px; padding: 5px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; padding: 0; background: var(--leather); transition: transform .2s var(--ease); }
.dot:hover { transform: scale(1.15); }
.dot.on { border-color: var(--text); }
.c-crimson { --leather: linear-gradient(135deg, #8d2a36, #5a1520); }
.c-navy { --leather: linear-gradient(135deg, #2c3f66, #172440); }
.c-forest { --leather: linear-gradient(135deg, #2f5644, #18301f); }
.c-ivory { --leather: linear-gradient(135deg, #e7dcc4, #c3b18d); }
.binder-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 16px; }
.page-nav { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; box-shadow: var(--shadow-1); transition: transform .3s var(--ease), opacity .2s; }
.page-nav:hover { transform: scale(1.08); }
.page-nav:disabled { opacity: .3; pointer-events: none; }
.page-nav.hover { transform: scale(1.15); box-shadow: 0 0 0 2px var(--gold), var(--shadow-1); }
.page-nav svg { width: 22px; height: 22px; }
.binder {
  position: relative; padding: 16px; border-radius: 28px; background: var(--leather); box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.binder[data-color="crimson"] { --leather: linear-gradient(135deg, #8d2a36, #4f111b); }
.binder[data-color="navy"] { --leather: linear-gradient(135deg, #2c3f66, #131d35); }
.binder[data-color="forest"] { --leather: linear-gradient(135deg, #2f5644, #142619); }
.binder[data-color="ivory"] { --leather: linear-gradient(135deg, #e7dcc4, #b9a57e); }
.cover-edge { position: absolute; inset: 7px; border-radius: 22px; border: 1.5px dashed rgba(255, 235, 200, .35); pointer-events: none; }
.binder[data-color="ivory"] .cover-edge { border-color: rgba(90, 70, 40, .35); }
.pages { position: relative; display: flex; gap: 0; perspective: 1800px; }
.page {
  height: var(--page-h); aspect-ratio: var(--page-ar, .66); padding: 18px 18px 8px; position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--album-page), var(--album-page-2)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
  transition: transform .26s var(--ease-soft), opacity .26s;
}
.page.left { border-radius: 14px 4px 4px 14px; box-shadow: inset -18px 0 24px -18px rgba(0, 0, 0, .3); transform-origin: right center; }
.page.right { border-radius: 4px 14px 14px 4px; box-shadow: inset 18px 0 24px -18px rgba(0, 0, 0, .3); transform-origin: left center; }
.pages.turn-out-next .page.right, .pages.single.turn-out-next .page { transform: rotateY(-70deg); opacity: .2; }
.pages.turn-out-prev .page.left, .pages.single.turn-out-prev .page { transform: rotateY(70deg); opacity: .2; }
.pages.turn-in-next .page.left { animation: turnInL .26s var(--ease); }
.pages.turn-in-prev .page.right { animation: turnInR .26s var(--ease); }
.pages.single.turn-in-next .page, .pages.single.turn-in-prev .page { animation: fadeIn .26s; }
@keyframes turnInL { from { transform: rotateY(70deg); opacity: .2; } }
@keyframes turnInR { from { transform: rotateY(-70deg); opacity: .2; } }
.rings { width: 26px; display: flex; flex-direction: column; justify-content: space-evenly; align-items: center; background: linear-gradient(90deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, .05), rgba(0, 0, 0, .25)); }
.rings i { width: 34px; height: 14px; border-radius: 99px; background: linear-gradient(180deg, #f4f4f6, #a7a9b2 45%, #f0f1f4 60%, #8a8c95); box-shadow: 0 2px 4px rgba(0, 0, 0, .45); }
.pockets { flex: 1; display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); grid-template-rows: repeat(var(--rows, 3), 1fr); gap: 10px; min-height: 0; }
.pocket { position: relative; aspect-ratio: var(--pocket-ar, 2 / 3); height: 100%; max-width: 100%; justify-self: center; border-radius: 9px; background: var(--pocket-empty); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12); transition: box-shadow .25s, transform .3s var(--ease); }
.pocket::before { content: ""; position: absolute; inset: 7px; border-radius: 6px; border: 1.5px dashed rgba(120, 100, 70, .22); }
.pocket-card { position: absolute; inset: 3px; z-index: 1; display: flex; align-items: center; justify-content: center; }
.pocket-card .tcg-inner { border-radius: 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.pocket-card .tcg-name { padding: 16px 7px 6px; }
.pocket-card .tcg-name b { font-size: 10.5px; }
.pocket-card .tcg-name small, .pocket-card .tcg-stars { display: none; }
.pocket-card .tcg-frame::after { inset: 4px; border-radius: 5px; }
.sleeve {
  position: absolute; inset: 0; z-index: 2; border-radius: 9px; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .05) 22%, transparent 40%, transparent 72%, rgba(255, 255, 255, .12) 88%, rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04);
}
.sleeve::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 9%; border-radius: 9px 9px 0 0; background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .1)); border-bottom: 1px solid rgba(255, 255, 255, .55); }
.sleeve::after { content: ""; position: absolute; left: 50%; top: 9%; width: 30%; height: 7%; transform: translateX(-50%); border-radius: 0 0 99px 99px; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .5); border-top: 0; }
.pocket.hover { box-shadow: 0 0 0 2px var(--gold), 0 0 24px color-mix(in srgb, var(--gold) 50%, transparent); transform: scale(1.03); }
.pocket.hover .sleeve::before { background: linear-gradient(180deg, rgba(255, 245, 210, .85), rgba(255, 255, 255, .2)); }
.page-no { text-align: center; font-family: var(--f-display); font-size: 10.5px; letter-spacing: .3em; color: rgba(90, 75, 50, .5); padding-top: 6px; }
.tcg.draggable { cursor: var(--cur-grab, grab); touch-action: none; }
.tcg.drag-src { opacity: .25; filter: grayscale(.6); }
.dragging, .dragging * { cursor: var(--cur-grabbing, grabbing) !important; }
.drag-ghost { position: fixed !important; left: 0; top: 0; z-index: 200; pointer-events: none; aspect-ratio: auto; transform-origin: 50% 30%; will-change: transform; }
.drag-ghost .tcg-inner { border-radius: 8px; box-shadow: 0 26px 50px rgba(0, 0, 0, .5); }
.drag-ghost .tcg-name { padding: 16px 7px 6px; }
.drag-ghost .tcg-name b { font-size: 10.5px; }
.drag-ghost .tcg-name small, .drag-ghost .tcg-stars { display: none; }
.tcg.inserting { animation: insert .5s cubic-bezier(.2, .9, .25, 1); }
@keyframes insert { 0% { transform: translateY(-26%); } 70% { transform: translateY(1.5%); } 100% { transform: none; } }
.tray { padding: 10px 14px 14px; flex: none; }
.tray-head { display: flex; align-items: center; gap: 14px; padding: 2px 2px 10px; flex-wrap: wrap; }
.tray-hint { font-size: 12.5px; flex: 1; }
.tray-cards { --tray-h: 128px; display: flex; gap: 12px; overflow-x: auto; padding: 6px 4px 6px; min-height: calc(var(--tray-h) + 14px); align-items: center; }
.tray-slot { flex: none; transition: transform .3s var(--ease); }
.tray-slot:hover { transform: translateY(-5px) rotate(-1.5deg); }
.tray-slot .tcg-name { padding: 14px 6px 5px; }
.tray-slot .tcg-name b { font-size: 10px; }
.tray-slot .tcg-name small, .tray-slot .tcg-stars { display: none; }
.tray-slot.placed { opacity: .55; }
.tray-empty { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 13px; padding: 0 8px; }
.tray-empty i { height: 120px; aspect-ratio: 2 / 3; border-radius: 10px; border: 1.5px dashed var(--line-strong); }
.album.dragging .tray { box-shadow: inset 0 0 0 1.5px var(--line-strong); }

/* ============ 工坊 ============ */
.view.workshop { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: var(--gap); overflow: hidden; }
.ws-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ws-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.ws-title { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.tools { display: flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.brush-size { width: 90px; margin: 0 6px; }
.ws-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--stage-bg); border-radius: 0 0 var(--r-lg) var(--r-lg);
  background-image: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--gold) 7%, transparent), transparent 70%); }
.ws-live { position: absolute; inset: 0; }
.ws-paint { position: absolute; z-index: 2; touch-action: none; }
.ws-stage:not(.editing) .ws-paint { pointer-events: none; }
.ws-stage.editing .ws-paint { cursor: none; }
.ws-stage.editing[data-tool="pivot"] .ws-paint { cursor: crosshair; }
.ws-empty { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 30px; }
.we-art { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--gold); border: 1px solid var(--line); }
.we-art svg { width: 38px; height: 38px; }
.ws-empty h3 { font-family: var(--f-serif); font-size: 24px; letter-spacing: .2em; margin: 10px 0 0; }
.ws-empty p { color: var(--text-2); margin: 0 0 12px; }
.we-lives { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.we-lives small { color: var(--text-3); }
.we-lives div { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.we-lives button { width: 52px; aspect-ratio: 2 / 3; padding: 0; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); transition: transform .3s var(--ease); }
.we-lives button:hover { transform: translateY(-3px); }
.we-lives img { width: 100%; height: 100%; object-fit: cover; }
.ws-progress { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-radius: 99px; background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); font-size: 13px; min-width: 300px; overflow: hidden; }
.ws-main { position: relative; }
.ws-progress i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--gold-grad); transition: width .3s; }
.ws-progress::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold); border-right-color: transparent; animation: spin .9s linear infinite; flex: none; }
.ws-side { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ws-tab-body { flex: 1; overflow: auto; padding: 6px 18px 18px; }
.ws-sec { padding: 14px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.ws-sec:last-child { border-bottom: 0; }
.ws-sec h4 { margin: 0; font-family: var(--f-serif); font-size: 15px; letter-spacing: .12em; display: flex; align-items: center; gap: 8px; }
.ws-sec .note { margin: 0; }
.depth-thumb { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); max-height: 180px; display: grid; place-items: center; background: #000; }
.depth-thumb img { max-width: 100%; max-height: 180px; display: block; }
.part-list { display: flex; flex-direction: column; gap: 6px; }
.part-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; border: 1px solid transparent; background: var(--surface-2); cursor: pointer; transition: background .2s, border-color .2s; }
.part-row:hover { background: var(--surface-3); }
.part-row.on { border-color: var(--line-strong); background: var(--surface-3); }
.part-row b { flex: 1; font-weight: 500; font-size: 14px; }
.part-row small { color: var(--text-3); font-size: 12px; }
.pdot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); display: inline-block; }
.mini-sw { position: relative; display: inline-flex; }
.mini-sw .sw { width: 32px; height: 18px; }
.mini-sw .sw::after { width: 12px; height: 12px; }
.mini-sw input:checked + .sw::after { transform: translateX(14px); }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.type-grid button { padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; transition: all .2s; }
.type-grid button:hover { border-color: var(--line-strong); }
.type-grid button.on { background: var(--primary-bg); color: var(--primary-text); border-color: transparent; }
.fill-depth { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.type-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tp { text-align: left; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; transition: all .25s var(--ease); }
.tp:hover { border-color: var(--gold); transform: translateY(-2px); }
.tp b { font-family: var(--f-serif); letter-spacing: .1em; }
.tp small { color: var(--text-2); font-size: 12px; line-height: 1.5; }
.live-list { display: flex; flex-direction: column; gap: 8px; }
.live-item { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; }
.live-item.on { border-color: var(--line-strong); }
.live-item img { width: 40px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 7px; }
.live-item span { flex: 1; min-width: 0; }
.live-item b { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item small { color: var(--text-3); font-size: 11.5px; }
.live-item .icon-btn { width: 32px; height: 32px; }

/* ============ 設定 ============ */
.view.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-content: start; max-width: 1200px; }
.set-col { display: flex; flex-direction: column; gap: var(--gap); }
.set-card { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.set-card h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-family: var(--f-serif); font-size: 18px; letter-spacing: .12em; }
.set-card h3 svg { color: var(--gold); }
.set-card p { margin: 0; font-size: 13.5px; }
.token-row { display: flex; gap: 10px; }
.conn-status { font-size: 13px !important; }
.conn-status.ok { color: #6fcf97; }
[data-tone="light"] .conn-status.ok { color: #2f8a57; }
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theme-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; transition: all .3s var(--ease); }
.theme-pick button:hover { transform: translateY(-2px); }
.theme-pick button.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.theme-pick i { width: 100%; height: 70px; border-radius: 12px; margin-bottom: 8px; }
.tp-day i { background: linear-gradient(135deg, #f8f3e8, #e7dcc6); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), inset -40px 0 0 #3b5a8f22; }
.tp-night i { background: linear-gradient(135deg, #1b1c26, #0b0c11); box-shadow: inset 0 0 0 1px rgba(214, 180, 117, .3), inset -40px 0 0 #d6b47522; }
.theme-pick small { color: var(--text-3); font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-grid div { padding: 14px 10px; border-radius: 16px; background: var(--surface-2); text-align: center; }
.stat-grid b { display: block; font-family: var(--f-display); font-size: 24px; color: var(--gold); }
.stat-grid small { color: var(--text-2); font-size: 12px; }
.tips { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }

/* ============ 響應式 ============ */
@media (max-width: 1180px) {
  .view.gacha { grid-template-columns: 1fr; }
  .banner-list { position: static; }
  .banner-items { flex-direction: row; overflow-x: auto; }
  .banner-item { flex: none; }
  .view.workshop { grid-template-columns: 1fr; grid-template-rows: minmax(min(68vh, 620px), auto) auto; overflow: auto; }
  .ws-side { max-height: 80vh; }
  .home-plate { min-width: 0; width: min(560px, calc(100vw - 140px)); }
  .home-quote { max-width: 46vw; }
}
@media (max-width: 760px) {
  :root { --rail-w: 0px; }
  body { font-size: 14.5px; }
  .rail { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; height: 66px; flex-direction: row; padding: 0 10px; border-radius: 26px; }
  .brand { display: none; }
  .nav { flex-direction: row; justify-content: space-around; }
  .nav a { width: 54px; padding: 7px 0 5px; border-radius: 18px; }
  .nav a svg { width: 20px; height: 20px; }
  .nav a .nt { font-size: 10.5px; }
  .theme-switch .ts-track { width: 44px; height: 26px; }
  .ts-knob { width: 20px; height: 20px; }
  [data-tone="dark"] .ts-knob { transform: translateX(18px); }
  .view { padding: 16px 16px 96px; }
  .home-frame { inset: 10px 10px 86px 10px; }
  .home-top { left: 26px; right: 26px; top: 24px; }
  .home-chips .chip:nth-child(3) { display: none; }
  .home-quote { top: 17%; right: 26px; left: 26px; max-width: none; }
  .home-plate { right: 16px; left: 16px; bottom: 170px; width: auto; }
  .plate-seal { width: 80px; margin: 0 -30px 0 -6px; }
  .plate-body { padding: 16px 18px 14px 42px; }
  .plate-script { display: none; }
  .home-menu { left: 16px; right: 16px; bottom: 92px; flex-direction: row; gap: 8px; }
  .menu-big { min-width: 0; flex: 1; padding: 6px 10px 6px 6px; gap: 8px; }
  .menu-big .mb-ico { width: 36px; height: 36px; }
  .menu-big b { font-size: 15px; letter-spacing: .08em; }
  .menu-big small { display: none; }
  .home-bg-btn { top: 70px; right: 26px; }
  .home-bg-btn span { display: none; }
  .hero-info { padding: 80px 22px 80px; }
  .hero-art { width: 100%; opacity: .35; clip-path: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .detail { grid-template-columns: 1fr; }
  .detail-card { position: static; }
  .view.album { overflow: auto; }
  .page-nav { width: 38px; height: 38px; }
  .binder { padding: 10px; }
  .view.settings { grid-template-columns: 1fr; }
  .summon-top { padding: 18px 70px 0 20px; flex-direction: column; }
  .summon-stage { padding: 10px 14px; gap: 10px; }
  .slot { width: calc(20vw); }
  .nc-row { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   v2：卡片比例自適應、卡膜、稀有度標誌、書架卡冊、首頁輪播、閃卡工藝
   ===================================================================== */

/* ---------- 卡片比例 / 透明素材 ---------- */
.tcg.boxed { aspect-ratio: auto; flex: none; }
.tcg.alpha .tcg-inner, .hero-art.alpha {
  background: repeating-conic-gradient(rgba(255, 255, 255, .06) 0 25%, rgba(0, 0, 0, .12) 0 50%) 0 0 / 18px 18px, linear-gradient(160deg, #262838, #12131b);
}
.tcg.alpha .tcg-art { object-fit: contain; padding: 6%; }

/* ---------- 卡膜（v3：紋理隨機生成、只在光點附近浮現，整體更細緻） ---------- */
.tcg-film {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; transition: opacity .5s;
  --light: radial-gradient(ellipse 75% 65% at var(--mx) var(--my), #000 0%, rgba(0, 0, 0, .35) 50%, rgba(0, 0, 0, .08) 85%);
}
.film-demo { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #e9b9c8, transparent 45%), radial-gradient(circle at 70% 75%, #7aa0d8, transparent 50%), linear-gradient(160deg, #3b3550, #191a26); }
.film-demo::after { content: ""; position: absolute; inset: 0; --mx: 40%; --my: 30%; animation: filmDemo 4s ease-in-out infinite alternate;
  --light: radial-gradient(ellipse 75% 65% at var(--mx) var(--my), #000 0%, rgba(0, 0, 0, .35) 50%, rgba(0, 0, 0, .08) 85%); }
@keyframes filmDemo { from { --mx: 15%; --my: 20%; } to { --mx: 85%; --my: 80%; } }
@property --mx { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --my { syntax: '<percentage>'; inherits: true; initial-value: 30%; }
.tcg-film.film-none, .tcg-film.film-auto, .film-demo.film-auto::after, .film-demo.film-none::after { display: none; }
.tcg-film.film-gloss, .film-demo.film-gloss::after {
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .42) 47%, rgba(255, 255, 255, .08) 53%, transparent 62%) var(--mx) 0 / 260% 100% no-repeat;
  mix-blend-mode: soft-light; opacity: .55;
}
.tcg.tilting .tcg-film.film-gloss { opacity: .95; }
.tcg-film.film-matte, .film-demo.film-matte::after {
  background: var(--tex-noise) 0 0 / 160px, rgba(255, 255, 255, .05);
  mix-blend-mode: soft-light; opacity: .22;
}
.tcg-film.film-laser, .film-demo.film-laser::after {
  background: linear-gradient(115deg, #ff9ec7, #ffe39e 18%, #a6ffd9 36%, #9ecbff 54%, #d9b2ff 72%, #ff9ec7 90%) var(--mx) var(--my) / 260% 260%;
  mix-blend-mode: color-dodge; opacity: .1; -webkit-mask: var(--light); mask: var(--light);
}
.tcg.tilting .tcg-film.film-laser { opacity: .3; }
.tcg-film.film-prism, .film-demo.film-prism::after {
  background: repeating-linear-gradient(128deg, rgba(255, 120, 190, .5) 0 .6%, rgba(255, 230, 140, .45) .6% 1.2%, rgba(120, 255, 210, .45) 1.2% 1.8%, rgba(130, 180, 255, .5) 1.8% 2.4%, transparent 2.4% 5%) calc(var(--mx) * 1.4) 0 / 180% 180%;
  mix-blend-mode: overlay; opacity: .16; -webkit-mask: var(--light); mask: var(--light);
}
.tcg.tilting .tcg-film.film-prism { opacity: .38; }
.tcg-film.film-glitter, .film-demo.film-glitter::after {
  background: var(--tex-glitter) calc(var(--mx) * .25) calc(var(--my) * .25) / 200px, var(--tex-glitter) calc(var(--mx) * -.35 + 37px) calc(var(--my) * -.2 + 91px) / 140px;
  mix-blend-mode: color-dodge; opacity: .38; -webkit-mask: var(--light); mask: var(--light);
}
.tcg.tilting .tcg-film.film-glitter { opacity: .7; }
.tcg-film.film-cracked, .film-demo.film-cracked::after {
  background: var(--tex-cracked) calc(var(--mx) * .1) 0 / 230px,
    linear-gradient(115deg, rgba(255, 150, 210, .9), rgba(150, 230, 255, .9) var(--mx), rgba(255, 240, 170, .9));
  background-blend-mode: multiply; mix-blend-mode: screen; opacity: .2; -webkit-mask: var(--light); mask: var(--light);
}
.tcg.tilting .tcg-film.film-cracked { opacity: .42; }
.tcg-film.film-galaxy, .film-demo.film-galaxy::after {
  background: var(--tex-stars) calc(var(--mx) * .2) calc(var(--my) * .2) / 300px,
    radial-gradient(ellipse at var(--mx) var(--my), rgba(170, 130, 255, .35), transparent 50%),
    radial-gradient(ellipse at calc(100% - var(--mx)) 80%, rgba(110, 180, 255, .28), transparent 55%);
  mix-blend-mode: screen; opacity: .45;
}
.tcg-film.film-gold, .film-demo.film-gold::after {
  background: linear-gradient(125deg, rgba(255, 210, 120, 0) 25%, rgba(255, 222, 150, .55) 46%, rgba(255, 250, 225, .6) 50%, rgba(255, 200, 100, 0) 66%) var(--mx) 0 / 250% 100% no-repeat;
  box-shadow: inset 0 0 0 2px rgba(255, 215, 140, .45), inset 0 0 18px rgba(255, 200, 100, .22);
  mix-blend-mode: soft-light; opacity: .75;
}
.tcg-film.film-ripple, .film-demo.film-ripple::after {
  background: repeating-radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .22) 0 1px, transparent 1.5px 16px);
  mix-blend-mode: overlay; opacity: .18; -webkit-mask: var(--light); mask: var(--light);
}
.tcg.tilting .tcg-film.film-ripple { opacity: .4; }

/* ---------- 稀有度標誌（v3：光暈、半透明，可縮放） ---------- */
.r-R { --rb: var(--r-R); --rb-text: #1d2433; --rb-star: #dfe8f5; --rb-c: #8cc1ff; --rb-glow: rgba(110, 170, 255, .75); --rb-edge: #4f86d6; }
.r-SR { --rb: var(--r-SR); --rb-text: #24103f; --rb-star: #e3c9ff; --rb-c: #c4a0ff; --rb-glow: rgba(170, 120, 255, .8); --rb-edge: #8a5ad8; }
.r-SSR { --rb: var(--r-SSR); --rb-text: #2a1a05; --rb-star: #ffe1a0; --rb-c: #ffd27a; --rb-glow: rgba(255, 200, 100, .85); --rb-edge: #c48a2c; }
.tcg-rarity {
  position: absolute; z-index: 3; top: 9px; left: 9px; display: inline-grid; place-items: center; pointer-events: none; zoom: var(--rb-scale, 1.2);
  font-family: var(--f-display); font-weight: 700; font-size: 10.5px; letter-spacing: .08em; color: var(--rb-text); line-height: 1;
}
.tcg-rarity b { position: relative; font-weight: 700; }
/* 光暈字：白色漸層字 + 彩色描邊 + 柔光漩渦 + 星芒 */
.rb-aura { top: 6px; left: 8px; padding: 6px 10px 8px; }
.rb-aura b {
  font-family: "Cormorant Garamond", var(--f-display); font-size: 21px; font-weight: 700; letter-spacing: .01em;
  background: linear-gradient(180deg, #fff 30%, var(--rb-c) 115%); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: .5px var(--rb-edge);
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .9)) drop-shadow(0 0 7px var(--rb-glow));
}
.rb-swirl {
  position: absolute; left: -22%; right: -30%; bottom: 0; height: 58%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 55%, transparent 38%, var(--rb-glow) 52%, transparent 70%);
  filter: blur(1.5px); transform: rotate(-10deg); opacity: .75; animation: swirl 5s ease-in-out infinite alternate;
}
.rb-swirl::after { content: ""; position: absolute; inset: 18% -8% 22% 8%; border-radius: 50%; border-top: 1px solid rgba(255, 255, 255, .7); filter: blur(.4px); transform: rotate(6deg); }
@keyframes swirl { to { transform: rotate(-4deg) scaleX(1.06); opacity: .95; } }
.rb-spark { position: absolute; top: -1px; right: -2px; font-style: normal; font-size: 9px; color: #fff; text-shadow: 0 0 6px #fff, 0 0 10px var(--rb-glow); animation: twinkle2 2.4s ease-in-out infinite; }
@keyframes twinkle2 { 50% { opacity: .35; transform: scale(.7) rotate(20deg); } }
/* 其他樣式改成半透明玻璃 + 光暈，不再是實心色塊 */
.rb-pill { padding: 3px 9px; border-radius: 99px; background: linear-gradient(135deg, rgba(255, 255, 255, .6), color-mix(in srgb, var(--rb-c) 45%, transparent)); border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 0 10px var(--rb-glow); backdrop-filter: blur(4px); }
.rb-gem, .rb-crest, .rb-seal { width: 32px; height: 32px; }
.rb-gem .rb-shape, .rb-crest .rb-shape, .rb-seal .rb-shape { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 255, 255, .85), color-mix(in srgb, var(--rb-c) 70%, transparent) 60%, color-mix(in srgb, var(--rb-edge) 60%, transparent)); filter: drop-shadow(0 0 5px var(--rb-glow)); }
.rb-gem .rb-shape { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.rb-gem .rb-shape::after, .rb-crest .rb-shape::after { content: ""; position: absolute; inset: 22%; background: linear-gradient(135deg, rgba(255, 255, 255, .8), transparent 60%); clip-path: inherit; }
.rb-gem b, .rb-crest b, .rb-seal b { font-size: 8.5px; letter-spacing: 0; }
.rb-crest { height: 36px; }
.rb-crest .rb-shape { clip-path: polygon(0 0, 100% 0, 100% 58%, 50% 100%, 0 58%); }
.rb-crest b { margin-top: -6px; }
.rb-seal .rb-shape { border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
.rb-ribbon { top: 13px; left: -26px; width: 96px; padding: 3px 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rb-c) 75%, white) 30%, color-mix(in srgb, var(--rb-c) 75%, white) 70%, transparent); transform: rotate(-45deg); box-shadow: 0 0 12px var(--rb-glow); font-size: 10px; }
.rb-stars { padding: 2px 6px; border-radius: 99px; background: rgba(10, 10, 16, .35); backdrop-filter: blur(4px); }
.rb-stars b { color: var(--rb-star); font-family: var(--f-sans); font-size: 10px; letter-spacing: 1px; text-shadow: 0 0 6px var(--rb-glow); }
.rb-foil b { font-size: 22px; letter-spacing: .02em; background: var(--rb); background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 6px var(--rb-glow)); animation: sheen 4s linear infinite; }
.rb-tag { top: 0; left: 12px; padding: 9px 6px 6px; gap: 3px; background: linear-gradient(180deg, color-mix(in srgb, var(--rb-c) 80%, white), rgba(255, 255, 255, .55)); border: 1px solid rgba(255, 255, 255, .7); border-top: 0; border-radius: 0 0 9px 9px; box-shadow: 0 0 12px var(--rb-glow); }
.rb-tag small { font-family: var(--f-sans); font-size: 6px; letter-spacing: 0; }
.tcg.big .tcg-rarity { top: 14px; left: 14px; zoom: calc(var(--rb-scale, 1.2) * 1.35); }
.tcg.big .rb-tag { top: 0; left: 18px; }
.tcg.big .rb-ribbon { top: 16px; left: -22px; }
.pocket-card .tcg-rarity, .tray-slot .tcg-rarity, .drag-ghost .tcg-rarity { top: 4px; left: 4px; zoom: calc(var(--rb-scale, 1.2) * .62); }
.pocket-card .rb-tag, .tray-slot .rb-tag, .drag-ghost .rb-tag { top: 0; }
.pocket-card .rb-ribbon, .tray-slot .rb-ribbon, .drag-ghost .rb-ribbon { top: 12px; left: -28px; }
.rs-demo { display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; position: relative; }
.rs-demo .tcg-rarity { position: relative; top: auto; left: auto; zoom: 1; }
.rs-demo .rb-ribbon { transform: none; width: auto; padding: 3px 12px; border-radius: 3px; }
.rs-demo .rb-tag { border-radius: 0 0 8px 8px; }
.rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.rs-grid.big { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.rs-sw { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); transition: all .25s var(--ease); position: relative; overflow: hidden; }
.rs-sw:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.rs-sw.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.rs-sw small { font-size: 11.5px; color: var(--text-2); }
.rs-sw .rs-demo { background: linear-gradient(160deg, #2c2e3e, #14151d); border-radius: 10px; width: 100%; padding: 8px 4px; overflow: hidden; }
.rs-sw > .rs-demo:only-child { color: var(--text-2); font-size: 12px; background: none; }

/* 卡片標記：大卡顯示文字，小卡（卡袋、待收納）只剩小圓點 */
.tcg-tags { position: absolute; z-index: 3; top: 9px; right: 9px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; }
.tcg-live, .tcg-craft { padding: 1px 7px; border-radius: 99px; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; background: rgba(10, 10, 16, .55); border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(6px); }
.tcg-live { color: #9ff3d0; }
.tcg-craft { color: #ffe1a0; }
.pocket-card .tcg-tags, .tray-slot .tcg-tags, .drag-ghost .tcg-tags, .mini .tcg-tags { top: 4px; right: 4px; flex-direction: row; gap: 3px; }
.pocket-card .tcg-live, .pocket-card .tcg-craft, .tray-slot .tcg-live, .tray-slot .tcg-craft, .drag-ghost .tcg-live, .drag-ghost .tcg-craft { width: 8px; height: 8px; padding: 0; border: 1.5px solid rgba(255, 255, 255, .85); box-shadow: 0 0 6px currentColor; background: currentColor; }
.pocket-card .tcg-tags b, .tray-slot .tcg-tags b, .drag-ghost .tcg-tags b { display: none; }

/* ---------- 卡片詳情 ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 30px; align-items: start; padding: 6px 0 4px; }
.detail.is-landscape { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 400px); }
.detail-left { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.detail-card { width: 100%; height: min(72vh, 760px); display: grid; place-items: center; position: relative; }
.detail-card .tcg.big { width: auto; height: auto; max-width: 100%; max-height: 100%; aspect-ratio: var(--ar); margin: 0; }
.detail-card .tcg.big { width: min(100%, calc(min(72vh, 760px) * var(--ar))); }
.film-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.film-sw { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); transition: all .25s var(--ease); position: relative; overflow: hidden; }
.film-sw span { font-size: 11.5px; color: var(--text-2); }
.film-sw:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.film-sw.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.film-sw.on span { color: var(--text); }
.film-hint { color: var(--gold) !important; }
.modal-x.floating { position: absolute; top: 14px; right: 14px; z-index: 5; background: var(--surface-solid); box-shadow: var(--shadow-1); }
.detail-modal .modal { width: min(1180px, 100%); }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); transition: all .25s var(--ease); position: relative; overflow: hidden; }
.choice b { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.choice small { color: var(--text-2); font-size: 12.5px; }
.choice:hover { border-color: var(--gold); transform: translateX(3px); }

/* ---------- 召喚：卡片依生圖比例 ---------- */
.slot { position: relative; height: var(--sh, 300px); width: calc(var(--sh, 300px) * var(--ar, .667)); animation: slotIn .8s var(--ease) backwards; animation-delay: var(--d); }
.slot-flip { height: 100%; aspect-ratio: auto; }
.summon.multi .summon-stage { display: grid; grid-template-columns: repeat(var(--cols, 5), auto); justify-content: center; align-content: center; gap: 22px 20px; }
.slot-face .tcg-back { aspect-ratio: auto; }

/* ---------- 卡冊：書架 ---------- */
.view.album[data-mode="shelf"] .binder-wrap, .view.album[data-mode="shelf"] .tray, .view.album[data-mode="shelf"] .at-open, .view.album[data-mode="shelf"] .album-tools { display: none; }
.view.album:not([data-mode="shelf"]) .shelf-view, .view.album:not([data-mode="shelf"]) .at-shelf { display: none; }
.at-shelf, .at-open { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.view-title { margin: 0; display: flex; align-items: center; gap: 10px; font-family: var(--f-serif); font-size: 22px; letter-spacing: .14em; }
.view-title svg { color: var(--gold); }
.shelf-view { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; padding: 10px 0 30px; }
.bookcase {
  width: min(1100px, 100%); align-self: flex-start; padding: 26px 26px 10px; border-radius: 22px;
  background: linear-gradient(180deg, var(--case-top), var(--case-bottom));
  box-shadow: inset 0 0 0 10px var(--case-frame), inset 0 0 40px rgba(0, 0, 0, .35), var(--shadow-2);
}
:root, [data-tone="dark"] { --case-top: #241a14; --case-bottom: #1a120d; --case-frame: #3a2618; --wood-1: #6b4426; --wood-2: #4a2d18; }
[data-tone="light"] { --case-top: #efe6d6; --case-bottom: #e6d9c3; --case-frame: #b98d5f; --wood-1: #c99a68; --wood-2: #a87a4c; }
.shelf-row { position: relative; padding: 0 16px; }
.shelf-books { display: flex; align-items: flex-end; gap: 10px; min-height: 260px; padding-top: 20px; flex-wrap: nowrap; overflow-x: auto; overflow-y: visible; }
.shelf-board { height: 18px; margin: 0 -16px 26px; border-radius: 4px; background: linear-gradient(180deg, var(--wood-1), var(--wood-2)); box-shadow: 0 10px 18px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .18); }
.book {
  position: relative; flex: none; width: 78px; height: 236px; border: 0; padding: 18px 0; border-radius: 6px 8px 8px 6px;
  background: var(--leather); color: rgba(255, 240, 210, .92); display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  box-shadow: inset 6px 0 10px rgba(255, 255, 255, .12), inset -8px 0 14px rgba(0, 0, 0, .35), 4px 0 10px rgba(0, 0, 0, .3);
  transition: transform .45s var(--ease), box-shadow .3s; transform-origin: bottom center;
}
.book:hover { transform: translateY(-14px) rotate(-1.5deg); box-shadow: inset 6px 0 10px rgba(255, 255, 255, .15), inset -8px 0 14px rgba(0, 0, 0, .35), 8px 14px 24px rgba(0, 0, 0, .4); }
.book.c-ivory { color: #4a3a22; }
.book-band { display: block; width: 100%; height: 10px; background: linear-gradient(180deg, #f6e2ac, #a87c37); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.book-title { writing-mode: vertical-rl; font-family: var(--f-serif); font-weight: 700; font-size: 16px; letter-spacing: .3em; max-height: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.book-meta { font-family: var(--f-display); font-size: 11px; letter-spacing: .05em; }
.book-orient { position: absolute; bottom: 30px; font-size: 10px; opacity: .7; }
.book.o-landscape { width: 210px; height: 92px; padding: 0 16px; flex-direction: row; border-radius: 6px; align-self: flex-end; }
.book.o-landscape .book-band { width: 10px; height: 100%; }
.book.o-landscape .book-title { writing-mode: horizontal-tb; letter-spacing: .14em; max-width: 120px; }
.book.o-landscape .book-orient { bottom: 6px; right: 26px; }
.book.o-landscape:hover { transform: translateY(-10px); }
.book.add { background: transparent; border: 2px dashed var(--line-strong); color: var(--text-2); box-shadow: none; justify-content: center; gap: 8px; }
.book.add svg { width: 26px; height: 26px; }
.book.add span { writing-mode: vertical-rl; letter-spacing: .3em; font-size: 13px; }
.book.add:hover { color: var(--gold); border-color: var(--gold); }
.c-plum { --leather: linear-gradient(135deg, #5c3570, #2e1638); }
.c-walnut { --leather: linear-gradient(135deg, #7a5233, #3d2614); }
.binder[data-color="plum"] { --leather: linear-gradient(135deg, #5c3570, #241030); }
.binder[data-color="walnut"] { --leather: linear-gradient(135deg, #7a5233, #301d0e); }
.orient-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.orient-pick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); position: relative; overflow: hidden; }
.orient-pick button.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.orient-pick i { display: block; border: 2px solid var(--gold); border-radius: 4px; background: repeating-linear-gradient(90deg, transparent 0 30%, color-mix(in srgb, var(--gold) 25%, transparent) 30% 33%); }
.op-p { width: 34px; height: 48px; }
.op-l { width: 52px; height: 36px; }
.orient-pick small { color: var(--text-2); font-size: 12px; }
.new-album { display: flex; flex-direction: column; gap: 14px; }
.new-album .color-dots { align-self: flex-start; }
/* 打開的卡冊 */
.binder { --page-h: 420px; }
.page.solo { border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); transform-origin: center; }
.pages.single.turn-out-next .page, .pages.single.turn-out-prev .page { transform: translateX(-4%) scale(.96); opacity: .2; }
.pages.single.turn-out-prev .page { transform: translateX(4%) scale(.96); }
.page-zoom { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; color: rgba(90, 75, 50, .55); opacity: 0; transition: opacity .2s; }
.page:hover .page-zoom { opacity: 1; }
.page-zoom:hover { color: var(--gold-2); background: rgba(0, 0, 0, .05); }

.tray-slot.mismatch { opacity: .75; }
.tray-slot .tcg { width: 100%; }

/* ---------- 首頁輪播 ---------- */
.home-layer { position: absolute; inset: 0; transition: opacity .6s var(--ease-soft), transform .9s var(--ease); }
.home-layer.enter { opacity: 0; transform: translateX(calc(var(--dir) * 3%)) scale(1.03); }
.home-layer.leave { opacity: 0; transform: translateX(calc(var(--dir, 0) * -3%)); }
.home-gl { position: absolute; inset: 0; }
.home-backdrop { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(34px) saturate(1.2) brightness(.7); }
[data-tone="light"] .home-backdrop { filter: blur(34px) saturate(1.1) brightness(1.05); opacity: .8; }
.home-slider { position: absolute; z-index: 4; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(14px); box-shadow: var(--shadow-1); }
.home-slider .icon-btn { width: 36px; height: 36px; }
.slide-dots { display: flex; gap: 6px; }
.slide-dots button { width: 9px; height: 9px; padding: 0; border-radius: 99px; border: 0; background: var(--text-3); transition: all .35s var(--ease); }
.slide-dots button.is-live { box-shadow: 0 0 0 2px color-mix(in srgb, #6fe0b5 50%, transparent); }
.slide-dots button.on { width: 26px; background: var(--gold); }
.bg-tile img { object-fit: contain; background: var(--surface-3); }
.bg-tile.on { outline: 2px solid var(--gold); outline-offset: 2px; }
.pick-no { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; font-size: 12px; background: var(--primary-bg); color: var(--primary-text); box-shadow: var(--shadow-1); }
.pick-no:empty { display: none; }
.row.between { justify-content: space-between; margin-bottom: 8px; }
.inline-sel { flex-direction: row; align-items: center; gap: 8px; }
.inline-sel .field { width: auto; padding: 6px 34px 6px 12px; }
.mini img { object-fit: contain; }

/* ---------- 召喚頁：素材池 / 提示詞庫 ---------- */
.banner-item.is-asset .bi-seal { filter: hue-rotate(160deg) saturate(1.3); }
.banner-kind { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; align-items: end; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); }
.banner-kind .toggle { grid-column: 1 / -1; }
.banner-kind .st-status { grid-column: 1 / -1; margin: 0; }
.prompt-lib { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.lib-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.lib-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid transparent; background: none; font-size: 13px; color: var(--text-2); position: relative; overflow: hidden; }
.lib-tabs button i { font-style: normal; color: var(--gold); }
.lib-tabs button.on { background: var(--surface-3); border-color: var(--line-strong); color: var(--text); }
.lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-chip { cursor: pointer; transition: all .2s var(--ease); }
.lib-chip:hover { border-color: var(--gold); color: var(--text); transform: translateY(-1px); }
.hero-art.alpha img { padding: 6%; }

/* ---------- 工坊：閃卡工藝 ---------- */
.ws-holo { position: absolute; inset: 0; display: none; }
.ws-stage.crafting .ws-holo { display: block; }
.ws-stage.crafting .ws-live, .ws-stage.crafting .ws-paint { visibility: hidden; }
.fld-note { display: block; font-size: 12px; color: var(--text-3); line-height: 1.5; margin-top: -2px; }
.st-status { margin: 0; }
.st-status.warn { color: #e0a14b; }
[data-tone="light"] .st-status.warn { color: #a8641c; }
.finish-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.finish-sw { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); transition: all .25s var(--ease); position: relative; overflow: hidden; }
.finish-sw i { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; }
.finish-sw b { font-size: 13.5px; font-weight: 600; }
.finish-sw small { font-size: 11px; color: var(--text-3); line-height: 1.35; }
.finish-sw:hover { border-color: var(--line-strong); }
.finish-sw.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.fs-pearl { background: conic-gradient(from 30deg, #ffd6e8, #fff4cf, #d4ffef, #d6e6ff, #f0dcff, #ffd6e8); }
.fs-silver { background: linear-gradient(135deg, #f4f5f7, #9ea2ab 45%, #fbfcfd 60%, #858892); }
.fs-gold { background: linear-gradient(135deg, #fff1c4, #d5a24b 45%, #fff6d8 60%, #a8782c); }
.fs-aurora { background: linear-gradient(135deg, #3ff2b5, #6f8dff 50%, #c76dff); }
.fs-rose { background: linear-gradient(135deg, #ffe1d8, #d98c8c 45%, #ffeee6 60%, #b8686b); }
.fs-original { background: linear-gradient(135deg, #3b3550, #191a26); box-shadow: inset 0 0 0 2px var(--line-strong); }
.holo-wrap { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1400px; }
.holo-card { position: relative; border-radius: 16px; transform-style: preserve-3d; will-change: transform; cursor: var(--cur-grab, grab); touch-action: none; }
.holo-card.grabbing { cursor: var(--cur-grabbing, grabbing); }
.holo-face, .holo-back { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .1); }
.holo-back { transform: rotateY(180deg); display: grid; }
.holo-back .tcg-back { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 16px; }
.holo-card canvas { display: block; width: 100%; height: 100%; }
.holo-shadow { position: absolute; bottom: 4%; height: 26px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent); filter: blur(4px); }
.detail-card .holo-wrap { position: absolute; }
.detail-mode { align-self: center; }

/* ---------- 主題切換形狀 ---------- */
:root[data-theme-vt="active"]::view-transition-new(root) { clip-path: var(--vt-clip-from); }
:root[data-theme-vt="active"]::view-transition-group(root) { animation-duration: var(--vt-duration, 700ms); }
.vt-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.vt-pick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--text-2); position: relative; overflow: hidden; transition: all .25s var(--ease); }
.vt-pick button.on { border-color: var(--gold); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.vt-pick i { width: 26px; height: 26px; background: var(--primary-bg); }
.vt-circle { border-radius: 50%; }
.vt-square { border-radius: 3px; }
.vt-triangle { clip-path: polygon(50% 4%, 100% 92%, 0 92%); }
.vt-diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.vt-hexagon { clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.vt-rectangle { height: 18px !important; width: 30px !important; border-radius: 3px; margin: 4px 0; }
.vt-star { clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.vt-random { background: conic-gradient(var(--gold), var(--accent), var(--gold)) !important; border-radius: 30%; }

/* ---------- 按鈕漣漪 ---------- */
.btn, .icon-btn, .seg button, .tabs button, .menu-big, .nav a, .banner-item, .book, .album-tab, .page-nav, .theme-switch { position: relative; overflow: hidden; }
.nav a, .menu-big, .banner-item, .album-tab { isolation: isolate; }
.ripple-host { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 0; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); animation: rippling .65s cubic-bezier(.2, .6, .3, 1) forwards; }
.btn.primary .ripple, .nav a.on .ripple, .menu-big.primary .ripple { background: #fff; opacity: .35; }
@keyframes rippling { to { transform: scale(1); opacity: 0; } }

@media (max-width: 760px) {
  .detail, .detail.is-landscape { grid-template-columns: 1fr; }
  .detail-left { position: static; }
  .detail-card { height: min(60vh, 520px); }
  .banner-kind { grid-template-columns: 1fr; }
  .book { width: 62px; height: 190px; }
  .shelf-books { min-height: 210px; }
  .home-slider { bottom: 160px; }
  .finish-grid { grid-template-columns: 1fr; }
}

/* 放大單頁：待收納移到右側，讓頁面用滿高度 */
.view.album[data-mode="page"] { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto minmax(0, 1fr); gap: 16px; }
.view.album[data-mode="page"] .album-top { grid-column: 1 / -1; }
.view.album[data-mode="page"] .binder-wrap { grid-column: 1; grid-row: 2; }
.view.album[data-mode="page"] .tray { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; min-height: 0; }
.view.album[data-mode="page"] .tray-head { flex-direction: column; align-items: stretch; gap: 8px; }
.view.album[data-mode="page"] .tray-hint { display: none; }
.view.album[data-mode="page"] .tray-cards { flex-wrap: wrap; align-content: flex-start; overflow-y: auto; overflow-x: hidden; flex: 1; --tray-h: 120px; }
@media (max-width: 900px) {
  .view.album[data-mode="page"] { display: flex; }
  .view.album[data-mode="page"] .tray-cards { flex-wrap: nowrap; overflow-x: auto; flex: none; --tray-h: 96px; }
}

/* ---------- v3 修正：分頁對齊、進度條、待收納區 ---------- */
.tabs button { flex: none; }
.ws-side .tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; overflow: visible; }
.ws-side .tabs button { padding: 8px 2px; font-size: 13px; text-align: center; min-width: 0; }
@keyframes progress-fill { from { width: 0%; } to { width: 100%; } }
@keyframes progress-fill-bg { from { background-size: 0% 100%, auto; } to { background-size: 100% 100%, auto; } }
.pbar { width: 64px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .14); overflow: hidden; flex: none; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--rc, var(--gold)) 70%, transparent), #fff); box-shadow: 0 0 8px var(--rc, var(--gold)); animation: progress-fill 1400ms ease-in-out 50ms infinite; }
.ws-progress::before { width: 46px; height: 4px; border: 0; border-radius: 99px; animation: progress-fill-bg 1400ms ease-in-out 50ms infinite;
  background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 0 / 0% 100%, var(--surface-3); }
.tray-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tray.expanded .tray-cards { flex-wrap: wrap; align-content: flex-start; overflow-x: hidden; overflow-y: auto; max-height: 44vh; }
.view.album:not([data-mode="page"]) .tray-cards { scrollbar-width: thin; }
.tray-cards::-webkit-scrollbar { height: 10px; }
.tray-cards::-webkit-scrollbar-thumb { background: var(--line-strong); }
.tray-count { font-size: 12px; color: var(--text-3); }

/* 卡冊縮放平移 */
.binder { transform: translate(var(--vx, 0px), var(--vy, 0px)) scale(var(--vs, 1)); transition: transform .12s ease-out; }
.binder-wrap { overflow: hidden; position: relative; cursor: var(--cur-grab, grab); touch-action: none; }
.binder-wrap.panning { cursor: var(--cur-grabbing, grabbing); }
.binder-wrap.panning .binder { transition: none; }
.binder-wrap .page-nav { position: relative; z-index: 5; }
.binder-wrap.zoomed::after { content: "滾輪縮放 · 拖曳空白處平移 · 雙擊回 100%"; position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 11.5px; color: var(--text-3); background: var(--surface); padding: 3px 10px; border-radius: 99px; pointer-events: none; }
.zoom-ctl { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.zoom-ctl .icon-btn { width: 28px; height: 28px; font-size: 16px; }
.zoom-ctl .btn { padding: 4px 8px; min-width: 52px; font-variant-numeric: tabular-nums; }
/* 橫式卡冊也直立放在書架上，用書背上的橫向徽記區分 */
.book.o-landscape { width: 78px; height: 236px; padding: 18px 0; flex-direction: column; border-radius: 6px 8px 8px 6px; }
.book.o-landscape .book-band { width: 100%; height: 10px; }
.book.o-landscape .book-title { writing-mode: vertical-rl; letter-spacing: .3em; max-width: none; }
.book.o-landscape .book-orient { position: absolute; bottom: 30px; right: auto; }
.book.o-landscape:hover { transform: translateY(-14px) rotate(-1.5deg); }
.book.o-landscape::before { content: ""; position: absolute; top: 28px; width: 30px; height: 18px; border: 1.5px solid rgba(255, 236, 190, .8); border-radius: 3px; box-shadow: inset 0 0 0 3px rgba(255, 236, 190, .15); }
.book.o-landscape .book-title { margin-top: 26px; }

/* 提示詞組 */
.groups { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.groups-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.groups-head b { display: flex; align-items: center; gap: 6px; font-family: var(--f-serif); letter-spacing: .08em; }
.groups-head b svg { color: var(--gold); }
.group-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.group { --gc: var(--gold); position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; padding: 9px 10px 9px 8px; border-radius: 14px; border: 1px solid var(--line); border-left: 3px solid var(--gc); background: var(--surface); cursor: var(--cur-grab, grab); transition: transform .2s var(--ease), box-shadow .2s, opacity .2s; }
.group:hover { box-shadow: var(--shadow-1); transform: translateY(-1px); }
.group.dragging { opacity: .4; }
.group .g-grip { grid-row: span 2; color: var(--text-3); font-size: 11px; letter-spacing: -2px; align-self: center; }
.group b { font-size: 13.5px; font-weight: 600; }
.group small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.group:hover .g-acts { opacity: 1; }
.g-acts button { border: 0; background: var(--surface-3); border-radius: 8px; padding: 2px 6px; font-size: 11px; color: var(--text-2); display: inline-flex; align-items: center; }
.g-acts button:hover { color: var(--text); background: var(--surface-solid); }
.g-acts svg { width: 12px; height: 12px; }
.group.c-blue { --gc: #6f9fe8; } .group.c-red { --gc: #e06a7a; } .group.c-green { --gc: #6cc49a; } .group.c-purple { --gc: #b48cf0; }
.drag-tags .tag-drop { outline: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 2px; }
.tag-drop.drop-hover { outline: 2px solid var(--gold) !important; background: color-mix(in srgb, var(--gold) 10%, var(--surface-2)); }

/* ---------- 閃卡工藝 v3：素材圖層、卡框、文字 ---------- */
.sticker-list { display: flex; flex-direction: column; gap: 6px; }
.sticker-row { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; cursor: pointer; }
.sticker-row.on { border-color: var(--line-strong); background: var(--surface-3); }
.sticker-row img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: repeating-conic-gradient(rgba(255,255,255,.06) 0 25%, rgba(0,0,0,.1) 0 50%) 0 0 / 10px 10px; }
.sticker-row span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sticker-row b { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticker-row .field { padding: 3px 26px 3px 8px; font-size: 12px; border-radius: 8px; background-position: right 6px center; }
.sticker-row .icon-btn { width: 28px; height: 28px; }
.sticker-edit { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.sticker-ov { position: absolute; z-index: 4; pointer-events: none; }
.st-box { position: absolute; pointer-events: auto; border: 1.5px dashed rgba(255, 255, 255, .55); border-radius: 6px; cursor: move; transform-origin: center; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.st-box.on { border: 2px solid var(--gold); box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 0 16px color-mix(in srgb, var(--gold) 50%, transparent); }
.st-box span { position: absolute; left: 0; top: -22px; white-space: nowrap; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: rgba(10, 10, 16, .7); color: #fff; opacity: 0; transition: opacity .2s; }
.st-box.on span, .st-box:hover span { opacity: 1; }
.st-box.l-back { border-color: rgba(140, 200, 255, .7); }
.st-box.l-top { border-color: rgba(255, 210, 140, .8); }
.frame-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.frame-sw { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; color: var(--text-2); transition: all .2s var(--ease); position: relative; overflow: hidden; }
.frame-sw.on { border-color: var(--gold); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.frame-sw i { width: 30px; height: 40px; border-radius: 4px; background: linear-gradient(160deg, #3b3550, #191a26); position: relative; }
.frame-sw i::after { content: ""; position: absolute; inset: 3px; border-radius: 3px; border: 1.5px solid #e2bd73; }
.fr-none::after { border: 0 !important; }
.fr-classic::after { box-shadow: inset 0 0 0 2px #191a26, inset 0 0 0 3px rgba(226,189,115,.7); }
.fr-ornate::after { border-radius: 8px 2px 8px 2px !important; border-width: 2px !important; }
.fr-silver::after { border: 1px solid #dfe3ea !important; }
.fr-gothic::after { border-radius: 50% 50% 3px 3px / 30% 30% 3px 3px !important; }
.fr-blackgold { box-shadow: inset 0 0 0 4px #0e0c12; }
.fr-blackgold::after { inset: 4px !important; }
.fr-corner::after { border: 0 !important; background: linear-gradient(#e2bd73, #e2bd73) 0 0 / 8px 1.5px no-repeat, linear-gradient(#e2bd73, #e2bd73) 0 0 / 1.5px 8px no-repeat, linear-gradient(#e2bd73, #e2bd73) 100% 100% / 8px 1.5px no-repeat, linear-gradient(#e2bd73, #e2bd73) 100% 100% / 1.5px 8px no-repeat; }
.fr-lace::after { border-style: dotted !important; border-width: 2px !important; }
.fr-neon::after { border-color: #c9a2ff !important; box-shadow: 0 0 6px #c9a2ff, inset 0 0 4px #c9a2ff; }
.fr-starfeather::after { border-color: #cdb6ff !important; }
.fr-starfeather::before { content: "✦"; position: absolute; top: -2px; left: 50%; transform: translateX(-50%); font-size: 9px; color: #e9dcff; font-style: normal; z-index: 1; }
.fr-crystal { background: url(../assets/deco/frame-d02.webp) center / 100% 100% no-repeat, linear-gradient(160deg, #3b3550, #191a26) !important; }
.fr-crystal::after { border: 0 !important; }
.toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.bg-grid.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: none; }
.bg-picker [data-pane] { max-height: 60vh; overflow: auto; }
.pick-h { margin: 12px 0 6px; font-family: var(--f-serif); font-size: 13px; letter-spacing: .12em; color: var(--gold); }
.st-pick img { padding: 6px; }
.back-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; padding: 2px; }
.back-sw { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); position: relative; overflow: hidden; }
.back-sw img, .back-sw .bs-default { width: 100%; aspect-ratio: 2 / 3; object-fit: contain; border-radius: 6px; }
.bs-default { background: radial-gradient(circle, rgba(214,180,117,.35), transparent 55%), linear-gradient(160deg, #1b1d2b, #0d0e16); box-shadow: inset 0 0 0 2px #c99a4c; }
.back-sw small { font-size: 11px; color: var(--text-2); }
.back-sw.on { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.tcg-back.img-back { background: none; box-shadow: none; overflow: visible; }
.tcg-back.img-back::before, .tcg-back.img-back::after { display: none; }
.tcg-back.img-back img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 24px rgba(0,0,0,.5)); }
output.num { display: inline-grid; place-items: center; }

/* =====================================================================
   首頁 v3：輕量、不擋畫面、自動淡出；素材庫裝飾依主題重新上色
   ===================================================================== */
:root, [data-tone="dark"] { --deco-filter: sepia(.45) saturate(1.5) hue-rotate(-18deg) brightness(1.06); }
[data-tone="light"] { --deco-filter: hue-rotate(-18deg) saturate(.55) brightness(1.08); }
.deco { filter: var(--deco-filter); pointer-events: none; user-select: none; }
.home.v3 .ui { transition: opacity .7s var(--ease-soft), transform .7s var(--ease); }
.home.v3.idle .ui { opacity: 0; }
.home.v3.idle .home-dock { opacity: .3; }
.home.v3.idle .home-slider { opacity: .45; }
.home.v3.zen .ui { opacity: 0 !important; pointer-events: none; }
.home.v3.zen .home-frame, .home.v3.idle .home-frame { opacity: 0; }
.home.v3 .home-frame { transition: opacity .7s; border-color: color-mix(in srgb, var(--line) 70%, transparent); }
.home-hint { position: absolute; z-index: 5; left: 50%; bottom: 18px; transform: translateX(-50%); font-size: 12px; color: rgba(255, 255, 255, .7); background: rgba(10, 10, 16, .35); padding: 4px 12px; border-radius: 99px; opacity: 0; transition: opacity .5s; pointer-events: none; backdrop-filter: blur(6px); }
.home.v3.zen .home-hint { opacity: 1; animation: hintFade 3s 1.5s forwards; }
@keyframes hintFade { to { opacity: 0; } }
/* 背景遮罩：只壓暗角落文字區，中間保持乾淨 */
.home.v3 .home-shade {
  background:
    radial-gradient(120% 70% at 100% 100%, color-mix(in srgb, var(--home-shade) 80%, transparent) 0%, transparent 45%),
    radial-gradient(60% 50% at 0% 100%, color-mix(in srgb, var(--home-shade) 55%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--home-shade) 45%, transparent) 0%, transparent 16%);
  transition: opacity .7s;
}
.home.v3.idle .home-shade, .home.v3.zen .home-shade { opacity: .25; }
/* 上方 */
.home.v3 .home-top { top: 26px; }
.home.v3 .home-mark b { font-size: 15px; }
.home.v3 .home-mark span { font-size: 11px; }
.home-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn.glass { background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(12px); border-color: var(--line); width: 36px; height: 36px; }
.home.v3 .chip { padding: 4px 10px; font-size: 12px; background: color-mix(in srgb, var(--surface) 65%, transparent); }
.home.v3 .home-bg-btn.btn { display: none; }
/* 台詞 */
.home.v3 .home-quote { top: 96px; right: 44px; max-width: min(420px, 36vw); text-align: right; }
.home.v3 .quote-text { font-size: clamp(15px, 1.35vw, 20px); line-height: 1.8; text-shadow: 0 1px 12px var(--home-shade), 0 0 2px var(--home-shade); }
.home.v3 .quote-text::before { margin-left: 0; }
.quote-deco { display: block; width: 150px; margin: 0 0 4px auto; opacity: .85; }
/* 名牌：無底色的優雅文字塊 */
.home.v3 .home-plate { right: 44px; bottom: 44px; width: auto; min-width: 0; max-width: min(520px, 46vw); display: flex; flex-direction: column; align-items: flex-end; text-align: right; color: var(--text); filter: none; }
.plate-feather { position: absolute; right: -18px; top: -64px; width: 150px; opacity: .55; transform: rotate(-8deg); }
.home.v3 .plate-name { display: flex; align-items: center; gap: 10px; justify-content: flex-end; font-family: var(--f-serif); font-weight: 900; font-size: clamp(24px, 2.4vw, 36px); letter-spacing: .08em; text-shadow: 0 2px 18px var(--home-shade), 0 0 3px var(--home-shade); }
.pn-rar { display: inline-grid; position: relative; }
.pn-rar .tcg-rarity { position: relative; top: auto; left: auto; zoom: 1.1; }
.plate-divider { width: min(210px, 60%); margin: 2px 0 2px; opacity: .75; }
.home.v3 .plate-en { font-family: var(--f-cond); font-weight: 500; font-size: clamp(22px, 2.6vw, 40px); letter-spacing: .04em; line-height: 1.05; margin: 0; background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--gold) 80%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 10px var(--home-shade)); }
.home.v3 .plate-meta { margin-top: 8px; font-size: 10px; letter-spacing: .22em; color: var(--text-2); text-shadow: 0 1px 6px var(--home-shade); }
.home.v3 .plate-script { margin: 4px 0 0; padding: 0; background: none; font-size: 15px; color: var(--text-2); display: block; text-shadow: 0 1px 8px var(--home-shade); }
/* 左下：圓形導覽 */
.home-dock { position: absolute; z-index: 4; left: calc(var(--rail-w) + 52px); bottom: 44px; display: flex; flex-direction: column; gap: 12px; }
.dock-btn { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: color-mix(in srgb, var(--surface) 72%, transparent); border: 1px solid var(--line); backdrop-filter: blur(14px); box-shadow: var(--shadow-1); transition: transform .35s var(--ease), background .3s; overflow: visible; }
.dock-btn svg { width: 22px; height: 22px; }
.dock-btn.primary { background: var(--primary-bg); color: var(--primary-text); border-color: transparent; box-shadow: var(--primary-shadow); }
.dock-btn:hover { transform: translateX(4px) scale(1.06); }
.dock-btn::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translate(-6px, -50%); white-space: nowrap; font-family: var(--f-serif); font-size: 13px; letter-spacing: .14em; padding: 5px 12px; border-radius: 99px; background: color-mix(in srgb, var(--surface-solid) 85%, transparent); color: var(--text); border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease); }
.dock-btn:hover::after { opacity: 1; transform: translate(0, -50%); }
.home.v3 .home-menu { display: none; }
.home.v3 .home-slider { bottom: 28px; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.empty-badge { width: 150px; animation: floaty 5s ease-in-out infinite; }
@media (max-width: 760px) {
  .home.v3 .home-quote { top: 80px; right: 20px; left: 20px; max-width: none; }
  .home.v3 .home-plate { right: 20px; bottom: 170px; max-width: none; }
  .home-dock { left: 18px; bottom: 96px; flex-direction: row; }
  .dock-btn::after { display: none; }
  .home-tools .home-chips { display: none; }
  .plate-feather { display: none; }
}
.hero-divider { width: 220px; margin: -8px 0 -4px; opacity: .9; }
.shelf-deco { width: 120px; opacity: .8; }
.seg button { white-space: nowrap; }

/* 配色選擇 */
.theme-pick { grid-template-columns: repeat(2, 1fr); }
.tp-sw { display: flex !important; overflow: hidden; height: 54px !important; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.tp-sw span { flex: 1; }

/* =====================================================================
   v4：扁平封蠟、程式分隔飾、卡背跟主題變色、首頁文字底襯
   ===================================================================== */
.seal-svg { filter: none !important; }
.brand .seal-svg { filter: none; }
.back-seal .seal-svg, .plate-seal .seal-svg, .empty-orb .seal-svg { filter: none !important; }
.banner-item.is-asset .bi-seal { filter: none; --seal: var(--gold); }
[data-tone="dark"] .banner-item.is-asset .bi-seal { --seal: var(--accent); --seal-hi: #fbe6e9; }
.orn { display: block; color: var(--gold); width: 220px; height: 18px; overflow: visible; }
.hero-divider { width: 200px; margin: -6px 0 -2px; opacity: .85; }
.shelf-deco { width: 130px; opacity: .8; }
.quote-deco { width: 150px; margin: 0 0 6px auto; }
.plate-divider { width: min(220px, 60%); margin: 4px 0; opacity: .9; }
/* 預設卡背：底色與紋路用主題色 */
.tcg-back {
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--seal-hi) 22%, transparent), transparent 55%),
    repeating-conic-gradient(from 0deg at 50% 50%, color-mix(in srgb, var(--seal-hi) 8%, transparent) 0 6deg, transparent 6deg 12deg),
    linear-gradient(160deg, color-mix(in srgb, var(--seal-lo) 70%, #07080c), color-mix(in srgb, var(--seal-lo) 35%, #05060a) 60%, color-mix(in srgb, var(--seal) 45%, #0a0a10));
}
.tcg-back::before { background: linear-gradient(135deg, var(--seal-hi), var(--seal) 45%, var(--seal-hi) 60%, var(--seal-lo)); }
.tcg-back::after { border-color: color-mix(in srgb, var(--seal-hi) 45%, transparent); }
.back-pattern { opacity: .4; background:
  radial-gradient(circle at 0 0, transparent 9px, color-mix(in srgb, var(--seal-hi) 50%, transparent) 10px, transparent 11px) 0 0 / 22px 22px,
  radial-gradient(circle at 100% 100%, transparent 9px, color-mix(in srgb, var(--seal-hi) 50%, transparent) 10px, transparent 11px) 0 0 / 22px 22px; }
.back-ring { border-color: color-mix(in srgb, var(--seal-hi) 55%, transparent); box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--seal-hi) 8%, transparent); }

.back-text { color: color-mix(in srgb, var(--seal-hi) 75%, transparent); }
.tcg-back.img-back .back-img, .back-sw img { filter: var(--back-filter) drop-shadow(0 10px 24px rgba(0,0,0,.35)); }

/* 首頁：修正背景按鈕被舊樣式擠到下面 */
.home.v3 .home-bg-btn { position: static; top: auto; right: auto; }
/* 首頁文字底襯：auto（依主題）、深底白字、淺底黑字、無 */
.home.v3 .home-quote, .home.v3 .home-plate { border-radius: 22px; transition: background .4s, box-shadow .4s, opacity .7s var(--ease-soft); }
.home.v3[data-plate="dark"] .home-quote, .home.v3[data-plate="dark"] .home-plate,
.home.v3[data-plate="light"] .home-quote, .home.v3[data-plate="light"] .home-plate { padding: 16px 22px 14px; backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }
.home.v3[data-plate="dark"] .home-quote, .home.v3[data-plate="dark"] .home-plate {
  --text: #f7f3ea; --text-2: rgba(247, 243, 234, .74); --home-shade: transparent;
  background: linear-gradient(160deg, rgba(14, 14, 20, .58), rgba(14, 14, 20, .38)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 18px 40px rgba(0, 0, 0, .28);
}
.home.v3[data-plate="light"] .home-quote, .home.v3[data-plate="light"] .home-plate {
  --text: #23202a; --text-2: rgba(35, 32, 42, .7); --home-shade: transparent;
  background: linear-gradient(160deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .55)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), 0 18px 40px rgba(40, 30, 60, .16);
}
.home.v3[data-plate="dark"] .home-plate, .home.v3[data-plate="light"] .home-plate { right: 36px; bottom: 36px; }
.home.v3[data-plate="dark"] .home-quote, .home.v3[data-plate="light"] .home-quote { right: 36px; }
.home.v3[data-plate="dark"] .quote-text, .home.v3[data-plate="light"] .quote-text { text-shadow: none; }
.home.v3[data-plate="dark"] .plate-name, .home.v3[data-plate="light"] .plate-name { text-shadow: none; }
.home.v3[data-plate="light"] .plate-en { filter: none; }
.home.v3[data-plate] .plate-meta, .home.v3[data-plate] .plate-script { text-shadow: none; }
.home.v3[data-plate="none"] .quote-text, .home.v3[data-plate="none"] .plate-name { text-shadow: 0 1px 3px var(--home-shade), 0 2px 18px var(--home-shade), 0 0 6px var(--home-shade); }
.home.v3[data-plate="dark"] .plate-feather, .home.v3[data-plate="light"] .plate-feather { top: -54px; right: -10px; }
.plate-btn { font-family: var(--f-serif); font-weight: 700; font-size: 13px; }

/* ---------- 彈跳 hover（彈簧曲線，接近 framer-motion stiffness 400 / damping 10） ---------- */
:root { --spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 19.4%, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163 27%, 1.154, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1); }
.btn, .icon-btn, .dock-btn, .film-sw, .frame-sw, .finish-sw, .rs-sw, .back-sw, .lib-chip, .page-nav, .theme-switch, .mini, .vt-pick button, .orient-pick button, .tp, .type-grid button {
  transition: transform .6s var(--spring), background .25s, border-color .25s, box-shadow .25s, color .2s, opacity .2s, width .5s var(--spring);
}
.btn:hover { transform: scale(1.05); }
.btn.small:hover, .lib-chip:hover { transform: scale(1.07); }
.icon-btn:hover, .page-nav:hover, .mini:hover, .theme-switch:hover { transform: scale(1.12); }
.film-sw:hover, .frame-sw:hover, .finish-sw:hover, .rs-sw:hover, .back-sw:hover, .vt-pick button:hover, .type-grid button:hover { transform: scale(1.06); }
.btn:active, .icon-btn:active, .dock-btn:active, .lib-chip:active { transform: scale(.94); transition-duration: .12s; }
.summon-btns .btn:hover { transform: scale(1.06); }

/* ---------- 分頁 / 分段選擇：滑動的選取膠囊 ---------- */
.tabs, .seg { position: relative; }
.pill { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; border-radius: 99px; opacity: 0;
  transition: transform .55s var(--spring), width .55s var(--spring), height .3s var(--ease), opacity .2s; }
.pill.no-anim { transition: none; }
.seg > .pill { background: var(--primary-bg); box-shadow: var(--primary-shadow); }
.tabs > .pill { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong); }
.has-pill > button { position: relative; z-index: 1; }
.has-pill > button.on { background: transparent !important; box-shadow: none !important; }

/* ---------- hover 展開全顯：卡池項目 ---------- */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spinAng { to { --ang: 360deg; } }
.banner-item { position: relative; isolation: isolate; flex-wrap: wrap; align-items: flex-start; transition: background .25s, border-color .25s, transform .5s var(--spring); }
.banner-item > span { flex: 1; min-width: 0; }
.banner-item b { white-space: normal; line-height: 1.35; }
.banner-item small { white-space: normal; }
.bi-more { display: block; max-height: 0; opacity: 0; overflow: hidden; font-size: 11.5px; color: var(--text-2); line-height: 1.6; margin-top: 0; transition: max-height .5s var(--spring), opacity .3s, margin .3s; }
.bi-more i { font-style: normal; color: var(--gold); }
.banner-item:hover .bi-more, .banner-item.on .bi-more { max-height: 60px; opacity: 1; margin-top: 4px; }
.banner-item::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 62%, color-mix(in srgb, var(--gold) 90%, white) 80%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s; animation: spinAng 2.6s linear infinite; }
.banner-item:hover::before { opacity: 1; }
.banner-item:hover { transform: translateX(3px) scale(1.02); }
.bi-seal { transition: transform .6s var(--spring); }
.banner-item:hover .bi-seal { transform: rotate(-12deg) scale(1.12); }

/* ---------- 首頁導覽：hover 展開顯示文字 ---------- */
.dock-btn { width: auto; min-width: 52px; padding: 0 15px; display: flex; align-items: center; justify-content: flex-start; gap: 0; border-radius: 99px; isolation: isolate; }
.dock-btn::after { display: none; }
.dock-label { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; font-family: var(--f-serif); font-size: 14px; letter-spacing: .14em; transition: max-width .55s var(--spring), opacity .3s, margin .4s; }
.dock-label small { font-family: var(--f-display); font-size: 9px; letter-spacing: .24em; opacity: .7; margin-left: 6px; }
.dock-btn:hover { transform: translateX(3px); }
.dock-btn:hover .dock-label { max-width: 200px; opacity: 1; margin-left: 10px; }
.dock-btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 62%, color-mix(in srgb, var(--gold) 90%, white) 80%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s; animation: spinAng 2.6s linear infinite; }
.dock-btn:hover::before { opacity: 1; }

/* ---------- 圖層分頁（PSD 式分組） ---------- */
.ws-side .tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 4px; }
.layer-groups { gap: 10px !important; }
.lg { border-radius: 14px; border: 1px solid var(--line-soft); background: var(--surface-2); overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.lg.drop { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.lg-head { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; background: var(--surface-3); }
.lg-head b { font-family: var(--f-serif); font-size: 13.5px; letter-spacing: .1em; }
.lg-head small { flex: 1; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-head span { font-size: 11px; color: var(--text-2); }
.lg[data-group="top"] .lg-head b { color: #d9a85a; }
.lg[data-group="outer"] .lg-head b { color: var(--accent); }
.lg[data-group="subject"] .lg-head b { color: var(--gold); }
.lg[data-group="bg"] .lg-head b { color: var(--text-2); }
.lg-list { display: flex; flex-direction: column; padding: 4px; gap: 2px; min-height: 30px; }
.ly-empty { font-size: 11.5px; color: var(--text-3); padding: 6px 10px; }
.ly-row { position: relative; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; cursor: var(--cur-grab, grab); transition: background .15s; }
.ly-row:hover { background: var(--surface-3); }
.ly-row.on { background: color-mix(in srgb, var(--gold) 14%, var(--surface-3)); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ly-row.off { opacity: .45; }
.ly-row.dragging { opacity: .3; }
.ly-row.drop-above::before, .ly-row.drop-below::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; border-radius: 2px; background: var(--gold); }
.ly-row.drop-above::before { top: -1px; } .ly-row.drop-below::after { bottom: -1px; }
.ly-eye { width: 26px; height: 26px; border: 0; background: none; padding: 3px; color: var(--text-2); border-radius: 8px; flex: none; }
.ly-eye:hover { background: var(--surface-solid); color: var(--text); }
.ly-eye svg { width: 18px; height: 18px; }
.ly-row img { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; flex: none; background: repeating-conic-gradient(rgba(127,127,127,.12) 0 25%, transparent 0 50%) 0 0 / 8px 8px; }
.ly-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ly-name b { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-name small { font-size: 10.5px; color: var(--text-3); }
.ly-op { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.layer-edit { background: color-mix(in srgb, var(--gold) 5%, transparent); border-radius: 14px; padding: 12px !important; }
.layer-hint { position: absolute; z-index: 5; left: 50%; bottom: 12px; transform: translateX(-50%); font-size: 11.5px; padding: 4px 12px; border-radius: 99px; background: var(--surface); color: var(--text-2); border: 1px solid var(--line); pointer-events: none; }
.st-box.g-bg { border-color: rgba(140, 200, 255, .75); }
.st-box.g-top { border-color: rgba(255, 210, 140, .85); }
.st-box.g-subject { border-color: rgba(200, 255, 200, .7); }

/* ---------- v5 ---------- */
/* 稀有度配色 */
.rc-row { display: flex; gap: 10px; flex-wrap: wrap; }
.rc-pick { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; }
.rc-pick input { width: 30px; height: 30px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; }
.rc-pick input::-webkit-color-swatch-wrapper { padding: 0; } .rc-pick input::-webkit-color-swatch { border: 2px solid rgba(255,255,255,.7); border-radius: 50%; }
.rc-pick b { font-family: var(--f-display); font-size: 13px; color: var(--rb-edge); }
.rc-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rc-preset { display: flex; align-items: center; gap: 3px; padding: 5px 10px 5px 6px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--text-2); transition: transform .5s var(--spring); }
.rc-preset:hover { transform: scale(1.06); }
.rc-preset i { width: 12px; height: 12px; border-radius: 50%; }
.rc-preset span { margin-left: 4px; }
/* 工坊面板不用毛玻璃：避免大量 WebGL 重繪時瀏覽器把面板畫成一片白 */
.view.workshop .panel { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface-solid); }
/* LIVE 拆件縮放 */
.ws-zoom { position: absolute; inset: 0; transform-origin: center center; will-change: transform; }
.ws-stage.pan-tool, .ws-stage.pan-tool .ws-paint { cursor: var(--cur-grab, grab) !important; }
.ws-stage.panning, .ws-stage.panning .ws-paint { cursor: var(--cur-grabbing, grabbing) !important; }
.tool-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.tools .zm-reset { padding: 4px 8px; min-width: 52px; font-variant-numeric: tabular-nums; }
.tools .zm-pan.on { background: var(--primary-bg); color: var(--primary-text); }
.ws-stage.crafting .ws-zoom { visibility: hidden; }
/* 動態閃卡的粒子層 */
.holo-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* 打開卡冊時左側的小書架 */
.mini-shelf { display: none; }
.view.album:not([data-mode="shelf"]) .mini-shelf { display: flex; flex-direction: column; position: absolute; z-index: 6; left: calc(var(--rail-w) + 36px); top: 92px; width: 70px; max-height: calc(100% - 300px); }
.view.album[data-mode="page"] .mini-shelf { max-height: calc(100% - 120px); }
.view.album:not([data-mode="shelf"]) .binder-wrap { margin-left: 70px; }
.ms-books { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding: 6px 6px 10px; border-radius: 16px 16px 4px 4px; background: linear-gradient(180deg, var(--case-top), var(--case-bottom)); box-shadow: inset 0 0 0 4px var(--case-frame); scrollbar-width: none; }
.ms-board { height: 8px; margin: 0 -4px; border-radius: 3px; background: linear-gradient(180deg, var(--wood-1), var(--wood-2)); box-shadow: 0 6px 10px rgba(0,0,0,.25); }
.mini-book { position: relative; width: 100%; min-height: 76px; border: 0; border-radius: 5px 6px 6px 5px; padding: 10px 2px 8px; background: var(--leather); color: rgba(255, 240, 210, .92); display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: inset 4px 0 6px rgba(255,255,255,.12), inset -5px 0 8px rgba(0,0,0,.3); transition: transform .5s var(--spring), box-shadow .2s; }
.mini-book.c-ivory { color: #4a3a22; }
.mini-book span { writing-mode: vertical-rl; font-family: var(--f-serif); font-size: 12px; font-weight: 700; letter-spacing: .2em; max-height: 64px; overflow: hidden; }
.mini-book small { font-family: var(--f-display); font-size: 9px; opacity: .8; }
.mb-band { position: absolute; top: 5px; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #f6e2ac, #a87c37); }
.mb-l { position: absolute; bottom: 4px; right: 4px; width: 10px; height: 7px; border: 1px solid currentColor; border-radius: 1px; opacity: .7; }
.mini-book:hover { transform: translateX(5px); }
.mini-book.on { transform: translateX(8px); box-shadow: inset 4px 0 6px rgba(255,255,255,.12), inset -5px 0 8px rgba(0,0,0,.3), -3px 0 0 var(--gold), 0 6px 16px rgba(0,0,0,.3); }
.mini-book.hover { transform: translateX(8px) scale(1.08); box-shadow: 0 0 0 2px var(--gold), 0 0 18px color-mix(in srgb, var(--gold) 55%, transparent); }
.mini-book.add { background: transparent; border: 1.5px dashed var(--line-strong); color: var(--text-2); min-height: 44px; justify-content: center; box-shadow: none; }
.mini-book.add svg { width: 18px; height: 18px; }
/* 書架拖曳排序 */
.book.dragging-book { z-index: 20; transition: none; box-shadow: 0 24px 40px rgba(0,0,0,.4); cursor: var(--cur-grabbing, grabbing); opacity: .95; }
.book.ins-before { box-shadow: -6px 0 0 -2px var(--gold), inset 6px 0 10px rgba(255,255,255,.12); }
.book.ins-after { box-shadow: 6px 0 0 -2px var(--gold), inset 6px 0 10px rgba(255,255,255,.12); }
.book { touch-action: none; }
@media (max-width: 760px) { .view.album:not([data-mode="shelf"]) .mini-shelf { display: none; } .view.album:not([data-mode="shelf"]) .binder-wrap { margin-left: 0; } }

/* ---------- 文字動效（React Bits 風格） ---------- */
.fx-split { display: inline-block; }
.fx-ch { display: inline-block; animation-duration: .7s; animation-fill-mode: both; will-change: transform, filter, opacity; }
.fx-rise { animation-name: fxRise; animation-timing-function: var(--spring); }
.fx-blur { animation-name: fxBlur; animation-timing-function: cubic-bezier(.2, .7, .2, 1); animation-duration: .9s; }
.fx-pop { animation-name: fxPop; animation-timing-function: var(--spring); }
@keyframes fxRise { from { opacity: 0; transform: translateY(.6em) rotate(6deg); } }
@keyframes fxBlur { from { opacity: 0; filter: blur(10px); transform: translateY(-.25em); } 60% { opacity: 1; filter: blur(2px); } }
@keyframes fxPop { from { opacity: 0; transform: scale(.3); } }
.fx-shiny { background: linear-gradient(110deg, currentColor 35%, color-mix(in srgb, currentColor 30%, white) 48%, #fff 50%, color-mix(in srgb, currentColor 30%, white) 52%, currentColor 65%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: fxShine 3.2s linear infinite; }
.fx-shiny .fx-ch { -webkit-text-fill-color: transparent; background: inherit; -webkit-background-clip: text; background-clip: text; }
@keyframes fxShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.fx-gradient { background: linear-gradient(90deg, var(--gold), var(--accent), var(--gold)) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: sheen 5s linear infinite; }
.hero-kicker { display: inline-block; min-height: 1.4em; color: var(--gold); }
.view-title { background: linear-gradient(110deg, var(--text) 40%, var(--gold) 50%, var(--text) 60%) 0 0 / 260% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: fxShine 6s linear infinite; }
.view-title svg { -webkit-text-fill-color: initial; }

/* BounceCards：選取的輪播項目扇形展開 */
:root { --elastic: linear(0, .33 5%, .86 11%, 1.12 16%, 1.2 19.5%, 1.16 23%, 1.02 30%, .95 35.5%, .94 39%, .98 47%, 1.01 55%, 1.005 66%, 1); }
.bounce-cards { position: relative; height: 210px; display: grid; place-items: center; margin: 4px 0 12px; border-radius: 18px; background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%); overflow: visible; }
.bc-empty { position: absolute; }
.bc-card { position: absolute; width: 124px; aspect-ratio: 1; border-radius: 22px; overflow: hidden; border: 5px solid #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); background: var(--surface-3); transition: transform .6s var(--elastic); cursor: pointer; }
[data-tone="dark"] .bc-card { border-color: #f4efe4; }
.bc-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-card b { position: absolute; top: 6px; left: 6px; min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; font-size: 11px; background: var(--primary-bg); color: var(--primary-text); }
.back-sw img { filter: var(--back-filter) !important; }

/* ===== v6：圖層外框把手（旋轉 / 縮放 / 裁切） ===== */
.st-box .lh { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--gold); border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.st-box .lh.sc.nw { left: -7px; top: -7px; cursor: nwse-resize; } .st-box .lh.sc.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.st-box .lh.sc.ne { right: -7px; top: -7px; cursor: nesw-resize; } .st-box .lh.sc.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.st-box .lh.cr { background: var(--gold); border-color: #fff; border-radius: 99px; }
.st-box .lh.c-l, .st-box .lh.c-r { width: 6px; height: 26px; top: calc(50% - 13px); cursor: ew-resize; }
.st-box .lh.c-l { left: -4px; } .st-box .lh.c-r { right: -4px; }
.st-box .lh.c-t, .st-box .lh.c-b { height: 6px; width: 26px; left: calc(50% - 13px); cursor: ns-resize; }
.st-box .lh.c-t { top: -4px; } .st-box .lh.c-b { bottom: -4px; }
.st-box .lh.rot { left: calc(50% - 8px); top: -34px; width: 16px; height: 16px; border-radius: 50%; cursor: var(--cur-grab, grab); }
.st-box .lh.rot::after { content: ''; position: absolute; left: 50%; top: 14px; width: 2px; height: 16px; margin-left: -1px; background: var(--gold); }
.st-box.on span { top: auto; bottom: -24px; }

/* ===== v6：待收納抽屜 ===== */
.view.album[data-mode="page"] { display: flex; }
.view.album:not([data-mode="shelf"]) .tray { position: absolute; z-index: 8; left: calc(var(--rail-w) + 38px); right: 24px; bottom: 0; margin: 0; display: block;
  border-radius: 22px 22px 0 0; padding: 12px 16px 16px; transform: translateY(100%); transition: transform .5s var(--spring, cubic-bezier(.3,1.3,.5,1)); box-shadow: 0 -18px 40px -20px rgba(0, 0, 0, .45); }
.view.album:not([data-mode="shelf"]) .tray.open { transform: none; }
.view.album:not([data-mode="shelf"]) .tray.open.tucked { transform: translateY(100%); transition-duration: .3s; }
.view.album:not([data-mode="shelf"]) .binder-wrap { margin-bottom: 26px; }
.view.album:not([data-mode="shelf"]) .mini-shelf { max-height: calc(100% - 170px); }
.view.album[data-mode="page"] .tray-head { flex-direction: row; align-items: center; gap: 14px; }
.view.album[data-mode="page"] .tray-hint { display: block; }
.view.album[data-mode="page"] .tray-cards { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; flex: none; --tray-h: 128px; }
.view.album .tray.expanded .tray-cards { flex-wrap: wrap; align-content: flex-start; overflow-x: hidden; overflow-y: auto; max-height: 44vh; }
.tray-handle { display: none; }
.view.album:not([data-mode="shelf"]) .tray-handle { display: inline-flex; align-items: center; gap: 8px; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  padding: 7px 18px 6px; border-radius: 16px 16px 0 0; border: 1px solid var(--line); border-bottom: 0; background: var(--surface); color: var(--text-2);
  font-size: 13px; letter-spacing: .06em; box-shadow: 0 -8px 18px -10px rgba(0, 0, 0, .35); cursor: pointer; transition: color .2s, background .2s; }
.tray-handle:hover { color: var(--text); background: var(--surface-2); }
.tray-handle b { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.tray-handle b:empty { display: none; }
.tray-handle.has:not(:hover) b { animation: handlePulse 2.2s ease-in-out infinite; }
@keyframes handlePulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); } }
.th-chev { width: 8px; height: 8px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: translateY(2px) rotate(45deg); transition: transform .3s var(--ease); }
.tray.open .th-chev { transform: translateY(-2px) rotate(225deg); }
.album.dragging .tray-handle { color: var(--text); background: var(--surface-3); box-shadow: 0 0 0 2px var(--gold), 0 -8px 18px -10px rgba(0,0,0,.35); }
.album.dragging .tray-handle.hover, .tray.hover .tray-handle { transform: translateX(-50%) translateY(-4px); }
.album.dragging .tray-handle::after { content: '拖到這裡取出'; font-size: 11px; color: var(--text-3); }

/* ===== v6：書頁翻動 ===== */
.pages > .page:not(.solo) { cursor: var(--cur-grab, grab); }
.binder-wrap.page-dragging, .binder-wrap.page-dragging * { cursor: var(--cur-grabbing, grabbing) !important; }
.leaf { position: absolute; z-index: 5; transform-style: preserve-3d; pointer-events: none; will-change: transform; }
.leaf-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.leaf-face.back { transform: rotateY(180deg); }
.leaf-face .page { width: 100%; height: 100%; transition: none; }
.leaf-face::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 0, 0, calc(var(--shade, 0) * .28)), rgba(255, 255, 255, calc(var(--shade, 0) * .12)) 60%, rgba(0, 0, 0, calc(var(--shade, 0) * .18))); }
.leaf-blank { background: linear-gradient(180deg, var(--album-page-2), var(--album-page)); border-radius: 14px; }
.pages.flipping .page-zoom { opacity: 0; }
.page.right::before, .page.solo::before { content: ''; position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; border-radius: 0 0 14px 0; pointer-events: none;
  background: linear-gradient(315deg, transparent 50%, rgba(0, 0, 0, .10) 50%, rgba(255, 255, 255, .5) 62%, transparent 63%); opacity: .7; transition: width .25s var(--ease), height .25s var(--ease); }
.page.right:hover::before, .page.solo:hover::before { width: 40px; height: 40px; }

/* ===== v6：十連逐張翻開 ===== */
.summon.multi .summon-stage.spot { display: flex; align-items: center; justify-content: center; }
.summon-stage.spot .slot { position: absolute; left: 50%; top: 50%; translate: -50% -50%; animation: spotIn .5s var(--ease) backwards; }
.summon-stage.spot .slot.flipped { cursor: pointer; }
@keyframes spotIn { from { opacity: 0; transform: translateY(40px) scale(.85); } }
.summon-strip { position: relative; display: flex; gap: 8px; justify-content: center; padding: 6px 20px 0; transition: opacity .35s, transform .35s; }
.summon-strip.done { opacity: 0; transform: translateY(20px); }
.summon-strip .sm-cell { position: relative; height: 70px; aspect-ratio: var(--ar, .667); border-radius: 7px; border: 1.5px dashed rgba(255, 255, 255, .22); display: grid; place-items: center; overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.summon-strip .sm-cell b { font: 500 11px var(--f-display); color: rgba(255, 255, 255, .35); }
.summon-strip .sm-cell.pending { border-style: solid; border-color: rgba(255, 255, 255, .45); animation: cellPulse 1.6s ease-in-out infinite; }
@keyframes cellPulse { 50% { border-color: rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .06); } }
.summon-strip .sm-cell.got { border: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 0 14px color-mix(in srgb, var(--rc) 60%, transparent); animation: miniPop .45s cubic-bezier(.3,1.6,.5,1); }
.summon-strip .sm-cell.got b { display: none; }
.summon-strip .sm-cell .tcg { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.summon-strip .sm-cell .tcg-name, .summon-strip .sm-cell .tcg-rarity, .summon-strip .sm-cell .tcg-tags { display: none; }
.summon-strip .sm-cell.skipped { opacity: .25; }
@keyframes miniPop { from { transform: scale(1.35); } }
.summon-skip { align-self: flex-start; }
.summon .slot.shown { animation: slotIn .7s var(--ease) backwards; animation-delay: var(--d); }
.summon .slot.shown .slot-flip { transition: none; }

/* ===== v7：首頁閃卡展示 ===== */
.home-layer.holo-show { background: #08080d; }
.home-holo-bg { position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(36px) saturate(1.2) brightness(.55); }
.home-holo { position: absolute; top: 9%; bottom: 7%; left: calc(var(--rail-w, 80px) + 90px); right: 34%; }
.home-holo .holo-wrap { pointer-events: auto; }
@media (max-width: 900px) { .home-holo { left: 6%; right: 6%; width: auto; top: 8%; bottom: 30%; } }

/* ===== v7：卡冊顯示閃卡 ===== */
.tcg.is-holo .tcg-inner { background: #0c0c12; }
.tcg.is-holo .tcg-art { object-fit: cover; }
.holo-sheen { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .35; border-radius: inherit;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 120, 200, .5) 35%, rgba(120, 220, 255, .55) 45%, rgba(255, 240, 150, .5) 55%, transparent 70%);
  background-size: 250% 250%; animation: sheenMove 6s ease-in-out infinite; }
.tcg.is-holo:hover .holo-sheen { opacity: .6; animation-duration: 2.4s; }
@keyframes sheenMove { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 100%; } }
.detail-modes { gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
.album-show .as-label { font-size: 11.5px; color: var(--text-3); padding: 0 6px 0 8px; align-self: center; position: relative; z-index: 1; }

/* ===== v8 ===== */
.holo-back:has(.img-back) { box-shadow: none; background: none; overflow: visible; }

/* ===== v9：召喚演出美化 ===== */
.summon-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.summon-nebula { position: absolute; inset: 0; overflow: hidden; }
.summon-nebula i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: .35; mix-blend-mode: screen; transition: background 1.2s; }
.summon-nebula i:nth-child(1) { left: -20vmax; top: -25vmax; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 60%, #3b2a6e), transparent 65%); animation: nebA 26s ease-in-out infinite alternate; }
.summon-nebula i:nth-child(2) { right: -25vmax; bottom: -30vmax; background: radial-gradient(circle, #1f4a78, transparent 65%); animation: nebB 32s ease-in-out infinite alternate; }
.summon-nebula i:nth-child(3) { left: 30%; top: 40%; width: 40vmax; height: 40vmax; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 40%, #6a2d5c), transparent 65%); opacity: .22; animation: nebA 20s ease-in-out infinite alternate-reverse; }
@keyframes nebA { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@keyframes nebB { to { transform: translate(-10vmax, -5vmax) scale(.9); } }
.summon-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0, 0, 0, .65)); pointer-events: none; z-index: 2; }
.summon .sigil { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--rc) 70%, transparent)); }
.summon.in .sigil { animation: sigilIn 1.3s cubic-bezier(.2, .8, .2, 1) both, spinC 60s linear 1.3s infinite; }
@keyframes sigilIn { from { transform: translate(-50%, -50%) scale(.55) rotate(-60deg); opacity: 0; } to { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: .6; } }
.summon.ssr-burst .sigil { animation: spinC 5s linear infinite; opacity: .95; }
.summon-glow { mix-blend-mode: screen; }
.summon-top, .summon-stage, .summon-strip, .summon-bottom { z-index: 3; }
.summon-close { z-index: 4; }
.summon-title { position: relative; padding-bottom: 10px; }
.summon-title b { text-shadow: 0 0 18px color-mix(in srgb, var(--rc) 60%, transparent); transition: text-shadow 1s; }
.st-orn { position: absolute; left: 0; bottom: 0; width: 140px; height: 1px; background: linear-gradient(90deg, var(--rc), transparent); transition: background 1s; }
.st-orn::before { content: ''; position: absolute; left: 0; top: -3px; width: 7px; height: 7px; transform: rotate(45deg); background: var(--rc); box-shadow: 0 0 8px var(--rc); }
.summon-status { box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 25%, transparent), 0 0 24px -6px color-mix(in srgb, var(--rc) 60%, transparent); transition: box-shadow 1s; }

/* 卡背：去掉深色底框，光暈貼著卡片形狀 */
.slot .tcg-back.img-back { box-shadow: none !important; }
.slot .tcg-back.img-back img { transition: filter .6s; }
.slot.charging .tcg-back.img-back img, .slot.ready .tcg-back.img-back img { filter: var(--back-filter, none) drop-shadow(0 0 2px #fff) drop-shadow(0 0 22px var(--rc, #c9d6f0)) drop-shadow(0 0 50px color-mix(in srgb, var(--rc, #c9d6f0) 50%, transparent)); }
.slot.charging .tcg-back:not(.img-back), .slot.ready .tcg-back:not(.img-back) { box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 0 30px var(--rc, #c9d6f0), 0 0 70px color-mix(in srgb, var(--rc, #c9d6f0) 45%, transparent); }
.back-sheen { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .55) 48%, color-mix(in srgb, var(--rc, #fff) 60%, transparent) 52%, transparent 65%) ; background-size: 300% 100%; background-position: 120% 0; opacity: 0; }
.back-sheen.rounded { border-radius: 12px; }
.slot.charging .back-sheen, .slot.ready .back-sheen { opacity: 1; animation: backSheen 2.2s ease-in-out infinite; }
.slot.ready .back-sheen { animation-duration: .9s; }
@keyframes backSheen { from { background-position: 120% 0; } to { background-position: -20% 0; } }
.slot.ready::before { width: 200%; height: 200%; filter: blur(14px); transition: background .4s; }
.slot.ready:not(.flipped) .slot-flip { animation: tremble .18s linear infinite; }
@keyframes tremble { 0%, 100% { transform: translate(0, 0) scale(1.02); } 25% { transform: translate(-1.5px, 1px) scale(1.02); } 50% { transform: translate(1.5px, -1px) scale(1.025); } 75% { transform: translate(-1px, -1.5px) scale(1.02); } }
.slot.upgrade .slot-flip { animation: upgradePop .45s cubic-bezier(.3, 1.8, .5, 1) !important; }
@keyframes upgradePop { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1.02); } }

/* 翻牌：抬起、帶一點透視甩過去 */
.slot.flipped:not(.shown) .slot-flip { animation: flipPop 1s cubic-bezier(.2, .9, .25, 1) both; }
@keyframes flipPop {
  0% { transform: rotateY(0) scale(1.02); }
  35% { transform: translateZ(140px) rotateY(110deg) rotateZ(-4deg) scale(1.12); }
  70% { transform: translateZ(40px) rotateY(195deg) scale(1.04); }
  100% { transform: rotateY(180deg) scale(1); }
}
.slot.flipped:not(.shown) .slot-face.front::after { content: ''; position: absolute; inset: 0; border-radius: 12px; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .7) 47%, color-mix(in srgb, var(--rc) 70%, transparent) 53%, transparent 70%); background-size: 300% 100%;
  animation: frontGlint 1.1s ease-out .75s both; }
@keyframes frontGlint { from { background-position: 130% 0; opacity: 1; } to { background-position: -30% 0; opacity: 0; } }
.slot.r-SSR.flipped .tcg-inner { box-shadow: 0 0 0 1.5px rgba(255, 230, 160, .7), 0 20px 50px rgba(0, 0, 0, .6), 0 0 60px rgba(255, 200, 110, .55), 0 0 120px rgba(255, 140, 200, .25); }

/* 光柱 */
.summon-pillar { position: absolute; top: -10%; bottom: -10%; width: 220px; transform: translateX(-50%); pointer-events: none; z-index: 1; mix-blend-mode: screen;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rc) 50%, transparent) 30%, rgba(255, 255, 255, .9) 50%, color-mix(in srgb, var(--rc) 50%, transparent) 70%, transparent);
  -webkit-mask: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent); mask: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
  animation: pillar 1.6s cubic-bezier(.2, .8, .3, 1) forwards; }
.summon-pillar.SSR { width: 320px; }
@keyframes pillar { 0% { opacity: 0; transform: translateX(-50%) scaleX(.05); } 15% { opacity: 1; transform: translateX(-50%) scaleX(1); } 100% { opacity: 0; transform: translateX(-50%) scaleX(.2); } }
.summon.shake .summon-stage { animation: screenShake .5s linear; }
@keyframes screenShake { 10%, 50%, 90% { transform: translate(-4px, 2px); } 30%, 70% { transform: translate(4px, -2px); } }

/* 十連：翻開後的名字字幕 */
.spot-cap { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; white-space: nowrap; padding: 6px 16px 6px 8px; border-radius: 99px;
  background: rgba(10, 10, 18, .55); border: 1px solid color-mix(in srgb, var(--rc, #fff) 40%, transparent); backdrop-filter: blur(8px); animation: capIn .5s cubic-bezier(.3, 1.5, .5, 1) .5s both; }
.spot-cap b { font-family: var(--f-serif); letter-spacing: .12em; font-size: 15px; }
.spot-cap.r-SSR b { background: linear-gradient(90deg, #fff3c4, #f5c86a, #ffd3ec, #f5c86a); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: shimmerText 2s linear infinite; }
@keyframes capIn { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.9); } }
@keyframes shimmerText { to { background-position: -200% 0; } }
.summon-strip .sm-cell.got { animation: miniPop .5s cubic-bezier(.3, 1.8, .5, 1); }
.summon-actions .btn.primary { box-shadow: 0 0 24px -4px rgba(243, 220, 159, .6); }

/* =====================================================================
   v10：平面化（實色表面、實色按鈕；拿掉毛玻璃、光暈與厚重陰影）
   ===================================================================== */
:root[data-theme] { --shadow-1: none; --shadow-2: 0 14px 36px -16px rgba(0, 0, 0, .35); --primary-shadow: none; --r-lg: 22px; }
:root[data-theme="night"] {
  --surface: #15161d; --surface-solid: #15161d; --surface-2: rgba(255, 255, 255, .04); --surface-3: rgba(255, 255, 255, .075);
  --line: rgba(214, 186, 128, .14); --line-soft: rgba(255, 255, 255, .06);
  --primary-bg: #d6b475; --gold-grad: #d6b475; --primary-text: #1b150a;
}
:root[data-theme="day"] {
  --surface: #fffcf6; --surface-solid: #fffcf6; --line-soft: rgba(70, 52, 22, .07);
  --primary-bg: #3b5a8f; --gold-grad: #a47b3a;
}
:root[data-theme="lavender"] { --surface: #fcfdfd; --surface-solid: #fcfdfd; --primary-bg: #767892; --gold-grad: #a0b1de; }
:root[data-theme="coral"] { --surface: #ffffff; --surface-solid: #ffffff; --primary-bg: #e95453; --gold-grad: #75d2d7; }

body { background-image: none; }
.rail { background: var(--surface); border-color: var(--line-soft); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; border-radius: 24px; }
.brand .seal-svg { filter: none; }
.nav a { border-radius: 16px; }
.nav a.on { box-shadow: none; }
.ts-knob { box-shadow: none; }
.panel { backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; border-color: var(--line-soft); }
.btn, .btn.primary, .icon-btn { box-shadow: none; }
.btn:hover, .btn:active { transform: none; }
.btn.primary:hover { filter: none; background: color-mix(in srgb, var(--primary-bg) 86%, #fff); }
.seg { background: var(--surface-2); border-color: var(--line-soft); }
.seg > .pill, .seg button.on, .icon-btn.on { box-shadow: none; }
.tabs > .pill { background: var(--surface-3); box-shadow: none; }
.tabs button.on { box-shadow: none; }
.field { box-shadow: none; }
.field:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 40%, transparent); }
.chip { backdrop-filter: none; background: var(--surface-2); border-color: var(--line-soft); }
.home .chip, .home .glass { backdrop-filter: blur(10px); }
.toast { box-shadow: none; border: 1px solid var(--line); }
.toast-dot, .toast-ok .toast-dot, .toast-warn .toast-dot, .toast-error .toast-dot { box-shadow: none; }
.modal-backdrop { backdrop-filter: none; background: rgba(5, 6, 10, .5); }
.modal { box-shadow: var(--shadow-2); }
.page-nav { box-shadow: none; background: var(--surface); }
.page-nav:hover { transform: none; background: var(--surface-3); }
.page-nav.hover { box-shadow: 0 0 0 2px var(--gold); }
.bg-tile:hover { transform: none; box-shadow: none; border-color: var(--line-strong); }
.hero-status i, .hero-status.warn i, .hero-status.demo i { box-shadow: none; }

/* ---- 召喚頁 ---- */
.banner-list { gap: 10px; }
.banner-item { border-radius: 14px; position: relative; padding: 11px 12px 11px 16px; }
.banner-item:hover { transform: none; }
.banner-item.on { background: var(--surface-2); border-color: transparent; }
.banner-item.on::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--gold); }
.banner-hero { background: var(--surface); box-shadow: none; border-color: var(--line-soft); }
.banner-hero::before { background: linear-gradient(90deg, var(--surface-solid) 34%, color-mix(in srgb, var(--surface-solid) 55%, transparent) 60%, transparent); }
.banner-hero::after { content: ''; position: absolute; z-index: -1; right: -90px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid var(--line-soft); outline: 1px solid var(--line-soft); outline-offset: 36px; pointer-events: none; }
.hero-bg img { opacity: .28; }
.hero-outline { -webkit-text-stroke: 1px var(--line); opacity: .9; }
.hero-name { text-shadow: none; }
.hero-art::after { width: 1px; opacity: .8; }
.hero-placeholder { filter: none; }
.hero-placeholder .tcg-back { box-shadow: none; }
.hero-rates .rar-badge { box-shadow: none; }
/* 保底條：十格一段的扁平刻度 */
.pity-bar { height: 8px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--surface-3) 0 calc(10% - 3px), transparent calc(10% - 3px) 10%); }
.pity-bar i { background: var(--gold); border-radius: 0; -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(34px - 3px), transparent calc(34px - 3px) 34px); mask: repeating-linear-gradient(90deg, #000 0 calc(34px - 3px), transparent calc(34px - 3px) 34px); }
.summon-btns .btn { border-radius: 14px; padding: 13px 26px; }
.summon-btns .btn:not(.primary) { background: transparent; border: 1.5px solid var(--line-strong); }
.summon-btns .btn:not(.primary):hover { background: var(--surface-2); border-color: var(--gold); }
.summon-btns .btn:hover { transform: none; }
.multi-wrap { border-radius: 16px; background: var(--surface-2); border-color: var(--line-soft); }
.multi-wrap .btn.primary { border-radius: 12px; }
.hero-recent { background: var(--surface-solid); backdrop-filter: none; border-color: var(--line-soft); border-radius: 14px; }
.mini { border-radius: 5px; }
.sec { color: var(--text); }
.sec::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: var(--gold); }
.roll-out { border-style: solid; border-color: var(--line-soft); }

/* ---- 卡冊 ---- */
.binder { box-shadow: none; border-radius: 22px; }
.binder[data-color="crimson"] { --leather: #8a2f3b; }
.binder[data-color="navy"] { --leather: #2c3e63; }
.binder[data-color="forest"] { --leather: #2f5243; }
.binder[data-color="ivory"] { --leather: #d9ccae; }
.binder[data-color="plum"] { --leather: #573367; }
.binder[data-color="walnut"] { --leather: #6b4a32; }
.book { box-shadow: none !important; border-radius: 6px; }
.book:hover { transform: translateY(-10px); }
.book-band { background: var(--gold); box-shadow: none; }
.book-title { text-shadow: none; }
.shelf-board { background: var(--wood-2); box-shadow: none; height: 12px; border-radius: 6px; }
.page { background: var(--album-page); }
.page.left, .page.right { box-shadow: none; }
.page.left { border-right: 1px solid var(--line-soft); }
.rings { background: color-mix(in srgb, var(--leather, #333) 80%, #000); }
.rings i { background: #d5d7dd; box-shadow: none; height: 10px; width: 30px; }
.pocket { box-shadow: none; border: 1px dashed color-mix(in srgb, var(--ink-2) 22%, transparent); }
.pocket:has(.tcg) { border-color: transparent; }
.sleeve::before { background: rgba(255, 255, 255, .28); border-bottom-color: rgba(255, 255, 255, .45); }
.sleeve::after { background: rgba(255, 255, 255, .16); }
.tray-handle { box-shadow: none; }
.view.album:not([data-mode="shelf"]) .tray { box-shadow: 0 -1px 0 var(--line-soft); border: 1px solid var(--line-soft); border-bottom: 0; }

/* ---- 工坊 / 設定 ---- */
.ws-sec h4 { font-family: var(--f-sans); font-weight: 700; font-size: 14px; letter-spacing: .08em; }
.note { box-shadow: none; }
.hero-placeholder .tcg-back.img-back .back-img { filter: var(--back-filter); }
.hero-placeholder { animation-duration: 8s; }
.back-sw img { filter: var(--back-filter); }

/* ===== v11：提示詞庫 ===== */
.lib-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.lib-top .lib-tabs { flex: 1 1 100%; }
.lib-search { display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 200px; color: var(--text-3); }
.lib-search svg { width: 15px; height: 15px; }
.lib-search .field { padding: 7px 12px; font-size: 13px; }
.lib-chips { max-height: 260px; overflow-y: auto; align-items: center; }
.lib-h { flex-basis: 100%; font-size: 11.5px; letter-spacing: .1em; color: var(--text-3); padding: 6px 2px 0; }
.lib-h:first-child { padding-top: 0; }
.lib-chip em { display: none; font-style: normal; font-size: 10.5px; color: var(--text-3); margin-left: 6px; }
.lib-chips.searching .lib-chip em { display: inline; }
.lib-chip[hidden], .lib-h[hidden] { display: none; }

/* ===== v11：首頁輪播指示器（最多 7 顆 + 縮圖跳轉） ===== */
.slide-dots { max-width: 150px; }
.slide-dots button.far { width: 5px; height: 5px; align-self: center; opacity: .6; }
.slide-count { border: 0; background: none; padding: 0 10px 0 2px; font-family: var(--f-cond); font-size: 13px; letter-spacing: .08em; color: var(--text-2); font-variant-numeric: tabular-nums; }
.slide-count:hover { color: var(--text); }
.slide-count.hidden { display: none; }
.slide-thumbs { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: min(560px, 80vw); display: flex; gap: 8px; overflow-x: auto; padding: 10px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line-soft); backdrop-filter: blur(12px); scrollbar-width: thin; }
.slide-thumbs.hidden { display: none; }
.slide-thumbs button { position: relative; flex: none; width: 58px; aspect-ratio: 2 / 3; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2); }
.slide-thumbs button.on { border-color: var(--gold); }
.slide-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-thumbs b { position: absolute; left: 4px; bottom: 2px; font: 600 11px var(--f-cond); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.slide-thumbs em { position: absolute; right: 3px; top: 3px; font-style: normal; font-size: 9px; padding: 0 4px; border-radius: 4px; background: rgba(0,0,0,.55); color: #9ff0cf; }

/* ===== v11：特效風格預設 ===== */
.fx-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-preset { cursor: pointer; }
.fx-preset:hover { border-color: var(--gold); color: var(--text); }

/* ===== v12：空白處點擊波紋 ===== */
.click-wave { position: fixed; z-index: 9999; width: 0; height: 0; pointer-events: none; }
.click-wave::before, .click-wave::after { content: ''; position: absolute; left: -40px; top: -40px; width: 80px; height: 80px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--gold) 80%, transparent); animation: clickWave .8s cubic-bezier(.2, .7, .3, 1) forwards; }
.click-wave::after { animation-delay: .12s; border-width: 1px; opacity: 0; }
@keyframes clickWave { 0% { transform: scale(.1); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }

/* ===== v13：開場動畫 ===== */
.boot-cover { position: fixed; inset: 0; z-index: 10001; background: #04040a; transition: opacity .45s; }
.boot-cover.out { opacity: 0; }
.intro { position: fixed; inset: 0; z-index: 10000; cursor: pointer; transition: opacity .45s; -webkit-tap-highlight-color: transparent; }
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro.revealing { pointer-events: none; cursor: default; }
.intro.out { opacity: 0; }
.intro-hint { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); margin: 0; color: rgba(215, 225, 255, .65); font-family: var(--f-serif); font-size: 14px; letter-spacing: .45em; white-space: nowrap; opacity: 0; transition: opacity 1.4s; pointer-events: none; }
.intro-hint.show { opacity: 1; animation: hintBreath 3.2s ease-in-out infinite; }
.intro-hint.gone { opacity: 0 !important; animation: none; transition-duration: .4s; }
@keyframes hintBreath { 50% { opacity: .35; } }
.intro-enter { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 38px 12px; border-radius: 14px;
  color: #fff; background: rgba(12, 10, 24, .42); border: 1px solid rgba(200, 220, 255, .45); backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px rgba(255, 150, 220, .15), 0 0 30px rgba(170, 140, 255, .3); opacity: 0; transform: translate(-50%, -50%) translateY(28px);
  transition: opacity .9s cubic-bezier(.2, .8, .2, 1), transform .9s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.intro-enter b { font-family: var(--f-serif); font-size: 24px; font-weight: 600; letter-spacing: .6em; margin-right: -.6em; }
.intro-enter small { font-family: var(--f-display); font-size: 10px; letter-spacing: .5em; margin-right: -.5em; color: rgba(200, 220, 255, .7); }
.intro-enter.show { opacity: 1; transform: translate(-50%, -50%); }
.intro-enter.show:hover { box-shadow: 0 0 0 1px rgba(255, 150, 220, .35), 0 0 44px rgba(170, 140, 255, .55); }
.intro-enter.gone { opacity: 0; transform: translate(-50%, -50%) scale(1.25); transition-duration: .5s; pointer-events: none; }
.intro-skip { position: absolute; top: 18px; right: 22px; border: 0; background: none; color: rgba(200, 210, 240, .5); font-size: 13px; letter-spacing: .2em; padding: 6px 10px; transition: color .2s, opacity .3s; }
.intro-skip:hover { color: #fff; }
.intro.revealing .intro-skip { opacity: 0; }
.brand.logo-absorb .seal-svg { animation: logoAbsorb 1.3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes logoAbsorb {
  0% { transform: scale(1); filter: none; }
  25% { transform: scale(1.3) rotate(-10deg); filter: drop-shadow(0 0 10px #ff9ad5) drop-shadow(0 0 18px #8ff3ff); }
  100% { transform: scale(1); filter: none; }
}

/* ===== v14：選卡依卡冊分類 ===== */
.pick-shelf { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; }
.ps-albums { display: flex; flex-direction: column; gap: 4px; max-height: 62vh; overflow-y: auto; padding-right: 4px; border-right: 1px solid var(--line-soft); }
.ps-album { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text-2); text-align: left; font-size: 13.5px; }
.ps-album span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-album b { font-weight: 500; font-size: 12px; color: var(--text-3); }
.ps-album:hover { background: var(--surface-2); color: var(--text); }
.ps-album.on { background: var(--surface-3); color: var(--text); }
.ps-album.on::before { content: ''; width: 3px; align-self: stretch; margin: 2px 0 2px -6px; border-radius: 3px; background: var(--gold); }
.ps-dot { width: 10px; height: 14px; border-radius: 3px; flex: none; background: var(--line-strong); }
.ps-album.all .ps-dot { background: var(--gold); border-radius: 50%; height: 10px; }
.ps-album.loose .ps-dot { background: none; border: 1.5px dashed var(--text-3); }
.ps-dot.c-crimson { background: #8a2f3b; } .ps-dot.c-navy { background: #2c3e63; } .ps-dot.c-forest { background: #2f5243; }
.ps-dot.c-ivory { background: #d9ccae; } .ps-dot.c-plum { background: #573367; } .ps-dot.c-walnut { background: #6b4a32; }
.ps-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ps-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ps-tools .filter-row { margin: 0; }
.ps-search { flex: 1; min-width: 160px; padding: 7px 12px; font-size: 13px; }
.ps-grid { max-height: 58vh; overflow-y: auto; padding: 2px; }
.ps-grid .bg-grid { max-height: none; overflow: visible; }
.ps-grid .pick-h { margin: 12px 2px 8px; font-size: 12px; color: var(--text-3); letter-spacing: .1em; font-weight: 500; }
.ps-grid .pick-h:first-child { margin-top: 0; }
@media (max-width: 700px) { .pick-shelf { grid-template-columns: 1fr; } .ps-albums { flex-direction: row; max-height: none; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line-soft); padding-bottom: 6px; } .ps-album { flex: none; } }

.click-wave-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }
.bg-tile .pk-tags { position: absolute; left: 6px; top: 6px; display: flex; gap: 3px; flex-wrap: wrap; }
.bg-tile .pk-tags b { font-size: 9.5px; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: rgba(0, 0, 0, .6); color: #9ff0cf; letter-spacing: .04em; }
.ps-album.lives .ps-dot { background: #6fe0b5; border-radius: 50%; height: 10px; }
.ps-note { margin: 0 0 10px; }

/* ===== v15：更多稀有度標誌 ===== */
.tcg-rarity .rb-ico { fill: var(--rb-c); filter: drop-shadow(0 0 3px var(--rb-glow)); }
.rb-crown { padding: 0 4px 2px; gap: 2px; }
.rb-crown .rb-ico { width: 20px; height: 10px; }
.rb-crown b { font-size: 11px; background: linear-gradient(180deg, #fff, var(--rb-c)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: .4px var(--rb-edge); filter: drop-shadow(0 0 4px var(--rb-glow)); }
.rb-wing { display: inline-flex; align-items: center; gap: 1px; }
.rb-wing .rb-ico { width: 14px; height: 10px; }
.rb-wing .rb-ico.r { transform: scaleX(-1); }
.rb-wing b { font-size: 11px; color: #fff; text-shadow: 0 0 2px var(--rb-edge), 0 0 7px var(--rb-glow); }
.rb-hex { width: 32px; height: 30px; }
.rb-hex .rb-shape { position: absolute; inset: 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: linear-gradient(150deg, rgba(255, 255, 255, .9), color-mix(in srgb, var(--rb-c) 70%, transparent) 55%, var(--rb-edge)); filter: drop-shadow(0 0 5px var(--rb-glow)); }
.rb-hex .rb-shape::after { content: ''; position: absolute; inset: 0; clip-path: polygon(25% 0, 75% 0, 50% 50%); background: rgba(255, 255, 255, .45); }
.rb-hex b { font-size: 8.5px; letter-spacing: 0; }
.rb-neon { padding: 3px 8px; border-radius: 6px; border: 1.5px solid var(--rb-c); background: rgba(8, 8, 16, .45); box-shadow: 0 0 8px var(--rb-glow), inset 0 0 6px var(--rb-glow); }
.rb-neon b { color: #fff; text-shadow: 0 0 3px var(--rb-c), 0 0 8px var(--rb-glow); }
.rb-moon { width: 34px; height: 30px; }
.rb-moon .rb-ico { position: absolute; inset: 0; width: 30px; height: 30px; }
.rb-moon b { position: relative; left: 3px; font-size: 9px; color: #fff; text-shadow: 0 0 2px var(--rb-edge), 0 0 6px var(--rb-glow); }
.rb-rosette { width: 34px; height: 34px; }
.rb-rosette .rb-ico { position: absolute; inset: 0; width: 34px; height: 34px; opacity: .9; animation: spinSlow 18s linear infinite; }
.rb-rosette .rb-ico ellipse { fill: color-mix(in srgb, var(--rb-c) 70%, white); opacity: .85; }
.rb-rosette .rb-core { fill: color-mix(in srgb, var(--rb-edge) 85%, black); }
.rb-rosette b { position: relative; font-size: 8px; letter-spacing: 0; color: #fff; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.rb-orbit { padding: 5px 9px; }
.rb-orbit b { color: #fff; text-shadow: 0 0 2px var(--rb-edge), 0 0 7px var(--rb-glow); }
.rb-ring { position: absolute; inset: 2px -4px; border-radius: 50%; border: 1px solid var(--rb-c); transform: rotate(-14deg); box-shadow: 0 0 6px var(--rb-glow); }
.rb-ring::after { content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px var(--rb-c); top: -2px; left: 50%; offset-path: none; animation: orbitDot 3.2s linear infinite; }
@keyframes orbitDot { 0% { top: -2px; left: 48%; } 25% { top: 40%; left: 96%; } 50% { top: 88%; left: 48%; } 75% { top: 40%; left: -2%; } 100% { top: -2px; left: 48%; } }
.rb-stamp { width: 36px; height: 36px; border-radius: 50%; border: 1.5px dashed var(--rb-edge); outline: 1px solid var(--rb-edge); outline-offset: -5px; background: rgba(255, 255, 255, .72); transform: rotate(-12deg); gap: 0; align-content: center; }
.rb-stamp b { font-size: 9px; color: var(--rb-edge); letter-spacing: 0; }
.rb-stamp small { font-family: var(--f-sans); font-size: 4.5px; color: var(--rb-edge); letter-spacing: 0; }
.rb-pixel { padding: 3px 7px; background: var(--rb-c); color: #120f1c; font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: .04em;
  clip-path: polygon(0 3px, 3px 3px, 3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px));
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .25), inset 2px 2px 0 rgba(255, 255, 255, .45); }
.rb-hanko { width: 28px; height: 28px; border-radius: 4px 6px 5px 4px; background: color-mix(in srgb, var(--rb-edge) 80%, #8a1020); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), 0 0 8px var(--rb-glow); transform: rotate(-4deg); }
.rb-hanko b { font-family: var(--f-serif); font-weight: 900; font-size: 16px; color: #fff4ec; letter-spacing: 0; }
.rs-demo .rb-stamp, .rs-demo .rb-hanko { transform: none; }

/* ===== v15：自訂游標（設定 → 外觀 → 游標樣式） ===== */
:root[data-cursor] body { cursor: var(--cur-default); }
:root[data-cursor] :is(a, button, select, summary, label, [role="button"], .btn, .icon-btn, .chip, .tcg, .bg-tile, .book, .mini-book, .slot.flipped, .banner-item, .lib-chip, .ps-album, .rs-sw, .back-sw, .film-sw, .finish-sw, .frame-sw, .choice, .page-nav, .tray-handle, .intro, input[type="checkbox"], input[type="range"]) { cursor: var(--cur-pointer); }
:root[data-cursor] :is(input:not([type="checkbox"]):not([type="range"]), textarea, [contenteditable]) { cursor: text; }
.cur-custom { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.cur-custom code { font-size: 11.5px; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); }
.cur-slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cur-prev { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 1px dashed var(--line-strong);
  background: repeating-conic-gradient(var(--surface-3) 0 25%, transparent 0 50%) 0 0 / 10px 10px; }
.cur-prev img { max-width: 36px; max-height: 36px; image-rendering: pixelated; }
.cur-meta { display: flex; flex-direction: column; min-width: 150px; flex: 1; }
.cur-meta b { font-size: 13px; }
.cur-meta small { font-size: 11.5px; color: var(--text-3); }
.cur-hot { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.cur-hot .field { width: 56px; padding: 5px 6px; font-size: 12px; }

/* ===== v16：隨機命名 ===== */
.name-row { display: flex; gap: 6px; align-items: center; }
.name-row .field { flex: 1; min-width: 0; }
.nc-dice { padding: 8px 12px; font-size: 16px; }

/* ===== v17：線上版 / 本機版 ===== */
:root[data-online] .local-only, :root:not([data-online]) .online-only { display: none; }
:root[data-online] .st-run { display: none; }
.update-bar { position: fixed; z-index: 9000; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: 13.5px; animation: rise .5s var(--ease); }

/* ===== v18：繁 / 簡切換 ===== */
:root[data-lang="hans"] {
  --f-sans: "Noto Sans SC", "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Noto Serif SC", "Noto Serif TC", "Songti SC", serif;
  --f-display: "Cinzel", "Noto Serif SC", "Noto Serif TC", serif;
  --f-cond: "Oswald", "Noto Sans SC", "Noto Sans TC", sans-serif;
  --f-script: "Cormorant Garamond", "Noto Serif SC", "Noto Serif TC", serif;
}
.lang-switch { width: 52px; height: 30px; margin-bottom: 6px; padding: 0 3px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-3);
  display: flex; align-items: center; position: relative; font-size: 12px; color: var(--text-3); }
.lang-switch b { flex: 1; position: relative; z-index: 1; font-weight: 600; transition: color .3s; }
.lang-switch::before { content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--primary-bg); transition: transform .45s var(--ease); }
:root[data-lang="hans"] .lang-switch::before { transform: translateX(22px); }
:root:not([data-lang="hans"]) .lang-switch .ls-hant, :root[data-lang="hans"] .lang-switch .ls-hans { color: var(--primary-text); }

/* ===== v19：卡背色調、橫式／方形卡背、更華麗的召喚演出 ===== */
/* 卡背色調（原圖是星夜藍紫；「跟隨主題」= 沿用各主題的 --back-filter） */
:root:root[data-back-tone="original"] { --back-filter: saturate(1.04); }
:root:root[data-back-tone="rose"] { --back-filter: url(#bt-rose); }
:root:root[data-back-tone="crimson"] { --back-filter: url(#bt-crimson); }
:root:root[data-back-tone="gold"] { --back-filter: url(#bt-gold); }
:root:root[data-back-tone="ice"] { --back-filter: url(#bt-ice); }
:root:root[data-back-tone="silver"] { --back-filter: url(#bt-silver); }
:root:root[data-back-tone="noir"] { --back-filter: url(#bt-noir); }

.back-tabs { margin: 2px 0 12px; }
.back-grid[data-shape="l"] { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.back-grid[data-shape="s"] { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.back-grid[data-shape="l"] .back-sw :is(img, .bs-default) { aspect-ratio: 3 / 2; }
.back-grid[data-shape="s"] .back-sw :is(img, .bs-default) { aspect-ratio: 1; }
.back-tone { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.bt-label { width: 100%; font-size: 12.5px; color: var(--text-2); margin-bottom: 2px; }
.bt-sw { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.bt-sw:hover { transform: translateY(-1px); color: var(--text); }
.bt-sw i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.bt-sw small { font-size: 12px; }
.bt-sw.on { border-color: var(--gold); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }

/* 前層粒子（蓋在卡片上） */
.summon-fx.front { z-index: 3; }

/* 地面魔法陣：躺平的第二層法陣，慢慢轉 */
.summon-floor { position: absolute; left: 50%; top: 76%; width: min(125vmin, 1150px); aspect-ratio: 1; transform: translate(-50%, -50%) perspective(1100px) rotateX(73deg); pointer-events: none; opacity: .5; transition: opacity .6s; }
.summon .summon-floor .sigil { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform: none; opacity: 1; animation: floorSpin 46s linear infinite; filter: drop-shadow(0 0 6px var(--rc)) drop-shadow(0 0 18px color-mix(in srgb, var(--rc) 60%, transparent)); }
.summon-floor::after { content: ''; position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rc) 55%, transparent), transparent 70%); filter: blur(10px); transition: background 1s; }
@keyframes floorSpin { to { transform: rotate(360deg); } }
.summon.ssr-burst .summon-floor { opacity: .95; }
.summon.ssr-burst .summon-floor .sigil { animation-duration: 5s; }

/* SSR：背後轉動的稜光 */
.summon-prism { position: absolute; left: 50%; top: 52%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%); pointer-events: none; mix-blend-mode: screen; opacity: 0; transition: opacity .8s;
  background: conic-gradient(from 0deg, rgba(255, 214, 130, .28), transparent 8%, rgba(255, 158, 210, .26) 16%, transparent 24%, rgba(169, 184, 255, .26) 33%, transparent 41%, rgba(199, 155, 255, .26) 50%, transparent 58%, rgba(255, 214, 130, .28) 66%, transparent 74%, rgba(255, 158, 210, .26) 83%, transparent 91%, rgba(255, 214, 130, .28));
  mask: radial-gradient(circle, #000 0, rgba(0, 0, 0, .6) 18%, transparent 48%); animation: spinC 16s linear infinite; }
.summon.ssr-glory .summon-prism { opacity: 1; }

/* 翻開前的一瞬間：四周暗下、卡片吸氣 */
.summon .summon-glow, .summon .summon-nebula, .summon .summon-floor, .summon .summon-bg > .sigil { transition: opacity .3s; }
.summon.hush .summon-glow, .summon.hush .summon-nebula { opacity: .08 !important; }
.summon.hush .summon-bg > .sigil, .summon.hush .summon-floor { opacity: .15 !important; }
.slot.inhale .slot-flip { animation: inhale .42s cubic-bezier(.5, 0, .75, 0) forwards !important; }
@keyframes inhale { to { transform: scale(.9); } }

/* 卡片出現：從一點光凝聚成形 */
@keyframes spotIn { 0% { opacity: 0; transform: scale(.25); filter: brightness(5) blur(8px); } 55% { opacity: 1; filter: brightness(1.8) blur(0); } 100% { filter: none; } }

/* 翻開後的光環（SR / SSR） */
.slot-halo { position: absolute; left: 50%; top: 50%; width: calc(100% + var(--sh, 300px) * .5); aspect-ratio: 1; translate: -50% -50%; transform: scale(.3); border-radius: 50%; pointer-events: none; opacity: 0; z-index: -1;
  background: conic-gradient(from 0deg, var(--rc), #fff 12%, var(--rc) 25%, transparent 40%, var(--rc) 55%, #fff 68%, var(--rc) 80%, transparent 92%, var(--rc));
  mask: radial-gradient(circle, transparent 46%, #000 50%, #000 54%, transparent 70%); filter: blur(5px); }
.slot.r-SSR .slot-halo { background: conic-gradient(from 0deg, #ffd98a, #fff6d8 10%, #ff9ed2 25%, #c79bff 40%, #a9b8ff 55%, #fff 65%, #ffd98a 80%, #ff9ed2 90%, #ffd98a); }
.slot.r-SR.flipped .slot-halo, .slot.r-SSR.flipped .slot-halo { opacity: .9; transform: scale(1); transition: transform 1s cubic-bezier(.2, .9, .25, 1), opacity .5s; animation: haloSpin 7s linear infinite; }
.slot.shown .slot-halo { opacity: .55 !important; }
@keyframes haloSpin { to { rotate: 360deg; } }

/* 稀有度字樣 */
.rar-stamp { position: fixed; z-index: 6; transform: translate(-50%, -50%); pointer-events: none; text-align: center; white-space: nowrap; animation: stampIn 1.9s cubic-bezier(.2, .9, .3, 1) forwards; }
.rar-stamp b { display: block; font: italic 900 clamp(64px, 11vw, 150px) / 1 var(--f-display); letter-spacing: .04em; padding: 0 .1em;
  background: linear-gradient(180deg, #fff 15%, color-mix(in srgb, var(--rc) 80%, #fff) 55%, #fff 92%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px var(--rc)) drop-shadow(0 0 40px color-mix(in srgb, var(--rc) 60%, transparent)); }
.rar-stamp.r-SSR b { background: linear-gradient(100deg, #fff6d8 0%, #ffd27a 22%, #ff9ed2 45%, #b9a8ff 68%, #fff6d8 90%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
  animation: shimmerText 1.1s linear infinite; filter: drop-shadow(0 0 16px rgba(255, 205, 120, .95)) drop-shadow(0 0 60px rgba(255, 140, 200, .6)); }
.rar-stamp small { display: block; margin-top: 4px; font: 600 12px var(--f-display); letter-spacing: .55em; color: #fff; text-shadow: 0 0 10px var(--rc), 0 0 22px var(--rc); }
@keyframes stampIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(3.2); filter: blur(14px); }
  13% { opacity: 1; transform: translate(-50%, -50%) scale(.9); filter: blur(0); }
  21% { transform: translate(-50%, -50%) scale(1.05); }
  30%, 68% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -95%) scale(.85); filter: blur(5px); }
}
@media (prefers-reduced-motion: reduce) { .rar-stamp, .slot-halo, .summon-prism { display: none; } }

/* ===== v20：粒子小魚躍進卡面、卡背由光點聚出來 ===== */
.summon .slot.assembling { opacity: 0 !important; animation: none !important; }
.summon .slot.assembled { animation: backAssembled .45s ease-out; }
@keyframes backAssembled { from { opacity: 0; filter: brightness(2.4) saturate(.6); } }
/* 小魚在卡面裡游，卡片本身就不再上下飄（不然卡面和小魚會對不齊） */
.summon .slot.charging .slot-flip { animation: none; }
/* 蓄力時卡背稍微暗一點，卡面裡發光的小魚才看得清楚 */
.summon .slot.charging .tcg-back.img-back img { filter: var(--back-filter, saturate(1)) brightness(.7) drop-shadow(0 0 2px #fff) drop-shadow(0 0 22px var(--rc, #c9d6f0)); animation: backBreath 2.6s ease-in-out infinite; }
@keyframes backBreath { 50% { filter: var(--back-filter, saturate(1)) brightness(.84) drop-shadow(0 0 2px #fff) drop-shadow(0 0 30px var(--rc, #c9d6f0)); } }

/* ===== v21：召喚引導選擇 ===== */
.guide-pick .bt-label em { font-style: normal; color: var(--text-3, var(--text-2)); opacity: .75; margin-left: 6px; font-size: 11.5px; }
.gd-sw .gd-ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; box-shadow: none; background: var(--surface); font-style: normal; font-size: 13px; line-height: 1; color: var(--text-2); }
.gd-sw.on .gd-ic { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: var(--text); }

/* ===== v23：我的提示詞組（分類分頁、搜尋、精簡標籤、點一下加入 / 拿掉） ===== */
.groups-head .g-fold { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 2px 4px; color: var(--text); cursor: pointer; }
.groups-head .g-fold svg { width: 17px; height: 17px; color: var(--gold); }
.groups-head .g-fold b { font-family: var(--f-serif); letter-spacing: .08em; }
.g-count { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); font-size: 11.5px; color: var(--text-2); }
.g-chev { font-style: normal; font-size: 12px; color: var(--text-3); transition: transform .25s var(--ease); }
.groups.collapsed .g-chev { transform: rotate(-90deg); }
.groups.collapsed .groups-body, .groups.collapsed .g-tip, .groups.collapsed .g-view { display: none; }
.g-tip { font-size: 12px; }
.groups-body { display: grid; gap: 10px; margin-top: 10px; }
.g-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.g-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.g-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--text-2); transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease); }
.g-tabs button span { font-size: 11px; color: var(--text-3); }
.g-tabs button:hover { color: var(--text); }
.g-tabs button.on { background: var(--gold); border-color: var(--gold); color: var(--on-gold, #fff); }
.g-tabs button.on span { color: inherit; opacity: .75; }
.g-tabs button.drop { transform: scale(1.08); border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.g-search { width: 200px; flex: none; }
.gchip-list { display: flex; flex-wrap: wrap; gap: 7px; max-height: 260px; overflow: auto; padding: 2px; }
.gchip { --gc: var(--gold); display: inline-flex; align-items: stretch; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: var(--cur-grab, grab); transition: border-color .2s, background .2s, box-shadow .2s, transform .2s var(--ease), opacity .2s; }
.gchip:hover { border-color: color-mix(in srgb, var(--gc) 55%, var(--line)); transform: translateY(-1px); }
.gchip.dragging { opacity: .4; }
.gchip button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.gc-main { display: inline-flex; align-items: center; gap: 6px; padding: 5px 4px 5px 10px; font-size: 13px; }
.gc-main b { font-weight: 500; }
.gc-main em { font-style: normal; font-size: 10.5px; padding: 0 5px; border-radius: 6px; background: color-mix(in srgb, #e06a7a 18%, transparent); color: #c4485a; }
.gc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gc) 22%, transparent); }
.gc-star { color: var(--gold); font-size: 11px; }
.gc-more { padding: 0 9px 0 4px; color: var(--text-3); border-radius: 0 99px 99px 0; }
.gc-more:hover { color: var(--text); }
/* 已經在提示詞裡：填色亮起 */
.gchip.in { background: color-mix(in srgb, var(--gc) 16%, var(--surface)); border-color: var(--gc); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gc) 35%, transparent); }
.gchip.in .gc-main b::after { content: ' ✓'; color: var(--gc); font-weight: 600; }
.group.in { background: color-mix(in srgb, var(--gc) 10%, var(--surface)); border-color: color-mix(in srgb, var(--gc) 45%, var(--line)); }
.group .g-folder { margin-left: 6px; font-style: normal; font-size: 10.5px; font-weight: 400; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-3); }
.group-list { max-height: 340px; overflow: auto; padding: 2px; }
.g-empty { padding: 6px 2px; }
.g-note { margin-top: -2px; }
.gchip.c-blue, .group.c-blue { --gc: #6f9fe8; } .gchip.c-red { --gc: #e06a7a; } .gchip.c-green { --gc: #6cc49a; } .gchip.c-purple { --gc: #b48cf0; }
/* ⋯ 選單 */
.g-menu { position: fixed; z-index: 400; min-width: 168px; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-solid); box-shadow: var(--shadow-2, 0 12px 32px rgba(0,0,0,.18)); display: grid; gap: 1px; animation: rise .18s var(--ease); }
.g-menu button { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 9px; font-size: 13px; color: var(--text); cursor: pointer; }
.g-menu button:hover { background: var(--surface-2); }
.g-menu button.danger { color: #d0414f; }
.g-menu svg { width: 14px; height: 14px; }
.g-menu-sub { display: grid; gap: 1px; padding: 4px 0; margin: 2px 0; border-top: 1px solid var(--line-soft, var(--line)); border-bottom: 1px solid var(--line-soft, var(--line)); }
.g-menu-sub small { padding: 2px 10px; color: var(--text-3); font-size: 11px; }
@media (max-width: 720px) { .g-search { width: 100%; } .g-tip { display: none; } }

/* ===== v24：自訂 API 位址（進階） ===== */
.custom-api { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.custom-api summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); list-style: none; }
.custom-api summary::-webkit-details-marker { display: none; }
.custom-api summary::before { content: '▸'; font-size: 11px; color: var(--text-3); transition: transform .2s var(--ease); }
.custom-api[open] summary::before { transform: rotate(90deg); }
.custom-api[open] > *:not(summary) { animation: rise .3s var(--ease) backwards; }
.ca-badge { font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-3); }
.ca-badge.on { background: color-mix(in srgb, var(--gold) 22%, transparent); color: var(--gold-2, var(--gold)); }
.ca-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ca-checks li { display: grid; grid-template-columns: 22px auto 1fr; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.ca-checks li b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; color: #fff; background: var(--text-3); }
.ca-checks li.ok b { background: #4fae7d; } .ca-checks li.bad b { background: #d0414f; }
.ca-checks li em { font-style: normal; color: var(--text-3); font-size: 12px; text-align: right; }
.ca-note { margin: 4px 2px 0; color: var(--text-2); }
.ca-note.bad { color: #d0414f; }
