/* momo 日常 — 設計系統
 * 品牌色取自 momo 購物 App 2610.x：新識別漸層 #FF2966 → #F201C8 → #A600EB、
 * 介面重點色 #E40080／#D62872、淺灰底 #F2F2F2、白卡片；數字用 App 內附的 Roboto Medium。 */

@font-face {
  font-family: "momo-num";
  src: url("/fonts/momo-numbers.woff") format("woff");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0030-0039;
}

:root {
  color-scheme: light;
  --brand-1: #ff2966;
  --brand-2: #f5139f;
  --brand-3: #e80bc6;
  --brand-4: #a600eb;
  --g-brand: linear-gradient(118deg, var(--brand-1) 0%, var(--brand-2) 40%, var(--brand-3) 68%, var(--brand-4) 100%);
  --g-brand-v: linear-gradient(160deg, var(--brand-1) 0%, var(--brand-2) 38%, var(--brand-3) 66%, var(--brand-4) 100%);
  --g-soft: linear-gradient(118deg, #fff1f5 0%, #ffeefa 52%, #f5edff 100%);
  --pink: #e4007f;
  --pink-hover: #cf0074;
  --pink-press: #bc0753;
  --rose: #d62872;
  --pink-50: #fff3f9;
  --pink-100: #ffe4f1;
  --pink-200: #ffc4e1;
  --violet: #9600e6;
  --violet-50: #f5ecff;
  --yellow: #ffe600;
  --orange: #ff9403;
  --green: #0c9a68;
  --green-50: #e6f7ef;
  --amber: #c26600;
  --amber-50: #fff3e2;
  --red: #dd2726;
  --red-50: #ffeceb;
  --blue: #1769e0;
  --blue-50: #ebf3ff;
  --bg: #f2f2f2;
  --bg-2: #e9e9eb;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #fbfbfc;
  --line: #ebebee;
  --line-2: #dcdce1;
  --text: #222222;
  --text-2: #4b4b51;
  --text-3: #85858d;
  --text-4: #b3b3b9;
  --overlay: rgba(25, 10, 30, .42);
  --shadow-1: 0 1px 2px rgba(25, 10, 35, .04), 0 2px 10px rgba(25, 10, 35, .04);
  --shadow-2: 0 10px 30px rgba(25, 10, 35, .10);
  --shadow-3: 0 24px 64px rgba(25, 10, 35, .20);
  --shadow-pink: 0 8px 20px rgba(228, 0, 127, .24);
  --ring: 0 0 0 3px rgba(228, 0, 127, .22);
  --r-xs: 6px;
  --r-s: 8px;
  --r: 12px;
  --r-l: 16px;
  --r-xl: 22px;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei UI", "Microsoft JhengHei", "Heiti TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "momo-num", "Roboto", "Segoe UI", "Helvetica Neue", Arial, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --topbar-h: 60px;
  --sidebar-w: 220px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
[data-theme="dark"] {
  color-scheme: dark;
  --g-soft: linear-gradient(118deg, #2a1622 0%, #2a1530 52%, #21183a 100%);
  --pink: #ff2b95;
  --pink-hover: #ff4aa6;
  --pink-press: #e0137e;
  --rose: #ff5aa3;
  --pink-50: rgba(255, 43, 149, .10);
  --pink-100: rgba(255, 43, 149, .17);
  --pink-200: rgba(255, 43, 149, .32);
  --violet: #c27bff;
  --violet-50: rgba(194, 123, 255, .14);
  --green: #3fd196;
  --green-50: rgba(63, 209, 150, .12);
  --amber: #ffb54c;
  --amber-50: rgba(255, 181, 76, .13);
  --red: #ff6e63;
  --red-50: rgba(255, 110, 99, .13);
  --blue: #74adff;
  --blue-50: rgba(116, 173, 255, .13);
  --bg: #121015;
  --bg-2: #18151c;
  --surface: #1c1920;
  --surface-2: #242029;
  --surface-3: #201c25;
  --line: #2e2934;
  --line-2: #3c3644;
  --text: #f4f1f7;
  --text-2: #d0c9d7;
  --text-3: #9c94a5;
  --text-4: #6e6777;
  --overlay: rgba(0, 0, 0, .6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, .4);
  --shadow-3: 0 24px 70px rgba(0, 0, 0, .6);
  --shadow-pink: 0 8px 22px rgba(255, 43, 149, .28);
}

/* ───── 基礎 ───── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; letter-spacing: .01em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-s); }
::selection { background: var(--pink-200); }
.num { font-family: var(--font-num); font-feature-settings: "tnum" 1, "lnum" 1; letter-spacing: -.01em; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 24px; height: 24px; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 16px; border-radius: var(--r); box-shadow: var(--shadow-2); }
.skip-link:focus { top: 12px; }

/* ───── 品牌標誌 ───── */
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; flex: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.brand-word { font-size: 21px; letter-spacing: -.02em; line-height: 1; font-family: "Arial Rounded MT Bold", "Varela Round", var(--font); }
.brand-word b { font-family: var(--font); font-size: 15px; font-weight: 700; margin-left: 4px; letter-spacing: .08em; opacity: .92; }
.brand-lockup.on-dark { color: #fff; }
.brand-lockup.on-dark .brand-mark, .auth-mobile-brand .brand-mark { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 4px 14px rgba(80, 0, 60, .25); }

/* ───── 按鈕 ───── */
.btn { --h: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--h); padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font-size: 14.5px; font-weight: 700; line-height: 1; white-space: nowrap; transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease); user-select: none; position: relative; }
.btn .icon { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(120deg, #f2168f, var(--pink) 60%); color: #fff; box-shadow: 0 2px 6px rgba(228, 0, 127, .22); }
[data-theme="dark"] .btn-primary { background: linear-gradient(120deg, #ff3fa1, var(--pink) 60%); }
.btn-primary:hover:not(:disabled) { background: var(--pink-hover); box-shadow: var(--shadow-pink); }
.btn-primary:active:not(:disabled) { background: var(--pink-press); }
.btn-brand { background: var(--g-brand); color: #fff; box-shadow: var(--shadow-pink); overflow: hidden; }
.btn-brand::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn-brand:hover:not(:disabled)::after { transform: translateX(120%); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-secondary:hover:not(:disabled) { border-color: var(--pink); color: var(--pink); }
.btn-outline { background: var(--surface); color: var(--pink); border: 1.5px solid var(--pink); }
.btn-outline:hover:not(:disabled) { background: var(--pink-50); }
.btn-ghost { background: transparent; color: var(--pink); padding: 0 10px; }
.btn-ghost:hover:not(:disabled) { background: var(--pink-50); }
.btn-quiet { background: var(--surface-2); color: var(--text-2); }
.btn-quiet:hover:not(:disabled) { background: var(--pink-50); color: var(--pink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 8px 20px rgba(221, 39, 38, .25); }
.btn-white { background: #fff; color: var(--pink); box-shadow: 0 6px 18px rgba(70, 0, 50, .2); }
.btn-white:hover:not(:disabled) { background: #fff5fa; }
.btn-glass { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .38); backdrop-filter: blur(6px); }
.btn-glass:hover:not(:disabled) { background: rgba(255, 255, 255, .26); }
.btn-sm { --h: 32px; padding: 0 13px; font-size: 13.5px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { --h: 48px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; box-shadow: none; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn[aria-busy="true"] > .icon:first-child { display: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); display: inline-grid; place-items: center; position: relative; transition: background .15s, color .15s; flex: none; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--pink); }
.icon-btn.on-brand { color: #fff; }
.icon-btn.on-brand:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.icon-btn.danger:hover { color: var(--red); background: var(--red-50); }
.text-btn { border: 0; background: none; padding: 0; color: var(--pink); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-btn .icon { width: 16px; height: 16px; }
.link { color: var(--pink); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .icon { width: 16px; height: 16px; }

/* ───── 標籤與徽章 ───── */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text-2); line-height: 1; }
.chip .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.pink { background: var(--pink-50); color: var(--rose); }
.chip.green { background: var(--green-50); color: var(--green); }
.chip.amber { background: var(--amber-50); color: var(--amber); }
.chip.red { background: var(--red-50); color: var(--red); }
.chip.blue { background: var(--blue-50); color: var(--blue); }
.chip.violet { background: var(--violet-50); color: var(--violet); }
.chip.gray { background: var(--surface-2); color: var(--text-3); }
.chip.solid { background: var(--g-brand); color: #fff; }
.chip.yellow { background: var(--yellow); color: #4a2a00; }
.chip.pulse .dot { animation: pulse 1.6s ease-in-out infinite; }
.chip-sm { height: 22px; padding: 0 8px; font-size: 11.5px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--violet-50); color: var(--violet); font-size: 12px; font-weight: 700; white-space: nowrap; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--surface-2); color: var(--text-3); font-family: var(--font-num); }
.kbd, kbd { font-family: var(--font-num); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-3); }

/* ───── 表單 ───── */
.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field > label, .field-label { font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.field-help { font-size: 13px; color: var(--text-3); line-height: 1.6; }
.input, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .select {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .select:focus { outline: none; border-color: var(--pink); box-shadow: var(--ring); }
.select, .field select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2385858d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.select-sm { min-height: 36px; height: 36px; padding: 0 34px 0 12px; font-size: 14px; border-radius: 999px; width: auto; }
.form-error { color: var(--red); font-size: 13.5px; font-weight: 600; min-height: 0; }
.form-error:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input, input.box { appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 1.6px solid var(--line-2); background: var(--surface); display: inline-grid; place-items: center; margin: 0; flex: none; cursor: pointer; transition: background .15s, border-color .15s; }
.check input:checked, input.box:checked, input.box:indeterminate { background: var(--pink); border-color: var(--pink); }
.check input:checked::after, input.box:checked::after { content: ""; width: 10px; height: 6px; border: 2.4px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
input.box:indeterminate::after { content: ""; width: 10px; height: 2.4px; background: #fff; border-radius: 2px; }
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; z-index: 1; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { width: 48px; height: 28px; border-radius: 999px; background: var(--line-2); transition: background .2s; position: relative; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .22s var(--ease); }
.switch input:checked + span { background: var(--pink); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search .icon { position: absolute; left: 13px; color: var(--text-3); width: 18px; height: 18px; pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 14px 0 40px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14.5px; }
.search input:focus { outline: none; border-color: var(--pink); box-shadow: var(--ring); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 999px; border: 1px solid var(--line); flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--pink); box-shadow: var(--shadow-1); }
.segmented button .count { background: transparent; padding: 0 2px; min-width: 0; height: auto; }
.segmented button.active .count { color: var(--pink); }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13.5px; font-weight: 700; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: all .15s; }
.filter-chip:hover { border-color: var(--pink); color: var(--pink); }
.filter-chip.active { background: var(--pink); border-color: var(--pink); color: #fff; }
.filter-chip .num { font-size: 12.5px; opacity: .85; }

/* ───── 外框：頂欄、側欄、底欄 ───── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: var(--topbar-h) 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--surface) calc(var(--sidebar-w) - 1px), var(--line) calc(var(--sidebar-w) - 1px), var(--line) var(--sidebar-w), transparent var(--sidebar-w)); }
.topbar { grid-column: 1 / -1; position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 18px; padding: 0 18px 0 22px; background: var(--g-brand); color: #fff; box-shadow: 0 2px 14px rgba(180, 0, 110, .18); }
[data-theme="dark"] .topbar { background: linear-gradient(118deg, #b8174f 0%, #b30d7a 42%, #a10a8a 70%, #6a0099 100%); box-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
.topbar-menu { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-date { font-size: 13.5px; font-weight: 700; opacity: .95; margin-right: 6px; white-space: nowrap; }
.dot-count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--yellow); color: #3a2400; font-size: 11px; font-weight: 800; display: grid; place-items: center; font-family: var(--font-num); border: 2px solid #f5139f; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); background: #fff; color: var(--pink); font-weight: 800; font-size: 15px; margin-left: 6px; display: grid; place-items: center; }
.avatar-btn:hover { box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); }
.run-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .16); color: #fff; font-size: 13px; font-weight: 700; margin-right: 6px; }
.run-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: pulse 1.4s infinite; }
.sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 14px 12px 16px; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 12px; font-weight: 700; color: var(--text-4); letter-spacing: .12em; padding: 12px 12px 6px; }
.nav-group:first-child { padding-top: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 12px; border-radius: 11px; color: var(--text-2); font-size: 15px; font-weight: 600; transition: background .15s, color .15s; }
.nav a .icon { color: var(--text-3); transition: color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--pink-50); color: var(--pink); font-weight: 800; }
.nav a.active .icon { color: var(--pink); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--g-brand-v); }
.nav-count { margin-left: auto; font-family: var(--font-num); font-size: 12.5px; color: var(--text-3); font-weight: 700; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; font-family: var(--font-num); }
.nav-badge.warn { background: var(--orange); }
.side-device { margin-top: auto; border-radius: var(--r-l); padding: 14px; background: var(--g-soft); border: 1px solid var(--pink-100); display: grid; gap: 10px; }
.side-device-head { display: flex; align-items: center; gap: 10px; }
.side-device-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--pink); box-shadow: var(--shadow-1); flex: none; }
.side-device strong { display: block; font-size: 14px; line-height: 1.35; }
.side-device small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); flex: none; }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-50); animation: pulse 2s infinite; }
.status-dot.busy { background: var(--orange); box-shadow: 0 0 0 3px var(--amber-50); animation: pulse 1.2s infinite; }
.main { min-width: 0; padding: 24px 28px 28px; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1280px; margin: 0 auto; flex: 1; display: grid; gap: 20px; align-content: start; }
.footnote { max-width: 1280px; width: 100%; margin: 28px auto 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-4); }
.tabbar { display: none; }

/* ───── 頁首 ───── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: .01em; }
.page-head-text { display: grid; gap: 8px; min-width: 0; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.summary-line { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; font-size: 14px; color: var(--text-3); }
.summary-line b { color: var(--text); font-family: var(--font-num); font-size: 15px; margin: 0 2px; }
.summary-line b.hot { color: var(--rose); }
.summary-line b.warn { color: var(--amber); }
.summary-line b.bad { color: var(--red); }
.summary-line .sep { width: 1px; height: 12px; background: var(--line-2); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.crumbs a:hover { color: var(--pink); }

/* ───── 卡片 ───── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-head > div:first-child { flex: 1 1 200px; min-width: 0; }
.card-head h2, .card-head h3 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon, .card-head h3 .icon { color: var(--pink); }
.card-head p { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 16px 20px 20px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.grid { display: grid; gap: 20px; }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; }

/* KPI 數字磚 */
.kpi { position: relative; overflow: hidden; padding: 18px 18px 16px; display: grid; gap: 6px; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
a.kpi:hover, button.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
button.kpi { text-align: left; font: inherit; border: 1px solid var(--line); cursor: pointer; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 13.5px; font-weight: 700; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--pink-50); color: var(--pink); flex: none; }
.kpi-icon.violet { background: var(--violet-50); color: var(--violet); }
.kpi-icon.green { background: var(--green-50); color: var(--green); }
.kpi-icon.amber { background: var(--amber-50); color: var(--amber); }
.kpi-icon.blue { background: var(--blue-50); color: var(--blue); }
.kpi-value { font-family: var(--font-num); font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--text); letter-spacing: -.02em; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.kpi-value.money { color: var(--rose); }
.kpi-value small { font-family: var(--font); font-size: 13.5px; font-weight: 700; color: var(--text-3); letter-spacing: 0; }
.kpi-value .sep-plus { font-family: var(--font); font-size: 16px; color: var(--text-4); font-weight: 600; }
.kpi-foot { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.kpi-foot .warn { color: var(--amber); font-weight: 700; }
.kpi-foot .bad { color: var(--red); font-weight: 700; }
.kpi-foot .good { color: var(--green); font-weight: 700; }

/* 金額 */
.money { font-family: var(--font-num); color: var(--rose); font-weight: 700; font-feature-settings: "tnum" 1; white-space: nowrap; }
.money.zero { color: var(--text-4); }
.money small, .amount small { font-family: var(--font); font-size: .78em; font-weight: 700; margin-left: 2px; color: var(--text-3); }
.amount { font-family: var(--font-num); font-weight: 700; white-space: nowrap; }
.coin-row { display: inline-flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }

/* ───── 今日主卡（漸層） ───── */
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); background: var(--g-brand); color: #fff; padding: 26px 28px; box-shadow: 0 16px 40px rgba(200, 0, 120, .22); isolation: isolate; }
[data-theme="dark"] .hero { background: linear-gradient(118deg, #c21a55 0%, #b8117f 42%, #a30b90 70%, #6d00a0 100%); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.hero::before { content: ""; position: absolute; width: 420px; height: 420px; right: -140px; top: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 65%); z-index: -1; }
.hero::after { content: ""; position: absolute; width: 360px; height: 360px; left: -120px; bottom: -240px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 230, 0, .22), transparent 65%); z-index: -1; }
.hero-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(250px, 340px); gap: 26px; align-items: center; }
.hero-copy { min-width: 0; }
.hero-title { font-size: 14px; font-weight: 700; opacity: .9; display: flex; align-items: center; gap: 8px; }
.hero-big { font-size: 28px; font-weight: 800; line-height: 1.25; margin-top: 6px; }
.hero-sub { margin-top: 8px; font-size: 14.5px; opacity: .92; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.glass { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--r-l); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero-side { padding: 16px 18px; display: grid; gap: 10px; }
.hero-side-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; }
.hero-side-row span { opacity: .86; }
.hero-side-row strong { font-family: var(--font-num); font-size: 18px; }
.hero-side-title { font-weight: 800; font-size: 15px; line-height: 1.4; }
.hero-progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.hero-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #fff, var(--yellow)); transition: width .6s var(--ease); }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring .ring-track { stroke: rgba(255, 255, 255, .24); }
.ring .ring-value { stroke: #fff; transition: stroke-dashoffset .8s var(--ease); filter: drop-shadow(0 0 6px rgba(255, 255, 255, .45)); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-family: var(--font-num); font-size: 34px; line-height: 1; letter-spacing: -.03em; }
.ring-label strong small { font-size: 17px; opacity: .8; }
.ring-label span { font-size: 12.5px; font-weight: 700; opacity: .9; margin-top: 4px; }

/* ───── 天天簽到：獎勵條與日曆 ───── */
.reward-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 10px; }
/* 活動頁：11 天排成一列，空間不夠時橫向捲動（保留勾勾與陰影的空間） */
.reward-strip.one-line { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(58px, 1fr); overflow-x: auto; padding: 8px 7px 12px 2px; margin: -8px -7px -12px -2px; scrollbar-width: thin; }
/* 總覽側欄（寬螢幕）：平均分成兩列 */
@media (min-width: 1241px) {
  .reward-strip.fit { grid-auto-flow: row; overflow: visible; padding: 0; margin: 0; gap: 8px; }
  .reward-strip.fit.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reward-strip.fit.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .reward-strip.fit.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .reward-strip.fit.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .reward-strip.fit .reward-day { padding: 9px 2px 8px; }
  .reward-strip.fit .reward-day small { font-size: 11px; white-space: nowrap; }
}
.reward-day { position: relative; border-radius: 14px; padding: 10px 6px 9px; text-align: center; background: var(--surface); border: 1.5px solid var(--line); display: grid; gap: 2px; justify-items: center; transition: transform .2s var(--ease); }
.reward-day small { font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.reward-day strong { font-family: var(--font-num); font-size: 21px; line-height: 1.2; color: var(--rose); }
.reward-day em { font-style: normal; font-size: 11px; color: var(--text-3); font-weight: 700; }
.reward-day.reached { background: var(--pink-50); border-color: var(--pink-100); }
.reward-day.reached::after { content: ""; position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--pink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 13px no-repeat; box-shadow: 0 2px 6px rgba(228, 0, 127, .35); }
.reward-day.next { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--g-brand) border-box; border-width: 2px; box-shadow: 0 6px 18px rgba(228, 0, 127, .18); transform: translateY(-2px); }
.reward-day.next small { color: var(--pink); }
.reward-day.big strong { font-size: 24px; }
.reward-day.big { background: linear-gradient(160deg, #fff7d6, #fff) ; border-color: #ffe27a; }
[data-theme="dark"] .reward-day.big { background: linear-gradient(160deg, rgba(255, 230, 0, .14), var(--surface)); border-color: rgba(255, 230, 0, .35); }
.reward-day.big.reached { background: var(--pink-50); border-color: var(--pink-100); }
.matrix-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; font-size: 13.5px; }
.matrix th, .matrix td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.matrix thead th { background: var(--surface-2); font-size: 12px; color: var(--text-3); font-weight: 700; position: sticky; top: 0; }
.matrix thead th.today { color: var(--pink); }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 150px; padding-left: 16px; }
.matrix thead th:first-child { background: var(--surface-2); z-index: 2; }
.matrix tbody tr:last-child td { border-bottom: 0; }
.matrix tbody tr:hover td { background: var(--surface-3); }
.cell-dot { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--text-4); font-size: 11px; font-family: var(--font-num); }
.cell-dot.done { background: var(--pink); color: #fff; box-shadow: 0 3px 8px rgba(228, 0, 127, .3); }
.cell-dot.done .icon { width: 14px; height: 14px; stroke-width: 3; }
.cell-dot.missed { background: transparent; border: 1.5px dashed var(--line-2); }
.cell-dot.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--pink-200); }
.cell-dot.future { background: transparent; color: var(--text-4); }

/* ───── 列表、表格 ───── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--text-3); background: var(--surface-2); padding: 10px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table th:first-child { border-top-left-radius: 0; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td, .table tbody tr.selected td { background: var(--pink-50); }
.table .right { text-align: right; }
.table .center { text-align: center; }
.table .col-check { width: 44px; padding-right: 0; }
.table .col-go { width: 40px; color: var(--text-4); }
.table .td-alert, .table .switch-label { display: none; }
.wallet-table .person-text { min-width: 84px; }
.text-blue { color: var(--blue); }
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); min-width: 0; }
.list-row:first-child { border-top: 0; }
a.list-row:hover, button.list-row:hover { background: var(--surface-3); }
button.list-row { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; }
button.list-row:first-child { border-top: 0; }
.list-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list-main strong { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main small { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-side { display: grid; justify-items: end; gap: 2px; text-align: right; flex: none; }
.list-side small { font-size: 12px; color: var(--text-3); }
/* 分享收件匣：上排名稱＋小工具，下排兩個主要動作 */
.link-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; column-gap: 14px; row-gap: 10px; }
.link-tools { display: flex; gap: 2px; margin: -4px -8px -4px 0; }
.link-actions { grid-column: 2 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; background: var(--g-brand-v); flex: none; position: relative; text-transform: uppercase; }
.avatar.sm { width: 32px; height: 32px; font-size: 13.5px; }
.avatar.lg { width: 60px; height: 60px; font-size: 24px; }
.avatar.off { background: var(--surface-2); color: var(--text-3); }
.avatar.warn { background: linear-gradient(150deg, #ffb24d, #ff7a2f); }
.avatar .badge-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); background: var(--green); }
.avatar .badge-dot.bad { background: var(--red); }
.avatar .badge-dot.idle { background: var(--text-4); }
.person-text { min-width: 0; display: grid; gap: 1px; }
.person-text strong { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-text small { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.person-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.stack { display: grid; gap: 2px; }
.stack small { font-size: 12px; color: var(--text-3); }
.urgent { color: var(--red) !important; font-weight: 700; }
.soon { color: var(--amber) !important; font-weight: 700; }
.good { color: var(--green) !important; }

/* 待處理 */
.todo { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.todo:first-child { border-top: 0; }
.todo-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-3); }
.todo.red .todo-icon { background: var(--red-50); color: var(--red); }
.todo.amber .todo-icon { background: var(--amber-50); color: var(--amber); }
.todo.pink .todo-icon { background: var(--pink-50); color: var(--pink); }
.todo.blue .todo-icon { background: var(--blue-50); color: var(--blue); }
.todo.green .todo-icon { background: var(--green-50); color: var(--green); }
.todo-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.todo-text strong { font-size: 14.5px; font-weight: 700; line-height: 1.45; }
.todo-text small { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.all-clear { display: flex; align-items: center; gap: 14px; padding: 22px 20px; }
.all-clear .todo-icon { background: var(--green-50); color: var(--green); }

/* 動態時間軸 */
.timeline { display: grid; padding: 4px 20px 16px; }
.tl-item { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 6px; top: 26px; bottom: -10px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; background: var(--surface); border: 3px solid var(--text-4); }
.tl-dot.ok { border-color: var(--green); }
.tl-dot.bad { border-color: var(--red); }
.tl-dot.skip { border-color: var(--blue); }
.tl-body strong { font-size: 14px; font-weight: 700; }
.tl-body p { font-size: 13px; color: var(--text-3); line-height: 1.55; margin-top: 2px; overflow-wrap: anywhere; }
.tl-time { font-size: 12px; color: var(--text-4); white-space: nowrap; font-family: var(--font-num); }

/* 錢包到期時間軸 */
.expiry-day { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line); }
.expiry-day:first-child { border-top: 0; }
.expiry-date { text-align: center; border-radius: 12px; padding: 8px 4px; background: var(--surface-2); align-self: start; }
.expiry-date strong { display: block; font-family: var(--font-num); font-size: 22px; line-height: 1.1; }
.expiry-date small { font-size: 12px; color: var(--text-3); font-weight: 700; }
.expiry-date.urgent { background: var(--red-50); color: var(--red); }
.expiry-date.urgent small { color: var(--red); }
.expiry-date.soon { background: var(--amber-50); color: var(--amber); }
.expiry-date.soon small { color: var(--amber); }
.expiry-items { display: grid; gap: 8px; align-content: center; }
.expiry-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line); }
.expiry-item button { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; font-weight: 700; font-size: 14px; }
.expiry-item button:hover { color: var(--pink); }

/* ───── 電子票券 ───── */
.ticket-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.ticket { position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr); background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); border: 1px solid var(--line); overflow: hidden; min-height: 168px; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.ticket:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.ticket-stub { position: relative; background: var(--g-brand-v); color: #fff; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 12px 6px; text-align: center; }
.ticket-stub .icon { width: 30px; height: 30px; stroke-width: 1.6; }
.ticket-stub span { font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.ticket-stub::after { content: ""; position: absolute; right: -1px; top: 10px; bottom: 10px; border-right: 2px dashed rgba(255, 255, 255, .55); }
.ticket::before, .ticket::after { content: ""; position: absolute; left: 82px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); z-index: 2; border: 1px solid var(--line); }
.ticket::before { top: -11px; }
.ticket::after { bottom: -11px; }
.ticket.inactive .ticket-stub { background: linear-gradient(160deg, #c9c9cf, #a5a5ad); }
[data-theme="dark"] .ticket.inactive .ticket-stub { background: linear-gradient(160deg, #4a4452, #34303a); }
.ticket.inactive { opacity: .92; }
.ticket.urgent { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), var(--shadow-1); }
.ticket-body { padding: 14px 16px 14px 20px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket-owner { font-size: 12.5px; color: var(--text-3); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-owner .icon { width: 14px; height: 14px; }
.ticket-title { font-size: 16px; font-weight: 800; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-meta { font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.ticket-deadline { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.ticket-deadline strong { font-family: var(--font-num); font-size: 15px; }
.ticket-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
/* 折價券 */
.coupon-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); padding: 0 20px 20px; }
.coupon { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 112px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.coupon::before, .coupon::after { content: ""; position: absolute; left: 79px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); z-index: 1; }
.coupon::before { top: -10px; }
.coupon::after { bottom: -10px; }
.coupon-value { display: grid; place-content: center; justify-items: center; gap: 4px; padding: 10px 6px; text-align: center; background: var(--pink-50); color: var(--rose); border-right: 2px dashed var(--line-2); }
.coupon-value strong { font-family: var(--font-num); font-size: 19px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.coupon-value small { font-size: 11.5px; font-weight: 700; opacity: .85; }
.coupon.shop .coupon-value { background: var(--violet-50); color: var(--violet); }
.coupon.freeShipping .coupon-value { background: var(--green-50); color: var(--green); }
.coupon.urgent { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.coupon-body { padding: 10px 14px 10px 16px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.coupon-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.coupon-title { font-size: 14.5px; font-weight: 800; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.coupon-meta { font-size: 12.5px; color: var(--text-3); line-height: 1.5; overflow-wrap: anywhere; }
.coupon-deadline { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.coupon-deadline .icon { width: 14px; height: 14px; }
.coupon-deadline.soon { color: var(--amber); }
.coupon-deadline.urgent { color: var(--red); }
.promo-row .list-main { gap: 3px; }
.promo-row .promo-gift { color: var(--text-2); font-weight: 700; }
.member-picker { min-width: 150px; height: 40px; min-height: 40px; }
@media (max-width: 760px) {
  .promo-row { flex-wrap: wrap; row-gap: 10px; }
  .promo-row > .list-main { flex: 1 1 calc(100% - 52px); }
  .promo-row > .btn, .promo-row > .chip { margin-left: 52px; }
  .page-actions .member-picker { flex: 1 1 100%; }
  .table.responsive.member-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.usage-meter { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.usage-meter strong { font-size: 14px; display: block; }
.usage-meter small { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.usage-meter .chip { white-space: normal; height: auto; min-height: 26px; padding: 4px 10px; line-height: 1.4; }
/* 自動化開關 */
.auto-master { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.auto-master.on { background: var(--pink-50); border-color: transparent; }
.auto-text { min-width: 0; display: grid; gap: 2px; }
.auto-text strong { font-size: 15px; }
.auto-text small { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.auto-list { display: grid; }
.auto-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); }
.auto-row:first-child { border-top: 0; }
.auto-row.freq > select { grid-column: 2 / 4; }
.auto-row.off > * { opacity: .55; }
@media (max-width: 760px) {
  .auto-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .auto-row > .auto-text { grid-column: 1; grid-row: 1; }
  .auto-row > .switch { grid-column: 2; grid-row: 1; }
  .auto-row > .input-sm, .auto-row.freq > select { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
}
.input-sm { min-height: 36px; height: 36px; padding: 0 10px; font-size: 14px; width: auto; border-radius: 10px; }
.toggle-pill { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 700; color: var(--text-2); }
.switch.on-glass span { background: rgba(255, 255, 255, .32); }
.switch.on-glass input:checked + span { background: #fff; }
.switch.on-glass input:checked + span::after { background: var(--pink); }
.hero-switch { align-items: center; }
/* 收合清單 */
.fold { border-top: 1px solid var(--line); }
.fold > summary { display: flex; align-items: center; gap: 8px; padding: 14px 20px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 700; color: var(--text-2); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .icon { width: 16px; height: 16px; color: var(--text-3); transition: transform .2s var(--ease); }
.fold[open] > summary .icon { transform: rotate(180deg); }
.fold > summary small { font-size: 12.5px; font-weight: 600; color: var(--text-4); }
.fold > summary:hover { color: var(--pink); }
.fold .list { border-top: 1px solid var(--line); }
.ticket-health { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--text-3); padding: 12px 20px; border-top: 1px solid var(--line); }
.ticket-health span { display: inline-flex; align-items: center; gap: 6px; }
.shot { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.shot img { width: 100%; }
.shot-empty { min-height: 160px; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--text-3); font-size: 13.5px; padding: 20px; }
.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.dl dt { color: var(--text-3); font-weight: 600; }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* ───── 本機登入：步驟、裝置、指令 ───── */
.stepper { display: flex; gap: 0; counter-reset: step; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; position: relative; padding-right: 14px; }
.step::after { content: ""; flex: 1; height: 2px; background: var(--line-2); border-radius: 2px; min-width: 12px; }
.step:last-child::after { display: none; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--surface-2); color: var(--text-3); border: 2px solid var(--line-2); flex: none; font-family: var(--font-num); }
.step-label { font-size: 13.5px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.step.done .step-dot { background: var(--pink); border-color: var(--pink); color: #fff; }
.step.done::after { background: var(--pink); }
.step.current .step-dot { background: var(--surface); border-color: var(--pink); color: var(--pink); box-shadow: 0 0 0 4px var(--pink-100); }
.step.current .step-label, .step.done .step-label { color: var(--text); }
.os-tabs { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.os-tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 14px; color: var(--text-2); }
.os-tab.active { border-color: var(--pink); color: var(--pink); background: var(--pink-50); }
.code-line { display: flex; align-items: stretch; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); overflow: hidden; }
.code-line code { flex: 1; min-width: 0; padding: 12px 14px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: nowrap; color: var(--text-2); }
.code-line button { border: 0; border-left: 1px solid var(--line-2); background: var(--surface); padding: 0 14px; font-weight: 700; font-size: 13px; color: var(--pink); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.code-line button:hover { background: var(--pink-50); }
.device-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-l); border: 1.5px solid var(--line); background: var(--surface); }
.device-card.online { border-color: var(--green); background: linear-gradient(90deg, var(--green-50), var(--surface) 60%); }
.device-card .device-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); flex: none; }
.device-card.online .device-icon { background: var(--surface); color: var(--green); box-shadow: var(--shadow-1); }
.live { display: grid; gap: 18px; }
.live-stage { display: flex; gap: 16px; align-items: center; padding: 20px; border-radius: var(--r-l); background: var(--g-soft); border: 1px solid var(--pink-100); }
.live-stage .orb { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--g-brand); color: #fff; flex: none; box-shadow: var(--shadow-pink); position: relative; }
.live-stage .orb .icon { width: 26px; height: 26px; }
.live-stage .orb.spin::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--pink); border-right-color: var(--brand-4); animation: spin 1.1s linear infinite; }
.live-stage .orb.ok { background: var(--green); box-shadow: 0 8px 20px rgba(12, 154, 104, .3); }
.live-stage .orb.bad { background: var(--red); box-shadow: 0 8px 20px rgba(221, 39, 38, .3); }
.live-stage h3 { font-size: 19px; font-weight: 800; }
.live-stage p { font-size: 14px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--g-brand); transition: width .5s var(--ease); }
.bar.indeterminate i { width: 35% !important; animation: slide 1.4s var(--ease) infinite; }
.checks { display: grid; gap: 2px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 14px; }
.check-row .state { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-4); }
.check-row .state .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.check-row.ok .state { background: var(--green-50); color: var(--green); }
.check-row.failed .state { background: var(--red-50); color: var(--red); }
.check-row.warning .state { background: var(--amber-50); color: var(--amber); }
.check-row.running .state { color: var(--pink); }
.check-row.running .state .icon { animation: spin 1s linear infinite; }
.check-row small { color: var(--text-3); margin-left: auto; font-size: 12.5px; text-align: right; }
.phone-art { width: 128px; height: 220px; border-radius: 24px; background: #17141b; padding: 9px; box-shadow: var(--shadow-2); flex: none; position: relative; }
.phone-screen { width: 100%; height: 100%; border-radius: 17px; background: var(--g-brand-v); display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; text-align: center; padding: 10px; }
.phone-screen .mini-logo { width: 46px; height: 46px; border-radius: 13px; background: #fff; display: grid; place-items: center; color: var(--pink); font-weight: 900; font-size: 22px; font-family: "Arial Rounded MT Bold", var(--font); }
.phone-screen span { font-size: 12px; font-weight: 700; opacity: .95; }
.phone-screen i { width: 70px; height: 9px; border-radius: 5px; background: rgba(255, 255, 255, .5); }
.phone-screen i.btn-shape { height: 22px; border-radius: 11px; background: #fff; }
.results { display: grid; gap: 8px; }
.result { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--green-50); color: var(--green); font-weight: 700; font-size: 14px; }
.result .icon { width: 18px; height: 18px; }
.pair-code { font-family: var(--font-num); font-size: 34px; letter-spacing: .14em; font-weight: 700; color: var(--pink); }

/* ───── 空狀態、骨架、提示 ───── */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 24px; }
.empty-art { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--g-soft); color: var(--pink); margin-bottom: 4px; border: 1px solid var(--pink-100); }
.empty-art .icon { width: 34px; height: 34px; stroke-width: 1.5; }
.empty strong { font-size: 16.5px; }
.empty p { font-size: 14px; color: var(--text-3); max-width: 420px; line-height: 1.65; }
.empty .btn { margin-top: 6px; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1.3s infinite; }
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
.sk-line { height: 14px; margin: 10px 0; }
.sk-block { height: 120px; border-radius: var(--r-l); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--blue-50); color: var(--text-2); font-size: 14px; line-height: 1.6; }
.notice > .icon { color: var(--blue); margin-top: 1px; }
.notice strong { color: var(--text); display: block; margin-bottom: 2px; }
.notice.warn { background: var(--amber-50); }
.notice.warn > .icon { color: var(--amber); }
.notice.bad { background: var(--red-50); }
.notice.bad > .icon { color: var(--red); }
.notice.good { background: var(--green-50); }
.notice.good > .icon { color: var(--green); }
.notice.pink { background: var(--pink-50); }
.notice.pink > .icon { color: var(--pink); }
.notice-actions { margin-left: auto; display: flex; gap: 8px; flex: none; align-self: center; }
.progress-strip { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--pink-100); box-shadow: var(--shadow-1); }
.progress-strip .bar { flex: 1; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--pink-200); border-top-color: var(--pink); animation: spin .8s linear infinite; flex: none; }
.bulkbar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px 10px 18px; border-radius: 999px; background: #241c2a; color: #fff; box-shadow: var(--shadow-3); width: fit-content; max-width: 100%; margin: 0 auto; animation: rise .25s var(--ease); }
.bulkbar strong { font-size: 14px; margin-right: 6px; white-space: nowrap; }
.bulkbar .btn-secondary { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .22); }
.bulkbar .btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, .2); color: #fff; border-color: rgba(255, 255, 255, .4); }
.toolbar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.toolbar .search { flex: 1 1 240px; max-width: 360px; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; font-size: 13.5px; color: var(--text-3); }

/* ───── 抽屜、對話框、快速搜尋、提示框 ───── */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: var(--overlay); animation: fade .2s var(--ease); }
.drawer { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--bg); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide-in .28s var(--ease); overscroll-behavior: contain; }
.drawer-head { background: var(--g-brand); color: #fff; padding: 18px 20px 0; position: relative; overflow: hidden; flex: none; }
[data-theme="dark"] .drawer-head { background: linear-gradient(118deg, #c21a55 0%, #b8117f 42%, #a30b90 70%, #6d00a0 100%); }
.drawer-head::after { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .25), transparent 65%); pointer-events: none; }
.drawer-top { display: flex; align-items: flex-start; gap: 14px; position: relative; z-index: 1; }
.drawer-top .avatar { background: #fff; color: var(--pink); box-shadow: 0 6px 16px rgba(80, 0, 50, .25); }
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h2 { font-size: 21px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.drawer-title p { font-size: 13px; opacity: .88; margin-top: 2px; overflow-wrap: anywhere; }
.drawer-title .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.drawer-title .chip { background: rgba(255, 255, 255, .2); color: #fff; }
.drawer-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.drawer-tabs { display: flex; gap: 2px; margin-top: 16px; position: relative; z-index: 1; overflow-x: auto; scrollbar-width: none; }
.drawer-tabs button { border: 0; background: transparent; color: rgba(255, 255, 255, .82); font-weight: 700; font-size: 14.5px; padding: 10px 14px 12px; border-radius: 12px 12px 0 0; white-space: nowrap; }
.drawer-tabs button:hover { color: #fff; }
.drawer-tabs button.active { background: var(--bg); color: var(--pink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: grid; gap: 16px; align-content: start; }
.drawer-close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.modal { border: 0; padding: 0; border-radius: var(--r-xl); width: min(540px, calc(100vw - 24px)); max-height: min(88vh, calc(100dvh - 24px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); overflow: hidden; }
.modal[open] { display: flex; flex-direction: column; animation: pop .22s var(--ease); }
.modal.wide { width: min(720px, calc(100vw - 24px)); }
.modal::backdrop { background: var(--overlay); animation: fade .2s; }
.modal form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); flex: none; }
.modal-head h2 { font-size: 18px; font-weight: 800; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 16px; min-height: 0; }
.modal > form > .form-error { padding: 0 20px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-3); flex: none; }
.modal-foot .btn-danger { order: 2; }
.palette { border: 0; padding: 0; background: transparent; width: min(660px, calc(100vw - 24px)); max-height: 80vh; margin-top: 10vh; }
.palette::backdrop { background: var(--overlay); }
.palette[open] { animation: pop .18s var(--ease); }
.palette-box { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); overflow: hidden; border: 1px solid var(--line); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input .icon { color: var(--pink); }
.palette-input input { flex: 1; height: 56px; border: 0; background: transparent; font-size: 17px; color: var(--text); }
.palette-input input:focus, .palette-input input:focus-visible { outline: none; box-shadow: none; }
.palette-results { max-height: min(56vh, 440px); overflow-y: auto; padding: 8px; }
.palette-group { font-size: 12px; font-weight: 700; color: var(--text-4); padding: 10px 12px 6px; letter-spacing: .08em; }
.palette-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 0; background: transparent; text-align: left; font-size: 14.5px; color: var(--text); }
.palette-item .pi-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); flex: none; }
.palette-item small { margin-left: auto; color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette-item.active, .palette-item:hover { background: var(--pink-50); }
.palette-item.active .pi-icon { background: var(--pink); color: #fff; }
.palette-empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 14px; }
.popover { position: fixed; z-index: 70; min-width: 220px; max-width: min(360px, calc(100vw - 16px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-3); padding: 6px; animation: pop .16s var(--ease); }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 14.5px; color: var(--text); }
.menu-item:hover { background: var(--surface-2); }
.menu-item .icon { color: var(--text-3); }
.menu-item.danger { color: var(--red); }
.menu-item.danger .icon { color: var(--red); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-head { padding: 10px 12px 8px; display: grid; gap: 2px; }
.menu-head strong { font-size: 15px; }
.menu-head small { color: var(--text-3); font-size: 12.5px; }
.inbox { max-height: 70vh; overflow-y: auto; padding: 4px 0; }
.inbox .todo { padding: 12px 14px; }
.inbox-head { padding: 12px 16px 8px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.toasts { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(380px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: 14px; background: #241c2a; color: #fff; font-size: 14px; line-height: 1.55; box-shadow: var(--shadow-3); animation: rise .25s var(--ease); }
.toast .icon { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.toast.success .icon { color: #5fe0a8; }
.toast.error .icon { color: #ff8c84; }
.toast.info .icon { color: #ff7cc0; }
.toast.leaving { animation: fade-out .3s var(--ease) forwards; }

/* ───── 登入頁 ───── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); background: var(--surface); }
.auth-brand { position: relative; overflow: hidden; background: var(--g-brand-v); color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; isolation: isolate; }
.auth-brand::before { content: ""; position: absolute; width: 640px; height: 640px; right: -260px; top: -280px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .3), transparent 62%); z-index: -1; }
.auth-brand::after { content: ""; position: absolute; width: 520px; height: 520px; left: -200px; bottom: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 230, 0, .28), transparent 62%); z-index: -1; }
.auth-brand-inner { width: min(520px, 100%); display: grid; gap: 26px; }
.auth-headline { font-size: clamp(34px, 3.6vw, 48px); font-weight: 900; line-height: 1.22; letter-spacing: .01em; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; }
.auth-points span { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); flex: none; }
.auth-art { position: relative; height: 210px; margin-top: 4px; }
.art-card { position: absolute; border-radius: 22px; }
.art-back { left: 54px; top: 20px; width: 300px; height: 170px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); transform: rotate(-7deg); }
.art-front { left: 30px; top: 30px; width: 320px; height: 170px; background: #fff; color: var(--text); box-shadow: 0 30px 60px rgba(80, 0, 60, .3); padding: 20px 22px; display: grid; gap: 14px; align-content: start; transform: rotate(3deg); }
.art-label { font-weight: 800; font-size: 15px; color: var(--pink); }
.art-days { display: flex; gap: 8px; }
.art-days i { width: 30px; height: 30px; border-radius: 50%; background: #f1f1f4; }
.art-days i.done { background: var(--pink); box-shadow: inset 0 0 0 9px var(--pink), inset 0 0 0 30px #fff; }
.art-days i.today { background: #fff; box-shadow: 0 0 0 2.5px var(--pink); }
.art-amount { font-family: var(--font-num); font-size: 38px; color: var(--rose); display: flex; align-items: baseline; gap: 6px; }
.art-amount small { font-family: var(--font); font-size: 15px; color: var(--text-3); }
.art-coin { position: absolute; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 24px; color: #a85a00; background: radial-gradient(circle at 35% 30%, #fff6a8, #ffd32a 60%, #f2a900); box-shadow: 0 10px 20px rgba(120, 60, 0, .3), inset 0 -3px 0 rgba(160, 90, 0, .25); font-family: "Arial Rounded MT Bold", var(--font); }
.art-coin.c1 { right: 40px; top: 0; animation: float 5s ease-in-out infinite; }
.art-coin.c2 { right: 0; top: 104px; width: 44px; height: 44px; font-size: 18px; animation: float 6s ease-in-out -2s infinite; }
.art-spark { position: absolute; width: 14px; height: 14px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); opacity: .9; animation: twinkle 3s ease-in-out infinite; }
.art-spark.s1 { left: 10px; top: 10px; }
.art-spark.s2 { right: 92px; bottom: 8px; width: 10px; height: 10px; animation-delay: -1.4s; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: min(420px, 100%); display: grid; gap: 18px; }
.auth-mobile-brand { display: none; }
.auth-title { font-size: 28px; font-weight: 900; }
.auth-sub { color: var(--text-3); font-size: 15px; margin-top: -8px; line-height: 1.65; }
.auth-foot { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.auth-foot .icon { width: 16px; height: 16px; color: var(--green); margin-top: 2px; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.setup-steps li { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-3); padding: 5px 10px 5px 6px; border-radius: 999px; background: var(--surface-2); }
.setup-steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: #fff; font-size: 11px; font-family: var(--font-num); }
.setup-steps li.current { background: var(--pink-50); color: var(--pink); }
.setup-steps li.current span { background: var(--pink); }

/* ───── 啟動畫面 ───── */
.boot { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 22px; background: var(--bg); transition: opacity .3s; }
.boot-logo { width: 72px; height: 72px; border-radius: 20px; box-shadow: var(--shadow-pink); animation: breathe 1.6s ease-in-out infinite; }
.boot-bar { width: 120px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; border-radius: inherit; background: var(--g-brand); animation: slide 1.2s var(--ease) infinite; }
.boot.done { opacity: 0; pointer-events: none; }

/* ───── 設定頁 ───── */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 2px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.settings-nav a .icon { width: 18px; height: 18px; color: var(--text-3); }
.settings-nav a:hover { background: var(--surface); color: var(--pink); }
.settings-nav a.active { background: var(--surface); color: var(--pink); box-shadow: var(--shadow-1); }
.settings-stack { display: grid; gap: 20px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; padding-top: 4px; }
.setting-row > div { min-width: 0; }
.setting-row strong { font-size: 15px; display: block; }
.setting-row p { font-size: 13px; color: var(--text-3); margin-top: 2px; line-height: 1.6; }
.time-big { font-family: var(--font-num); font-size: 40px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 180px; }

/* ───── 帳號抽屜內 ───── */
.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.health { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 4px; }
.health span { font-size: 12.5px; color: var(--text-3); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.health strong { font-size: 14px; }
.health.ok strong { color: var(--green); }
.health.bad strong { color: var(--red); }
.health.warn strong { color: var(--amber); }
.balance-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.balance { border-radius: var(--r-l); padding: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; }
.balance span { font-size: 13px; font-weight: 700; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.balance span .icon { color: var(--pink); width: 18px; height: 18px; }
.balance strong { font-family: var(--font-num); font-size: 32px; color: var(--rose); line-height: 1.15; }
.balance small { font-size: 12px; color: var(--text-3); }

/* ───── 動畫 ───── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(310%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes slide-in { from { transform: translateX(40px); opacity: .4; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes twinkle { 0%, 100% { opacity: .9; transform: scale(1); } 50% { opacity: .3; transform: scale(.6); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.reveal > * { animation: rise .42s var(--ease) both; }
.reveal > *:nth-child(2) { animation-delay: .04s; }
.reveal > *:nth-child(3) { animation-delay: .08s; }
.reveal > *:nth-child(4) { animation-delay: .12s; }
.reveal > *:nth-child(5) { animation-delay: .16s; }
.reveal > *:nth-child(n + 6) { animation-delay: .2s; }

/* ───── 響應式 ───── */
@media (max-width: 1240px) {
  .hero { padding: 22px 24px; }
  .hero-grid { grid-template-columns: auto minmax(0, 1fr) minmax(210px, 250px); gap: 22px; }
  .ring { width: 116px; height: 116px; }
  .ring-label strong { font-size: 30px; }
  .hero-big { font-size: 25px; }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .settings-nav a { white-space: nowrap; background: var(--surface); border: 1px solid var(--line); }
  .top-date { display: none; }
}
@media (max-width: 980px) {
  :root { --sidebar-w: 84px; }
  .sidebar { padding: 12px 8px; }
  .nav-group { display: none; }
  .nav a { flex-direction: column; height: auto; padding: 10px 4px; gap: 4px; font-size: 12px; text-align: center; border-radius: 12px; }
  .nav a .icon { width: 22px; height: 22px; }
  .nav a.active::before { left: -8px; }
  .nav-count { display: none; }
  .nav-badge { position: absolute; top: 4px; right: 10px; margin: 0; min-width: 18px; height: 18px; font-size: 10.5px; }
  .side-device { padding: 10px 6px; justify-items: center; text-align: center; }
  .side-device .side-device-head { flex-direction: column; gap: 6px; }
  .side-device-text small { justify-content: center; }
  .side-device .btn { padding: 0 8px; font-size: 12px; }
  .side-device .btn span { display: none; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { grid-template-columns: auto minmax(0, 1fr); }
  .hero-side { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .hero-task { grid-column: 1 / -1; order: 9; }
}
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reward-strip.one-line { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); overflow: visible; padding: 0; margin: 0; }
}
@media (max-width: 760px) {
  :root { --topbar-h: 54px; }
  body { font-size: 15px; }
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { display: none; }
  .topbar { padding: 0 8px 0 14px; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-word { font-size: 19px; }
  .run-chip span { display: none; }
  .main { padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); }
  .content { gap: 16px; }
  .footnote { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; height: calc(62px + env(safe-area-inset-bottom)); padding: 4px 4px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(30, 10, 40, .06); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--text-3); border: 0; background: none; padding: 0; }
  .tabbar .icon { width: 23px; height: 23px; }
  .tabbar a.active, .tabbar button.active { color: var(--pink); }
  .tab-hero { position: relative; }
  .tab-hero-disc { width: 50px; height: 50px; margin-top: -24px; border-radius: 50%; display: grid; place-items: center; background: var(--g-brand); color: #fff; box-shadow: 0 6px 16px rgba(228, 0, 127, .38); border: 4px solid var(--surface); }
  .tab-hero-disc .icon { width: 24px; height: 24px; }
  .tab-hero.active { color: var(--pink); }
  .page-head h1 { font-size: 22px; }
  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .hero { padding: 20px; border-radius: 18px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; justify-items: stretch; }
  .hero-main { display: flex; gap: 16px; align-items: center; }
  .ring { width: 104px; height: 104px; }
  .ring-label strong { font-size: 27px; }
  .hero-big { font-size: 21px; }
  .hero-side { grid-template-columns: minmax(0, 1fr); }
  .hero-task { order: 0; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 25px; }
  .kpi-icon { width: 32px; height: 32px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 14px 16px 16px; }
  .list-row, .todo { padding: 13px 16px; }
  .toolbar { padding: 14px 16px; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar-right { margin-left: 0; width: 100%; }
  .timeline { padding: 4px 16px 14px; }
  .ticket-grid { grid-template-columns: minmax(0, 1fr); }
  /* 表格在手機改成卡片：第一欄（帳號）佔滿，其餘兩欄並排並附欄名 */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody { display: block; width: 100%; }
  .table.responsive tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: relative; }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive td { display: block; border: 0; padding: 0; min-width: 0; text-align: left; }
  .table.responsive td:not([data-label]) { grid-column: 1 / -1; }
  .table.responsive td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--text-4); font-weight: 700; margin-bottom: 2px; }
  .table.responsive .col-go { display: none; }
  .table.wallet-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 帳號卡片：頭像列 → 狀態＋自動簽到 → 四格數字 → 到期提醒 */
  .table.accounts tr { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: "person person person person" "state state switch switch" "point coin ticket prog" "alert alert alert alert"; gap: 10px 8px; }
  .table.accounts .col-check { position: absolute; right: 16px; top: 16px; width: auto; }
  .table.accounts .td-person { grid-area: person; padding-right: 34px; }
  .table.accounts .td-state { grid-area: state; align-self: center; }
  .table.accounts .td-switch { grid-area: switch; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
  .table.accounts td.td-state::before, .table.accounts td.td-switch::before { display: none; }
  .table.accounts .switch-label { display: inline; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
  .table.accounts .td-point { grid-area: point; }
  .table.accounts .td-coin { grid-area: coin; }
  .table.accounts .td-ticket { grid-area: ticket; }
  .table.accounts .td-prog { grid-area: prog; }
  .table.accounts :is(.td-point, .td-coin, .td-ticket, .td-prog) { background: var(--surface-2); border-radius: 10px; padding: 7px 10px 8px; white-space: nowrap; overflow: hidden; }
  .table.accounts tr.selected :is(.td-point, .td-coin, .td-ticket, .td-prog), .table.accounts tr.clickable:hover :is(.td-point, .td-coin, .td-ticket, .td-prog) { background: var(--surface); }
  .table.accounts :is(.td-point, .td-ticket) small { display: none; }
  .table.accounts .td-ticket .fs-125 { font-size: 12px; }
  .table.accounts .td-alert { grid-area: alert; display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
  .drawer { width: 100vw; }
  .drawer-head { padding: calc(14px + env(safe-area-inset-top)) 16px 0; }
  .drawer-body { padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .modal-foot .btn { flex: 1; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-panel { align-items: flex-start; padding: 0; background: var(--bg); }
  .auth-card { width: 100%; padding: 0 18px 40px; gap: 16px; }
  .auth-mobile-brand { display: flex; margin: 0 -18px 6px; padding: calc(28px + env(safe-area-inset-top)) 22px 64px; background: var(--g-brand-v); border-radius: 0 0 28px 28px; color: #fff; }
  .auth-mobile-brand + * { margin-top: -50px; }
  .auth-card > form, .auth-card > h2, .auth-card > p, .auth-card > ol { position: relative; }
  .auth-title { font-size: 24px; background: var(--surface); padding: 20px 20px 0; border-radius: 20px 20px 0 0; margin: -46px 0 0; }
  .auth-title + .auth-sub { background: var(--surface); margin: -16px 0 0; padding: 6px 20px 0; }
  .auth-card > form { background: var(--surface); margin-top: -16px; padding: 16px 20px 22px; border-radius: 0 0 20px 20px; }
  .setup-steps { order: -1; }
  .toasts { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; }
  .stepper .step-label { display: none; }
  .stepper .step { flex: 0 0 auto; gap: 8px; padding-right: 8px; }
  .stepper .step::after { flex: 0 0 22px; }
  .stepper .step.current { flex: 1 1 auto; }
  .stepper .step.current::after { flex: 1 1 12px; }
  .stepper .step.current .step-label, .stepper .step:last-child.done .step-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .matrix { min-width: 0; }
  .matrix .m-hide { display: none; }
  .matrix th, .matrix td { padding: 10px 4px; }
  .matrix th:first-child, .matrix td:first-child { min-width: 0; padding-left: 12px; }
  .live-stage { flex-direction: column; align-items: flex-start; text-align: left; }
  .phone-art { display: none; }
  .bulkbar { border-radius: 18px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 10px 12px; }
  .settings-layout { gap: 14px; }
  .settings-nav a { padding: 7px 11px; font-size: 13.5px; gap: 7px; }
  .settings-nav a .icon { width: 16px; height: 16px; }
  .expiry-day { grid-template-columns: 62px minmax(0, 1fr); padding: 12px 16px; gap: 12px; }
}
@media (max-width: 420px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi-value { font-size: 22px; }
  .topbar .top-date { display: none; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .side-device { padding: 10px 12px; gap: 8px; }
  .side-device .side-device-hint { display: none; }
  .nav a { height: 38px; }
  .nav-group { padding: 8px 12px 4px; }
  .main { padding-top: 18px; }
  .content { gap: 16px; }
  .hero { padding: 18px 24px; }
  .ring { width: 104px; height: 104px; }
  .ring-label strong { font-size: 27px; }
  .hero-big { font-size: 23px; margin-top: 4px; }
  .hero-sub { margin-top: 4px; font-size: 14px; }
  .hero-actions { margin-top: 12px; }
  .hero-side { padding: 12px 16px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .sidebar, .tabbar, .footnote, .page-actions { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; }
}

/* ───── 工具類（取代內嵌 style，符合 CSP） ───── */
.stack-20 { display: grid; gap: 20px; }
.stack-16 { display: grid; gap: 16px; }
.stack-14 { display: grid; gap: 14px; }
.stack-12 { display: grid; gap: 12px; }
.stack-10 { display: grid; gap: 10px; }
.stack-8 { display: grid; gap: 8px; }
.stack-6 { display: grid; gap: 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-8 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-6 { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-6.end { justify-content: flex-end; }
.row-4 { display: flex; gap: 4px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.align-start { align-items: start; }
.self-center { align-self: center; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.pt-4 { padding-top: 4px; }
.pb-16 { padding-bottom: 16px; }
.pl-72 { padding-left: 72px; }
.chips-pad { padding: 0 20px 16px; }
.fs-12 { font-size: 12px; }
.fs-125 { font-size: 12.5px; }
.fs-13 { font-size: 13px; }
.fs-135 { font-size: 13.5px; }
.fs-14 { font-size: 14px; }
.fs-145 { font-size: 14.5px; }
.fs-15 { font-size: 15px; }
.fs-18 { font-size: 18px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.lh-165 { line-height: 1.65; }
.text-2 { color: var(--text-2); }
.text-white { color: #fff; }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.wrap-normal { white-space: normal !important; }
.pointer { cursor: pointer; }
.bt { border-top: 1px solid var(--line); }
.no-shadow { box-shadow: none; }
.flush { border-bottom: 0; }
.w-44 { width: 44px; flex: none; }
.w-96 { width: 96px; flex: none; }
.tint-pink { background: var(--pink-50) !important; color: var(--pink) !important; }
.tint-green { background: var(--green-50) !important; color: var(--green) !important; }
.plain-btn { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.step-num { width: 34px; height: 34px; font-family: var(--font-num); font-weight: 800; }
.log-message { white-space: normal !important; color: var(--text-2) !important; font-size: 13.5px !important; line-height: 1.55; }
.summary-row { padding: 14px 20px; cursor: pointer; font-weight: 700; font-size: 14px; }
.summary-plain { cursor: pointer; font-weight: 700; }
.notes-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.65; }
.result-time { margin-left: auto; font-weight: 600; font-size: 12.5px; }
.sk-ticket { height: 168px; }
.hero-task { font-size: 12.5px; opacity: .85; line-height: 1.5; }
.inline-dot { display: inline-block; margin-right: 6px; }
.faq { display: grid; gap: 8px; margin-top: 10px; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.center-stack { display: grid; gap: 16px; justify-items: center; text-align: center; }
.rules { display: grid; gap: 12px; font-size: 14px; line-height: 1.7; }
.tips { display: grid; gap: 10px; text-align: left; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.danger-card { display: grid; gap: 10px; border-color: var(--red-50); }
.group-title { color: var(--text); font-size: 13.5px; }
.group-head { border-top: 1px solid var(--line); background: var(--surface-3); }
.skeleton.sk-line:nth-child(2) { width: 82%; }
.skeleton.sk-line:nth-child(3) { width: 74%; }
.skeleton.sk-line:nth-child(4) { width: 66%; }
.skeleton.sk-line:nth-child(n + 5) { width: 58%; }
