.auth-prompt-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 16, 26, 0.72);
  backdrop-filter: blur(2px);
  z-index: 1400;
}

.auth-prompt-overlay.is-visible {
  display: flex;
}

.auth-prompt {
  background: var(--card, #131c2d);
  color: var(--text-primary, #f4f6fb);
  padding: 1.75rem;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(10, 16, 26, 0.45);
  max-width: 320px;
  width: min(90vw, 320px);
  text-align: center;
}

.auth-prompt__message {
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.auth-prompt__actions .btn {
  width: 100%;
}

.global-error-banner {
  background: #b42318;
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.btn,
button,
a.btn {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:hover,
button:hover,
a.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(16, 22, 34, 0.12);
}

.btn:focus-visible,
button:focus-visible,
a.btn:focus-visible {
  outline: 3px solid rgba(200, 169, 106, 0.6);
  outline-offset: 2px;
}

.btn.is-loading,
button.is-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn.is-loading::after,
button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: rgba(255, 255, 255, 0.1);
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
:root {
  --bg: #0b2545;
  --bg-soft: #102d54;
  --surface: rgba(17, 40, 73, 0.92);
  --surface-alt: rgba(20, 48, 88, 0.78);
  --fg: #f4f6fa;
  --muted: #b8c4da;
  --border: rgba(184, 196, 218, 0.22);
  --primary: #c8a96a;
  --primary-dark: #af8d47;
  --ok: #24c19e;
  --danger: #f47272;
  --shadow-sm: 0 20px 50px rgba(6, 17, 36, 0.34);

  /* 優化的字體系統 */
  --font-base:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    "SF Mono", "Monaco", "Inconsolata", "Fira Code", "Droid Sans Mono", "Source Code Pro", monospace;

  /* 優化的間距系統 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 100;
  background: var(--primary);
  color: #0b1a2e;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease;
}
.skip-link:focus {
  left: 1rem;
  outline: 3px solid #fff;
  transform: translateY(4px);
}
.btn-small {
  padding: 6px 14px;
  font-size: 14px;
}
.edit-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(14, 116, 144, 0.85);
  color: #f1f5f9;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 24px rgba(14, 116, 144, 0.35);
}
.edit-toggle:hover {
  background: rgba(14, 116, 144, 1);
}
.edit-toggle.is-active {
  background: rgba(16, 185, 129, 0.85);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.32);
}
[contenteditable="true"].is-editable {
  outline: 1px dashed rgba(94, 234, 212, 0.6);
  outline-offset: 4px;
  background: rgba(14, 165, 233, 0.08);
  border-radius: 8px;
  padding: 2px 4px;
}
.is-editable-dirty {
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.6);
}
.policy-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: rgba(7, 15, 29, 0.78);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 95;
}
.policy-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.policy-modal[hidden] {
  display: none;
}
.policy-dialog {
  position: relative;
  width: min(92%, 560px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  padding: 28px 32px;
  color: var(--fg);
}
.policy-close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}
.policy-close:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}
.policy-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.policy-content {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(226, 232, 240, 0.9);
}
.policy-content p {
  margin: 0 0 12px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 700px at 20% -10%, rgba(58, 102, 170, 0.38), transparent 70%),
    radial-gradient(900px 650px at 90% 0%, rgba(27, 74, 125, 0.32), transparent 80%), var(--bg);
  color: var(--fg);
  font-family:
    "Inter",
    "Noto Sans TC",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.65;
  font-feature-settings: "tnum";
}
a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--primary);
}
main {
  margin: 0;
  padding: 0 0 140px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #101622;
  box-shadow: 0 18px 36px rgba(200, 169, 106, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(200, 169, 106, 0.4);
}
.btn-outline {
  border: 1px solid rgba(200, 169, 106, 0.6);
  color: var(--fg);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--fg);
  background: transparent;
}
.btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.btn-primary:focus-visible {
  outline-color: rgba(200, 169, 106, 0.9);
  box-shadow: 0 0 0 3px rgba(200, 169, 106, 0.35);
}
.btn-outline:focus-visible,
.btn-ghost:focus-visible {
  border-color: rgba(200, 169, 106, 0.85);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.site-.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 20px 24px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    padding 0.3s ease,
    backdrop-filter 0.3s ease;
}
.site-header.scrolled {
  background: rgba(9, 15, 28, 0.86);
  border-bottom-color: rgba(200, 169, 106, 0.18);
  backdrop-filter: blur(14px);
  padding: 14px 24px;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle span:nth-child(1) {
  top: 14px;
}
.nav-toggle span:nth-child(2) {
  top: 21px;
}
.nav-toggle span:nth-child(3) {
  top: 28px;
}
.primary-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.primary-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.65);
  color: var(--fg);
  font-size: 14px;
  transition: all 0.2s ease;
}
.primary-nav a:hover,
.primary-nav a:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-actions .lang-toggle {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(17, 24, 39, 0.55);
  color: var(--fg);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.header-actions .lang-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #101622;
  box-shadow: 0 16px 34px rgba(200, 169, 106, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(200, 169, 106, 0.45);
}
.user-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.user-links a {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.55);
  transition: all 0.2s ease;
}
.header-actions .header-login {
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  transition: all 0.2s ease;
}
.header-actions .header-login:hover,
.header-actions .header-login:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}
.user-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-menu .user-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.user-menu button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
}
.user-menu button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.site-header.nav-open .primary-nav {
  display: flex;
}
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 160px 0 120px;
  overflow: hidden;
}
.hero-background {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 30, 69, 0.95), rgba(16, 48, 88, 0.65));
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1100px 760px at 18% 10%, rgba(191, 161, 106, 0.32), transparent 72%),
    radial-gradient(900px 680px at 82% -10%, rgba(20, 65, 104, 0.55), transparent 78%);
  mix-blend-mode: screen;
  opacity: 0.75;
}
.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: flex-start;
}
.hero-copy {
  max-width: 640px;
  padding: 48px;
  border-radius: 28px;
  background: rgba(9, 15, 28, 0.68);
  border: 1px solid rgba(200, 169, 106, 0.2);
  box-shadow: 0 42px 88px rgba(3, 9, 20, 0.55);
  backdrop-filter: blur(18px);
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(200, 169, 106, 0.4);
  color: var(--primary);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(200, 169, 106, 0.1);
}
.hero-copy h1 {
  margin: 18px 0 12px;
  font-size: clamp(36px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.hero-copy p {
  margin: 0;
  color: rgba(232, 238, 248, 0.86);
  font-size: 16px;
  line-height: 1.8;
}
.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.hero-actions .btn {
  min-width: 160px;
}

.hero-actions.secondary-cta {
  margin-top: 36px;
  justify-content: flex-start;
}
.hero-actions.secondary-cta .btn {
  min-width: 160px;
}
.hero-metrics {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}
.hero-facts {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.hero-facts .fact {
  flex: 1 1 180px;
  min-width: 180px;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}
.fact-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(184, 196, 218, 0.75);
  margin-bottom: 6px;
}
.fact-value {
  display: block;
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.metric-card {
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(12, 21, 38, 0.62);
  border: 1px solid rgba(200, 169, 106, 0.16);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.metric-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}
.metric-card strong {
  display: block;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 600;
}
.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(200, 169, 106, 0.35);
  box-shadow: 0 24px 50px rgba(5, 12, 24, 0.45);
}
.content-section {
  margin-top: 80px;
}
.section-head h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 700;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}
.section-body {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
}
.section-body p {
  margin-top: 0;
  margin-bottom: 14px;
}
.bullet-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.bullet-list li {
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.65);
  font-size: 15px;
}
.team-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.team-card {
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.team-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
}
.team-card .role {
  margin: 0;
  color: rgba(245, 158, 11, 0.85);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.contact-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.contact-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(17, 24, 39, 0.6);
}
.country-card,
.allocation-card,
.risk-card,
.activity-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Constrain allocation card width on desktop to avoid infinite horizontal stretch */
.allocation-card {
  max-width: 1200px;
  margin: 0 auto;
  /* 增加高度以容納更大的圓餅圖 */
  height: auto !important;
  min-height: 600px !important;
  max-height: none !important;
  overflow: auto !important;
  /* Prevent flex children from stretching the container */
  display: flex;
  flex-direction: column;
}

/* Force allocation-wrap to fixed height and prevent canvas from triggering resize loops */
.allocation-card .allocation-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  /* 增加高度以容納更大的圓餅圖 */
  height: 560px !important;
  min-height: 560px !important;
  max-height: 560px !important;
  flex: none !important;
  overflow: visible; /* allow chart to be visible within its fixed space */
}

/* Ensure any canvas inside allocation card cannot drive the card to extreme heights */
.allocation-card canvas,
.allocation-card .allocation-wrap canvas {
  display: block;
  width: 100% !important;
  max-height: 520px !important;
  height: 520px !important;
  flex: none !important; /* avoid flex auto-stretch which triggers Chart.js resize */
  box-sizing: border-box;
  /* CRITICAL: prevent canvas from being a flex child that can stretch */
  position: relative !important;
}

/* Defensive containment to prevent children from overflowing and creating huge blank areas */
.allocation-card,
.allocation-card * {
  box-sizing: border-box;
}
.allocation-card .allocation-detail,
.allocation-card .allocation-rows,
.allocation-card .allocation-wrap {
  max-width: 100%;
  /* keep internal panes from forcing very large heights; if content is large, scroll within the card */
  max-height: 50vh !important;
  overflow: auto !important;
}

/* Country chart wrapper also needs fixed height */
.country-card .country-wrap {
  height: 320px !important;
  max-height: 320px !important;
  flex: none !important;
}

/* Make canvas elements immune to flex auto-stretch which can cause Chart.js to repeatedly resize */
.allocation-wrap canvas,
.country-wrap canvas,
.kpi-spark canvas,
.perf-canvas-wrap canvas {
  flex: none !important;
  max-height: 420px !important;
}

/* If allocation detail is empty, avoid very tall min-height; keep layout compact */
.allocation-card .allocation-empty {
  margin: 0;
  padding: 18px 12px;
}
/* Rebalance suggestion styling inside allocation detail */
.allocation-rebalance {
  margin: 12px 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(16, 28, 46, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.06);
  font-size: 13px;
  color: var(--muted);
}
.allocation-rebalance .rebalance-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 18vh;
  overflow: auto;
}
.allocation-rebalance .rebalance-row {
  color: var(--muted);
}
.risk-empty {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 18px 12px;
}
.country-legend,
.allocation-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.country-pill,
.allocation-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.6);
  color: var(--muted);
}
.country-pill .swatch,
.allocation-pill .swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
footer {
  margin-top: 80px;
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}
@media (max-width: 960px) {
  main {
    padding: 0 20px 64px;
    .header-actions {
      width: 100%;
      flex-wrap: wrap;
      gap: 12px;
    }
    .header-actions .header-cta {
      flex: 1 1 180px;
      text-align: center;
    }
    .header-actions .lang-toggle {
      margin-left: auto;
    }
  }
  .primary-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-top: 16px;
  }
  .site-header.nav-open .primary-nav {
    display: flex;
  }
  .header-bar {
    flex-wrap: wrap;
    gap: 16px;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .site-header.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .site-header.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }
  .site-header.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .hero {
    padding: 100px 0 64px;
  }
  .hero-content {
    padding: 28px;
  }
}
@media (max-width: 600px) {
  main {
    padding: 0 16px 56px;
    .hero-facts {
      flex-direction: column;
    }
    .hero-facts .fact {
      width: 100%;
    }
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .brand-title {
    font-size: 18px;
  }
} /* Existing dashboard & admin styling */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}
/* Mobile-specific containment for allocation card to prevent runaway vertical growth */
@media (max-width: 960px) {
  .allocation-card {
    /* 移動端使用 auto 高度，但設置合理的最小高度 */
    height: auto !important;
    min-height: 400px !important;
    max-height: none !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .allocation-card .allocation-wrap {
    height: 350px !important;
    min-height: 350px !important;
    max-height: 350px !important;
  }
  .allocation-card canvas,
  .allocation-card .allocation-wrap canvas {
    max-height: 320px !important;
    height: 320px !important;
  }
  .allocation-card .allocation-detail,
  .allocation-card .allocation-rows {
    max-height: 60vh;
    overflow-y: auto;
  }
}
.card {
  background: linear-gradient(200deg, rgba(16, 24, 40, 0.75), rgba(15, 23, 42, 0.45));
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 18px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
}
.hero-card {
  margin-bottom: 8px;
}
.hero-card h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
}
.hero-card p {
  margin: 0;
  color: var(--muted);
}
.ok {
  color: var(--ok);
}
.err {
  color: var(--danger);
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}
th,
td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
}
.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.admin-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.admin-.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 20px 24px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    padding 0.3s ease,
    backdrop-filter 0.3s ease;
  .hero-actions.secondary-cta {
    flex-direction: column;
    align-items: stretch;
  }
}
.site-header.scrolled {
  background: rgba(9, 15, 28, 0.86);
  border-bottom-color: rgba(200, 169, 106, 0.18);
  backdrop-filter: blur(14px);
  padding: 14px 24px;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle span:nth-child(1) {
  top: 14px;
}
.nav-toggle span:nth-child(2) {
  top: 21px;
}
.nav-toggle span:nth-child(3) {
  top: 28px;
}
.primary-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.primary-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.65);
  color: var(--fg);
  font-size: 14px;
  transition: all 0.2s ease;
}
.primary-nav a:hover,
.primary-nav a:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-actions .lang-toggle {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(17, 24, 39, 0.55);
  color: var(--fg);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.header-actions .lang-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #101622;
  box-shadow: 0 16px 34px rgba(200, 169, 106, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(200, 169, 106, 0.45);
}
.user-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.user-links a {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.55);
  transition: all 0.2s ease;
}
.user-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-menu .user-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.user-menu button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
}
.user-menu button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.site-header.nav-open .primary-nav {
  display: flex;
}
.hero {
  padding: 140px 0 80px;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(800px 600px at 0% 0%, rgba(200, 169, 106, 0.18), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  gap: 48px;
  align-items: stretch;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(200, 169, 106, 0.14);
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.hero-copy h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  max-width: 580px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.hero-cta-note {
  margin: 8px 0 0;
  color: rgba(226, 232, 240, 0.78);
  font-size: 14px;
  line-height: 1.7;
  max-width: 620px;
}
.hero-actions .btn {
  min-width: 180px;
}
.hero-actions .btn-primary {
  padding: 14px 32px;
  font-size: 16px;
}
.hero-highlights {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}
.hero-highlights li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 12px;
  border-left: 2px solid rgba(200, 169, 106, 0.4);
}
.hero-highlights strong {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-highlights span {
  font-size: 15px;
  color: var(--muted);
}
.hero-card {
  align-self: stretch;
  background: var(--surface);
  border: 1px solid rgba(200, 169, 106, 0.18);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hero-card__title {
  font-size: 16px;
  letter-spacing: 0.2em;
  color: var(--primary);
  text-transform: uppercase;
}
.hero-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.hero-card__list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}
.hero-card__list strong {
  color: var(--fg);
  font-size: 16px;
}
.about-cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.principle {
  background: var(--surface);
  border: 1px solid rgba(200, 169, 106, 0.18);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.principle h3 {
  margin: 0 0 16px;
  font-size: 18px;
}
.principle ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  color: var(--muted);
}
.strategy-cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.strategy-card {
  background: var(--surface-alt);
  border: 1px solid rgba(200, 169, 106, 0.12);
  border-radius: 18px;
  padding: 24px;
}
.strategy-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--primary);
}
.strategy-card p {
  margin: 0;
  color: var(--muted);
}
.strategy-flow {
  margin-top: 40px;
  background: var(--surface);
  border: 1px solid rgba(200, 169, 106, 0.18);
  border-radius: 20px;
  padding: 28px;
}
.strategy-flow h3 {
  margin: 0 0 20px;
  font-size: 18px;
}
.strategy-flow ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}
.strategy-flow li {
  display: grid;
  gap: 4px;
  color: var(--muted);
}
.strategy-flow li span {
  font-weight: 600;
  color: var(--fg);
}
.team-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.team-card {
  background: var(--surface);
  border: 1px solid rgba(200, 169, 106, 0.16);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  align-items: start;
}
.team-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(200, 169, 106, 0.12), rgba(200, 169, 106, 0.4));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
}
.team-meta h3 {
  margin: 0;
  font-size: 18px;
}
.team-meta .role {
  display: block;
  margin: 4px 0 12px;
  font-size: 14px;
  color: var(--muted);
}
.team-meta p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.team-meta a {
  font-size: 14px;
  color: var(--primary);
}
.portfolio-cards,
.insight-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.portfolio-card,
.insight-card {
  background: var(--surface);
  border: 1px solid rgba(200, 169, 106, 0.16);
  border-radius: 20px;
  padding: 24px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.portfolio-card .chip,
.insight-card .chip {
  align-self: start;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(200, 169, 106, 0.16);
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.portfolio-dashboard {
  margin-top: 48px;
  background: var(--surface);
  border: 1px solid rgba(200, 169, 106, 0.18);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 12px;
}
.portfolio-dashboard h3 {
  margin: 0;
  font-size: 20px;
}
.portfolio-dashboard p {
  margin: 0 0 12px;
  color: var(--muted);
}
.dashboard-card {
  min-height: 320px;
}
.contact-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}
.contact-card {
  background: var(--surface);
  border: 1px solid rgba(200, 169, 106, 0.18);
  border-radius: 20px;
  padding: 28px;
  display: grid;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}
.contact-detail span {
  display: block;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(200, 169, 106, 0.85);
}
.contact-detail a {
  color: var(--fg);
  font-size: 18px;
  font-weight: 600;
}
.contact-detail p {
  margin: 10px 0 0;
  color: var(--muted);
}
.compliance-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
  color: var(--muted);
}
.compliance-list li {
  padding-left: 16px;
  position: relative;
}
.compliance-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.site-.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 20px 24px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    padding 0.3s ease,
    backdrop-filter 0.3s ease;
}
.site-header.scrolled {
  background: rgba(9, 15, 28, 0.86);
  border-bottom-color: rgba(200, 169, 106, 0.18);
  backdrop-filter: blur(14px);
  padding: 14px 24px;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle span:nth-child(1) {
  top: 14px;
}
.nav-toggle span:nth-child(2) {
  top: 21px;
}
.nav-toggle span:nth-child(3) {
  top: 28px;
}
.primary-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.primary-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.65);
  color: var(--fg);
  font-size: 14px;
  transition: all 0.2s ease;
}
.primary-nav a:hover,
.primary-nav a:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-actions .lang-toggle {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(17, 24, 39, 0.55);
  color: var(--fg);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.header-actions .lang-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #101622;
  box-shadow: 0 16px 34px rgba(200, 169, 106, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(200, 169, 106, 0.45);
}
.user-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.user-links a {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.55);
  transition: all 0.2s ease;
}
.user-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-menu .user-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.user-menu button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
}
.user-menu button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.site-header.nav-open .primary-nav {
  display: flex;
}

