/* ╔═══════════════════════════════════════════════════════════════╗
   PERPETUA Dashboard — Light Fintech Theme
   靈感：Stripe / Linear / 太陽能工程圖紙的清晰感
   暖白底 + 深墨字 + 金棕強調 + 細節線條
   ╚═══════════════════════════════════════════════════════════════╝ */

:root {
  /* 背景 — 雲彩紙（冷白系、tienlipaper #210） */
  --bg: #f3f4f4;           /* 雲彩紙底 */
  --bg-elev: #ffffff;      /* 卡片白 */
  --bg-sub: #ebedec;       /* 微底／hover */
  --bg-sub-2: #dde0df;

  /* 文字（白紋理底下全部加深；細字配 400 以上字重） */
  --ink: #0f0f14;          /* 主文 */
  --ink-2: #22242a;        /* 次文 */
  --ink-3: #3c4049;        /* 提示（原 #4a4e58 在紋理上仍糊、再深一階） */
  --ink-4: #50545e;        /* 靜默（原 #6a6e78 太淡） */

  /* 品牌（墨金、低飽和、不飛濺） */
  --gold: #9a6f18;         /* 深墨金、當文字/邊線 */
  --gold-2: #c8a04b;       /* 亮金、hover */
  --gold-ink: #7a5710;     /* 更深、正文強調 */
  --gold-soft: #fbf4e0;    /* 金底淺底色 */
  --gold-line: #e8d7a7;    /* 金細線 */

  /* 語意 */
  --red: #c0392b;
  --red-soft: #fdeaea;
  --green: #1f7a4d;
  --green-soft: #e6f4ec;
  --blue: #2e5d9a;
  --blue-soft: #e9f0f9;

  /* 線 */
  --line: #e1e3e2;
  --line-strong: #c8cccb;
  --line-soft: #ebedec;

  /* 方框統一色（語意化、light/dark 自動切換）*/
  --card-bg:              #fbf4e0;    /* 標準卡片底 */
  --card-bg-featured:     #f7ebc7;    /* 強調卡片底 */
  --card-bg-header:       #f5e9c0;    /* 表頭列 */
  --card-bg-row-alt:      #efe1bc;    /* 特殊表格列 */
  --card-border:          #e8d7a7;
  --card-border-featured: #d9c286;

  /* 陰影 */
  --shadow-sm: 0 1px 2px rgba(28,24,15,.04), 0 1px 1px rgba(28,24,15,.03);
  --shadow-md: 0 2px 8px rgba(28,24,15,.06), 0 1px 3px rgba(28,24,15,.04);
  --shadow-lg: 0 12px 40px rgba(28,24,15,.08), 0 4px 12px rgba(28,24,15,.05);

  /* 字級 */
  --font-sans: 'Inter', 'Noto Sans TC', -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', 'Noto Serif TC', 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --radius: 8px;
  --radius-lg: 14px;
  --maxw: 1160px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light; }   /* 全站鎖 light、避免 iOS dark mode 把 panel 變黑底 → 深字不可讀 */
html, body { height: 100%; }

/* ═══ Dark Mode palette 已停用 — 全站鎖 light theme（避免 iOS dark mode 反白 panel 文字看不到）═══ */
@media (prefers-color-scheme: dark) and (max-width: 0px) {
  :root {
    /* 背景：深暖棕（對應 light 的雲彩紙）*/
    --bg:        #15120c;
    --bg-elev:   #1f1a11;    /* 卡片底 — 深暖棕 */
    --bg-sub:    #2a2417;
    --bg-sub-2:  #352d1d;

    /* 文字：奶油色（對應 light 的深墨）*/
    --ink:     #f4eadb;      /* 主文 */
    --ink-2:   #d9ccb1;      /* 次文 */
    --ink-3:   #b8a883;      /* 提示 */
    --ink-4:   #96876a;      /* 靜默 */

    /* 品牌金：在暗底上可用更亮的金 */
    --gold:       #d4af37;
    --gold-2:     #e8c878;
    --gold-ink:   #e6c477;
    --gold-soft:  #2e2517;   /* 金色卡片底（取代 light 的 #fbf4e0）*/
    --gold-line:  #544118;

    /* 語意 */
    --red:        #ef4444;
    --red-soft:   #3a1a18;
    --green:      #22c55e;
    --green-soft: #133b26;
    --blue:       #6ba6ff;
    --blue-soft:  #1a2842;

    /* 線 */
    --line:        #3a3220;
    --line-strong: #584a2c;
    --line-soft:   #2a2417;

    /* 方框統一色（dark mode 版本：深暖棕、比頁面 bg 亮一點）*/
    --card-bg:              #221c10;
    --card-bg-featured:     #2e2517;
    --card-bg-header:       #2a2417;
    --card-bg-row-alt:      #352d1d;
    --card-border:          #3a3220;
    --card-border-featured: #7a5710;

    /* 陰影（暗底的陰影要淡一點、或用 inset-like border）*/
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  }
}

