/* ==========================================================================
   Pro 後台 / 前台 — Shared chrome
   Single topbar + global page shell, mirroring Marketing landing tokens.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;600;700&display=swap');

/* tokens (subset, copied so each page can stand alone without the DS file) */
:root {
  --void-black:    #05080B;
  --deep-space:    #0A181D;
  --pegasus-blue:  #36717C;
  --aurora-teal:   #5AA5AC;
  --radiant-gold:  #D5B464;
  --soft-gold:     #BCA15D;
  --warm-ivory:    #F3EBCF;
  --mist-gray:     #9FB5BA;

  --bg:            var(--void-black);
  --bg-elevated:   var(--deep-space);
  --bg-panel:      rgba(10, 24, 29, 0.72);

  --text-primary:   var(--warm-ivory);
  --text-secondary: var(--mist-gray);
  --text-muted:     rgba(159, 181, 186, 0.6);
  --text-on-gold:   #0B0A05;

  --line-soft:   rgba(243, 235, 207, 0.12);
  --line-strong: rgba(243, 235, 207, 0.22);
  --line-gold:   rgba(213, 180, 100, 0.35);
  --line-teal:   rgba(90, 165, 172, 0.35);

  --shadow-soft:   0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-lifted: 0 20px 60px rgba(0, 0, 0, 0.45);
  --glow-gold:     0 0 24px rgba(213, 180, 100, 0.28);

  --radius-xs:     6px;
  --radius-sm:     10px;
  --radius-button: 14px;
  --radius-card:   20px;
  --radius-lg:     28px;
  --radius-pill:   999px;

  --font-display: 'Barlow Condensed', 'Noto Sans TC', sans-serif;
  --font-body:    'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-zh:      'Noto Sans TC', 'Inter', system-ui, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text-primary); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ============ Topbar ============ */
.pro-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 12px 22px;
  background: rgba(5, 8, 11, 0.88);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.pro-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.pro-brand-dot {
  width: 22px; height: 22px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-gold);
  background: radial-gradient(circle at 30% 30%, rgba(243, 235, 207, 0.1), rgba(213, 180, 100, 0.04) 70%);
  box-shadow: 0 0 12px rgba(213, 180, 100, 0.28);
  overflow: hidden;
}
.pro-brand-dot::before {
  content: ""; width: 14px; height: 14px;
  background: linear-gradient(135deg, var(--warm-ivory), var(--radiant-gold));
  -webkit-mask: url("/assets/logo-mark.png") center / contain no-repeat;
          mask: url("/assets/logo-mark.png") center / contain no-repeat;
}
.pro-brand-text { color: var(--warm-ivory); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.pro-brand-pro { color: var(--radiant-gold); }

/* Primary nav — the only three destinations the user switches between.
   Rendered as a segmented pill, centred between brand and right cluster. */
.pro-primary-nav {
  display: none; align-items: center; gap: 2px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(10, 24, 29, 0.55);
}
.pro-primary-link {
  font-family: var(--font-display);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600;
  padding: 8px 22px;
  border-radius: 999px;
  white-space: nowrap;
  transition: 180ms ease;
  border: 1px solid transparent;
}
.pro-primary-link:hover { color: var(--warm-ivory); background: rgba(243, 235, 207, 0.04); }
.pro-primary-link.is-active {
  color: var(--radiant-gold);
  background: rgba(213, 180, 100, 0.12);
  border-color: var(--line-gold);
  box-shadow: 0 0 18px rgba(213, 180, 100, 0.12) inset;
}
.pro-primary-link.is-active:hover { color: var(--radiant-gold); }

/* Legacy hooks — kept so older inline markup degrades gracefully. */
.pro-topnav { display: none; }


/* ============ Right-side cluster (mirrors Marketing landing) ============ */
.pro-topbar-right { display: inline-flex; align-items: center; gap: 8px; }

/* Secondary text link on the right — for 看誰會來.
   Visually quieter than primary nav AND the gold CTA. */
.pro-topbar-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-secondary);
  font-size: 11.5px; font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: 180ms ease;
}
.pro-topbar-link:hover { color: var(--radiant-gold); }
.pro-topbar-link .arr {
  font-family: var(--font-body); font-size: 12px; color: var(--soft-gold);
  transition: transform 180ms ease;
}
.pro-topbar-link:hover .arr { transform: translateX(2px); color: var(--radiant-gold); }
.pro-topbar-link.is-here {
  color: var(--radiant-gold);
  cursor: default;
}
.pro-topbar-link.is-here .arr { color: var(--radiant-gold); }