/* Desktop-first breakpoints */
/* Add an earlier desktop breakpoint so typical laptop widths get the desktop layout */
@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    margin: 0 auto;
  }

  .hero-grid {
    grid-template-columns: 1fr 360px;
    gap: 48px;
  }

  .perf-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
    margin: 0 auto;
  }

  .hero-grid {
    grid-template-columns: 1fr 360px;
    gap: 48px;
  }

  .perf-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 960px) {
  .hero {
    padding-top: 120px;
  }

  .hero-grid {
    gap: 36px;
  }

  .hero-card {
    order: -1;
  }

  .primary-nav {
    display: none;
  }

  .site-header.nav-open .primary-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .site-header.nav-open .primary-nav a {
    width: 100%;
    justify-content: center;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 640px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-actions .btn-primary {
    font-size: 17px;
  }

  .team-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .team-avatar {
    margin: 0 auto;
  }

  .contact-card {
    padding: 24px;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 4px;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-btn[data-lang="zh"] {
  font-family: "Noto Sans TC", sans-serif;
}
.lang-btn:hover {
  color: var(--primary);
}
.user-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.user-links a {
  font-size: 13px;
  color: var(--muted);
}
.user-links a:hover {
  color: var(--primary);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-name {
  font-size: 13px;
  color: var(--muted);
}
.is-editing [data-editable-key] {
  outline: 1px dashed rgba(200, 169, 106, 0.55);
  outline-offset: 4px;
}
.edit-hint {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(12, 35, 64, 0.92);
  border: 1px solid rgba(200, 169, 106, 0.3);
  color: var(--fg);
  font-size: 13px;
  letter-spacing: 0.04em;
  z-index: 1000;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}
.auth-wrapper {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 16px 120px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 30, 54, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-card h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.auth-lead {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form label,
.auth-otp-row label {
  font-size: 13px;
  color: var(--muted);
}
.auth-form input,
.auth-otp-row input {
  width: 100%;
}
.auth-message {
  min-height: 24px;
  font-size: 13px;
}
.auth-message .info {
  color: #38bdf8;
}
.auth-2fa {
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.auth-otp-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
@media (max-width: 600px) {
  .auth-wrapper {
    padding: 56px 16px 96px;
  }
  .auth-card {
    padding: 28px 24px;
  }
  .auth-card h1 {
    font-size: 24px;
  }
}
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(17, 30, 54, 0.85);
  color: var(--fg);
  box-shadow: 0 18px 30px rgba(11, 25, 45, 0.45);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  z-index: 90;
}
.back-to-top:hover {
  transform: translateY(-2px);
}
.back-to-top:focus-visible {
  outline: 2px solid rgba(200, 169, 106, 0.9);
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .hero-cta-note {
    font-size: 13px;
  }
  .back-to-top {
    bottom: 18px;
    right: 18px;
  }
}

/* Navigation & skeleton enhancements */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(11, 37, 69, 0.85);
  backdrop-filter: blur(8px);
  padding: 1rem;
}

.site-header .nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 30, 54, 0.65);
  color: inherit;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: column;
  padding: 8px 10px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.site-header .nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.site-header .nav-toggle:focus-visible {
  outline: 3px solid rgba(200, 169, 106, 0.7);
  outline-offset: 3px;
}

.site-header.nav-open .nav-toggle {
  background: rgba(200, 169, 106, 0.15);
}

.site-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 960px) {
  .site-header .nav-toggle {
    display: flex;
  }

  .site-header .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: grid;
    gap: 12px;
    padding: 18px 24px 24px;
    background: rgba(11, 15, 24, 0.96);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition:
      opacity 0.22s ease,
      transform 0.22s ease;
  }

  .site-header.nav-open .primary-nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-header .primary-nav a {
    padding: 10px 6px;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .site-header .primary-nav a:hover,
  .site-header .primary-nav a:focus-visible {
    background: rgba(200, 169, 106, 0.15);
    color: var(--primary);
  }

  .site-header .header-actions {
    margin-left: auto;
    gap: 12px;
  }

  .site-header.nav-open .header-actions {
    align-items: flex-start;
  }
}

.dashboard-loading {
  position: relative;
  min-height: 420px;
}

.dashboard-skeleton,
.dashboard-signedout .skeleton-grid {
  animation: skeletonFade 0.3s ease;
}

.dashboard-skeleton {
  display: grid;
  gap: 20px;
  padding: 12px 4px 24px;
}

.dashboard-skeleton .skeleton-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skeleton-chip {
  display: inline-flex;
  width: 96px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.skeleton-chip.wide {
  width: 140px;
}

.dashboard-skeleton .skeleton-kpis {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.skeleton-card {
  position: relative;
  min-height: 120px;
  border-radius: 20px;
  background: rgba(18, 34, 60, 0.72);
  overflow: hidden;
}

.skeleton-card.tall {
  min-height: 160px;
}

.skeleton-chart {
  min-height: 280px;
  border-radius: 24px;
  background: rgba(18, 34, 60, 0.72);
  position: relative;
  overflow: hidden;
}

.dashboard-skeleton .skeleton-main {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.dashboard-skeleton .skeleton-side {
  display: grid;
  gap: 16px;
}

.skeleton-card::after,
.skeleton-chip::after,
.skeleton-chart::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.5s infinite;
}

.dashboard-signedout .skeleton-card {
  min-height: 180px;
}

@media (max-width: 960px) {
  .dashboard-skeleton .skeleton-main {
    grid-template-columns: 1fr;
  }

  .dashboard-skeleton .skeleton-chart {
    min-height: 240px;
  }
}

@keyframes skeletonShimmer {
  0% {
    transform: translateX(-100%);
  }
  60% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@keyframes skeletonFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dashboard.is-public [data-role="toolbar-benchmark"],
.dashboard.is-public [data-role="toolbar-density"],
.dashboard.is-public .toolbar-spacer,
.dashboard.is-public .dashboard-side,
.dashboard.is-public .activity-card {
  display: none;
}

.dashboard.is-public .dashboard-main {
  display: grid;
  grid-template-columns: 1fr;
}

.card.nav-card .chart-wrapper {
  position: relative;
  /* fixed height prevents Chart.js + flex from entering an infinite resize loop */
  height: 360px;
  min-height: 320px;
}

.card.nav-card .chart-wrapper canvas {
  width: 100%;
  height: 360px;
  flex: none !important; /* prevent flex containers from stretching the canvas */
  display: block;
}

.dashboard.is-public .nav-card {
  min-height: 320px;
}
/* General dashboard layout: two columns (main + side). Constrain right column height to viewport. */
.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}
.dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - 160px);
  overflow: auto;
}
:root {
  --bg: #0b1e36;
  --bg-soft: #14213d;
  --surface: rgba(16, 28, 46, 0.88);
  --surface-alt: rgba(19, 39, 65, 0.76);
  --fg: #f5f7fa;
  --muted: #c7d0dd;
  --primary: #bfa14a;
  --primary-dark: #9f8536;
  --accent: #2e6f80;
  --shadow-sm: 0 24px 50px rgba(5, 12, 24, 0.35);
}

body {
  background:
    radial-gradient(1200px 800px at 15% -10%, rgba(31, 76, 117, 0.35), transparent 70%),
    radial-gradient(1000px 700px at 90% -5%, rgba(8, 30, 57, 0.45), transparent 80%), var(--bg);
  color: var(--fg);
  font-family:
    "Inter",
    "Noto Sans TC",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.7;
}

.site-.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 20px 24px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    padding 0.3s ease,
    backdrop-filter 0.3s ease;
}
.site-header.scrolled {
  background: rgba(9, 15, 28, 0.86);
  border-bottom-color: rgba(200, 169, 106, 0.18);
  backdrop-filter: blur(14px);
  padding: 14px 24px;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  width: 20px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle span:nth-child(1) {
  top: 14px;
}
.nav-toggle span:nth-child(2) {
  top: 21px;
}
.nav-toggle span:nth-child(3) {
  top: 28px;
}
.primary-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.primary-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.65);
  color: var(--fg);
  font-size: 14px;
  transition: all 0.2s ease;
}
.primary-nav a:hover,
.primary-nav a:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.header-actions .lang-toggle {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(17, 24, 39, 0.55);
  color: var(--fg);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.header-actions .lang-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #101622;
  box-shadow: 0 16px 34px rgba(200, 169, 106, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(200, 169, 106, 0.45);
}
.user-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.user-links a {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.55);
  transition: all 0.2s ease;
}
.user-links a:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-menu .user-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.user-menu button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s ease;
}
.user-menu button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.site-header.nav-open .primary-nav {
  display: flex;
}
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(47, 101, 156, 0.35), transparent 55%),
    linear-gradient(120deg, rgba(23, 45, 76, 0.85), rgba(11, 30, 54, 0.95));
  background-size: cover;
  filter: saturate(110%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 30, 54, 0.35) 0%, rgba(11, 30, 54, 0.9) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 2.5rem;
  padding: 6rem 2rem 4rem;
}