body {
  font-family: var(--font-sans);
  /* 雲彩紙紋 — 純 CSS（SVG noise filter）、取代 yuncai.jpg、自動適應 dark mode */
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.07  0 0 0 0 0.04  0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>"),
    radial-gradient(ellipse 1200px 800px at 15% 10%, rgba(168,140,90,0.06), transparent 55%),
    radial-gradient(ellipse 900px 700px at 85% 60%, rgba(180,160,120,0.05), transparent 60%),
    radial-gradient(ellipse 1100px 600px at 50% 95%, rgba(170,150,110,0.05), transparent 55%);
  background-size: 200px 200px, auto, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Dark mode body bg override 已移除 — 全站固定 light theme（color-scheme:light）*/

a { color: var(--gold-ink); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-2); }

::selection { background: var(--gold-soft); color: var(--gold-ink); }

/* ═══ Typography Utilities ═══ */
.mono { font-family: var(--font-mono); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-sans); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.dim { color: var(--ink-3); font-weight: 500; }
.mute { color: var(--ink-4); font-weight: 500; }
.small { font-size: 13px; }
.caps { letter-spacing: .14em; text-transform: uppercase; font-size: 11px; color: var(--ink-3); font-weight: 600; }

/* ═══ Top Bar ═══ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 36px;
  padding: 14px 32px;
  background: rgba(52, 56, 60, .88);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(200,160,75,.20);
  box-shadow: 0 2px 16px rgba(20,25,30,.10);
}
.topbar .logo {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .28em;
  background: linear-gradient(135deg, #b88a1f 0%, #f3ca4f 35%, #ffe7a0 50%, #f3ca4f 65%, #b88a1f 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(243,202,79,0.55)) drop-shadow(0 0 2px rgba(200,160,75,0.5));
  display: flex; align-items: center; gap: 8px;
  animation: logo-shimmer 4s ease-in-out infinite;
}
@keyframes logo-shimmer {
  0%, 100% { background-position: 0% 50%; filter: drop-shadow(0 0 6px rgba(243,202,79,0.55)) drop-shadow(0 0 2px rgba(200,160,75,0.5)); }
  50%      { background-position: 100% 50%; filter: drop-shadow(0 0 14px rgba(255,215,120,0.8)) drop-shadow(0 0 4px rgba(255,200,100,0.7)); }
}
.topbar .logo::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--gold-2);
  border-radius: 1px;
  transform: rotate(45deg);
  -webkit-text-fill-color: initial;
}
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  padding: 7px 14px;
  font-size: 14px;
  color: rgba(236, 232, 221, .72);
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.topbar nav a:hover { background: rgba(255,255,255,.06); color: var(--gold-2); }
.topbar nav a.active { background: rgba(200,160,75,.15); color: var(--gold-2); }
.topbar .tb-right { display: flex; gap: 10px; align-items: center; font-size: 13px; color: rgba(236,232,221,.72); }
.topbar .tb-right .ghost { color: rgba(236,232,221,.85); border-color: rgba(200,160,75,.35); background: transparent; }
.topbar .tb-right .ghost:hover { background: rgba(200,160,75,.15); color: var(--gold-2); }

/* Hamburger toggle — 桌機隱藏，手機顯示 */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(200,160,75,.35);
  border-radius: 8px;
  width: 40px; height: 38px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--gold-2);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══ Layout ═══ */
.container { max-width: var(--maxw); margin: 0 auto; padding: 32px 28px 80px; }
.container-narrow { max-width: 440px; margin: 56px auto; padding: 0 20px; }