/* Logged-in account chip — replaces 「登入後台」 on public pages once a session exists. */
.pro-topbar-account {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 600;
  color: var(--warm-ivory);
  text-decoration: none;
  padding: 4px 12px 4px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(10, 24, 29, 0.5);
  transition: 180ms ease;
  white-space: nowrap;
}
.pro-topbar-account:hover { border-color: var(--line-gold); background: rgba(213, 180, 100, 0.08); }
.pro-topbar-ava {
  width: 24px; height: 24px; border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line-gold); flex: none;
  display: inline-block; background: var(--bg-elevated);
}
.pro-topbar-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pro-topbar-account-id { color: var(--soft-gold); letter-spacing: 0.1em; }
.pro-topbar-account .arr {
  font-family: var(--font-body); font-size: 12px; color: var(--soft-gold);
  transition: transform 180ms ease;
}
.pro-topbar-account:hover .arr { transform: translateX(2px); color: var(--radiant-gold); }
.pro-topbar-signout {
  font-family: var(--font-display);
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-muted);
  background: transparent; border: none; cursor: pointer;
  padding: 6px 4px;
  transition: 180ms ease;
}
.pro-topbar-signout:hover { color: var(--radiant-gold); }

/* ---- Account dropdown (public pages, logged in) ---- */
.pro-acct { position: relative; }
.pro-acct .pro-topbar-account { cursor: pointer; }
.pro-acct-caret {
  font-size: 9px; color: var(--soft-gold);
  transition: transform 180ms ease; margin-left: 1px;
}
.pro-acct.is-open .pro-acct-caret { transform: rotate(180deg); color: var(--radiant-gold); }
.pro-acct.is-open .pro-topbar-account { border-color: var(--line-gold); background: rgba(213, 180, 100, 0.08); }

.pro-acct-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 232px; z-index: 200;
  background: var(--bg-elevated);
  border: 1px solid var(--line-gold);
  border-radius: 14px;
  box-shadow: var(--shadow-lifted);
  overflow: hidden;
  animation: pro-acct-in 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pro-acct-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pro-acct-menu__hd {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
}
.pro-acct-menu__hd .pro-topbar-ava { width: 26px; height: 26px; }
.pro-acct-menu__who {
  font-family: var(--font-zh); color: var(--warm-ivory);
  font-size: 12.5px; font-weight: 500; line-height: 1.3;
}
.pro-acct-menu__who small {
  display: block; font-family: var(--font-mono);
  color: var(--soft-gold); font-size: 10px; letter-spacing: 0.02em;
}
.pro-acct-menu__list { padding: 6px; display: grid; gap: 1px; }
.pro-acct-menu__item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 9px;
  font-family: var(--font-zh); font-size: 12.5px; color: var(--text-secondary);
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
  transition: 140ms ease;
}
.pro-acct-menu__item:hover { background: rgba(213, 180, 100, 0.07); color: var(--warm-ivory); }
.pro-acct-menu__item .r {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.02em;
}
.pro-acct-menu__item.is-teal { color: var(--aurora-teal); margin: 0 6px; }
.pro-acct-menu__item.is-teal:hover { color: var(--radiant-gold); background: rgba(90, 165, 172, 0.08); }
.pro-acct-menu__item.is-signout {
  color: var(--text-muted); font-family: var(--font-display);
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  margin: 2px 6px 6px;
}
.pro-acct-menu__item.is-signout:hover { color: var(--radiant-gold); background: rgba(243, 235, 207, 0.03); }
.pro-acct-menu__div { height: 1px; background: var(--line-soft); margin: 4px 0; }

/* ---- Sub-bar breadcrumb (sub-flow pages: claim / page-hub) ---- */
.pro-subbar-crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-zh); font-size: 12px;
  color: var(--text-muted); white-space: nowrap;
}
.pro-subbar-crumb .sep { color: var(--line-strong); }
.pro-subbar-crumb .here { color: var(--warm-ivory); font-weight: 500; }