.hero-copy {
  max-width: 720px;
}

.hero-tag {
  display: inline-flex;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: rgba(191, 161, 74, 0.18);
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 600;
  margin: 1.5rem 0 1rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.75rem 0;
}

.btn-primary {
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  color: #0b1320;
  border: none;
  box-shadow: 0 18px 32px rgba(191, 161, 74, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 22px 38px rgba(191, 161, 74, 0.36);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--fg);
  background: transparent;
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--primary);
}

.hero-metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric-card {
  background: rgba(12, 28, 49, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 50px rgba(4, 10, 22, 0.45);
}

.section {
  padding: 6rem 0;
}

.section-heading {
  margin-bottom: 2.5rem;
}

.section-eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
}

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0.75rem 0 1rem;
}

.timeline {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.timeline-step {
  background: rgba(14, 33, 55, 0.8);
  border-radius: 20px;
  padding: 1.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.timeline-step .step-index {
  position: absolute;
  top: 1.4rem;
  right: 1.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.4);
}

.case-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.case-card {
  background: rgba(14, 32, 54, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 1.9rem 1.8rem;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.case-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 58px rgba(5, 11, 22, 0.5);
}

.case-industry {
  display: inline-flex;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(46, 111, 128, 0.18);
  color: #7ed9f2;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.case-body dt {
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.case-body dd {
  margin: 0 0 1rem;
  color: var(--fg);
}

.team-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.team-card {
  background: rgba(14, 32, 54, 0.82);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2rem 1.8rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.team-card:hover {
  transform: translateY(-4px);
}

.team-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.team-links {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.team-link {
  color: var(--primary);
  font-size: 0.9rem;
  text-decoration: none;
}

.team-link:hover {
  text-decoration: underline;
}

.insight-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.insight-card {
  background: rgba(15, 32, 55, 0.76);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.contact-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.contact-card {
  background: rgba(15, 33, 57, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 1.5rem;
  margin: 0 1.5rem;
  background: rgba(11, 30, 54, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1.2rem 1.5rem;
  display: none;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 24px 48px rgba(3, 8, 18, 0.45);
  z-index: 1200;
}

.cookie-banner.is-visible {
  display: flex;
  flex-wrap: wrap;
}

.cookie-banner p {
  flex: 1 1 240px;
  margin: 0;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.cookie-note {
  display: block;
  margin-top: 0.5rem;
  font-size: 12px;
  color: var(--muted);
}

.cookie-link {
  color: var(--primary);
  text-decoration: underline;
  font-size: 0.9rem;
}

.policy-page {
  background:
    radial-gradient(900px 600px at 15% 0%, rgba(47, 101, 156, 0.28), transparent 70%), var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.policy-article {
  max-width: 720px;
  background: rgba(14, 32, 54, 0.88);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .site-header .header-bar {
    padding: 1rem 1.25rem;
  }
  .hero-content {
    padding: 5rem 1.5rem 3rem;
  }
  .cookie-banner {
    margin: 0 1rem;
    bottom: 1rem;
  }
}
.site-header .header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(191, 161, 74, 0.45);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.site-header .header-cta:hover,
.site-header .header-cta:focus-visible {
  background: rgba(191, 161, 74, 0.18);
  color: #0b1e36;
}
.site-header .header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (max-width: 960px) {
  .site-header .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .site-header .header-cta {
    order: 3;
  }
}
.case-details {
  margin: 0;
  padding: 0;
}

.case-row {
  margin-bottom: 1rem;
}

.case-row:last-child {
  margin-bottom: 0;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
  gap: 3rem;
  align-items: stretch;
}

.hero-compliance {
  align-self: stretch;
  padding: 2.5rem;
  border-radius: 28px;
  background: rgba(8, 14, 28, 0.78);
  border: 1px solid rgba(200, 169, 106, 0.28);
  box-shadow: 0 32px 68px rgba(5, 12, 24, 0.45);
  backdrop-filter: blur(16px);
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-compliance .section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(200, 169, 106, 0.16);
  color: var(--primary);
}

.hero-compliance h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--fg);
}

.hero-compliance .compliance-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.75rem;
  color: rgba(232, 238, 248, 0.78);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 1200px) {
  .hero-content {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem;
  }
  .hero-compliance {
    max-width: none;
  }
}

@media (max-width: 960px) {
  .hero-content {
    grid-template-columns: 1fr;
  }
  .hero-compliance {
    order: 3;
  }
}

/* 手機端佈局優化 */
@media (max-width: 640px) {
  .main {
    padding: 16px 12px;
  }

  .card {
    padding: 16px;
    margin: 12px 0;
    border-radius: 14px;
  }

  /* 確保內容不會溢出 */
  * {
    max-width: 100%;
  }

  /* 防止圖表溢出 */
  canvas {
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 12px 8px;
  }

  .card {
    padding: 12px;
    margin: 8px 0;
  }
}