/* Split layout for auth pages (intro + form) */
.auth-split {
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
}
.auth-split .intro {
  padding: 64px 56px;
  background: linear-gradient(180deg, var(--bg) 0%, #f6f2e8 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-split .intro::before {
  content: "";
  position: absolute;
  top: -200px; right: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(200,160,75,.15), transparent 65%);
  pointer-events: none;
}
.auth-split .intro .brand {
  font-family: var(--font-sans);
  font-size: 15px;
  letter-spacing: .3em;
  color: var(--gold-ink);
  margin-bottom: 40px;
}
.auth-split .intro h1 {
  font-family: var(--font-sans);
  font-size: 48px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  color: var(--ink);
}
.auth-split .intro h1 em {
  font-style: italic;
  color: var(--gold-ink);
  font-weight: 400;
}
.landing-hero h1 em,
.faq-step h3 em { font-style: italic; color: var(--gold-ink); font-weight: 400; }
.auth-split .intro .lead {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.75;
  max-width: 440px;
  margin-bottom: 36px;
}
.auth-split .intro .kpi-row {
  display: flex; gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  position: relative; z-index: 1;
}
.auth-split .intro .kpi-row .kpi { }
.auth-split .intro .kpi-row .kpi .k-num {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--gold-ink);
  font-variant-numeric: tabular-nums;
}
.auth-split .intro .kpi-row .kpi .k-lbl {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 4px;
}
.auth-split .form-side {
  padding: 64px 56px;
  display: flex; align-items: center; justify-content: center;
}
.auth-split .form-side .auth-box {
  width: 100%;
  max-width: 380px;
}

/* ═══ Card ═══ */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-title {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-3);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.card-title::before {
  content: "";
  width: 4px; height: 14px;
  background: var(--gold);
  border-radius: 1px;
}

/* ═══ Hero stats (dashboard) ═══ */
.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.hero-card {
  background: linear-gradient(135deg, #fffdf5 0%, var(--bg-elev) 100%);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(200,160,75,.10), transparent 70%);
  pointer-events: none;
}
.hero-card .hero-value {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-top: 8px;
}
.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
  line-height: 1.2;
}