/* Primary CTA — gold-tinted pill, identical to Marketing landing's .topbar-cta */
.pro-topbar-cta {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-gold); border-radius: 999px;
  background: rgba(213, 180, 100, 0.08);
  color: var(--radiant-gold); font-size: 12px; font-weight: 600;
  padding: 8px 14px; cursor: pointer;
  font-family: var(--font-display); letter-spacing: 0.16em; text-transform: uppercase;
  white-space: nowrap;
}
.pro-topbar-cta:hover { background: rgba(213, 180, 100, 0.14); }
.pro-topbar-cta::after { content: "→"; transition: transform 180ms ease; }
.pro-topbar-cta:hover::after { transform: translateX(3px); }

/* ============ Sub-bar (back-office only) ============ */
.pro-subbar {
  position: sticky; top: 55px; z-index: 99;
  background: rgba(5, 8, 11, 0.92);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.pro-subbar-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 9px 32px;
  /* D-03：sub-bar 寬度跟著各頁內容欄(預設對齊 dashboard 1080);窄頁用 --pro-subbar-max 覆寫 */
  max-width: var(--pro-subbar-max, 1080px); margin: 0 auto;
}
.pro-subbar-tag {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
  background: rgba(243, 235, 207, 0.02);
}
.pro-subbar-lead {
  font-family: var(--font-display);
  color: var(--radiant-gold);
  letter-spacing: 0.22em; font-weight: 600; font-size: 10px;
}
.pro-subbar-sep { color: var(--text-muted); }
.pro-subbar-id {
  color: var(--warm-ivory);
  font-family: var(--font-zh); font-weight: 500;
  font-size: 12px;
}

.pro-subnav {
  display: flex; align-items: center; gap: 2px;
  flex: 1; min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.pro-subnav::-webkit-scrollbar { display: none; }
.pro-subnav-link {
  font-family: var(--font-zh);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: 180ms ease;
}
.pro-subnav-link:hover { color: var(--warm-ivory); }
.pro-subnav-link.is-active {
  color: var(--radiant-gold);
  background: rgba(213, 180, 100, 0.08);
  border-color: var(--line-gold);
}

.pro-subbar-preview {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--aurora-teal);
  font-size: 10.5px; font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-teal);
  white-space: nowrap;
  transition: 180ms ease;
}
.pro-subbar-preview:hover { color: var(--radiant-gold); border-color: var(--line-gold); }
.pro-subbar-preview .arr { transition: transform 180ms ease; }
.pro-subbar-preview:hover .arr { transform: translate(2px, -2px); }

/* ============ Responsive ============ */
@media (min-width: 720px) {
  .pro-primary-nav { display: inline-flex; }
  .pro-topbar { padding: 14px 32px; }
}
@media (max-width: 1080px) {
  .pro-primary-link { font-size: 11.5px; padding: 7px 16px; letter-spacing: 0.16em; }
  .pro-topbar { padding: 12px 22px; }
}
@media (max-width: 860px) {
  .pro-primary-link { padding: 7px 12px; font-size: 11px; }
  .pro-topbar-link { padding: 6px 8px; font-size: 10.5px; letter-spacing: 0.14em; }
  .pro-topbar-link .arr { display: none; }
  .pro-topbar-account-id { display: none; }
}
@media (max-width: 760px) {
  .pro-topbar { padding: 10px 12px; gap: 8px; }
  .pro-topbar-cta { display: none; }
  .pro-topbar-link { display: none; }
  .pro-topbar-signout { display: none; }
  .pro-brand-text { font-size: 12px; }
  .pro-primary-nav { padding: 3px; }
  .pro-primary-link { padding: 6px 12px; font-size: 11px; letter-spacing: 0.14em; }

  .pro-subbar-inner { padding: 8px 14px; gap: 10px; }
  .pro-subbar-tag { padding: 4px 9px; gap: 6px; }
  .pro-subbar-id { font-size: 11px; }
  .pro-subbar-preview { display: none; }
  .pro-subnav-link { font-size: 12px; padding: 9px 12px; min-height: 44px; display: inline-flex; align-items: center; }
  /* the section nav scrolls horizontally on a phone — fade the right edge so
     it's obvious there's more to swipe to (auto-scroll-to-active lives in chrome.js). */
  .pro-subbar { position: sticky; }
  .pro-subbar::after {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 38px;
    pointer-events: none; z-index: 1;
    background: linear-gradient(90deg, rgba(5,8,11,0), rgba(5,8,11,0.92));
  }
}
@media (max-width: 480px) {
  /* keep the brand/home text on a phone — an empty top bar showing only a dot
     reads as broken. The bottom tab bar carries nav; this bar carries identity + home. */
  .pro-brand-text { font-size: 11.5px; }
  .pro-primary-link { padding: 6px 10px; }
}

