:root {
  --c-navy: #0F222A; --c-slate-700: #334155; --c-slate-600: #475569;
  --c-slate-500: #64748B; --c-slate-400: #94A3B8; --c-slate-300: #CBDCE1;
  --c-border: #E2EDF0; --c-bg-page: #F8FBFC; --c-bg-soft: #F1F7F9; --c-white: #FFF;
  --c-accent: #3BC7F6; --c-accent-hover: #25B4EB;
  --c-accent-soft: #EFFBFF; --c-accent-border: #BFF0FE;
  --c-danger: #EF4444; --c-danger-dark: #DC2626;
  --c-success: #10B981; --c-warning: #F59E0B;
  --radius-input: 8px; --radius-card: 16px; --radius-pill: 999px;
  --shadow-card: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-pop: 0 10px 22px rgba(15, 34, 42, .08);
  --font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--c-bg-page); color: var(--c-navy);
  font-family: var(--font-family); font-size: 14px; -webkit-font-smoothing: antialiased; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button { font: inherit; }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.rail { width: 84px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 6px; }
.rail__logo { width: 40px; height: 40px; border-radius: 10px; background: var(--c-accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.rail__item { width: 68px; padding: 10px 0 8px; border-radius: 12px; border: 0; background: none;
  color: var(--c-slate-500); display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.rail__item svg { width: 22px; height: 22px; }
.rail__item:hover { background: var(--c-bg-soft); }
.rail__item.is-active { background: var(--c-accent-soft); color: var(--c-accent-hover); font-weight: 600; }

.flyout { width: 252px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column; }
.flyout__head { padding: 20px 18px 12px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.flyout__head::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--c-accent); }
.flyout__list { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.folder { margin-top: 6px; }
.folder__row { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none;
  padding: 8px 6px; font-size: 12px; font-weight: 700; color: var(--c-slate-500); cursor: pointer; border-radius: 8px; }
.folder__row:hover { background: var(--c-bg-soft); }
.folder__row svg { width: 12px; height: 12px; transition: transform .15s ease; }
.folder.is-collapsed .folder__row svg { transform: rotate(-90deg); }
.folder.is-collapsed .folder__items { display: none; }
.count-pill { margin-left: auto; background: var(--c-bg-soft); color: var(--c-slate-500);
  font-size: 11px; padding: 0 7px; border-radius: 999px; line-height: 18px; }
.folder__items { margin-left: 15px; padding-left: 8px; border-left: 1px solid var(--c-border); }
.nav-item { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0;
  background: none; text-align: left; padding: 8px 10px; margin: 2px 0; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--c-slate-600); cursor: pointer; transition: background .15s ease; }
.nav-item:hover { background: var(--c-bg-soft); }
.nav-item.is-active { background: var(--c-accent-soft); color: var(--c-accent-hover);
  box-shadow: inset 2px 0 0 var(--c-accent); }
.nav-item code { font-family: inherit; font-size: 10.5px; color: var(--c-slate-400); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; }
.crumb { color: var(--c-slate-500); font-size: 13px; }
.crumb b { color: var(--c-navy); font-weight: 600; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.wh-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  color: var(--c-slate-600); background: var(--c-bg-soft); padding: 4px 12px; border-radius: 999px; }
.wh-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-success); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent-hover);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.icon-btn { border: 0; background: none; color: var(--c-slate-500); width: 32px; height: 32px;
  border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--c-bg-soft); }
.menu-toggle { display: none; }
.content { flex: 1; overflow-y: auto; padding: 24px; }
.page { max-width: 1152px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  animation: fadeUp .2s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.page-head__icon { background: var(--c-accent); color: #fff; padding: 8px; border-radius: 8px; display: flex; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; margin: 0; }
.page-head__code { color: var(--c-slate-500); font-size: 13px; }

/* ---------- card ---------- */
.card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: 24px; }
.card__title { font-size: 16px; font-weight: 600; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.card__title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); }
.card__title .sub { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--c-slate-400); }

/* ---------- query ---------- */
.query-grid { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.query-field { display: flex; align-items: center; gap: 10px; }
.query-field__label { width: 96px; flex-shrink: 0; text-align: right; color: var(--c-slate-600); font-weight: 500; }
.query-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 22px -24px -24px;
  padding: 14px 24px; background: var(--c-bg-page); border-top: 1px solid var(--c-border); border-radius: 0 0 15px 15px; }

.input, .select { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--c-border);
  border-radius: var(--radius-input); font: inherit; color: var(--c-navy); outline: none; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease; }