/* ═══ Tables ═══ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  text-align: left;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-strong);
  background: var(--bg-sub);
}
thead th:first-child { border-top-left-radius: 8px; }
thead th:last-child { border-top-right-radius: 8px; }
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: top;
}
tbody tr:hover { background: var(--bg-sub); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ═══ Forms ═══ */
form.stack > * + * { margin-top: 16px; }
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
input, select, textarea {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, select:hover, textarea:hover { border-color: #c4ba9f; }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,160,75,.18);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b6b6b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

button, .btn, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, transform .05s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
}
button:hover, .btn:hover { background: #2a2a2a; box-shadow: var(--shadow-md); }
button:active { transform: translateY(1px); }

button.primary-gold, .btn.primary-gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: var(--gold);
  color: #fff;
}
button.primary-gold:hover, .btn.primary-gold:hover {
  background: linear-gradient(180deg, #d6ad54, var(--gold-ink));
}

button.secondary, .btn.secondary {
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
button.secondary:hover, .btn.secondary:hover {
  border-color: var(--gold);
  color: var(--gold-ink);
  background: var(--gold-soft);
}
button.danger { background: var(--red); border-color: var(--red); }
button.danger:hover { background: #a02a1f; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent; box-shadow: none; }
button.ghost:hover { background: var(--bg-sub); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═══ Pills / Badges ═══ */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--ink-3);
  background: var(--bg-sub);
}
.pill.ok { color: var(--green); border-color: #b8dcc5; background: var(--green-soft); }
.pill.warn { color: #b07410; border-color: #edd9a7; background: #fbf3df; }
.pill.bad { color: var(--red); border-color: #eabbb3; background: var(--red-soft); }
.pill.gold { color: var(--gold-ink); border-color: var(--gold-line); background: var(--gold-soft); }

/* ═══ Auth Box ═══ */
.auth-box {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.auth-box .eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-ink);
  font-weight: 600;
  margin-bottom: 10px;
}
.auth-box h1 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.auth-box .subtitle {
  color: var(--ink-2);
  font-size: 14px;
  margin-bottom: 28px;
  font-weight: 500;
}
.auth-box button { width: 100%; padding: 12px; }
.auth-foot {
  margin-top: 22px; font-size: 13px;
  color: var(--ink-2); text-align: center;
  padding-top: 22px; border-top: 1px solid var(--line);
  font-weight: 500;
}
.auth-foot a { font-weight: 600; }

/* ═══ Intro landing (/v2/) ═══ */
.landing {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 28px 80px;
}
.landing-hero {
  padding: 60px 0 80px;
  text-align: left;
  position: relative;
}
.landing-hero .eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold-ink);
  font-weight: 600;
  margin-bottom: 18px;
}
.landing-hero h1 {
  font-family: var(--font-sans);
  font-size: 62px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 820px;
  margin-bottom: 22px;
}
.landing-hero h1 em {
  font-style: italic;
  color: var(--gold-ink);
  font-weight: 500;
}
.landing-hero .lead {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 640px;
  line-height: 1.7;
  margin-bottom: 38px;
}
.landing-hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.landing-hero .cta-row .btn { padding: 13px 28px; font-size: 15px; }

.landing-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 20px 0 80px;
  box-shadow: var(--shadow-sm);
}
.landing-kpis .k {
  background: var(--bg-elev);
  padding: 26px 24px;
}
.landing-kpis .k .k-num {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.landing-kpis .k .k-num.pos { color: var(--green); }
.landing-kpis .k .k-num.neg { color: var(--red); }
.landing-kpis .k .k-lbl {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 6px; font-weight: 500;
}

.landing-section {
  padding: 60px 0;
  border-top: 1px solid var(--line);
}
.landing-section .section-head { margin-bottom: 36px; }
.landing-section .section-eyebrow {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-ink); font-weight: 600; margin-bottom: 12px;
}
.landing-section h2 {
  font-family: var(--font-sans);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  max-width: 680px;
  margin-bottom: 12px;
}
.landing-section .section-sub {
  font-size: 16px; color: var(--ink-2);
  max-width: 620px; line-height: 1.7;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-grid .f {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.feature-grid .f:hover {
  border-color: var(--gold-line);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.feature-grid .f .f-num {
  font-family: var(--font-sans);
  font-style: italic;
  font-size: 32px;
  color: var(--gold);
  font-weight: 500;
  line-height: 1;
  margin-bottom: 14px;
}
.feature-grid .f h3 {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}
.feature-grid .f p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
}

/* ═══ Messages ═══ */
.msg {
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 8px;
}
.msg::before { font-weight: 700; flex-shrink: 0; }
.msg.ok { background: var(--green-soft); color: var(--green); border: 1px solid #b8dcc5; }
.msg.ok::before { content: "✓"; }
.msg.err { background: var(--red-soft); color: var(--red); border: 1px solid #eabbb3; }
.msg.err::before { content: "!"; }
.msg.info { background: var(--blue-soft); color: var(--blue); border: 1px solid #b9cfea; }
.msg.info::before { content: "i"; font-style: italic; font-family: var(--font-sans); }

/* ═══ Toggle Switch ═══ */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  gap: 16px;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .tg-label { font-size: 14px; color: var(--ink); font-weight: 600; }
.toggle-row .tg-label .dim { font-size: 13px; display: block; margin-top: 4px; font-weight: 500; color: var(--ink-3); }
.switch {
  position: relative; display: inline-block;
  width: 40px; height: 22px; flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: var(--bg-sub-2);
  transition: .2s;
  border-radius: 22px;
}
.switch .slider::before {
  position: absolute; content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: .2s;
  border-radius: 50%;
}
.switch input:checked + .slider { background: var(--gold); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ═══ Help pages ═══ */
.help-hero {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.help-hero h1 {
  font-family: var(--font-sans);
  font-size: 34px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.help-hero p { color: var(--ink-2); font-size: 15px; max-width: 640px; line-height: 1.7; font-weight: 500; }

.faq-step {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.faq-step h3 {
  font-family: var(--font-sans);
  font-size: 18px; color: var(--ink);
  margin-bottom: 12px; font-weight: 600;
  display: flex; align-items: center;
}
.faq-step ol, .faq-step ul {
  padding-left: 22px; color: var(--ink-2); font-size: 14px;
  line-height: 1.75; font-weight: 500;
}
.faq-step li { margin-bottom: 5px; }
.faq-step p { color: var(--ink-2); font-size: 14px; line-height: 1.75; margin-bottom: 10px; font-weight: 500; }
.faq-step code {
  background: var(--gold-soft);
  color: var(--gold-ink);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  border: 1px solid var(--gold-line);
}

/* ═══ Help Screenshot Figure ═══ */
.help-shot {
  margin: 20px 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fafaf7; overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: transform .28s cubic-bezier(.2,.7,.25,1), box-shadow .28s ease, border-color .28s ease;
}
.help-shot:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 44px rgba(30,25,15,.16), 0 6px 16px rgba(30,25,15,.08);
  border-color: rgba(200,160,75,.45);
}
.help-shot img { display: block; width: 100%; height: auto; }

/* ═══ Lightbox (click to zoom) ═══ */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,10,14,.86);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: 96vw; max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  transform: scale(.96);
  transition: transform .26s cubic-bezier(.2,.7,.25,1);
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
  position: absolute; top: 22px; right: 28px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.22); }
.help-shot figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--bg-sub);
  border-top: 1px solid var(--line);
  font-weight: 500;
}
.dot-green, .dot-red {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  vertical-align: middle; margin: 0 3px;
}
.dot-green { background: #10b981; }
.dot-red { background: #ef4444; }

/* ═══ Warnings (help_bingx) ═══ */
.warn-box {
  margin: 16px 0; padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid #eabbb3;
  background: var(--red-soft);
  color: var(--red);
  font-size: 14px; line-height: 1.7;
  display: flex; gap: 10px;
}
.warn-box::before { content: "⚠"; font-weight: 700; flex-shrink: 0; }
.warn-box b { color: #8e1e13; }

.perm-list { list-style: none !important; padding-left: 0 !important; }
.perm-list li { padding: 6px 0 6px 28px; position: relative; font-size: 14px; }
.perm-list li.perm-yes::before {
  content: "✓"; position: absolute; left: 4px;
  color: var(--green); font-weight: 700; font-size: 16px;
}
.perm-list li.perm-no::before {
  content: "✗"; position: absolute; left: 4px;
  color: var(--red); font-weight: 700; font-size: 16px;
}

.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--ink); color: #fff;
  font-family: var(--font-sans);
  font-weight: 600; font-size: 14px;
  margin-right: 12px; font-style: italic;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-hot {
  display: inline-block; margin-left: 10px; padding: 3px 12px;
  font-size: 12px; font-weight: 600; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-ink);
  border: 1px solid var(--gold-line);
  vertical-align: middle;
  letter-spacing: .05em;
}

/* ═══ Admin ═══ */
.admin-topbar {
  background: var(--ink);
  color: #fff;
}
.admin-topbar .logo { color: var(--gold-2); }
.admin-topbar nav a { color: #c4c4c4; }
.admin-topbar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-topbar nav a.active { background: var(--gold-ink); color: #fff; }
.admin-badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11px; letter-spacing: .15em;
  text-transform: uppercase; font-weight: 600;
  background: var(--gold-soft);
  color: var(--gold-ink);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  margin-left: 10px;
}

/* ═══ Misc ═══ */
.row { display: flex; gap: 20px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 0; }
.help-links a { margin-right: 6px; }

hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* ═══ Footer ═══ */
.site-foot {
  margin-top: 80px;
  padding: 32px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg-sub);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}
.site-foot .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.site-foot .brand {
  font-family: var(--font-sans);
  letter-spacing: .18em;
  color: var(--gold-ink);
  font-weight: 600;
}

/* ═══ Responsive ═══ */
@media (max-width: 960px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-split .intro { padding: 48px 32px; border-right: none; border-bottom: 1px solid var(--line); }
  .auth-split .intro h1 { font-size: 38px; }
  .auth-split .form-side { padding: 48px 24px; }
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .landing-hero h1 { font-size: 44px; }
  .landing-kpis { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar {
    padding: 12px 14px;
    gap: 10px;
    grid-template-columns: auto 1fr auto auto;
  }
  .topbar .logo { font-size: 16px; letter-spacing: .22em; }
  .nav-toggle { display: inline-flex; order: 3; }
  .topbar .tb-right { order: 4; }
  .topbar .tb-right .ghost { padding: 6px 10px; font-size: 12px; }
  /* Nav 變成 dropdown，從 topbar 下方滑出 */
  .topbar nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 12px 14px;
    background: rgba(40, 44, 48, .98);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid rgba(200,160,75,.25);
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    z-index: 49;
  }
  .topbar nav.open { display: flex; }
  .topbar nav a {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 8px;
  }
  .container { padding: 20px 16px 60px; }
  .hero-grid { grid-template-columns: 1fr; }
  .landing-hero { padding: 40px 0 50px; }
  .landing-hero h1 { font-size: 34px; }
  .landing-section h2 { font-size: 26px; }
  .landing-kpis { grid-template-columns: 1fr; }
}