/* ============ Page shell ============ */
.pro-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% -6%, rgba(213, 180, 100, 0.08), transparent 36rem),
    radial-gradient(circle at 4% 18%, rgba(90, 165, 172, 0.07), transparent 32rem),
    var(--bg);
  position: relative;
}

/* mobile-first content column. Most Pro pages are personal tools — keep one column. */
.pro-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* slightly wider variant for dashboard / settings list pages */
.pro-page--wide {
  max-width: 720px;
}

/* hero block */
.pro-eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--soft-gold);
  font-weight: 500;
  font-size: 11px;
}
.pro-eyebrow.is-gold { color: var(--radiant-gold); }
.pro-eyebrow.is-teal { color: var(--aurora-teal); }
.pro-eyebrow.is-muted { color: var(--text-muted); }

.pro-h1 {
  font-family: var(--font-zh); font-weight: 500;
  font-size: clamp(26px, 3.4vw, 32px);
  line-height: 1.18;
  color: var(--warm-ivory);
  margin: 10px 0 0;
  text-wrap: pretty;
}
.pro-h1 .gold { color: var(--radiant-gold); }
.pro-h1 .quiet { color: var(--text-secondary); font-size: clamp(16px, 2vw, 18px); font-weight: 400; }

.pro-lede {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 12px 0 0;
  text-wrap: pretty;
}

/* milestone bar */
.pro-milestone {
  display: flex; align-items: center;
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.18em;
  margin: 22px 0 0;
}
.pro-milestone span.step {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-muted);
}
.pro-milestone span.step.is-on { color: var(--radiant-gold); }
.pro-milestone span.step.is-done { color: var(--text-secondary); }
.pro-milestone span.step .bullet {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.pro-milestone span.step.is-done .bullet {
  background: var(--radiant-gold);
}
.pro-milestone .rule {
  flex: 1; height: 1px; background: var(--line-soft); margin: 0 12px;
}
.pro-milestone .rule.is-done { background: var(--line-gold); opacity: 0.6; }

/* primary button */
.pro-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 18px;
  font-family: var(--font-zh); font-weight: 600; font-size: 15px;
  border-radius: 999px; border: 1px solid transparent;
  transition: 180ms ease;
}
.pro-btn--primary {
  background: var(--radiant-gold); color: var(--text-on-gold); border: none;
  box-shadow: 0 0 24px rgba(213, 180, 100, 0.22);
}
.pro-btn--primary:hover { box-shadow: 0 0 32px rgba(213, 180, 100, 0.4); }
.pro-btn--secondary {
  background: transparent; color: var(--warm-ivory);
  border: 1px solid var(--line-soft);
}
.pro-btn--secondary:hover { border-color: var(--line-gold); background: rgba(213, 180, 100, 0.04); }
.pro-btn--inline { width: auto; padding: 10px 18px; font-size: 13px; }

/* eyebrow + heading combo for sections */
.pro-section-head {
  margin: 32px 0 12px;
}

/* hairline footer */
.pro-foot {
  margin: 40px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
}
.pro-foot a { color: var(--aurora-teal); }
.pro-foot a:hover { color: var(--radiant-gold); }

/* card */
.pro-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 18px;
}
.pro-card--gold { border-color: var(--line-gold); }

/* hairline dividers inside cards */
.pro-card-divider { height: 1px; background: var(--line-soft); }

/* breath animation — only on opt-in elements */
@keyframes pro-breathe {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.012); }
}
.pro-breathe { animation: pro-breathe 6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }

/* utility */
.pro-mono { font-family: var(--font-mono); }
.pro-disp { font-family: var(--font-display); }
.pro-zh   { font-family: var(--font-zh); }
.pro-num  { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -0.01em; }

/* small chip */
.pro-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-zh);
  font-size: 11px; padding: 2px 7px; border-radius: 4px;
  border: 1px solid var(--line-soft);
  color: var(--text-secondary);
  white-space: nowrap;
}
.pro-chip.is-gold { color: var(--radiant-gold); border-color: var(--line-gold); }
.pro-chip.is-teal { color: var(--aurora-teal); border-color: var(--line-teal); }

@media (prefers-reduced-motion: reduce) {
  .pro-breathe { animation: none; }
}