.input::placeholder { color: var(--c-slate-400); }
.input:focus, .select:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(59, 199, 246,.15); }
.btn { height: 38px; padding: 0 18px; border-radius: var(--radius-input); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn--sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn--primary { background: var(--c-accent); color: #fff; box-shadow: 0 1px 2px rgba(37, 180, 235,.3); }
.btn--primary:hover { background: var(--c-accent-hover); }
.btn--secondary { background: #fff; color: var(--c-slate-600); border-color: var(--c-border); }
.btn--secondary:hover { background: var(--c-bg-soft); }
.btn--ghost { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.btn--ghost:hover { background: #DBF6FE; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.kpi { padding: 20px 22px; }
.kpi__label { color: var(--c-slate-500); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi__label svg { width: 16px; height: 16px; color: var(--c-slate-400); }
.kpi__value { font-size: 28px; font-weight: 700; margin: 8px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi__value small { font-size: 14px; font-weight: 500; color: var(--c-slate-500); margin-left: 4px; }
.kpi__delta { font-size: 12px; color: var(--c-slate-500); }
.up { color: #059669; font-weight: 600; } .down { color: var(--c-danger-dark); font-weight: 600; }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 8px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars__pair { display: flex; gap: 4px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar { width: 14px; border-radius: 4px 4px 0 0; transition: height .4s ease; }
.bar--in { background: var(--c-accent); } .bar--out { background: var(--c-slate-300); }
.bars__x { font-size: 12px; color: var(--c-slate-500); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--c-slate-500); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.meter { margin-bottom: 14px; }
.meter__top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.meter__top span:last-child { color: var(--c-slate-500); font-variant-numeric: tabular-nums; }
.meter__track { height: 8px; border-radius: 999px; background: var(--c-bg-soft); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 999px; background: var(--c-accent); }
.meter__fill.is-warn { background: var(--c-warning); } .meter__fill.is-danger { background: var(--c-danger); }

/* ---------- table ---------- */
.table-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.table-bar__count { color: var(--c-slate-500); }
.table-bar__count b { color: var(--c-accent-hover); }
.table-bar__right { margin-left: auto; display: flex; gap: 8px; }
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.table th { text-align: left; color: var(--c-slate-500); font-size: 13px; font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--c-border); background: #fff; white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--c-bg-soft); white-space: nowrap; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: var(--c-accent-soft); }
.table tbody tr.clickable { cursor: pointer; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.muted { color: var(--c-slate-400); font-size: 12px; }
.link { color: var(--c-accent-hover); font-weight: 500; cursor: pointer; background: none; border: 0; padding: 0; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 16px; }
.pager button { min-width: 30px; height: 30px; border: 1px solid var(--c-border); background: #fff; border-radius: 8px;
  color: var(--c-slate-600); cursor: pointer; font-size: 13px; }
.pager button.is-active { background: var(--c-accent-soft); color: var(--c-accent-hover); border-color: var(--c-accent-border); font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

.tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 600; display: inline-block; line-height: 20px; }
.tag--success { background: #ECFDF5; color: #059669; }
.tag--warning { background: #FFFBEB; color: #B45309; }
.tag--danger  { background: #FEF2F2; color: #DC2626; }
.tag--info    { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.tag--muted   { background: #F1F7F9; color: #64748B; }

.empty { text-align: center; padding: 40px 0; color: var(--c-slate-400); font-weight: 500; }
.empty__icon { width: 56px; height: 56px; border-radius: 50%; background: var(--c-bg-soft); color: var(--c-slate-300);
  display: grid; place-items: center; margin: 0 auto 10px; }
.empty__icon svg { width: 26px; height: 26px; }

/* ---------- step bar / KV ---------- */
.steps { display: flex; align-items: flex-start; justify-content: center; gap: 0; padding: 4px 0; }
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 120px; font-size: 13px; color: var(--c-slate-500); }
.step__dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--c-bg-soft); color: var(--c-slate-400); }
.step.is-active .step__dot { background: var(--c-accent); color: #fff; box-shadow: 0 0 0 4px var(--c-accent-soft); }
.step.is-active { color: var(--c-navy); font-weight: 600; }
.step.is-done .step__dot { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.step-line { flex: 1; max-width: 120px; margin-top: 20px;
  background: repeating-linear-gradient(90deg, var(--c-accent-border) 0 6px, transparent 6px 12px); height: 2px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 24px; }
.kv__row { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--c-bg-soft); }
.kv__k { width: 110px; flex-shrink: 0; text-align: right; color: var(--c-slate-500); font-size: 13px; }
.kv__v { font-weight: 500; }

.form-lines { width: 100%; border-collapse: collapse; }
.form-lines th { text-align: left; font-size: 13px; color: var(--c-slate-500); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--c-border); }
.form-lines td { padding: 6px; }

/* ---------- dialog / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 34, 42,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s ease; }
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.dialog { background: #fff; border-radius: 16px; width: min(640px, 100%); max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow-pop); animation: fadeUp .2s ease; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--c-border); }
.dialog__body { padding: 20px 24px; overflow-y: auto; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; background: var(--c-bg-page);
  border-top: 1px solid var(--c-border); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--c-navy); color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-pop); z-index: 60; animation: fadeUp .2s ease; }
.toast[hidden] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .flyout { position: fixed; left: 84px; top: 0; bottom: 0; z-index: 40; box-shadow: var(--shadow-pop);
    transform: translateX(-120%); transition: transform .2s ease; }
  .app.is-menu-open .flyout { transform: none; }
  .menu-toggle { display: grid; }
}
@media (max-width: 640px) {
  .rail { position: fixed; bottom: 0; left: 0; right: 0; width: auto; height: 64px; flex-direction: row;
    justify-content: space-around; padding: 4px; border-right: 0; border-top: 1px solid var(--c-border); z-index: 45; }
  .rail__logo { display: none; }
  .rail__item { width: auto; flex: 1; padding: 6px 0; font-size: 11px; }
  .flyout { left: 0; bottom: 64px; }
  .content { padding: 16px 16px 88px; }
  .topbar { padding: 0 16px; }
  .wh-pill { display: none; }
  .query-field { flex-direction: column; align-items: stretch; gap: 6px; }
  .query-field__label { width: auto; text-align: left; }
  .kv__k { width: 90px; }
  .steps .step { width: 76px; font-size: 12px; }
}

/* =====================================================================
   客戶商機開發系統 Demo — 追加樣式（登入 / 轉場 / 首頁 / 共用元件）
   ===================================================================== */
.muted-text { color: var(--c-slate-500); font-size: 13px; }
.sub-title { font-size: 14px; font-weight: 600; margin: 20px 0 8px; color: var(--c-slate-700); }
.pitch { margin: 0; padding: 12px 14px; background: var(--c-bg-page); border: 1px solid var(--c-border); border-radius: 8px; line-height: 1.7; color: var(--c-slate-700); }
.ellipsis { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.is-danger-text { color: var(--c-danger-dark) !important; }
.form-err { color: var(--c-danger-dark); font-size: 13px; margin: 4px 0 0; }
.pager__gap { color: var(--c-slate-400); padding: 0 4px; }
.card__title .link.sub { margin-left: auto; font-size: 13px; }
.range { display: flex; align-items: center; gap: 6px; width: 100%; }
.range span { color: var(--c-slate-400); }
.range .input { min-width: 0; }
.textarea { height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-stack .query-field__label { width: 88px; }
.query-actions--inline { margin: 4px 0 0; padding: 0; background: none; border: 0; }
.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton i { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--c-bg-soft) 0%, #E9F2F5 50%, var(--c-bg-soft) 100%); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
.skeleton i:first-child { width: 30%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.nav-item:disabled { opacity: .45; cursor: not-allowed; }
.nav-item:disabled:hover { background: none; }
.flyout__note { font-size: 12px; color: var(--c-slate-400); padding: 12px 10px; }
.dialog--wide { width: min(860px, 100%); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand__mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--c-accent); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.brand__mark--lg { width: 56px; height: 56px; font-size: 15px; border-radius: 14px; }
.brand__text { font-size: 17px; font-weight: 700; display: flex; flex-direction: column; line-height: 1.2; }
.brand__text small { font-size: 11px; font-weight: 600; color: var(--c-slate-400); letter-spacing: .2em; }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #fff; }
.login__body { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; }
.login__hero { position: relative; overflow: hidden; background: var(--c-navy); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login__hero-deco { position: absolute; inset: 0; pointer-events: none; }
.deco-ring { position: absolute; border: 1px solid rgba(148,163,184,.18); border-radius: 50%; }
.deco-ring--1 { width: 520px; height: 520px; right: -180px; top: -160px; }
.deco-ring--2 { width: 340px; height: 340px; right: -60px; top: -40px; }
.deco-ring--3 { width: 180px; height: 180px; left: -60px; bottom: -40px; }
.deco-chart { position: absolute; right: 48px; bottom: 110px; width: 300px; color: rgba(59, 199, 246,.55); }
.login__hero-body { position: relative; margin-top: auto; margin-bottom: 40px; max-width: 460px; }
.hero-slide { min-height: 170px; }
.hero-slide.is-in { animation: fadeUp .5s ease; }
.login__hero-title { font-size: 36px; line-height: 1.3; font-weight: 700; letter-spacing: -.02em; margin: 0 0 16px; }
.login__hero-desc { color: var(--c-slate-300); line-height: 1.8; margin: 0; }
.login__hero-tags { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.hero-tag { font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(148,163,184,.35); color: var(--c-slate-300); }
.hero-dots { display: flex; gap: 8px; margin-top: 28px; }
.hero-dots__dot { width: 8px; height: 8px; border-radius: 999px; border: 0; background: rgba(148,163,184,.4); cursor: pointer; padding: 0; transition: width .2s ease, background .2s ease; }
.hero-dots__dot.is-active { width: 24px; background: var(--c-accent); }
.login__hero-foot { position: relative; font-size: 12px; letter-spacing: .2em; color: var(--c-slate-400); text-transform: uppercase; }
.login__panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px 24px; background: var(--c-bg-page); }
.login__form { width: min(380px, 100%); background: #fff; border: 1px solid var(--c-border); border-radius: 16px; box-shadow: var(--shadow-card); padding: 36px 32px; margin: auto 0; }
.login__title { font-size: 24px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.02em; }
.login__sub { color: var(--c-slate-500); margin: 0 0 24px; font-size: 13px; }
.login__field { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 12px; border: 1px solid var(--c-border); border-radius: 8px; margin-bottom: 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.login__field:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(59, 199, 246,.15); }
.login__field-icon { color: var(--c-slate-400); display: flex; }
.login__field-icon svg { width: 18px; height: 18px; }
.login__input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 15px; color: var(--c-navy); background: none; }
.login__input::placeholder { color: var(--c-slate-400); }
.login__field-btn { border: 0; background: none; color: var(--c-slate-400); cursor: pointer; display: flex; padding: 4px; border-radius: 6px; }
.login__field-btn:hover { background: var(--c-bg-soft); }
.login__field-btn svg { width: 16px; height: 16px; }
.login__err { color: var(--c-danger-dark); font-size: 13px; margin: -4px 0 12px; }
.login__submit { width: 100%; height: 44px; justify-content: center; font-size: 15px; letter-spacing: .3em; }
.login__demo { width: 100%; justify-content: center; margin-top: 10px; }
.login__hint { font-size: 12px; color: var(--c-slate-400); text-align: center; margin: 16px 0 0; line-height: 1.6; }
.login__panel-foot { font-size: 12px; color: var(--c-slate-400); margin-top: 24px; }

/* ---------- boot overlay ---------- */
.boot-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(248, 251, 252,.92); backdrop-filter: blur(4px); display: grid; place-items: center; animation: fade .2s ease; }
.boot-overlay.is-out { opacity: 0; transition: opacity .3s ease; }
.boot-overlay__card { width: 280px; background: #fff; border: 1px solid var(--c-border); border-radius: 16px; box-shadow: var(--shadow-pop); padding: 32px 28px; text-align: center; animation: fadeUp .3s ease; }
.boot-overlay__mark { position: relative; width: 84px; height: 84px; margin: 0 auto 20px; display: grid; place-items: center; }
.boot-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--c-accent-soft); border-top-color: var(--c-accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot-overlay__bar { height: 4px; border-radius: 999px; background: var(--c-bg-soft); overflow: hidden; }
.boot-overlay__bar span { display: block; height: 100%; width: 0; background: var(--c-accent); animation: boot 1.5s ease forwards; }
@keyframes boot { to { width: 100%; } }
.boot-overlay__text { margin-top: 14px; font-size: 13px; color: var(--c-slate-500); animation: fadeUp .3s ease; }

/* ---------- shell additions ---------- */
.rail__logo { font-size: 12px; }
.marquee { height: 32px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 24px; background: var(--c-accent-soft); color: var(--c-accent-hover); font-size: 13px; font-weight: 500; overflow: hidden; border-bottom: 1px solid var(--c-accent-border); }
.marquee svg { width: 16px; height: 16px; }
.marquee__track { flex: 1; overflow: hidden; white-space: nowrap; }
.marquee__track span { display: inline-block; padding-left: 100%; animation: marquee 22s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track span { animation: none; padding-left: 0; } }
.topbar__right { position: relative; }
.agent-pill { font-size: 12px; font-weight: 600; color: #B45309; background: #FFFBEB; padding: 4px 12px; border-radius: 999px; }
.user-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; color: var(--c-slate-500); transition: background .15s ease; }
.user-btn:hover { background: var(--c-bg-soft); }
.user-btn svg { width: 14px; height: 14px; }
.user-btn__text { display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.user-btn__text b { color: var(--c-navy); font-size: 13px; }
.user-btn__text small { font-size: 11px; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: #fff; border: 1px solid var(--c-border); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 30; animation: fadeUp .15s ease; }
.user-menu[hidden] { display: none; }
.user-menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: var(--c-slate-700); cursor: pointer; }
.user-menu button:hover { background: var(--c-bg-soft); }
.user-menu button svg { width: 16px; height: 16px; color: var(--c-slate-400); }
.user-menu button.is-danger { color: var(--c-danger-dark); }
.user-menu hr { border: 0; border-top: 1px solid var(--c-border); margin: 4px 0; }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--c-border); border-radius: 10px; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.choice:hover { background: var(--c-bg-page); }
.choice:has(input:checked) { border-color: var(--c-accent-border); background: var(--c-accent-soft); }
.choice input { accent-color: var(--c-accent); }
.choice span { display: flex; flex-direction: column; }
.choice small { color: var(--c-slate-400); font-size: 12px; }

/* ---------- home ---------- */
.kpi--link { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.kpi--link:hover { border-color: var(--c-accent-border); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.home-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.home-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav b { min-width: 104px; text-align: center; font-size: 14px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__w { text-align: center; font-size: 12px; color: var(--c-slate-400); padding: 4px 0; font-weight: 600; }
.cal__d { aspect-ratio: 1.25; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; color: var(--c-navy); transition: background .15s ease; }
.cal__d:hover { background: var(--c-bg-soft); }
.cal__d.is-blank { cursor: default; }
.cal__d.is-today .cal__n { background: var(--c-accent); color: #fff; }
.cal__d.is-sel { border-color: var(--c-accent-border); background: var(--c-accent-soft); }
.cal__n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.cal__dots { display: flex; gap: 3px; height: 6px; }
.cal__dots i { width: 6px; height: 6px; border-radius: 50%; }
.ev-約訪 { background: var(--c-accent); } .ev-待辦 { background: var(--c-warning); } .ev-會議 { background: var(--c-slate-400); }
.ev-bd, .dot-bd { background: #fff; box-shadow: inset 0 0 0 1.5px #EC4899; }
.legend i.dot-bd { border-radius: 50%; }
.timeline { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.tl { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--c-bg-soft); }
.tl time { font-size: 12px; color: var(--c-slate-500); font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl b { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tl b svg { width: 16px; height: 16px; color: #EC4899; }
.tl p { margin: 4px 0 0; font-size: 13px; color: var(--c-slate-600); }
.timeline .empty { padding: 32px 0; }
.timeline .empty svg { width: 28px; height: 28px; color: var(--c-slate-300); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--c-bg-soft); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed li > svg { width: 16px; height: 16px; color: var(--c-slate-400); }
.feed li span:not(.tag) { flex: 1; min-width: 0; }
.feed time { font-size: 12px; color: var(--c-slate-400); white-space: nowrap; }
.fav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fav { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--c-border); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; color: var(--c-slate-700); text-align: left; transition: background .15s ease, border-color .15s ease; }
.fav:hover { background: var(--c-accent-soft); border-color: var(--c-accent-border); color: var(--c-accent-hover); }
.fav svg { width: 18px; height: 18px; color: var(--c-accent); }
.func-list { display: flex; flex-direction: column; }
.func { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--c-bg-soft); }
.func > span:first-child { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.func svg { width: 16px; height: 16px; color: var(--c-slate-400); }
.func code { font-family: inherit; font-size: 11px; color: var(--c-slate-400); }
.func__ops { display: flex; align-items: center; gap: 4px; }
.func__ops .icon-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ---------- search / segment / tabs ---------- */
.seg { display: inline-flex; padding: 3px; background: var(--c-bg-soft); border-radius: 10px; margin-bottom: 12px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--c-slate-500); cursor: pointer; transition: background .15s ease; }
.seg input:checked + span { background: #fff; color: var(--c-accent-hover); box-shadow: var(--shadow-card); }
.seg input:focus-visible + span { outline: 2px solid var(--c-accent); }
.search-bar { display: flex; align-items: center; gap: 10px; }
.search-bar > svg { color: var(--c-slate-400); }
.search-bar .input { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); margin: -4px 0 16px; overflow-x: auto; }
.tabs__btn { border: 0; background: none; padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 500; color: var(--c-slate-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs__btn:hover { color: var(--c-navy); }
.tabs__btn.is-active { color: var(--c-accent-hover); border-bottom-color: var(--c-accent); font-weight: 600; }

@media (max-width: 1100px) { .home-grid, .home-grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .login__body { grid-template-columns: 1fr; }
  .login__hero { padding: 28px 24px; min-height: 240px; }
  .login__hero-body { margin: 24px 0 0; }
  .hero-slide { min-height: 0; }
  .login__hero-title { font-size: 26px; }
  .deco-chart, .login__hero-foot { display: none; }
}
@media (max-width: 640px) {
  .login__hero { display: none; }
  .login__form { padding: 28px 20px; }
  .user-btn__text { display: none; }
  .marquee { padding: 0 16px; }
  .tl { grid-template-columns: 72px 1fr; }
  .form-stack .query-field { flex-direction: column; align-items: stretch; }
  .dialog__body { padding: 16px; }
}

.home-grid > *, .two-col > * { min-width: 0; }
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi__value { font-size: 22px; }
  .kpi__label { font-size: 12px; }
  .cal-nav b { min-width: 88px; font-size: 13px; }
  .cal__d { aspect-ratio: 1; }
  .fav-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   v2 — 提高對比與色彩：深藍側欄、彩色指標、歡迎橫幅、客戶首頁、操作教學
   ===================================================================== */
:root {
  --c-violet: #7C3AED; --c-green: #10B981; --c-pink: #EC4899; --c-amber: #F59E0B; --c-red: #EF4444; --c-sky: #0ECAE9;
  --c-rail: #0B2E3A; --c-rail-2: #134A5E; --c-bg-page: #EEF5F7;
  --grad-brand: linear-gradient(135deg, #1DA1D8 0%, #3BC7F6 55%, #06B6D4 100%);
  --grad-navy: linear-gradient(135deg, #0B2E3A 0%, #1E6A8A 60%, #25B4EB 100%);
}
body { background: var(--c-bg-page); }
.accent { color: var(--c-accent-hover); }
.spacer { flex: 1; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--c-bg-soft); padding: 2px 6px; border-radius: 6px; }
.up { color: #059669; } .down { color: var(--c-danger-dark); }
.card { border-color: #E2EDF0; box-shadow: 0 1px 3px rgba(15, 34, 42,.06); }
.table th { background: #F8FBFC; border-bottom-color: #E2EDF0; }
.table-wrap .table thead th:first-child { border-top-left-radius: 8px; } .table-wrap .table thead th:last-child { border-top-right-radius: 8px; }
.page-head__icon { background: var(--grad-brand); box-shadow: 0 6px 14px rgba(37, 180, 235,.25); }

/* ---------- 深藍側欄 ---------- */
.rail { background: linear-gradient(180deg, var(--c-rail) 0%, var(--c-rail-2) 100%); border-right: 0; }
.rail__logo { border: 0; cursor: pointer; background: var(--grad-brand); box-shadow: 0 6px 16px rgba(59, 199, 246,.45); color: #fff; font-weight: 700; }
.rail__item { color: #94A3B8; position: relative; }
.rail__item:hover { background: rgba(255,255,255,.06); color: #E2EDF0; }
.rail__item.is-active { background: rgba(59, 199, 246,.18); color: #fff; }
.rail__item.is-active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: #60D7FA; }
.rail__item.is-active svg { color: #93E6FD; }
.flyout { transition: width .22s ease, opacity .18s ease; overflow: hidden; }
.flyout__head { white-space: nowrap; }
@media (min-width: 901px) { .app.is-fly-collapsed .flyout { width: 0; opacity: 0; border-right-width: 0; } }
.nav-item.is-active { background: linear-gradient(90deg, #DBF6FE, #EFFBFF); }

/* ---------- 頂欄 ---------- */
.topbar { gap: 14px; box-shadow: 0 1px 0 #E2EDF0; }
.gsearch { position: relative; flex: 0 1 380px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--c-bg-soft); border: 1px solid transparent; transition: border-color .15s, background .15s, box-shadow .15s; }
.gsearch:focus-within { background: #fff; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(59, 199, 246,.15); }
.gsearch > svg { width: 16px; height: 16px; color: var(--c-slate-400); }
.gsearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 13.5px; color: var(--c-navy); }
.gsearch kbd { font: 600 11px/1 inherit; color: var(--c-slate-400); border: 1px solid var(--c-slate-300); border-radius: 5px; padding: 3px 6px; }
.gsearch__pop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 300px; background: #fff; border: 1px solid var(--c-border); border-radius: 14px; box-shadow: 0 16px 36px rgba(15, 34, 42,.14); padding: 6px; z-index: 35; animation: fadeUp .15s ease; }
.gs-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left; font: inherit; color: var(--c-navy); }
.gs-item:hover, .gs-item.is-active { background: var(--c-accent-soft); }
.gs-item > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.gs-item small { color: var(--c-slate-500); font-size: 12px; }
.gs-item > svg { width: 14px; height: 14px; color: var(--c-slate-300); }
.gs-foot, .gs-empty { font-size: 12px; color: var(--c-slate-400); padding: 8px 10px 4px; }
.gs-av { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--grad-brand); font-size: 14px; }
.gs-av--sm { width: 26px; height: 26px; font-size: 12px; }
.name-cell { display: inline-flex; align-items: center; gap: 8px; }
.btn--tour { background: linear-gradient(135deg, #F59E0B, #F97316); color: #fff; box-shadow: 0 4px 12px rgba(249,115,22,.3); }
.btn--tour:hover { filter: brightness(1.05); }
.btn--light { background: #fff; color: #1DA1D8; }
.btn--light:hover { background: #EFFBFF; }
.btn--glass { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.25); }
.btn--glass:hover { background: rgba(255,255,255,.24); }
.marquee { background: linear-gradient(90deg, #1E6A8A, #25B4EB); color: #fff; border-bottom: 0; }
.cust-link { font-weight: 600; }
.cust-link:hover { text-decoration: underline; }

/* ---------- 首頁 hero ---------- */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 32px; border-radius: 20px; color: #fff; background: var(--grad-navy); box-shadow: 0 12px 28px rgba(30, 106, 138,.25); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); }
.hero::before { width: 320px; height: 320px; right: -80px; top: -160px; } .hero::after { width: 200px; height: 200px; right: 220px; bottom: -120px; }
.hero__text { position: relative; }
.hero__date { font-size: 12.5px; color: #BFF0FE; letter-spacing: .04em; }
.hero h1 { margin: 6px 0 8px; font-size: 26px; letter-spacing: -.02em; }
.hero p { margin: 0; color: #DBF6FE; }
.hero p b { color: #fff; font-size: 17px; }
.hero__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hero__stats { position: relative; display: flex; align-items: center; gap: 22px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 16px 22px; backdrop-filter: blur(4px); }
.ring { position: relative; width: 92px; height: 92px; display: grid; place-items: center; text-align: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 8; }
.ring .ring__v { stroke: #34D399; stroke-linecap: round; }
.ring b { font-size: 20px; line-height: 1; } .ring small { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: #BFF0FE; }
.hero__nums { display: grid; grid-template-columns: repeat(3, auto); gap: 22px; }
.hero__nums div { display: flex; flex-direction: column; }
.hero__nums b { font-size: 24px; font-variant-numeric: tabular-nums; } .hero__nums small { font-size: 12px; color: #BFF0FE; }

/* ---------- 彩色指標磚 ---------- */
.kpi-grid--color { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.kpi-tile { --tc: var(--c-accent); --tb: #EFFBFF; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font: inherit; color: var(--c-navy);
  background: #fff; border: 1px solid #E2EDF0; border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(15, 34, 42,.06); cursor: default; transition: transform .15s ease, box-shadow .15s ease; }
button.kpi-tile { cursor: pointer; }
button.kpi-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 34, 42,.1); }
.kpi-tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--tb); }
.kpi-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tc); }
.kpi-tile > * { position: relative; z-index: 1; }
.kpi-tile__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: var(--tc); margin-bottom: 6px; box-shadow: 0 6px 14px color-mix(in srgb, var(--tc) 35%, transparent); }
.kpi-tile__icon svg { width: 20px; height: 20px; }
.kpi-tile__label { font-size: 13px; color: var(--c-slate-500); font-weight: 500; }
.kpi-tile__value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--tc); font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-tile__value small { font-size: 14px; color: var(--c-slate-500); margin-left: 4px; font-weight: 500; }
.kpi-tile__go { font-size: 12px; color: var(--c-slate-500); display: inline-flex; align-items: center; gap: 2px; }
.kpi-tile__go svg { width: 12px; height: 12px; }
.kpi-tile--blue { --tc: #25B4EB; --tb: #EFFBFF; } .kpi-tile--violet { --tc: #7C3AED; --tb: #F5F3FF; } .kpi-tile--amber { --tc: #D97706; --tb: #FFFBEB; }
.kpi-tile--pink { --tc: #DB2777; --tb: #FDF2F8; } .kpi-tile--green { --tc: #059669; --tb: #ECFDF5; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { --sc: var(--c-slate-500); display: flex; align-items: baseline; gap: 8px; padding: 12px 16px; border-radius: 12px; background: #fff; border: 1px solid #E2EDF0; border-top: 3px solid var(--sc); font: inherit; text-align: left; cursor: default; }
button.stat { cursor: pointer; } button.stat:hover { box-shadow: 0 6px 16px rgba(15, 34, 42,.08); }
.stat b { font-size: 22px; color: var(--sc); font-variant-numeric: tabular-nums; } .stat span { font-size: 13px; color: var(--c-slate-600); }
.stat--blue { --sc: #25B4EB; } .stat--violet { --sc: #7C3AED; } .stat--green { --sc: #059669; } .stat--red { --sc: #DC2626; } .stat--slate { --sc: #334155; } .stat--muted { --sc: #94A3B8; }

/* ---------- 首頁卡片 ---------- */
.home-grid--even { grid-template-columns: 1fr 1fr; }
.ev-約訪 { background: var(--c-accent); } .ev-會議 { background: var(--c-violet); }
.cal__d.is-wkend .cal__n { color: var(--c-danger-dark); }
.cal__d.is-today .cal__n { background: var(--grad-brand); color: #fff; box-shadow: 0 4px 10px rgba(37, 180, 235,.35); }
.tl { border-left: 3px solid var(--c-accent); padding-left: 12px; border-bottom: 0; background: #F8FBFC; border-radius: 0 10px 10px 0; margin-bottom: 8px; }
.tl--待辦 { border-left-color: var(--c-amber); } .tl--會議 { border-left-color: var(--c-violet); } .tl--bd { border-left-color: var(--c-pink); background: #FDF2F8; }
.pill-tabs { display: inline-flex; gap: 4px; background: var(--c-bg-soft); padding: 3px; border-radius: 10px; flex-wrap: wrap; }
.pill-tabs button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--c-slate-500); padding: 5px 10px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pill-tabs button i { font-style: normal; font-size: 11px; background: #fff; border-radius: 999px; padding: 0 6px; line-height: 17px; color: var(--c-slate-600); }
.pill-tabs button.is-active { background: #fff; color: var(--c-accent-hover); box-shadow: var(--shadow-card); }
.pill-tabs button.is-active.is-bad, .pill-tabs button.is-bad i { color: var(--c-danger-dark); }
.pill-tabs button.is-active.is-hot { color: #EA580C; }
.task-list, .ev-list { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow-y: auto; }
.task-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #E2EDF0; }
.task-list li > div:first-child { flex: 1; min-width: 0; }
.task-list b { font-size: 14px; } .task-list p { margin: 2px 0; font-size: 13px; color: var(--c-slate-600); } .task-list small { font-size: 12px; color: var(--c-slate-400); }
.task-ops { display: flex; gap: 6px; flex-shrink: 0; }
.ev-list li { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.ev-list li:hover { background: var(--c-accent-soft); }
.ev-list__main { flex: 1; min-width: 0; } .ev-list__main b { display: flex; align-items: center; gap: 6px; font-size: 14px; } .ev-list__main b svg { width: 16px; height: 16px; color: #F97316; }
.ev-list__main small { display: block; font-size: 12px; color: var(--c-slate-500); margin-top: 2px; }
.ev-num { text-align: center; min-width: 64px; } .ev-num b { display: block; font-size: 20px; color: var(--c-slate-700); } .ev-num small { font-size: 11px; color: var(--c-slate-400); }
.ev-num.is-warn b { color: #EA580C; }
.feed li.clickable { cursor: pointer; border-radius: 8px; padding-left: 6px; padding-right: 6px; } .feed li.clickable:hover { background: var(--c-accent-soft); }
.follow { display: flex; flex-direction: column; gap: 6px; }
.follow__item { display: flex; align-items: center; gap: 10px; border: 1px solid #E2EDF0; background: #fff; border-radius: 12px; padding: 8px 10px; cursor: pointer; font: inherit; text-align: left; color: var(--c-navy); transition: border-color .15s, background .15s; }
.follow__item:hover { border-color: var(--c-accent-border); background: var(--c-accent-soft); }
.follow__item > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; } .follow__item small { font-size: 12px; color: var(--c-slate-500); } .follow__item > svg { width: 14px; height: 14px; color: var(--c-slate-300); }
.fav { background: linear-gradient(180deg, #fff, #F8FBFC); }
.fav svg { color: #fff; background: var(--grad-brand); border-radius: 8px; padding: 4px; width: 26px; height: 26px; }

/* ---------- 共用小元件 ---------- */
.alert { display: flex; gap: 12px; padding: 14px 18px; border-radius: 14px; font-size: 13.5px; line-height: 1.6; }
.alert svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.alert--info { background: #EFFBFF; border: 1px solid #BFF0FE; color: #1E83AF; }
.badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.badge--gold { background: linear-gradient(135deg, #FBBF24, #F59E0B); border-color: transparent; color: #422006; }
.badge--blue { background: #DBF6FE; color: #1DA1D8; border-color: transparent; } .badge--red { background: #FEE2E2; color: #B91C1C; border-color: transparent; } .badge--amber { background: #FEF3C7; color: #92400E; border-color: transparent; }
.lv { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #F1F7F9; color: #475569; }
.lv--白金 { background: #E0F6FF; color: #4338CA; } .lv--鑽石 { background: #CFFAFE; color: #0E7490; } .lv--領航 { background: linear-gradient(135deg, #FDE68A, #FBBF24); color: #78350F; }
.section-title { font-size: 15px; margin: 4px 0 -4px; color: var(--c-slate-700); }
.card--inline { display: flex; align-items: center; gap: 12px; padding: 14px 20px; } .card--inline .select { width: 220px; }
.hint { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--c-slate-500); margin: 14px 0 0; } .hint svg { width: 15px; height: 15px; color: var(--c-accent); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 40px; height: 22px; border-radius: 999px; background: var(--c-slate-300); position: relative; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--c-accent); } .switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.seg--wrap { flex-wrap: wrap; margin: 0; }
.mini-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.mini-steps span { font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--c-bg-soft); color: var(--c-slate-400); }
.mini-steps span.is-done { background: var(--c-accent-soft); color: var(--c-accent-hover); } .mini-steps span.is-on { background: var(--grad-brand); color: #fff; }
.mini-steps i { width: 20px; height: 2px; background: repeating-linear-gradient(90deg, var(--c-accent-border) 0 4px, transparent 4px 7px); }
.prod-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.prod-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--c-accent-soft); color: var(--c-accent-hover); font-weight: 600; font-size: 13px; }
.prod-chip svg { width: 15px; height: 15px; }
.pitch-list { margin: 0; padding-left: 20px; line-height: 2; color: var(--c-slate-700); }
.lead-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; background: linear-gradient(90deg, #EFFBFF, #F8FBFC); border: 1px solid #DBF6FE; }
.lead-head > div { flex: 1; display: flex; flex-direction: column; } .lead-head small { font-size: 12px; color: var(--c-slate-500); }
.qnr fieldset { border: 1px solid #E2EDF0; border-radius: 12px; padding: 12px 16px; margin: 0 0 12px; }
.qnr legend { font-weight: 600; padding: 0 6px; }
.qnr label { display: inline-flex; margin: 6px 8px 0 0; cursor: pointer; }
.qnr input { position: absolute; opacity: 0; }
.qnr label span { padding: 6px 14px; border-radius: 999px; border: 1px solid #E2EDF0; font-size: 13px; transition: all .15s; }
.qnr input:checked + span { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.welcome { text-align: center; } .welcome__icon { width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #F59E0B, #F97316); box-shadow: 0 10px 20px rgba(249,115,22,.3); }
.welcome__icon svg { width: 32px; height: 32px; } .welcome__icon--ok { background: linear-gradient(135deg, #10B981, #059669); box-shadow: 0 10px 20px rgba(16,185,129,.3); }
.welcome p { color: var(--c-slate-600); line-height: 1.7; } .welcome ul { text-align: left; display: inline-block; margin: 4px 0 0; color: var(--c-slate-600); line-height: 1.9; font-size: 13.5px; }
.mini-meter { display: inline-block; width: 120px; height: 6px; background: var(--c-bg-soft); border-radius: 999px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.mini-meter i { display: block; height: 100%; background: var(--grad-brand); border-radius: 999px; } .mini-meter--inline { width: 60px; }
.ellipsis--wide { max-width: 420px; }

/* ---------- 商品 ---------- */
.type-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.type-tab { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid #E2EDF0; background: #fff; cursor: pointer; font: inherit; color: var(--c-slate-600); transition: all .15s; }
.type-tab svg { width: 18px; height: 18px; } .type-tab span { flex: 1; text-align: left; font-weight: 600; } .type-tab b { font-size: 13px; background: var(--c-bg-soft); border-radius: 999px; padding: 1px 9px; }
.type-tab:hover { border-color: var(--c-accent-border); } .type-tab.is-active { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(37, 180, 235,.28); }
.type-tab.is-active b { background: rgba(255,255,255,.22); color: #fff; }
.prod-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .prod-filter .search-bar { flex: 1 1 260px; } .prod-filter .select { width: auto; flex: 0 1 160px; }
.view-toggle { display: inline-flex; background: var(--c-bg-soft); border-radius: 10px; padding: 3px; }
.view-toggle button { border: 0; background: none; width: 34px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--c-slate-500); font-size: 16px; }
.view-toggle button.is-active { background: #fff; color: var(--c-accent-hover); box-shadow: var(--shadow-card); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.prod-card { display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: var(--c-navy); background: #fff; border: 1px solid #E2EDF0; border-radius: 16px; padding: 16px 18px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.prod-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 34, 42,.1); border-color: var(--c-accent-border); }
.prod-card__top { display: flex; gap: 6px; align-items: center; }
.prod-card__type { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--c-accent-hover); background: var(--c-accent-soft); padding: 3px 9px; border-radius: 8px; margin-right: auto; }
.prod-card__type svg { width: 14px; height: 14px; }
.prod-card__name { font-size: 15.5px; margin-top: 4px; } .prod-card small { color: var(--c-slate-400); font-size: 12px; }
.prod-card__kpi { display: flex; gap: 16px; padding: 10px 0; border-top: 1px dashed #E2EDF0; border-bottom: 1px dashed #E2EDF0; margin-top: 4px; }
.prod-card__kpi span { display: flex; flex-direction: column; } .prod-card__kpi b { font-size: 16px; font-variant-numeric: tabular-nums; }
.prod-card__foot { display: flex; justify-content: space-between; align-items: center; }
.prod-hero { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }

/* ---------- 認領 ---------- */
.claim-cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.claim-cam { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: var(--c-navy); background: #fff; border: 2px solid #E2EDF0; border-radius: 16px; padding: 16px 18px; cursor: pointer; transition: all .15s; }
.claim-cam:hover { border-color: var(--c-accent-border); } .claim-cam.is-active { border-color: var(--c-accent); box-shadow: 0 10px 24px rgba(37, 180, 235,.15); background: linear-gradient(180deg, #F8FDFF, #fff); }
.claim-cam small { color: var(--c-slate-500); font-size: 12px; }
.claim-cam__days { position: absolute; right: 14px; top: 14px; font-size: 11.5px; font-weight: 700; color: #EA580C; background: #FFF7ED; padding: 2px 8px; border-radius: 999px; }
.claim-cam__bar { height: 8px; border-radius: 999px; background: var(--c-bg-soft); overflow: hidden; margin-top: 6px; } .claim-cam__bar i { display: block; height: 100%; background: var(--grad-brand); }
.claim-cam__nums { display: flex; gap: 14px; font-size: 12.5px; color: var(--c-slate-500); } .claim-cam__nums b { color: var(--c-navy); }
.claim-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.claim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.claim-card { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--c-navy); background: #fff; border: 2px solid #E2EDF0; border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: all .15s; }
.claim-card:hover:not(:disabled) { border-color: var(--c-accent-border); }
.claim-card.is-sel { border-color: var(--c-accent); background: #EFFBFF; }
.claim-card:disabled { cursor: default; opacity: .75; background: #F8FBFC; }
.claim-card__top { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; } .claim-card small { font-size: 12px; color: var(--c-slate-400); }
.claim-card__meta { font-size: 12.5px; color: var(--c-slate-600); }
.claim-check { margin-left: auto; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--c-slate-300); display: grid; place-items: center; color: transparent; font-size: 12px; font-weight: 700; }
.claim-card.is-sel .claim-check { background: var(--c-accent); border-color: var(--c-accent); color: #fff; } .claim-card:disabled .claim-check { display: none; }

/* ---------- 報表圖表 ---------- */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel__row { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 10px; font-size: 13px; }
.funnel__row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-slate-600); }
.funnel__row > b { text-align: right; color: var(--c-green); font-variant-numeric: tabular-nums; }
.funnel__bar { position: relative; height: 18px; } .funnel__bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.funnel__bar .f1 { background: #DBF6FE; } .funnel__bar .f2 { background: var(--c-accent); } .funnel__bar .f3 { background: var(--c-green); }
.vbars { display: flex; align-items: flex-end; gap: 12px; height: 240px; padding-top: 10px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.vbar b { font-size: 12px; color: var(--c-slate-600); }
.vbar__track { flex: 1; width: 100%; max-width: 42px; background: var(--c-bg-soft); border-radius: 10px; display: flex; align-items: flex-end; overflow: hidden; }
.vbar__track i { display: block; width: 100%; background: linear-gradient(180deg, #60D7FA, #25B4EB); border-radius: 10px; transition: height .5s ease; }
.vbar span { font-size: 12px; color: var(--c-slate-500); white-space: nowrap; }
.mq-preview { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; background: linear-gradient(90deg, #1E6A8A, #25B4EB); color: #fff; font-size: 13px; }
.mq-preview svg { width: 16px; height: 16px; }
.refer { display: flex; flex-direction: column; gap: 16px; }

/* ---------- 客戶首頁（側滑視窗） ---------- */
.sheet { position: fixed; inset: 0; z-index: 45; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(15, 34, 42,.45); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s ease; }
.sheet__panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(1120px, 100%); background: var(--c-bg-page); box-shadow: -20px 0 40px rgba(15, 34, 42,.2); transform: translateX(40px); opacity: 0; transition: transform .22s ease, opacity .22s ease; display: flex; flex-direction: column; }
.sheet.is-open .sheet__backdrop { opacity: 1; } .sheet.is-open .sheet__panel { transform: none; opacity: 1; }
#sheetBody { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sheet__loading { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--c-slate-500); }
.sheet__loading .boot-ring { position: static; width: 40px; height: 40px; display: block; }
.ch-head { background: var(--grad-navy); color: #fff; padding: 22px 28px 0; flex-shrink: 0; position: relative; overflow: hidden; }
.ch-head::after { content: ""; position: absolute; width: 360px; height: 360px; right: -100px; top: -200px; border-radius: 50%; background: rgba(255,255,255,.06); }
.ch-head__main { display: flex; align-items: flex-start; gap: 16px; position: relative; z-index: 1; }
.ch-avatar { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 24px; font-weight: 700; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); flex-shrink: 0; }
.ch-id { flex: 1; min-width: 0; }
.ch-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .ch-name h2 { margin: 0; font-size: 24px; letter-spacing: .04em; }
.ch-sub { color: #BFF0FE; font-size: 13px; margin-right: 4px; }
.ch-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: #CBDCE1; }
.ch-meta span { display: inline-flex; align-items: center; gap: 5px; } .ch-meta b { color: #fff; font-weight: 600; } .ch-meta svg { width: 14px; height: 14px; } .ch-meta .muted { color: #94A3B8; }
.ch-actions { display: flex; gap: 8px; align-items: center; }
.ch-actions .btn--secondary { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); } .ch-actions .btn--secondary:hover { background: rgba(255,255,255,.2); }
.ch-actions .btn--primary { background: #fff; color: #1DA1D8; box-shadow: none; } .ch-actions .btn--primary:hover { background: #EFFBFF; }
.ch-actions .icon-btn { color: #fff; } .ch-actions .icon-btn:hover { background: rgba(255,255,255,.14); }
.ch-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; margin-top: 18px; background: rgba(255,255,255,.14); border-radius: 14px; overflow: hidden; }
.ch-stats > div { background: rgba(11, 46, 58,.35); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.ch-stats span { font-size: 12px; color: #BFF0FE; } .ch-stats b { font-size: 20px; font-variant-numeric: tabular-nums; } .ch-stats b small { font-size: 12px; margin-left: 2px; color: #BFF0FE; }
.ch-stats small { font-size: 11.5px; color: #CBDCE1; } .ch-stats small.is-warn { color: #FCD34D; } .ch-stats small.is-bad { color: #FCA5A5; font-weight: 700; }
.ch-tabs { position: relative; z-index: 1; margin: 14px 0 0; border-bottom: 0; }
.ch-tabs .tabs__btn { color: #BFF0FE; border-bottom-width: 3px; } .ch-tabs .tabs__btn:hover { color: #fff; } .ch-tabs .tabs__btn.is-active { color: #fff; border-bottom-color: #60D7FA; }
.ch-body { flex: 1; overflow-y: auto; padding: 20px 28px 32px; }
.ch-body.is-in { animation: fadeUp .25s ease; }
.ch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ch-span { grid-column: 1 / -1; }
.ch-card { padding: 20px 22px; }
.ch-dl { display: grid; grid-template-columns: 130px 1fr; margin: 0; }
.ch-dl dt { color: var(--c-slate-500); font-size: 13px; padding: 9px 0; border-bottom: 1px dashed #EEF5F7; }
.ch-dl dd { margin: 0; padding: 9px 0; border-bottom: 1px dashed #EEF5F7; font-weight: 500; }
.ch-dl--tight { margin-top: 10px; }
.ch-aum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ch-aum div { padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, #EFFBFF, #F5F3FF); }
.ch-aum span { display: block; font-size: 12px; color: var(--c-slate-500); } .ch-aum b { font-size: 20px; color: #1DA1D8; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; background: var(--c-bg-soft); color: var(--c-slate-400); }
.chip small { font-size: 11px; font-weight: 500; } .chip.is-on { background: #ECFDF5; color: #047857; }
.lead-list { display: flex; flex-direction: column; gap: 8px; }
.lead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #E2EDF0; border-radius: 12px; border-left: 4px solid var(--c-accent); }
.lead > div { flex: 1; min-width: 0; } .lead p { margin: 2px 0 0; font-size: 12.5px; color: var(--c-slate-500); }
.ch-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #DBF6FE; }
.ch-timeline li { position: relative; padding: 0 0 16px 16px; }
.ch-timeline li::before { content: ""; position: absolute; left: -21px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--c-accent); }
.ch-timeline time { font-size: 12px; color: var(--c-slate-400); } .ch-timeline b { font-size: 13.5px; } .ch-timeline p { margin: 4px 0 2px; font-size: 13px; color: var(--c-slate-600); }
.risk-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 12px; background: #F8FBFC; margin-bottom: 8px; flex-wrap: wrap; }
.risk-box > div:first-child { display: flex; flex-direction: column; } .risk-box span { font-size: 12px; color: var(--c-slate-500); }
.risk-box small { font-size: 12px; color: var(--c-slate-500); } .risk-box small.is-warn { color: #B45309; } .risk-box small.is-bad { color: var(--c-danger-dark); font-weight: 700; }
.risk-bar { display: flex; gap: 4px; }
.risk-bar i { font-style: normal; font-size: 11px; font-weight: 700; padding: 5px 8px; border-radius: 6px; background: #E2EDF0; color: #94A3B8; }
.risk-bar i:nth-child(1).is-on { background: #10B981; color: #fff; } .risk-bar i:nth-child(2).is-on { background: #22C55E; color: #fff; } .risk-bar i:nth-child(3).is-on { background: #3BC7F6; color: #fff; }
.risk-bar i:nth-child(4).is-on { background: #F59E0B; color: #fff; } .risk-bar i:nth-child(5).is-on { background: #EF4444; color: #fff; }
.pref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.pref { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: #ECFDF5; }
.pref span { font-size: 12px; color: var(--c-slate-500); } .pref b { color: #047857; } .pref.is-reject { background: #FEF2F2; } .pref.is-reject b { color: #B91C1C; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 70px 1fr 110px; align-items: center; gap: 10px; font-size: 13px; }
.hbar span { color: var(--c-slate-500); } .hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.hbar__track { height: 10px; background: var(--c-bg-soft); border-radius: 999px; overflow: hidden; } .hbar__track i { display: block; height: 100%; background: var(--grad-brand); border-radius: 999px; }
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut__t { font-size: 10px; fill: var(--c-slate-500); } .donut__v { font-size: 15px; font-weight: 700; fill: var(--c-navy); }
.donut__legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; display: grid; gap: 6px; }
.donut__legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; } .donut__legend li i { width: 10px; height: 10px; border-radius: 3px; }
.donut__legend li b { margin-left: auto; font-variant-numeric: tabular-nums; } .donut__legend li.is-off { color: var(--c-slate-300); }

/* ---------- 操作教學 ---------- */
.tour { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.tour[hidden] { display: none; }
.tour__spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15, 34, 42,.62), 0 0 0 3px #60D7FA; transition: all .25s ease; pointer-events: none; }
.tour__card { position: fixed; pointer-events: auto; background: #fff; border-radius: 16px; padding: 18px 20px; box-shadow: 0 20px 44px rgba(15, 34, 42,.3); border-top: 4px solid #F59E0B; transition: left .25s ease, top .25s ease; }
.tour__card.is-in { animation: fadeUp .25s ease; }
.tour__step { font-size: 12px; font-weight: 700; color: #EA580C; letter-spacing: .04em; }
.tour__card h4 { margin: 6px 0 6px; font-size: 17px; } .tour__card p { margin: 0; color: var(--c-slate-600); line-height: 1.7; font-size: 14px; }
.tour__dots { display: flex; gap: 5px; margin: 14px 0 12px; } .tour__dots i { width: 6px; height: 6px; border-radius: 999px; background: #E2EDF0; } .tour__dots i.is-on { width: 18px; background: #F59E0B; }
.tour__foot { display: flex; gap: 8px; align-items: center; } .tour__foot span { flex: 1; }
body.is-touring .marquee__track span { animation-play-state: paused; }

@media (max-width: 1100px) { .home-grid--even { grid-template-columns: 1fr; } .ch-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .gsearch { flex: 1; } .gsearch kbd { display: none; } .ch-grid { grid-template-columns: 1fr; } .hero { flex-direction: column; align-items: stretch; } }
@media (max-width: 640px) {
  .crumb { display: none; } .btn--tour span { display: none; } .btn--tour { padding: 0 10px; }
  .hero { padding: 20px; } .hero h1 { font-size: 21px; } .hero__stats { gap: 14px; padding: 14px; } .hero__nums { gap: 12px; } .hero__nums b { font-size: 19px; } .ring { width: 76px; height: 76px; }
  .kpi-tile { padding: 14px; } .kpi-tile__value { font-size: 24px; } .kpi-tile__icon { width: 32px; height: 32px; }
  .ch-head { padding: 16px 16px 0; } .ch-head__main { flex-wrap: wrap; } .ch-actions { width: 100%; } .ch-actions .btn { flex: 1; justify-content: center; }
  .ch-actions .icon-btn { position: absolute; right: 0; top: 0; } .ch-stats { grid-template-columns: repeat(2, 1fr); } .ch-body { padding: 16px; } .ch-dl { grid-template-columns: 104px 1fr; }
  .funnel__row { grid-template-columns: 90px 1fr 44px; } .hbar { grid-template-columns: 60px 1fr 90px; }
  .claim-grid { grid-template-columns: 1fr 1fr; }
}
.ring svg { width: 100%; height: 100%; }
.donut svg { width: 140px; height: 140px; flex-shrink: 0; }
.ring small { bottom: -20px; }
.query-field:has(.range--btns) { grid-column: span 2; }
.range--btns .input { flex: 0 1 180px; }
@media (max-width: 760px) { .query-field:has(.range--btns) { grid-column: auto; } .range--btns { flex-wrap: wrap; } }
@media (max-width: 640px) { .kpi-grid--color { grid-template-columns: repeat(2, 1fr); gap: 10px; } .kpi-tile::after { width: 70px; height: 70px; } .hero__actions .btn { flex: 1 1 auto; justify-content: center; } }
@media (max-width: 640px) { .ch-stats > div:last-child:nth-child(odd) { grid-column: span 2; } }

/* ---------- v2.1 參考元大自動化行銷案：操作教學 / 個人設定 ---------- */
.page-head__tour { margin-left: auto; }
.tour__dim { position: fixed; inset: 0; background: rgba(15, 34, 42,.55); }
.tour__dim[hidden], .tour__spot[hidden] { display: none; }
.tour { pointer-events: auto; }
.tour__spot { box-shadow: 0 0 0 9999px rgba(15, 34, 42,.55), 0 0 0 2px #60D7FA; }
.tour__card { max-width: calc(100vw - 32px); }
.btn--ghost-plain { background: none; border-color: transparent; color: var(--c-slate-500); padding: 0 6px; }
.btn--ghost-plain:hover { color: var(--c-navy); }
.user-pref { padding: 6px 8px 2px; display: flex; flex-direction: column; gap: 8px; }
.user-pref__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--c-slate-600); cursor: pointer; }
.user-menu { min-width: 250px; }
html[data-fs="1"] { font-size: 110%; } html[data-fs="1"] body, html[data-fs="1"] .table { font-size: 15.5px; }
html[data-fs="2"] body, html[data-fs="2"] .table { font-size: 17px; } html[data-fs="2"] .nav-item { font-size: 15px; }
html.grid-lines .table td, html.grid-lines .table th { border-right: 1px solid #E2EDF0; }
html.grid-lines .table td:last-child, html.grid-lines .table th:last-child { border-right: 0; }
.user-pref .pill-tabs { flex-wrap: nowrap; } .user-pref .pill-tabs button { white-space: nowrap; }

/* =====================================================================
   v3 元大藍漸層主題（參考元大銀行官網：主選單藍色漸層、金融看板石板藍＋金色）
   ===================================================================== */
:root {
  --c-accent: #0093C1; --c-accent-hover: #007EA7; --c-accent-soft: #E3F5FA; --c-accent-border: #A6DCEB;
  --c-ink: #0A3550; --c-gold: #E8B84A; --c-gold-dark: #B8861F;
  --grad-brand: linear-gradient(100deg, #08355C 0%, #00769F 48%, #00A59B 100%);
  --grad-navy: linear-gradient(100deg, #08355C 0%, #00769F 48%, #00A59B 100%);
  --grad-rail: linear-gradient(180deg, #08355C 0%, #00769F 100%);
  --grad-slate: linear-gradient(180deg, #17506B 0%, #0B324B 100%);
  --c-bg-page: #EEF5F7;
}
body { color: var(--c-ink); }
.page-head h1, .card__title, .hero h1 { color: inherit; }
.page-head h1 { color: var(--c-ink); }
.card__title::before { background: var(--c-accent); }

/* 側欄：由上而下的元大藍漸層，選取為白底藍字 */
.rail { background: var(--grad-rail); }
.rail__logo { background: #fff; color: var(--c-accent-hover); box-shadow: 0 6px 16px rgba(4, 60, 80, .35); }
.rail__item { color: #D6F6FF; }
.rail__item:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.rail__item.is-active { background: #fff; color: var(--c-accent-hover); }
.rail__item.is-active svg { color: var(--c-accent-hover); }
.rail__item.is-active::before { background: var(--c-gold); }
.flyout__head::before { background: var(--grad-rail); }
.nav-item.is-active { background: var(--c-accent-soft); color: var(--c-accent-hover); box-shadow: inset 3px 0 0 var(--c-accent); }

/* 頁首：底部元大藍漸層線；跑馬燈用金融看板的石板藍＋金 */
.topbar { border-bottom: 4px solid var(--c-accent); border-image: var(--grad-brand) 1; box-shadow: none; }
.marquee { background: var(--grad-slate); color: #fff; }
.marquee svg { color: var(--c-gold); }

/* 按鈕 */
.btn--primary { background: var(--grad-brand); box-shadow: 0 6px 14px rgba(0, 146, 182, .28); border: 0; }
.btn--primary:hover { background: var(--grad-brand); filter: brightness(1.08); }
.btn--secondary { border: 2px solid var(--c-ink); color: var(--c-ink); }
.btn--secondary:hover { background: var(--c-accent-soft); }
.btn--ghost { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.btn--tour { background: linear-gradient(135deg, #F0C766, var(--c-gold) 55%, var(--c-gold-dark)); color: #1C3A44; box-shadow: 0 4px 12px rgba(184, 134, 31, .35); }
.page-head__icon { background: var(--grad-brand); box-shadow: 0 6px 14px rgba(0, 146, 182, .3); }

/* 表格：金融看板風格表頭 */
.table th { background: #2E6A7E; background-image: var(--grad-slate); color: #fff; border-bottom: 3px solid var(--c-gold); }
.table tbody tr:hover { background: var(--c-accent-soft); }
html.grid-lines .table th { border-right-color: rgba(255, 255, 255, .18); }

/* 首頁橫幅與指標 */
.hero { background: var(--grad-navy); box-shadow: 0 16px 32px rgba(0, 146, 182, .28); }
.hero__stats { background: rgba(4, 60, 80, .3); border-color: rgba(255, 255, 255, .22); }
.hero p b { color: var(--c-gold); }
.ring .ring__v { stroke: var(--c-gold); }
.kpi-tile { border: 2px solid var(--c-ink); }
.kpi-tile--blue { --tc: #0092B6; --tb: #E6F8FC; }
.kpi-tile--violet { --tc: #2E6A7E; --tb: #E8F3F7; }
.kpi-tile--amber { --tc: #B8861F; --tb: #FBF3DF; }
.kpi-tile__icon { background: var(--grad-brand); }
.kpi-tile--violet .kpi-tile__icon { background: var(--grad-slate); }
.kpi-tile--amber .kpi-tile__icon { background: linear-gradient(135deg, #F0C766, var(--c-gold-dark)); }
.stat { border-top-width: 4px; }
.stat--blue { --sc: #0092B6; } .stat--violet { --sc: #2E6A7E; }
.cal__d.is-today .cal__n { background: var(--grad-brand); }
.ev-約訪 { background: var(--c-accent); } .ev-會議 { background: #2E6A7E; }
.tl { border-left-color: var(--c-accent); } .tl--會議 { border-left-color: #2E6A7E; }
.fav svg { background: var(--grad-brand); }
.gs-av { background: var(--grad-brand); }
.pill-tabs button.is-active { color: var(--c-accent-hover); }

/* 客戶首頁頂部 */
.ch-head { background: var(--grad-navy); }
.ch-stats > div { background: rgba(4, 60, 80, .3); }
.ch-stats > div:nth-child(3) { background: var(--grad-slate); }
.ch-stats > div:nth-child(3) b { color: var(--c-gold); }
.ch-actions .btn--primary { background: #fff; color: var(--c-accent-hover); }
.ch-tabs .tabs__btn.is-active { border-bottom-color: var(--c-gold); }
.badge--gold { background: var(--c-gold); color: #1C3A44; }
.ch-aum div { background: var(--c-accent-soft); } .ch-aum b { color: var(--c-accent-hover); }
.hbar__track i, .mini-meter i, .claim-cam__bar i { background: var(--grad-brand); }
.ch-timeline { border-left-color: var(--c-accent-border); } .ch-timeline li::before { border-color: var(--c-accent); }
.lead { border-left-color: var(--c-accent); }

/* 商品、認領、報表 */
.type-tab.is-active { background: var(--grad-brand); }
.prod-card__type { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.claim-cam.is-active { border-color: var(--c-accent); }
.claim-card.is-sel { border-color: var(--c-accent); background: var(--c-accent-soft); }
.claim-card.is-sel .claim-check { background: var(--c-accent); border-color: var(--c-accent); }
.funnel__bar .f1 { background: #CFEEF6; } .funnel__bar .f2 { background: var(--c-accent); }
.vbar__track i { background: linear-gradient(180deg, #0AB8DB, #0A6B8C); }
.mq-preview { background: var(--grad-slate); } .mq-preview svg { color: var(--c-gold); }
.mini-steps span.is-on { background: var(--grad-brand); }

/* 登入頁：左側元大藍斜向漸層、金色標籤 */
.login__hero { background: linear-gradient(135deg, #08355C 0%, #00769F 48%, #00A59B 100%); }
.deco-ring { border-color: rgba(255, 255, 255, .18); }
.deco-chart { color: rgba(255, 255, 255, .45); }
.login__hero-desc { color: #DCF7FF; }
.hero-tag { border-color: rgba(255, 255, 255, .45); color: #fff; }
.hero-dots__dot { background: rgba(255, 255, 255, .4); } .hero-dots__dot.is-active { background: var(--c-gold); }
.login__hero-foot { color: #BFE9F5; }
.brand__mark { background: var(--grad-brand); }
.login__submit { background: var(--grad-brand); }
.boot-ring { border-color: var(--c-accent-soft); border-top-color: var(--c-accent); }
.boot-overlay__bar span { background: var(--grad-brand); }

/* 操作教學 */
.tour__card { border-top-color: var(--c-gold); }
.tour__step { color: var(--c-gold-dark); }
.tour__dots i.is-on { background: var(--c-gold); }
.tour__spot { box-shadow: 0 0 0 9999px rgba(10, 78, 102, .6), 0 0 0 3px var(--c-gold); }
.welcome__icon { background: linear-gradient(135deg, #F0C766, var(--c-gold-dark)); }

/* 跑馬燈：放在頂欄搜尋框右側的膠囊，不佔整列 */
.topbar .marquee { flex: 1 1 360px; min-width: 160px; max-width: 520px; height: 38px; padding: 0 14px 0 12px; border-radius: 999px; border: 0; background: var(--grad-slate); box-shadow: inset 0 0 0 1px rgba(232, 184, 74, .45); }
.topbar .marquee svg { width: 16px; height: 16px; flex-shrink: 0; }
.topbar .marquee__track { -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
.topbar .marquee__track span { font-size: 13px; animation-duration: 18s; }
.topbar .gsearch { flex: 0 1 340px; }
@media (max-width: 1100px) { .topbar .marquee { display: none; } }
.crumb, .user-btn__text b, .user-btn__text small { white-space: nowrap; }
.crumb { flex-shrink: 0; }
.topbar .marquee { flex: 1 1 280px; }
@media (max-width: 1280px) { .user-btn__text small { display: none; } }

/* =====================================================================
   RWD 修正：手機（iPhone 13 Pro 390px）與平板（直 820／橫 1180）
   ===================================================================== */
html, body { overflow-x: hidden; }
.main, .content, .page { min-width: 0; }
.range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.range--btns { display: flex; flex-wrap: wrap; }
input[type="date"].input, input[type="time"].input { min-width: 0; width: 100%; }
.query-field > .input, .query-field > .select, .query-field > .range { min-width: 0; }

/* 平板橫向與小筆電：頂欄精簡 */
@media (max-width: 1280px) {
  .topbar { gap: 10px; padding: 0 16px; }
  .crumb { display: none; }
  .user-btn__text { display: none; }
  .topbar .gsearch { flex: 1 1 240px; }
  .topbar .marquee { flex: 1 1 200px; min-width: 120px; }
}
/* 平板直向：功能選單改為浮出，關閉時完全藏起來（不再露出在左欄上） */
@media (max-width: 900px) {
  .flyout { left: 84px; transform: translateX(calc(-100% - 84px)); visibility: hidden; transition: transform .2s ease, visibility .2s ease; }
  .app.is-menu-open .flyout { transform: none; visibility: visible; }
  .content { padding: 20px; }
  .ch-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* 手機 */
@media (max-width: 640px) {
  .flyout { left: 0; transform: translateX(-105%); }
  .topbar { gap: 8px; padding: 0 10px; height: 56px; }
  .topbar__right { gap: 6px; }
  .topbar .gsearch { padding: 0 10px; min-width: 0; }
  .gsearch kbd, .user-btn > svg { display: none; }
  .user-btn { padding: 2px; }
  .btn--tour { width: 38px; padding: 0; justify-content: center; }
  .user-menu { right: 0; width: min(280px, calc(100vw - 20px)); }
  /* iOS 小於 16px 的輸入框在點擊時會自動放大畫面，一律用 16px */
  input, select, textarea, .input, .select, .gsearch input, .login__input { font-size: 16px !important; }
  .content { padding: 14px 14px 92px; }
  .page { gap: 12px; }
  .page-head { flex-wrap: wrap; row-gap: 6px; }
  .page-head h1 { font-size: 21px; }
  .page-head__tour { margin-left: 0; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .query-actions { margin: 18px -16px -18px; padding: 12px 16px; }
  .query-actions .btn { flex: 1; justify-content: center; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .prod-filter .select { flex: 1 1 100%; }
  .view-toggle { margin-left: auto; }
  .card--inline { flex-wrap: wrap; } .card--inline .select { width: 100%; }
  .toast { bottom: 84px; max-width: calc(100vw - 32px); text-align: center; }
  .dialog { max-height: calc(100dvh - 24px); }
  .dialog__foot { flex-wrap: wrap; }
  .dialog__foot .btn { flex: 1 1 auto; justify-content: center; }
  .overlay { padding: 12px; }
  .hero__stats { flex-wrap: wrap; justify-content: center; }
  .hero__nums { grid-template-columns: repeat(3, auto); }
  .sheet__panel { width: 100%; }
  .ch-name h2 { font-size: 20px; }
  .ch-meta { gap: 8px 12px; }
  .ch-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .claim-cams, .prod-grid { grid-template-columns: 1fr; }
  .type-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tour__card { width: calc(100vw - 32px) !important; }
}

/* v3.2 fixes: header tab scrollbar, donut center label */
.tabs { scrollbar-width: none; overflow-y: hidden; }
.tabs::-webkit-scrollbar { display: none; }
.ch-tabs { overflow-x: auto; overflow-y: hidden; }
.donut__ring { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.donut__ring svg { width: 140px; height: 140px; display: block; }
.donut__c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; pointer-events: none; line-height: 1.1; }
.donut__c span { font-size: 12px; font-weight: 500; color: var(--c-slate-500, #64748B); letter-spacing: .02em; }
.donut__c b { font-size: 20px; font-weight: 800; color: var(--ink, #0A4E66); font-variant-numeric: tabular-nums; }
.donut__c b small { font-size: 12px; font-weight: 700; margin-left: 1px; }

/* v3.3 logo mark */
.rail__logo { padding: 0; background: transparent !important; box-shadow: 0 6px 16px rgba(4, 60, 80,.35); overflow: hidden; width: 44px; height: 44px; border-radius: 12px; }
.rail__logo img, .brand__logo { display: block; width: 100%; height: 100%; }
.brand__logo { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; box-shadow: 0 6px 16px rgba(4, 60, 80,.3); }
.brand__logo--lg { width: 60px; height: 60px; border-radius: 16px; }

/* v3.4 hero ring label stays inside card */
.hero__stats .ring { margin-bottom: 24px; }
.ring small { bottom: -22px; line-height: 1.2; font-size: 12px; }

/* v3.5 客戶首頁：資產總覽 */
.as-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.as-kpi { background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.as-kpi span { font-size: 12.5px; color: var(--c-slate-500); }
.as-kpi b { font-size: 22px; color: var(--ink, #0A4E66); font-variant-numeric: tabular-nums; white-space: nowrap; }
.as-kpi b small { font-size: 12px; margin-left: 2px; }
.as-kpi > small { font-size: 12px; color: var(--c-slate-500); }
.as-kpi--main { background: var(--grad-brand); border: 0; color: #fff; box-shadow: 0 10px 22px rgba(0, 146, 182, .25); }
.as-kpi--main span, .as-kpi--main > small { color: #DBF6FE; } .as-kpi--main b { color: #fff; }
.as-kpi--main > small.is-up { color: var(--c-gold); } .as-kpi--main > small.is-down { color: #A7F3D0; }
.is-up { color: #D92D20 !important; } .is-down { color: #0E9F6E !important; }
.as-trend { width: 100% !important; height: 170px !important; display: block; }
.as-grid { stroke: #E6F3F7; stroke-width: 1; }
.as-dot { fill: #fff; stroke: #0092B6; stroke-width: 2; } .as-dot--last { fill: var(--c-gold, #E8B84A); stroke: #fff; stroke-width: 2; }
.as-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin: 2px 5% 0; font-size: 11.5px; color: var(--c-slate-500); text-align: center; }
.as-stack { display: flex; height: 18px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 4px 0 14px; }
.as-stack i { display: block; min-width: 4px; }
.as-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.as-legend li { display: grid; grid-template-columns: 12px 1fr auto 56px; align-items: center; gap: 10px; font-size: 13.5px; }
.as-legend li i { width: 12px; height: 12px; border-radius: 3px; }
.as-legend li span { color: var(--c-slate-500); font-variant-numeric: tabular-nums; } .as-legend li b { text-align: right; font-variant-numeric: tabular-nums; }
.as-note { margin: 12px 0 0; font-size: 12.5px; color: var(--c-slate-500); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.as-note b { color: var(--ink, #0A4E66); }
.as-warn { display: inline-flex; align-items: center; gap: 6px; color: #B45309; font-weight: 600; }
.as-warn svg { width: 16px; height: 16px; }
.as-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.as-table th.num { text-align: right; }
.rr { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--c-accent-soft, #E6F7FB); color: #0092B6; }
.rr.is-over { background: #FEF3C7; color: #92400E; }
.as-due { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.as-due__item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--c-border); background: #F8FDFE; }
.as-due__item > b { font-size: 24px; color: #0092B6; min-width: 48px; text-align: center; line-height: 1; }
.as-due__item > b small { font-size: 12px; margin-left: 1px; }
.as-due__item div { display: flex; flex-direction: column; min-width: 0; } .as-due__item div span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-due__item div small { color: var(--c-slate-500); font-size: 12px; }
.as-due__item.is-soon { border-color: #F5C26B; background: #FFFBEB; } .as-due__item.is-soon > b { color: #B45309; }
@media (max-width: 1100px) { .as-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .as-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .as-kpi--main { grid-column: 1 / -1; }
  .as-kpi b { font-size: 19px; }
  .as-trend { height: 140px !important; }
  .as-months span:nth-child(odd) { visibility: hidden; }
  .ch-tabs .tabs__btn { padding-left: 10px; padding-right: 10px; }
}
.ch-card { min-width: 0; }
@media (max-width: 900px) { .ch-grid { grid-template-columns: minmax(0, 1fr); } }
.as-trend { height: auto !important; }
.as-trend circle { stroke-width: 2; }
.as-months { position: relative; display: block; height: 18px; margin: 4px 0 0; }
.as-months span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.as-months span:first-child { transform: none; } .as-months span:last-child { transform: translateX(-100%); }
.as-kpi--main > small { align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff !important; font-weight: 600; }
@media (max-width: 640px) { .as-months span { visibility: visible !important; } .as-months span:nth-child(even) { visibility: hidden !important; } }
.as-kpi--main b small { color: #fff; opacity: .85; }

/* v3.6 表格凍結欄 + 右上角橫向拉霸（比照凱基理規 FPS 查詢結果 FPFIM900 的 Tablesaw swipe 版型）
 * 原生水平捲軸隱藏；欄位超出時，表格右上角出現 ‹ 拉霸 ›，前幾欄固定不動。 */
.xs-frame { position: relative; }
.table-wrap.is-xs { margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior-x: contain; }
.table-wrap.is-xs::-webkit-scrollbar { display: none; width: 0; height: 0; }
.table-wrap.is-xs > .table { border-collapse: separate; border-spacing: 0; }
.xs-frame::after { content: ""; position: absolute; top: var(--xs-head, 0px); right: 0; bottom: 0; width: 40px; pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .96)); opacity: 0; transition: opacity .2s ease; }
.xs-frame.more-right::after { opacity: 1; }
.table .is-frozen { position: sticky; z-index: 1; background-color: #fff; }
.table thead th.is-frozen { z-index: 2; background-color: #2E6A7E; }
.table tbody tr:hover td.is-frozen { background-color: var(--c-accent-soft); }
.table .is-frozen-last { transition: box-shadow .2s ease; }
.table-wrap.is-scrolled .is-frozen-last { box-shadow: 10px 0 12px -10px rgba(10, 78, 102, .5); }
.table-wrap.is-scrolled td.is-frozen-last { border-right: 1px solid #D5EAF0; }

.table-bar > .xs { order: 3; }
.xs-bar { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.xs { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.xs[hidden] { display: none; }
.xs__btn { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--c-border); background: #fff; color: var(--c-ink); cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.xs__btn:hover:not(:disabled) { background: var(--c-accent-soft); border-color: var(--c-accent-border); color: var(--c-accent-hover); }
.xs__btn:disabled { opacity: .35; cursor: default; }
.xs__btn:focus-visible, .xs__track:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-accent-soft), 0 0 0 4px var(--c-accent-hover); }
.xs__track { position: relative; width: 140px; height: 30px; cursor: pointer; touch-action: none; border-radius: 999px; }
.xs__track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 999px; background: #E1F0F5; box-shadow: inset 0 1px 2px rgba(10, 78, 102, .14); }
.xs__thumb { position: absolute; left: 0; top: 50%; height: 22px; margin-top: -11px; cursor: grab; touch-action: none; }
.xs__thumb::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 999px; background: var(--grad-brand); box-shadow: 0 1px 3px rgba(0, 146, 182, .35); transition: height .15s ease, margin-top .15s ease; }
.xs__track:hover .xs__thumb::before, .xs.is-drag .xs__thumb::before { height: 12px; margin-top: -6px; }
.xs.is-drag .xs__thumb { cursor: grabbing; }
@media (max-width: 640px) {
  .table-bar > .xs, .xs-bar > .xs, .card__title > .xs { flex: 1 1 100%; }
  .xs__track { flex: 1; width: auto; height: 34px; }
  .xs__btn { width: 34px; height: 34px; }
}

/* v3.7 資產總覽：資產種類頁籤（全資產＋各類庫存明細 MDCRM3xx，比照 mfo 客戶資產頁籤） */
.as-nav { position: sticky; top: -20px; z-index: 6; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -20px -28px 16px; padding: 12px 28px;
  background: rgba(238, 247, 250, .94); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(10, 78, 102, .08); }
.as-nav::-webkit-scrollbar { display: none; }
.as-nav:empty { min-height: 58px; }
.as-pill { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--c-border); background: #fff;
  color: var(--c-slate-600); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.as-pill:hover { border-color: var(--c-accent-border); color: var(--c-accent-hover); }
.as-pill b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--c-accent-soft); color: var(--c-accent-hover); font-size: 12px; display: inline-grid; place-items: center; }
.as-pill.is-zero { color: var(--c-slate-400); } .as-pill.is-zero b { background: var(--c-bg-soft); color: var(--c-slate-400); }
.as-pill.is-active { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(0, 146, 182, .28); }
.as-pill.is-active b { background: rgba(255, 255, 255, .22); color: #fff; }
.as-pill:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-accent-soft), 0 0 0 4px var(--c-accent-hover); }

.as-cat__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 2px 0 14px; }
.as-cat__head h3 { margin: 0; font-size: 20px; color: var(--c-ink); }
.as-cat__head p { margin: 4px 0 0; font-size: 12.5px; color: var(--c-slate-500); }
.as-code { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--c-accent-hover); background: var(--c-accent-soft); border: 1px solid var(--c-accent-border); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

.as-sum { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.as-tile { background: #fff; border: 1px solid var(--c-border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.as-tile > span { font-size: 12px; color: var(--c-slate-500); }
.as-tile > b { font-size: 17px; color: var(--c-ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-tile > small { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--c-slate-500); }
.as-tile:first-child { background: var(--grad-brand); border-color: transparent; box-shadow: 0 8px 18px rgba(0, 146, 182, .22); }
.as-tile:first-child > span, .as-tile:first-child > small { color: #DBF6FE; } .as-tile:first-child > b { color: #fff; }
.card__title:has(> .xs) { flex-wrap: wrap; row-gap: 10px; }
.card__title > .xs { font-size: 13px; font-weight: 500; }

.as-mini { display: grid; gap: 16px; margin-bottom: 16px; }
.as-mini--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .as-mini--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hbars--wide .hbar { grid-template-columns: minmax(56px, 104px) minmax(0, 1fr) 52px; }
.hbars--wide .hbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c-slate-600); }

.as-list { margin-bottom: 16px; }
.as-table th { white-space: nowrap; line-height: 1.35; vertical-align: middle; }
.as-table td { vertical-align: middle; }
.as-table td b { color: var(--c-ink); font-weight: 600; }
.c2 { display: inline-flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.c2 small { font-size: 12px; color: var(--c-slate-500); }
td.num .c2 { align-items: flex-end; }
.as-total td { background: #F3FBFD; font-weight: 600; border-top: 2px solid var(--c-accent-border); }
.as-go { color: var(--c-slate-400); font-size: 18px; text-align: center; width: 28px; }
tr.clickable:hover .as-go { color: var(--c-accent-hover); }
.as-share { display: inline-block; vertical-align: middle; width: 56px; height: 6px; margin-right: 8px; border-radius: 999px; background: var(--c-bg-soft); overflow: hidden; }
.as-share i { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); }
.as-risk { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; font-size: 13px; line-height: 1.7; }
.as-risk svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; }
.as-risk .link { color: #B45309; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.as-kpi--link { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.as-kpi--link:hover { border-color: var(--c-accent-border); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.as-due__item { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.as-due__item:hover { border-color: var(--c-accent-border); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.as-emptycard { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.as-detail .kv__v { text-align: left; }
.donut__item { display: flex; align-items: center; gap: 8px; width: calc(100% + 8px); padding: 3px 4px; margin: -3px -4px; border: 0; background: none; font: inherit; font-size: 13px; color: inherit; cursor: pointer; border-radius: 6px; text-align: left; }
.donut__item:hover { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.donut__item b { margin-left: auto; } .donut__item i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
@media (max-width: 1100px) { .as-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); } .as-mini--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .as-nav { top: -16px; margin: -16px -16px 12px; padding: 10px 16px; }
  .as-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .as-mini--2, .as-mini--3 { grid-template-columns: minmax(0, 1fr); }
  .as-cat__head { flex-wrap: wrap; align-items: flex-start; }
  .as-cat__head h3 { font-size: 18px; }
}
.as-detail .kv__k { width: 132px; line-height: 1.35; } .as-detail .kv__row { align-items: flex-start; }
/* 手機：整個客戶首頁面板一起捲動（頁首捲走、資產種類頁籤吸頂），內容區不再被頁首擠壓 */
@media (max-width: 640px) {
  .sheet__panel { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
  #sheetBody { height: auto; min-height: 100%; }
  .ch-body { flex: none; overflow: visible; }
  .as-nav { top: 0; }
}
.as-total td.is-frozen { background-color: #F3FBFD; }
@media (max-width: 640px) {
  /* 手機：商品名稱欄可換行，讓第一欄能凍結、數字欄左右滑 */
  .as-table th:first-child, .as-table td:first-child { white-space: normal; min-width: 116px; max-width: 42vw; }
  .as-table td:first-child .c2 b { display: block; line-height: 1.35; }
}
/* 相鄰凍結欄之間補 1px，避免高解析螢幕出現縫隙透出底下的內容 */
.table td.is-frozen:not(.is-frozen-last) { box-shadow: 1px 0 0 0 #fff; }
.table th.is-frozen:not(.is-frozen-last)::after { content: ""; position: absolute; top: 0; bottom: 0; right: -1px; width: 1px; background: var(--grad-slate); }
.table tbody tr:hover td.is-frozen:not(.is-frozen-last) { box-shadow: 1px 0 0 0 var(--c-accent-soft); }
.as-total td.is-frozen:not(.is-frozen-last) { box-shadow: 1px 0 0 0 #F3FBFD; }

/* v3.8 拉霸比照凱基理規 FPFIM900：右上角一條細長軌道＋膠囊把手（不放箭頭、不用原生捲軸） */
.xs__track { width: 330px; height: 24px; }
.xs__track::before { height: 8px; margin-top: -4px; background: #E3F2F6; box-shadow: inset 0 1px 2px rgba(10, 78, 102, .16); }
.xs__thumb { width: 44px; height: 16px; margin-top: -8px; }
.xs__thumb::before { top: 0; bottom: 0; height: auto; margin-top: 0; border-radius: 999px; background: linear-gradient(180deg, #2FBEE6 0%, #0B9CC4 100%);
  border: 2px solid #fff; box-shadow: 0 0 0 1px #8ED9EE, 0 2px 5px rgba(0, 124, 160, .28); transition: box-shadow .15s ease; }
.xs__track:hover .xs__thumb::before, .xs.is-drag .xs__thumb::before { height: auto; margin-top: 0;
  box-shadow: 0 0 0 1px #5ECBEA, 0 0 0 5px rgba(0, 162, 198, .14), 0 2px 6px rgba(0, 124, 160, .3); }
@media (max-width: 1100px) { .xs__track { width: 240px; } }
@media (max-width: 640px) { .xs__track { flex: 1; width: auto; height: 32px; } .xs__thumb { width: 52px; height: 18px; margin-top: -9px; } }
/* 凍結欄分界：有橫向欄位時就顯示陰影（比照 FPFIM900），捲動後更明顯；可捲動區的儲存格淡灰底，和凍結區做出區隔 */
.xs-frame.has-overflow .table .is-frozen-last { box-shadow: 6px 0 8px -6px rgba(10, 78, 102, .35); }
.xs-frame.has-overflow .table-wrap.is-scrolled .is-frozen-last { box-shadow: 10px 0 12px -8px rgba(10, 78, 102, .5); }
.xs-frame.has-overflow .table-wrap.has-freeze tbody td:not(.is-frozen) { background-color: #F8FCFD; }
.xs-frame.has-overflow .table-wrap.has-freeze tbody tr:hover td:not(.is-frozen) { background-color: var(--c-accent-soft); }
/* 登入頁：小螢幕不被內容撐寬 */
@media (max-width: 900px) { .login__body { grid-template-columns: minmax(0, 1fr); } .login__panel { min-width: 0; } .login__panel-foot { text-align: center; padding: 0 8px; } }

/* v3.9 分頁頁碼移到表格左上角（比照凱基理規 FPFIM900：‹ 頁碼 › 共 N 頁 / 共 N 筆資料） */
.pg { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pg__grp { display: inline-flex; align-items: stretch; height: 32px; border: 1px solid var(--c-border); border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(15, 34, 42, .04); }
.pg__btn { width: 32px; padding: 0; border: 0; background: #fff; color: var(--c-ink); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; transition: background .15s ease, color .15s ease; }
.pg__btn:hover:not(:disabled) { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.pg__btn:disabled { color: var(--c-slate-300); cursor: default; }
.pg__input { width: 48px; min-width: 0; padding: 0 4px; border: 0; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); background: #fff;
  text-align: center; font: inherit; font-size: 14px; font-weight: 600; color: var(--c-ink); outline: none; font-variant-numeric: tabular-nums; }
.pg__input:focus { background: var(--c-accent-soft); color: var(--c-accent-hover); }
.pg__input[readonly] { color: var(--c-slate-500); }
.pg__btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--c-accent-hover); }
.pg__info { font-size: 13px; color: var(--c-slate-500); white-space: nowrap; }
.pg__info b { color: var(--c-accent-hover); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .pg__grp { height: 36px; } .pg__btn { width: 38px; } .pg__input { width: 52px; } }

/* ================= v4.0 全系統按鈕統一 =================
 * 三種層級、同一個外型（高度、圓角、字重、圖示大小一致）：
 *   主要 .btn--primary   ：品牌藍漸層實心，一個區塊只放一顆（查詢、登入、儲存、送出）
 *   次要 .btn--secondary ：白底＋藍色細框＋藍字（清除、匯出、新增、取消…）
 *        .btn--ghost     ：與次要按鈕同一外觀（舊 class 保留相容）
 *   危險 .is-danger-text ：次要按鈕外型＋紅字紅框（退回、作廢）
 *   文字 .link / .btn--ghost-plain：無框純文字
 * 深色底上的按鈕（客戶首頁頁首、首頁橫幅）另用 .btn--glass / .btn--light，外型相同只換配色。 */
.btn { height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 14px; letter-spacing: .01em; gap: 6px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, filter .15s ease; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--sm svg { width: 15px; height: 15px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 162, 198, .22); }
.btn--primary { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: 0 2px 6px rgba(0, 146, 182, .28); }
.btn--primary:hover { background: var(--grad-brand); filter: brightness(1.08); }
.btn--secondary, .btn--ghost { background: #fff; color: var(--c-accent-hover); border: 1px solid var(--c-accent-border); box-shadow: 0 1px 2px rgba(10, 78, 102, .06); }
.btn--secondary:hover, .btn--ghost:hover { background: var(--c-accent-soft); border-color: #86D3E6; color: var(--c-accent-hover); }
.btn--secondary.is-danger-text { border-color: #F3C4C4; }
.btn--secondary.is-danger-text:hover { background: #FEF2F2; border-color: #EBA3A3; }
.btn:disabled, .btn:disabled:hover { opacity: .45; cursor: not-allowed; filter: none; }
/* 深色底上的次要按鈕（首頁橫幅／客戶首頁頁首）：外型同次要按鈕，只換成白框半透明 */
.btn--glass, .ch-actions .btn--secondary { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .45); box-shadow: none; }
.btn--glass:hover, .ch-actions .btn--secondary:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .7); color: #fff; }
.btn--light, .ch-actions .btn--primary { background: #fff; color: var(--c-accent-hover); border-color: #fff; box-shadow: 0 2px 6px rgba(4, 60, 80, .2); filter: none; }
.btn--light:hover, .ch-actions .btn--primary:hover { background: var(--c-accent-soft); }
.login__submit { height: 44px; }
.login__demo { height: 40px; }
/* 頂列「操作教學」也改用次要按鈕外型，全系統只保留一種主要按鈕（藍漸層） */
.btn--tour { background: #fff; color: var(--c-accent-hover); border: 1px solid var(--c-accent-border); box-shadow: 0 1px 2px rgba(10, 78, 102, .06); }
.btn--tour:hover { background: var(--c-accent-soft); border-color: #86D3E6; filter: none; }
.btn--tour svg { color: var(--c-gold-dark); }
.table-bar__right { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
/* 分頁中間改為頁碼下拉選單（比照 FPFIM900） */
.pg__select { width: 64px; min-width: 0; height: 100%; padding: 0 20px 0 10px; border: 0; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); border-radius: 0;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  -webkit-appearance: none; appearance: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--c-ink); text-align: center; text-align-last: center; cursor: pointer; outline: none; font-variant-numeric: tabular-nums; }
.pg__select:hover:not(:disabled), .pg__select:focus { background-color: var(--c-accent-soft); color: var(--c-accent-hover); }
.pg__select:disabled { color: var(--c-slate-500); cursor: default; background-image: none; padding: 0 10px; }
@media (max-width: 640px) { .pg__select { width: 72px; } }

/* v4.1 客戶首頁：抽屜左側書籤式「近期瀏覽客戶」頁簽（最多 8 位） */
.ch-marks { display: none; }
.sheet.has-marks .ch-marks { display: flex; }
.ch-marks { position: absolute; right: 100%; top: 88px; z-index: 3; flex-direction: column; align-items: flex-end; gap: 6px;
  max-height: calc(100% - 110px); overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding: 6px 0 12px 14px; }
.ch-marks::-webkit-scrollbar { display: none; }
.ch-marks__head { writing-mode: vertical-rl; font-size: 12px; font-weight: 600; letter-spacing: .35em; color: rgba(255, 255, 255, .9); margin: 0 12px 6px 0;
  padding-bottom: 8px; border-bottom: 2px solid var(--c-gold); text-shadow: 0 1px 2px rgba(4, 60, 80, .5); }
.ch-mark { position: relative; flex-shrink: 0; }
.ch-mark__go { display: flex; align-items: center; justify-content: center; width: 40px; min-height: 72px; padding: 12px 0; border: 0; border-radius: 12px 0 0 12px;
  background: #fff; color: var(--c-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: -3px 3px 10px rgba(4, 60, 80, .22), inset -4px 0 6px -4px rgba(4, 60, 80, .15); transform: translateX(4px);
  transition: transform .15s ease, background-color .15s ease, width .15s ease, box-shadow .15s ease; }
.ch-mark__go span { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: .12em; white-space: nowrap; }
.ch-mark__go:hover { transform: translateX(0); background: #EEFAFD; color: var(--c-accent-hover); }
.ch-mark__go:focus-visible { outline: none; box-shadow: -3px 3px 10px rgba(4, 60, 80, .22), 0 0 0 3px rgba(0, 162, 198, .35); }
.ch-mark.is-active .ch-mark__go { width: 46px; transform: translateX(1px); cursor: default; color: #fff;
  background: linear-gradient(180deg, #08355C 0%, #00769F 100%); box-shadow: -5px 5px 14px rgba(4, 60, 80, .35), inset 3px 0 0 var(--c-gold); }
.ch-mark__x { position: absolute; top: -5px; left: -7px; width: 20px; height: 20px; padding: 0; border: 2px solid #fff; border-radius: 50%;
  background: var(--c-slate-500); color: #fff; font-size: 12px; line-height: 15px; cursor: pointer; opacity: 0; transform: scale(.8); transition: opacity .15s ease, transform .15s ease; }
.ch-mark:hover .ch-mark__x, .ch-mark__x:focus-visible { opacity: 1; transform: scale(1); }
.ch-mark__x:hover { background: var(--c-danger-dark); }
@media (min-width: 641px) { .sheet.has-marks .sheet__panel { width: min(1120px, calc(100% - 64px)); } }
@media (max-width: 640px) {
  /* 手機：改成頁首上方一排可左右滑的客戶膠囊 */
  .sheet.has-marks .ch-marks { position: static; flex-direction: row; align-items: center; gap: 6px; max-height: none; overflow-x: auto; overflow-y: hidden;
    padding: 10px 16px 2px; background: var(--grad-navy); }
  .ch-marks__head { writing-mode: horizontal-tb; letter-spacing: .08em; margin: 0 4px 0 0; padding: 0 8px 0 0; border-bottom: 0; border-right: 2px solid var(--c-gold); flex-shrink: 0; }
  .ch-mark__go { width: auto; min-height: 30px; padding: 0 12px; border-radius: 999px; transform: none; box-shadow: none; background: rgba(255, 255, 255, .14);
    color: #fff; border: 1px solid rgba(255, 255, 255, .35); font-size: 13px; }
  .ch-mark__go span { writing-mode: horizontal-tb; letter-spacing: .02em; }
  .ch-mark__go:hover { transform: none; background: rgba(255, 255, 255, .24); color: #fff; }
  .ch-mark.is-active .ch-mark__go { width: auto; transform: none; background: #fff; color: var(--c-accent-hover); box-shadow: none; border-color: #fff; }
  .ch-mark__x { display: none; }
}
/* 近期訪談紀錄時間軸：圓點與直線精準對齊（線段畫在每一點之間，最後一點不延伸） */
.ch-timeline { list-style: none; margin: 0; padding: 0; border: 0; }
.ch-timeline li { position: relative; padding: 0 0 18px 30px; }
.ch-timeline li:last-child { padding-bottom: 0; }
.ch-timeline li::before { content: ""; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%;
  background: #fff; border: 3px solid var(--c-accent); z-index: 1; }
.ch-timeline li:first-child::before { background: var(--c-accent); box-shadow: 0 0 0 4px var(--c-accent-soft); }
.ch-timeline li::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 2px; border-radius: 2px; background: var(--c-accent-border); }
.ch-timeline li:last-child::after { display: none; }
/* 書籤頁簽標題：深藍小膠囊，模糊背景上也清楚 */
.ch-marks__head { writing-mode: vertical-rl; background: rgba(10, 78, 102, .88); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .25em;
  padding: 10px 6px; margin: 0 6px 6px 0; border: 0; border-radius: 999px; box-shadow: 0 4px 10px rgba(4, 60, 80, .3), inset 0 -3px 0 var(--c-gold); text-shadow: none; }
@media (max-width: 640px) { .ch-marks__head { writing-mode: horizontal-tb; background: none; box-shadow: none; padding: 0 8px 0 0; margin: 0 4px 0 0; border-radius: 0; border-right: 2px solid var(--c-gold); letter-spacing: .08em; } }
@media (max-width: 640px) { .sheet.has-marks .ch-marks { flex-shrink: 0; min-height: 44px; padding: 8px 16px 6px; } }
.ch-marks__head { white-space: nowrap; flex-shrink: 0; }
/* 書籤頁簽改為「頭像＋橫排姓名」：避免直排時遮罩符號「○」歪斜，也更好辨識 */
.ch-marks__head { writing-mode: horizontal-tb; width: 44px; padding: 7px 0; margin: 0 6px 6px 0; text-align: center; line-height: 1.25; letter-spacing: .08em; font-size: 11.5px; border-radius: 10px; }
.ch-mark__go { width: 56px; min-height: 0; padding: 9px 4px 8px; flex-direction: column; gap: 5px; }
.ch-mark__go span { writing-mode: horizontal-tb; letter-spacing: 0; }
.ch-mark__av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--c-accent-soft); color: var(--c-accent-hover); font-size: 13px; font-weight: 700; }
.ch-mark__nm { font-size: 12px; font-weight: 600; line-height: 1.2; }
.ch-mark.is-active .ch-mark__go { width: 62px; }
.ch-mark.is-active .ch-mark__av { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: 0 0 0 2px var(--c-gold); }
@media (min-width: 641px) { .sheet.has-marks .sheet__panel { width: min(1120px, calc(100% - 80px)); } }
@media (max-width: 640px) {
  .ch-marks__head { width: auto; padding: 0 8px 0 0; margin: 0 4px 0 0; border-radius: 0; font-size: 12px; }
  .ch-marks__head br { display: none; }
  .ch-mark__go { width: auto; flex-direction: row; padding: 0 12px; gap: 0; }
  .ch-mark__av { display: none; }
  .ch-mark__nm { font-size: 13px; }
  .ch-mark.is-active .ch-mark__go { width: auto; }
}
/* 頁碼下拉：比照 FPFIM900 平時只顯示數字（不放箭頭），滑過／聚焦時才淡淡提示可下拉 */
.pg__select { width: 56px; padding: 0 8px; background-image: none; }
.pg__select:hover:not(:disabled), .pg__select:focus {
  background: var(--c-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M1 1l3 3 3-3' fill='none' stroke='%2386A9D4' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 5px center / 8px 5px; }
@media (max-width: 640px) { .pg__select { width: 60px; } }
/* 換頁動畫：資料列先淡出，再逐列淡入並微微浮現（比照 FPFIM900）；系統設定「減少動態效果」時不播放 */
.table tbody { transition: opacity .15s ease; }
.table tbody.is-out { opacity: 0; }
.table tbody.is-in tr { animation: pgRowIn .34s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes pgRowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .table tbody { transition: none; } .table tbody.is-in tr { animation: none; } }
/* 置頂的書籤（目前客戶）滑入 */
.ch-mark.is-active .ch-mark__go { animation: markIn .28s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes markIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(1px); } }
@media (max-width: 640px) { @keyframes markIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } } }
@media (prefers-reduced-motion: reduce) { .ch-mark.is-active .ch-mark__go { animation: none; } }
/* 換頁淡入浮現放慢，比照 FPFIM900（card-fade-up 0.95s、逐張延遲）：先淡出 0.26 秒，再逐列由下往上浮現，每列約 0.7 秒、間隔 0.07 秒 */
.table tbody { transition: opacity .26s ease; }
.table tbody.is-in tr { animation: pgRowIn .7s cubic-bezier(.22, .61, .36, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes pgRowIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .table tbody { transition: none; } .table tbody.is-in tr { animation: none; } }
