/* ==========================================================================
   韌性計畫快查通 - 國際頂級數位設計系統 (Awwwards / Webby / FWA Tier)
   Design Philosophy: Cyber-Nordic Sovereign GovTech
   Author: Antigravity Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. 全局變數與色彩矩陣 (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* 背景與表面層次 (Deep Midnight & Space Slate) */
  --bg-canvas: #070a12;
  --bg-surface: #0c111d;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-hover: rgba(23, 34, 60, 0.85);
  --bg-card-subtle: rgba(30, 41, 59, 0.45);
  --bg-glass-nav: rgba(7, 10, 18, 0.82);

  /* 精緻光影與邊界 */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-glow: rgba(99, 102, 241, 0.4);
  --border-emerald-glow: rgba(16, 185, 129, 0.35);

  /* 主題品牌漸層與高彩度光暈 */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.28);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

  /* 語義色彩 (Cyber Accents) */
  --emerald: #10b981;
  --emerald-light: rgba(16, 185, 129, 0.12);
  --emerald-border: rgba(16, 185, 129, 0.3);

  --cyan: #06b6d4;
  --cyan-light: rgba(6, 182, 212, 0.12);

  --rose: #f43f5e;
  --rose-light: rgba(244, 63, 94, 0.12);
  --rose-border: rgba(244, 63, 94, 0.3);

  --amber: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.12);

  /* 文字階層 (High-Contrast Luminance) */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;

  /* 圓角體系 */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* 深度陰影體系 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 50px -10px rgba(99, 102, 241, 0.3);
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 35px -5px rgba(0, 0, 0, 0.5);

  /* 字體系統 */
  --font-display: 'Outfit', 'Plus Jakarta Sans', 'Noto Sans TC', sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Noto Sans TC', system-ui, -apple-system, sans-serif;

  /* 動畫時間與緩動曲線 */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   1. 基礎重置與排版設定
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-canvas);
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* 自訂精緻極光滾動條 */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-canvas);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* 頁面最大寬度容器 */
.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   2. 頁頂滾動進度條與環境氛圍光暈 (Atmosphere & Canvas Dynamics)
   -------------------------------------------------------------------------- */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981);
  z-index: 999;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.8);
  pointer-events: none;
  transition: width 0.08s linear;
}

/* 光標跟隨光暈 (Ambient Cursor Spotlight) */
.ambient-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.03) 40%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  will-change: transform;
  transform: translate3d(-250px, -250px, 0);
  transition: opacity 0.3s ease;
}

/* 背景光斑與微網格紋理 */
.bg-decor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.decor-circle-1 {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(139, 92, 246, 0.04) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
}

.decor-circle-2 {
  position: absolute;
  top: 500px;
  left: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(16, 185, 129, 0.03) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(50px);
}

.decor-grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 20%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, black 30%, transparent 80%);
}

/* --------------------------------------------------------------------------
   3. 浮動毛玻璃導覽列 (Floating Glass Navigation)
   -------------------------------------------------------------------------- */
header.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--bg-glass-nav);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s var(--ease-smooth);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-primary);
  group: logo;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.3s var(--ease-spring);
}

.logo-brand:hover .logo-icon {
  transform: scale(1.06) rotate(-3deg);
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-badge-live {
  font-size: 0.72rem;
  font-weight: 600;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links .nav-link {
  text-decoration: none;
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  transition: all 0.2s var(--ease-smooth);
  position: relative;
}

.nav-links .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-links .nav-link.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.18);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.4);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-nav-query {
  padding: 9px 20px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.25s var(--ease-spring);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-nav-query:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, #4338ca, #4f46e5);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 8px #34d399;
  animation: pulseBeacon 2s infinite;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-xs);
}

.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

/* --------------------------------------------------------------------------
   4. 主視覺區塊 (Hero & Facts Grid)
   -------------------------------------------------------------------------- */
section.hero {
  padding: 68px 0 52px 0;
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-top-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.kick-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: #a5b4fc;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.15);
}

.live-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulseBeacon 2s infinite ease-in-out;
}

.hero-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.hero h2 {
  font-family: var(--font-display);
  font-size: 2.9rem;
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
  color: #ffffff;
}

.gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

.hero p.lead {
  max-width: 820px;
  margin: 0 auto 48px auto;
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-weight: 400;
}

/* 4 大核心政策要點 (Interactive Metric Grid) */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.fact-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  text-align: center;
  transition: all 0.35s var(--ease-spring);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.fact-card-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: all 0.4s ease;
}

.fact-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg), 0 0 30px -5px rgba(99, 102, 241, 0.3);
}

.fact-card:hover .fact-card-glow {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, transparent 70%);
}

.fact-val {
  font-family: var(--font-display);
  font-size: 2.85rem;
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 40%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.fact-unit {
  font-size: 1.35rem;
  font-weight: 700;
  color: #818cf8;
}

.fact-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.fact-desc {
  font-size: 0.86rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* 官方提醒 Notice Banner */
.notice-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  font-size: 0.92rem;
  color: #fde68a;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
}

.notice-icon-box {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
}

.notice-icon-box svg {
  width: 22px;
  height: 22px;
}

.notice-text {
  line-height: 1.6;
}

.notice-text strong {
  color: #fff;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   5. 核心焦點功能：統編秒查指揮中心 (Command Center #bizcheck)
   -------------------------------------------------------------------------- */
.bc-section {
  padding: 60px 0;
  position: relative;
  z-index: 2;
}

.bc-header {
  text-align: center;
  margin-bottom: 32px;
}

.bc-header h3 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.bc-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

.bc-box {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.bc-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, #06b6d4, transparent);
  pointer-events: none;
}

/* 查詢頁籤 (Segmented Switcher) */
.bc-tabs {
  display: flex;
  background: rgba(10, 15, 28, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px;
  gap: 6px;
  margin-bottom: 30px;
}

.bc-tab-btn {
  flex: 1;
  padding: 12px 18px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.bc-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.bc-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.15));
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.35s ease;
}

.tab-pane.active {
  display: block;
}

/* 搜尋表單結構 */
.bc-form {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.input-wrap {
  position: relative;
  flex: 1;
}

.input-wrap input {
  width: 100%;
  height: 56px;
  background: rgba(10, 15, 28, 0.85);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0 52px 0 20px;
  font-family: var(--font-body);
  font-size: 1.12rem;
  color: #ffffff;
  outline: none;
  transition: all 0.25s var(--ease-smooth);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.input-wrap input::placeholder {
  color: #475569;
}

.input-wrap input:focus {
  border-color: #818cf8;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.clear-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text-tertiary);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.clear-btn.show {
  display: flex;
}

.bc-submit-btn {
  height: 56px;
  padding: 0 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s var(--ease-spring);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.bc-submit-btn:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.bc-submit-btn:active {
  transform: translateY(0);
}

.bc-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 常用快速標籤晶片 (Preset Chips) */
.quick-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.88rem;
}

.quick-presets .label {
  color: var(--text-muted);
  font-weight: 600;
}

.preset-chip {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.preset-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.preset-chip.eligible-tag {
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.preset-chip.eligible-tag:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.5);
}

.preset-chip.ineligible-tag {
  border-color: rgba(244, 63, 94, 0.25);
  color: #fda4af;
}

.preset-chip.ineligible-tag:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.5);
}

/* 訊息提示 (Error / Warning Message Box) */
.bc-msg {
  margin-top: 20px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid var(--rose-border);
  color: #fecdd3;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: shake 0.4s ease;
}

/* 載入動畫 (Cyber Scanning Loading) */
.bc-loading, .search-loading {
  margin-top: 36px;
  text-align: center;
  padding: 30px;
  background: rgba(10, 15, 28, 0.6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  animation: fadeIn 0.3s ease;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #38bdf8;
  border-right-color: #818cf8;
  border-radius: 50%;
  margin: 0 auto 16px auto;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.loading-steps {
  list-style: none;
  max-width: 460px;
  margin: 18px auto 0 auto;
  text-align: left;
}

.loading-steps li {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.loading-steps li span {
  color: var(--emerald);
  font-weight: 800;
}

/* 關鍵字搜尋卡片列表 (Search Cards) */
.search-results-container {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-results-header strong {
  color: #38bdf8;
}

.company-result-card {
  background: rgba(10, 15, 28, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: all 0.25s var(--ease-smooth);
}

.company-result-card:hover {
  background: rgba(20, 29, 52, 0.85);
  border-color: var(--border-glow);
  transform: translateX(4px);
}

.company-result-card .c-info h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.company-result-card .c-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.company-result-card .c-meta .ban-tag {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 700;
}

.btn-select-ban {
  padding: 9px 20px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-select-ban:hover {
  background: var(--primary);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* --------------------------------------------------------------------------
   6. 查詢結果展示 (Eligibility Verdict & Checklist)
   -------------------------------------------------------------------------- */
.bc-res {
  margin-top: 36px;
  animation: slideUp 0.4s var(--ease-spring);
}

.verdict-banner {
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.verdict-banner.ok {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(6, 182, 212, 0.12) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.verdict-banner.no {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.18) 0%, rgba(225, 29, 72, 0.1) 100%);
  border: 1.5px solid rgba(244, 63, 94, 0.4);
  box-shadow: 0 10px 30px rgba(244, 63, 94, 0.2);
}

.verdict-banner.unknown {
  background: rgba(148, 163, 184, 0.12);
  border: 1.5px solid rgba(148, 163, 184, 0.3);
}

.verdict-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.verdict-banner.ok .verdict-icon {
  background: var(--emerald);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.verdict-banner.no .verdict-icon {
  background: var(--rose);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.5);
}

.verdict-banner.unknown .verdict-icon {
  background: #64748b;
  color: #ffffff;
}

.verdict-text h4 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.verdict-text p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* 企業明細卡片 (Company Detail Card) */
.biz-info-card {
  background: rgba(10, 15, 28, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 24px;
}

.biz-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.biz-name-row h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
}

.biz-badge-group {
  display: flex;
  gap: 8px;
}

.biz-badge {
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.biz-badge.primary {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

.biz-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  font-size: 0.95rem;
  color: var(--text-tertiary);
}

.biz-prop strong {
  color: #ffffff;
  font-weight: 600;
}

/* 指標檢查清單 (Criteria Checklist) */
.criteria-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.criteria-item {
  background: rgba(10, 15, 28, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.2s ease;
}

.criteria-item.pass {
  border-left: 4px solid var(--emerald);
}

.criteria-item.fail {
  border-left: 4px solid var(--rose);
}

.check-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.criteria-item.pass .check-mark {
  background: var(--emerald-light);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.criteria-item.fail .check-mark {
  background: var(--rose-light);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.criteria-content h5 {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.criteria-content p {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* 自我審核區塊 (Self-Check Box) */
.self-check-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.self-check-box h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.self-check-box .intro {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.self-check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.self-check-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(10, 15, 28, 0.6);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.self-check-label:hover {
  background: rgba(20, 28, 50, 0.8);
  color: #ffffff;
}

.self-check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.final-eligibility-msg {
  display: none;
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-md);
  color: #6ee7b7;
  font-weight: 700;
  font-size: 0.96rem;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

.final-eligibility-msg.show {
  display: flex;
}

/* 操作按鈕橫列 (Action Buttons) */
.bc-actions-row {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.btn-primary-action {
  padding: 13px 26px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.96rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s var(--ease-spring);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.55);
}

.btn-secondary-action {
  padding: 13px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s var(--ease-smooth);
}

.btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.data-source-meta {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   7. 互動補助試算器 (Cockpit Calculator #calc)
   -------------------------------------------------------------------------- */
.calc-section {
  padding: 60px 0;
  position: relative;
  z-index: 2;
}

.calc-header {
  text-align: center;
  margin-bottom: 36px;
}

.calc-header h3 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.calc-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-card);
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.calc-input-group label {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.calc-num-field {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.calc-num-field .currency {
  position: absolute;
  left: 20px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-tertiary);
}

.calc-num-field input {
  width: 100%;
  height: 64px;
  background: rgba(10, 15, 28, 0.85);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0 20px 0 68px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  outline: none;
  transition: all 0.25s ease;
}

.calc-num-field input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.25);
}

/* 自訂 Range 質感滑桿 (Glowing Track Slider) */
.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: #1e293b;
  outline: none;
  margin-bottom: 28px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  cursor: pointer;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 2px solid #ffffff;
  transition: transform 0.2s ease;
}

.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

.preset-amounts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.amount-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.amount-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

.amount-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

/* 計算機結果展示看板 (Cockpit Result Panel) */
.calc-results-box {
  background: rgba(10, 15, 28, 0.8);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 動態比例條 (Dynamic Proportion Ratio Bar) */
.calc-ratio-container {
  margin-bottom: 24px;
}

.ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.ratio-label-sub {
  color: #34d399;
}

.ratio-label-self {
  color: #94a3b8;
}

.calc-ratio-bar {
  display: flex;
  height: 10px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: #1e293b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.ratio-bar-subsidy {
  background: linear-gradient(90deg, #10b981, #06b6d4);
  transition: width 0.3s var(--ease-spring);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.ratio-bar-selfpay {
  background: #334155;
  transition: width 0.3s var(--ease-spring);
}

.calc-res-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 1rem;
  color: var(--text-tertiary);
}

.calc-res-row .val {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.calc-res-row.highlight {
  padding: 18px 0;
  border-bottom: 1.5px solid var(--border-medium);
}

.calc-res-row.highlight span:first-child {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
}

.calc-res-row .val.subsidy {
  font-size: 2.1rem;
  color: #34d399;
  text-shadow: 0 0 25px rgba(52, 211, 153, 0.45);
}

.calc-res-row .val.self-pay {
  color: #e2e8f0;
}

.calc-tip {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.6;
  padding-top: 14px;
}

/* --------------------------------------------------------------------------
   8. 資格標準對照 (Rules Comparison Cards #rules)
   -------------------------------------------------------------------------- */
#rules {
  padding: 60px 0;
  position: relative;
  z-index: 2;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 680px;
  margin: 0 auto 36px auto;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.rule-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 34px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-spring);
}

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

.rule-card.allow {
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.rule-card.disallow {
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.rule-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.rule-card.allow .rule-card-header h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #34d399;
}

.rule-card.disallow .rule-card-header h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #fb7185;
}

.rule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rule-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.rule-card.allow .rule-list li svg {
  width: 20px;
  height: 20px;
  color: var(--emerald);
  flex-shrink: 0;
  margin-top: 3px;
}

.rule-card.disallow .rule-list li svg {
  width: 20px;
  height: 20px;
  color: var(--rose);
  flex-shrink: 0;
  margin-top: 3px;
}

.rule-list li strong {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   9. 8 大步驟流程指南 (Timeline Stepper #steps)
   -------------------------------------------------------------------------- */
#steps {
  padding: 60px 0;
  position: relative;
  z-index: 2;
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: relative;
  max-width: 880px;
  margin: 0 auto;
}

.steps-container::before {
  content: '';
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 27px;
  width: 2px;
  background: linear-gradient(180deg, #6366f1 0%, #06b6d4 50%, #10b981 100%);
  z-index: 0;
  opacity: 0.4;
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px 30px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s var(--ease-spring);
  position: relative;
  z-index: 1;
}

.step-card:hover {
  transform: translateX(6px);
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.step-number-badge {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #6366f1;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.step-body {
  flex: 1;
}

.step-body h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.step-body p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.68;
  margin-bottom: 12px;
}

.step-body ul {
  margin-left: 20px;
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: var(--text-tertiary);
}

.step-body ul li {
  margin-bottom: 6px;
}

.step-body ul li strong {
  color: #ffffff;
}

.step-callout {
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
}

.step-callout.warn {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
}

.step-callout.warn svg {
  color: #f59e0b;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-callout.tip {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #a5f3fc;
}

.step-callout.tip svg {
  color: #06b6d4;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   10. 常見問題摺疊面板 (Glass Accordion #faq)
   -------------------------------------------------------------------------- */
#faq {
  padding: 60px 0;
  position: relative;
  z-index: 2;
}

.faq-accordion {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s var(--ease-smooth);
}

.faq-item:hover {
  border-color: var(--border-medium);
}

.faq-item[open] {
  border-color: rgba(99, 102, 241, 0.45);
  background: var(--bg-card-hover);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.faq-item summary {
  padding: 22px 26px;
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary .arrow {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform 0.3s var(--ease-spring), color 0.2s ease;
  flex-shrink: 0;
}

.faq-item[open] summary .arrow {
  transform: rotate(180deg);
  color: #38bdf8;
}

.faq-content {
  padding: 0 26px 24px 26px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  animation: fadeIn 0.3s ease;
}

/* --------------------------------------------------------------------------
   11. 底部行動召喚橫幅 (High-Impact CTA Banner)
   -------------------------------------------------------------------------- */
.cta-banner {
  margin: 60px 0 80px 0;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-xl);
  padding: 56px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 50px rgba(99, 102, 241, 0.2);
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cta-banner-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 20px;
}

.cta-banner h3 {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.cta-banner p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 34px;
}

.cta-banner-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-cta-primary {
  padding: 15px 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.25s var(--ease-spring);
}

.btn-cta-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 35px rgba(79, 70, 229, 0.65);
}

.btn-cta-secondary {
  padding: 15px 28px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-medium);
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s var(--ease-smooth);
}

.btn-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   12. 頁尾資訊 (Executive Footer)
   -------------------------------------------------------------------------- */
footer.main-footer {
  background: #04070e;
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 40px 0;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  position: relative;
  z-index: 2;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
}

.footer-content h5 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 14px;
}

.footer-content p {
  line-height: 1.8;
}

.footer-content a {
  color: #38bdf8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-content a:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

/* --------------------------------------------------------------------------
   13. 回到頂部按鈕與 Toast 浮窗系統
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-medium);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.3s var(--ease-spring);
  z-index: 90;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary);
  border-color: #818cf8;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
}

/* Toast 容器與卡片 */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}

.toast-item {
  padding: 12px 24px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  animation: toastIn 0.35s var(--ease-spring);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-item.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.toast-item.hide {
  animation: toastOut 0.35s ease forwards;
}

/* --------------------------------------------------------------------------
   14. 動畫定義庫 (Keyframe Animations)
   -------------------------------------------------------------------------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseBeacon {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.5;
  }
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
}

/* --------------------------------------------------------------------------
   15. 響應式優化 (Responsive Perfection)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero h2 {
    font-size: 2.3rem;
  }
  .facts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(7, 10, 18, 0.96);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border-subtle);
    display: none;
  }

  .nav-links.nav-open {
    display: flex;
    animation: fadeIn 0.25s ease;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .btn-nav-query {
    display: none;
  }

  .hero h2 {
    font-size: 1.85rem;
  }

  .hero p.lead {
    font-size: 1.02rem;
  }

  .facts-grid {
    grid-template-columns: 1fr;
  }

  .bc-box {
    padding: 24px;
  }

  .bc-form {
    flex-direction: column;
  }

  .bc-submit-btn {
    width: 100%;
    justify-content: center;
  }

  .biz-details-grid {
    grid-template-columns: 1fr;
  }

  .steps-container::before {
    display: none;
  }

  .step-card {
    flex-direction: column;
    padding: 20px;
  }

  .step-number-badge {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  .cta-banner {
    padding: 40px 20px;
  }

  .cta-banner h3 {
    font-size: 1.7rem;
  }
}

/* ==========================================================================
   8. 系統認證與登入介面 (Login System & Security Modals)
   ========================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 25%, rgba(99, 102, 241, 0.22), rgba(7, 10, 18, 0.98) 75%);
  backdrop-filter: blur(32px);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.login-overlay[hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  padding: 40px 36px;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9), 0 0 50px rgba(99, 102, 241, 0.25);
  animation: modalPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.logo-icon-lg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  border-radius: 20px;
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
}

.login-brand h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login-sub {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  line-height: 1.45;
}

.login-admin-tip {
  display: flex;
  gap: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 22px;
  text-align: left;
}

.login-admin-tip .tip-icon {
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 2px;
}

.login-admin-tip .tip-body strong {
  display: block;
  font-size: 0.88rem;
  color: #fcd34d;
  margin-bottom: 4px;
}

.login-admin-tip .tip-body p {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0;
}

.login-admin-tip code {
  background: rgba(245, 158, 11, 0.2);
  color: #fef08a;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.login-error-alert {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  text-align: left;
}

.login-field {
  margin-bottom: 20px;
  text-align: left;
}

.login-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.label-row label {
  margin-bottom: 0;
}

.label-hint {
  font-size: 0.78rem;
  color: #38bdf8;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap .field-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.login-input-wrap input {
  width: 100%;
  height: 52px;
  background: rgba(7, 10, 18, 0.75);
  border: 1.5px solid var(--border-medium);
  border-radius: 14px;
  padding: 0 46px 0 46px;
  color: #ffffff;
  font-size: 0.96rem;
  outline: none;
  transition: all 0.2s ease;
}

.login-input-wrap input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
  background: rgba(7, 10, 18, 0.95);
}

.btn-toggle-pwd {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  font-size: 1rem;
}

.btn-login-submit {
  width: 100%;
  height: 52px;
  background: var(--primary-gradient);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
  margin-top: 10px;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -5px rgba(99, 102, 241, 0.7);
}

.btn-login-submit:active {
  transform: translateY(0);
}

.login-footer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 頂部使用者資訊選單 */
.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 4px 6px 4px 14px;
}

.user-avatar-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #ffffff;
  font-weight: 600;
}

.user-role-icon {
  font-size: 1rem;
}

.badge-role {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  text-transform: uppercase;
}

.user-action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-nav-mini {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-nav-mini:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.btn-nav-logout {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.25);
}

.btn-nav-logout:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #ffffff;
}

.nav-link-admin {
  color: #c084fc !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   9. 通用彈窗系統 (Application Modals)
   ========================================================================== */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}

.app-modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(20px);
}

.modal-backdrop-locked {
  cursor: not-allowed;
}

.modal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(99, 102, 241, 0.2);
  animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content-sm {
  max-width: 480px;
}

.modal-content-lg {
  max-width: 820px;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-icon-badge.primary {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.header-icon-badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.header-icon-badge.purple {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.modal-header p {
  font-size: 0.88rem;
  color: var(--text-tertiary);
  margin: 0;
}

.modal-close-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-tertiary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.form-section-title span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group .req {
  color: #f43f5e;
}

.app-input, .app-select, .app-textarea {
  width: 100%;
  background: rgba(7, 10, 18, 0.75);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.app-input:focus, .app-select:focus, .app-textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(7, 10, 18, 0.95);
}

.font-mono {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.input-with-action {
  display: flex;
  gap: 8px;
}

.btn-input-mini {
  white-space: nowrap;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-input-mini:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
}

.audit-meta-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: rgba(7, 10, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.audit-meta-box strong {
  color: var(--text-secondary);
}

.modal-msg {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  text-align: left;
}

.modal-msg.err {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.modal-msg.ok {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.modal-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 10px;
}

.footer-btn-group {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #ffffff;
}

.w-full {
  width: 100% !important;
  justify-content: center !important;
}

/* ==========================================================================
   10. 客戶維護與戰情看板樣式 (#crm-board)
   ========================================================================== */
.crm-section {
  padding: 60px 0;
  position: relative;
  z-index: 2;
}

.crm-header {
  text-align: center;
  margin-bottom: 36px;
}

.section-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.live-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.crm-header h3 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.crm-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

/* 6 大戰情統計卡片 */
.crm-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.crm-kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.crm-kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}

.crm-kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.25s ease;
}

.crm-kpi-card.total::after { background: var(--cyan-gradient); }
.crm-kpi-card.potential::after { background: linear-gradient(90deg, #38bdf8, #60a5fa); }
.crm-kpi-card.negotiating::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.crm-kpi-card.won::after { background: var(--emerald-gradient); }
.crm-kpi-card.rejected::after { background: linear-gradient(90deg, #f43f5e, #fda4af); }
.crm-kpi-card.rate::after { background: var(--primary-gradient); }

.kpi-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.crm-kpi-card.total .kpi-icon-box { background: rgba(6, 182, 212, 0.15); color: #38bdf8; }
.crm-kpi-card.potential .kpi-icon-box { background: rgba(56, 189, 248, 0.15); color: #60a5fa; }
.crm-kpi-card.negotiating .kpi-icon-box { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.crm-kpi-card.won .kpi-icon-box { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.crm-kpi-card.rejected .kpi-icon-box { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.crm-kpi-card.rate .kpi-icon-box { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-tertiary);
  display: block;
  margin-bottom: 4px;
}

.kpi-val-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.kpi-num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.kpi-unit {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.kpi-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 戰情看板工具列 */
.crm-toolbar-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.toolbar-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
}

.toolbar-search-wrap svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.toolbar-search-wrap input {
  width: 100%;
  height: 44px;
  background: rgba(7, 10, 18, 0.7);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0 36px 0 42px;
  color: #ffffff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.toolbar-search-wrap input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-select {
  height: 44px;
  background: rgba(7, 10, 18, 0.7);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0 14px;
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar-select:focus {
  border-color: #6366f1;
}

.view-switch-tabs {
  display: flex;
  background: rgba(7, 10, 18, 0.8);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 3px;
}

.view-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  padding: 6px 14px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-tab-btn.active {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.btn-icon-refresh {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-refresh:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: rotate(45deg);
}

/* 看板檢視 (Kanban View) */
.crm-kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.kanban-column {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-title h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-potential { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }
.dot-negotiating { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dot-won { background: #10b981; box-shadow: 0 0 8px #10b981; }
.dot-rejected { background: #f43f5e; box-shadow: 0 0 8px #f43f5e; }

.column-badge {
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.kanban-cards-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.kanban-card {
  background: rgba(23, 34, 60, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  position: relative;
}

.kanban-card:hover {
  transform: translateY(-3px);
  background: rgba(28, 42, 75, 0.9);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 12px 24px -5px rgba(0, 0, 0, 0.5);
}

.kanban-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.kanban-ban-pill {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.kanban-card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 8px;
}

.kanban-card-meta {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.kanban-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.sales-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-status-select {
  background: rgba(7, 10, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 3px 6px;
  cursor: pointer;
}

/* 清單表格檢視 (Table View) */
.crm-table-container {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  padding: 8px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.crm-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.crm-data-table th {
  background: rgba(7, 10, 18, 0.8);
  color: var(--text-tertiary);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.crm-data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.crm-data-table tbody tr {
  transition: background 0.15s ease;
}

.crm-data-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.45);
}

.cell-name-strong {
  font-weight: 700;
  color: #ffffff;
}

.cell-ban-link {
  font-family: var(--font-display);
  font-weight: 700;
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.potential { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.status-badge.negotiating { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.status-badge.won { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.status-badge.rejected { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.35); }

.table-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-tbl-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-tbl-action:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-tbl-action.danger:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #ffffff;
  border-color: rgba(244, 63, 94, 0.4);
}

/* 空狀態 */
.crm-empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: 20px;
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.crm-empty-state h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.crm-empty-state p {
  font-size: 0.92rem;
  color: var(--text-tertiary);
  max-width: 500px;
  margin: 0 auto 20px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ==========================================================================
   11. 帳號管理平台樣式 (#modal-users)
   ========================================================================== */
.users-platform-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.users-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.users-toolbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-primary-sm {
  background: var(--primary-gradient);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.user-edit-card {
  background: rgba(7, 10, 18, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.user-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.user-card-head h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-link-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-link-sm:hover {
  color: #ffffff;
}

.user-grid-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.user-grid-form .full-width {
  grid-column: span 2;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.custom-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
}

.form-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

.user-form-msg {
  font-size: 0.85rem;
  margin-right: auto;
}

.user-form-msg.err { color: #f43f5e; }
.user-form-msg.ok { color: #10b981; }

.users-table-wrap {
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  overflow: hidden;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.app-table th {
  background: rgba(7, 10, 18, 0.9);
  color: var(--text-tertiary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.app-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.role-tag-admin {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.role-tag-user {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.pwd-tag-must-change {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
}

.pwd-tag-ok {
  color: #10b981;
  font-size: 0.78rem;
}

/* 統編秒查結果卡片新增客戶按鈕 */
.btn-add-crm-highlight {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.5) !important;
  border: none !important;
}

.btn-add-crm-highlight:hover {
  box-shadow: 0 12px 28px -4px rgba(16, 185, 129, 0.7) !important;
}

.btn-quick-add-crm {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-quick-add-crm:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #ffffff;
}

/* 響應式優化 */
@media (max-width: 1024px) {
  .crm-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .crm-kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .crm-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .crm-kanban-board {
    grid-template-columns: 1fr;
  }
  .form-row-2, .form-row-3, .user-grid-form {
    grid-template-columns: 1fr;
  }
  .user-profile-menu {
    flex-direction: column;
    align-items: flex-start;
    border-radius: 14px;
    padding: 10px;
  }
  .user-action-buttons {
    flex-wrap: wrap;
    width: 100%;
  }
}

/* ==========================================================================
   12. 頂級獨立頁面架構與視覺樣式 (Awwwards / Webby / FWA Tier Multi-Page)
   ========================================================================== */

/* --------------------------------------------------------------------------
   A. 通用導覽列連結啟用狀態 (Universal Nav)
   -------------------------------------------------------------------------- */
.nav-link.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 16px -2px rgba(99, 102, 241, 0.4);
}

.btn-nav-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-gradient);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s var(--ease-spring);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-nav-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.55);
}

/* --------------------------------------------------------------------------
   B. 全域 Toast 訊息元件
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 20px -2px rgba(99, 102, 241, 0.3);
  animation: toastSlideIn 0.35s var(--ease-spring) forwards;
  max-width: 420px;
}

.toast-item.toast-success { border-color: rgba(16, 185, 129, 0.5); box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 20px -2px rgba(16, 185, 129, 0.3); }
.toast-item.toast-error { border-color: rgba(244, 63, 94, 0.5); box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 20px -2px rgba(244, 63, 94, 0.3); }
.toast-item.toast-warning { border-color: rgba(245, 158, 11, 0.5); box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 20px -2px rgba(245, 158, 11, 0.3); }

.toast-icon { font-size: 1.15rem; flex-shrink: 0; }
.toast-msg { flex-grow: 1; line-height: 1.5; }
.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
}
.toast-close:hover { color: #ffffff; }

.toast-item.toast-hide {
  animation: toastSlideOut 0.25s ease forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(12px) scale(0.95); }
}

/* --------------------------------------------------------------------------
   C. 首頁 CRM 引導卡片 (.crm-teaser-banner)
   -------------------------------------------------------------------------- */
.crm-teaser-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 27, 75, 0.65) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 20px;
  padding: 28px 32px;
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.crm-teaser-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.teaser-tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.crm-teaser-left h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.crm-teaser-left p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 620px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .crm-teaser-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --------------------------------------------------------------------------
   D. 獨立登入頁面樣式 (.page-auth, login.html)
   -------------------------------------------------------------------------- */
.page-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  background: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
              radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.1) 0%, transparent 45%),
              #070a12;
}

.auth-page-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.auth-split-wrapper {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 28px;
  transition: all 0.2s ease;
}

.auth-back-link:hover {
  color: #ffffff;
  transform: translateX(-4px);
}

.brand-kick-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818cf8;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}

.auth-hero-title {
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.auth-hero-desc {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.auth-features-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.auth-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 18px;
  border-radius: 14px;
}

.feature-icon-badge {
  font-size: 1.3rem;
  line-height: 1;
  padding-top: 2px;
}

.feature-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.feature-text p {
  font-size: 0.84rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.auth-telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #10b981;
  font-family: var(--font-display);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseBeacon 2s infinite;
}

/* 登入卡片 */
.auth-glass-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  padding: 38px 34px;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
}

.auth-glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #6366f1, #06b6d4, transparent);
}

.auth-card-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-card-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 10px;
  margin-bottom: 4px;
}

.auth-card-sub {
  font-size: 0.88rem;
  color: var(--text-tertiary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap input {
  width: 100%;
  background: rgba(7, 10, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.95rem;
  padding: 12px 14px 12px 42px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.auth-input-wrap input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(12, 17, 29, 0.95);
}

.auth-input-wrap .field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.btn-auth-submit {
  width: 100%;
  background: var(--primary-gradient);
  border: none;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  padding: 14px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 25px -4px rgba(99, 102, 241, 0.5);
  transition: all 0.25s var(--ease-spring);
  margin-top: 6px;
}

.btn-auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px -4px rgba(99, 102, 241, 0.7);
}

.btn-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* 密碼強度指示器 */
.pwd-strength-box {
  margin-top: 4px;
}
.pwd-strength-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
}
.strength-fill.weak { background: #f43f5e; }
.strength-fill.medium { background: #f59e0b; }
.strength-fill.strong { background: #10b981; }
.strength-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.force-pwd-notice {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.auth-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
  margin-top: 24px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .auth-split-wrapper {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* --------------------------------------------------------------------------
   E. 獨立 CRM 戰情看板樣式 (.page-crm, crm.html)
   -------------------------------------------------------------------------- */
.crm-main-container {
  padding-top: 40px;
  padding-bottom: 80px;
}

.crm-hero-telemetry {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 32px;
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818cf8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.telemetry-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.telemetry-sub {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin-top: 6px;
}

.telemetry-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* 6 大高光 KPI 指標卡 */
.crm-kpis-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.crm-kpis-grid .kpi-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.crm-kpis-grid .kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.6);
}

.crm-kpis-grid .kpi-card.glow-cyan:hover { border-color: rgba(6, 182, 212, 0.5); box-shadow: 0 16px 30px -10px rgba(6, 182, 212, 0.35); }
.crm-kpis-grid .kpi-card.glow-amber:hover { border-color: rgba(245, 158, 11, 0.5); box-shadow: 0 16px 30px -10px rgba(245, 158, 11, 0.35); }
.crm-kpis-grid .kpi-card.glow-emerald:hover { border-color: rgba(16, 185, 129, 0.5); box-shadow: 0 16px 30px -10px rgba(16, 185, 129, 0.35); }
.crm-kpis-grid .kpi-card.glow-rose:hover { border-color: rgba(244, 63, 94, 0.5); box-shadow: 0 16px 30px -10px rgba(244, 63, 94, 0.35); }
.crm-kpis-grid .kpi-card.glow-purple:hover { border-color: rgba(168, 85, 247, 0.5); box-shadow: 0 16px 30px -10px rgba(168, 85, 247, 0.35); }

.kpi-icon-wrap {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.kpi-info .kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.kpi-val-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0 6px;
}

.kpi-val-row .kpi-num {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.kpi-val-row .kpi-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.crm-kpis-grid .kpi-footer {
  font-size: 0.74rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  margin-top: auto;
}

@media (max-width: 1200px) {
  .crm-kpis-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .crm-kpis-grid { grid-template-columns: repeat(2, 1fr); }
  .crm-hero-telemetry { flex-direction: column; align-items: flex-start; }
}

.btn-icon-refresh {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-medium);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}
.btn-icon-refresh:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg) scale(1.05);
}

/* 綜合工具列與篩選列 */
.crm-toolbar-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 14px 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  flex-wrap: wrap;
}

.toolbar-search-wrap {
  position: relative;
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
}

.toolbar-search-wrap svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.toolbar-search-wrap input {
  width: 100%;
  height: 44px;
  background: rgba(7, 10, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.92rem;
  padding: 0 40px 0 44px;
  outline: none;
  transition: all 0.2s ease;
}

.toolbar-search-wrap input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(7, 10, 18, 0.95);
}

.toolbar-search-wrap .clear-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  display: none;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-select {
  height: 44px;
  background: rgba(7, 10, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0 16px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.toolbar-select:focus {
  border-color: #6366f1;
}

.view-switch-tabs {
  display: inline-flex;
  background: rgba(7, 10, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}

.view-tab-btn {
  height: 36px;
  padding: 0 14px;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--text-tertiary);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.view-tab-btn:hover {
  color: #ffffff;
}

.view-tab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(79, 70, 229, 0.25) 100%);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   Kanban 看板視圖：高度鎖定視窗 + 內部各欄獨立滾動 (解決數百筆卡片畫面過長問題)
   ========================================================================== */
.crm-kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  /* 關鍵高度鎖定：配合瀏覽器視窗高度，將看板固定在當前視圖內，欄內獨立滾動 */
  height: calc(100vh - 290px);
  min-height: 560px;
  max-height: 860px;
  margin-bottom: 28px;
}

.kanban-column {
  background: rgba(13, 20, 36, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.55);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.kanban-column:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.kanban-column.col-potential { border-top: 3.5px solid #38bdf8; }
.kanban-column.col-negotiating { border-top: 3.5px solid #fbbf24; }
.kanban-column.col-won { border-top: 3.5px solid #34d399; }
.kanban-column.col-rejected { border-top: 3.5px solid #f43f5e; }

.column-header {
  padding: 16px 18px;
  background: rgba(7, 10, 18, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.column-title h4 {
  font-size: 1.02rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px currentColor;
}
.dot-potential { background-color: #38bdf8; color: #38bdf8; }
.dot-negotiating { background-color: #fbbf24; color: #fbbf24; }
.dot-won { background-color: #34d399; color: #34d399; }
.dot-rejected { background-color: #f43f5e; color: #f43f5e; }

.column-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-variant-numeric: tabular-nums;
}

/* 獨立卡片滾動盒：高度自動填滿欄位，卡片再多也只在內部滑動，不會拉長整個網頁！ */
.kanban-cards-box {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.kanban-cards-box::-webkit-scrollbar {
  width: 6px;
}
.kanban-cards-box::-webkit-scrollbar-track {
  background: transparent;
}
.kanban-cards-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 6px;
}
.kanban-cards-box::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* 舒適詳細模式卡片 */
.kanban-card {
  background: rgba(18, 26, 47, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(24, 34, 61, 0.95);
  box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.25);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-ban-chip {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(99, 102, 241, 0.16);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
}

.card-actions-quick {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.65;
  transition: opacity 0.2s ease;
}
.kanban-card:hover .card-actions-quick {
  opacity: 1;
}

.btn-card-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.86rem;
  padding: 3px 5px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.btn-card-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.card-company-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 8px;
  word-break: break-all;
}

.card-contact-row {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-sales-row {
  margin-bottom: 8px;
}

.sales-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  margin-top: 4px;
}

.card-time {
  font-size: 0.72rem;
  color: #64748b;
}

.select-quick-status {
  background: rgba(7, 10, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.75rem;
  padding: 3px 6px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.select-quick-status:hover, .select-quick-status:focus {
  border-color: #6366f1;
}

/* 緊湊精簡模式 - 應對數百筆卡片的高密度佈局 (卡片空間縮減 70%) */
.kanban-card.compact {
  padding: 8px 12px;
  border-radius: 10px;
}

.card-compact-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-compact-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-compact-rep {
  font-size: 0.74rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.card-compact-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.kanban-card.compact:hover .card-compact-actions {
  opacity: 1;
}

.btn-card-icon-mini {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.btn-card-icon-mini:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* 載入更多卡片按鈕 (百筆分批載入) */
.btn-load-more-cards {
  width: 100%;
  padding: 11px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px dashed rgba(99, 102, 241, 0.45);
  border-radius: 12px;
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-load-more-cards:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: #818cf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

/* ==========================================================================
   清單表格視圖 (Table View) & 空白狀態 (Empty State)
   ========================================================================== */
.crm-table-container {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.55);
  margin-bottom: 30px;
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

.crm-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.crm-data-table th {
  padding: 14px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crm-data-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.crm-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.cell-ban-link {
  color: #818cf8;
  font-weight: 700;
  cursor: pointer;
}
.cell-ban-link:hover {
  text-decoration: underline;
  color: #a5b4fc;
}

.cell-name-strong {
  color: #ffffff;
  font-weight: 800;
}

.cell-muted {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-badge.potential { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.status-badge.negotiating { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.status-badge.won { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.status-badge.rejected { background: rgba(244, 63, 94, 0.15); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.3); }

.table-actions-cell {
  display: inline-flex;
  gap: 8px;
}

.btn-tbl-action {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-tbl-action:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-tbl-action.danger:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.crm-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  margin: 30px 0;
}
.crm-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
.crm-empty-state h4 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}
.crm-empty-state p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  margin-bottom: 24px;
}
.crm-empty-state .empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ==========================================================================
   頂級客戶資料維護 Dialog 視窗 (Awwwards / Webby / FWA 獲獎級美化排版)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active,
.modal-overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay[hidden] {
  display: none !important;
}

/* Dialog Container Card */
.modal-customer-dialog {
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  background: linear-gradient(170deg, rgba(17, 24, 39, 0.96) 0%, rgba(9, 14, 26, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.85),
              0 0 0 1px rgba(255, 255, 255, 0.08),
              0 0 50px -10px rgba(99, 102, 241, 0.2);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: dialogEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dialogEntrance {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.dialog-header {
  padding: 22px 28px;
  background: rgba(7, 10, 18, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.dialog-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dialog-icon-badge {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(56, 189, 248, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.dialog-header h3 {
  font-size: 1.28rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.dialog-subtitle {
  font-size: 0.84rem;
  color: var(--text-tertiary);
  margin: 4px 0 0 0;
}

.kbd-hint {
  font-size: 0.74rem;
  color: #64748b;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dialog-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.dialog-close-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #ffffff;
  transform: rotate(90deg);
}

.customer-dialog-form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.dialog-scroll-body {
  overflow-y: auto;
  max-height: calc(90vh - 170px);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.dialog-scroll-body::-webkit-scrollbar {
  width: 6px;
}
.dialog-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 6px;
}

/* 區塊卡片化 (Sectioned Card) */
.dialog-form-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s ease;
}

.dialog-form-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  font-weight: 800;
  color: #f1f5f9;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sec-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field.full-width {
  width: 100%;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-field label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #cbd5e1;
}

.form-field .req {
  color: #f43f5e;
  font-weight: 900;
}

.label-hint {
  font-size: 0.76rem;
  color: #64748b;
}

/* 統編狀態徽章 */
.ban-status-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.ban-status-tag.valid {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.ban-status-tag.warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* 統編輸入框 + 自動查驗按鈕 */
.input-with-action {
  display: flex;
  gap: 8px;
}

.input-ban-mono {
  flex: 1;
  font-family: var(--font-mono, 'Courier New', monospace);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffffff;
  background: rgba(7, 10, 18, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  outline: none;
  transition: all 0.2s ease;
}

.input-ban-mono:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.btn-lookup-addon {
  padding: 0 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(56, 189, 248, 0.2) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  color: #38bdf8;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease-spring);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-lookup-addon:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(56, 189, 248, 0.35) 100%);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

/* 一般輸入框整合圖標 */
.field-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input-box .input-icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.8;
}

.field-input-box input {
  width: 100%;
  height: 46px;
  background: rgba(7, 10, 18, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.92rem;
  padding: 0 14px 0 44px;
  outline: none;
  transition: all 0.2s ease;
}

.field-input-box input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(7, 10, 18, 0.95);
}

.input-company-name {
  font-weight: 700 !important;
  font-size: 0.96rem !important;
}

.form-field textarea {
  width: 100%;
  background: rgba(7, 10, 18, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.9rem;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.form-field textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* 4 階段狀態 Segmented Pills 選擇器 */
.status-pills-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.status-pill-btn {
  background: rgba(7, 10, 18, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 11px 8px;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.status-pill-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 狀態 Pills 選中樣式 (Glowing Active States) */
.status-pill-btn.active[data-status="潛在客戶"] {
  background: rgba(56, 189, 248, 0.16);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.status-pill-btn.active[data-status="接洽中"] {
  background: rgba(251, 191, 36, 0.16);
  border-color: #fbbf24;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.25);
}

.status-pill-btn.active[data-status="已成交"] {
  background: rgba(52, 211, 153, 0.16);
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.25);
}

.status-pill-btn.active[data-status="已拒絕"] {
  background: rgba(244, 63, 94, 0.16);
  border-color: #f43f5e;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.25);
}

/* 審計追蹤資訊盒 */
.dialog-audit-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(7, 10, 18, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.audit-capsule {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.audit-capsule strong {
  color: #e2e8f0;
}

.audit-capsule .audit-ts {
  color: #64748b;
}

/* Dialog 底部列 */
.dialog-footer {
  padding: 18px 28px;
  background: rgba(7, 10, 18, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.footer-left {
  display: flex;
  align-items: center;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-danger-ghost {
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-ghost:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: #f43f5e;
  color: #ffffff;
}

.btn-dialog-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dialog-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-dialog-submit {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 11px 24px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.25s var(--ease-spring);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-dialog-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.55);
}

.btn-dialog-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 響應式優化 */
@media (max-width: 1200px) {
  .crm-kanban-board {
    grid-template-columns: repeat(2, 1fr);
    height: auto;
    max-height: none;
  }
  .kanban-column {
    height: 520px;
  }
}

@media (max-width: 768px) {
  .crm-toolbar-box {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-select, .view-switch-tabs {
    width: 100%;
    justify-content: center;
  }
  .crm-kanban-board {
    grid-template-columns: 1fr;
    height: auto;
  }
  .kanban-column {
    height: 480px;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .status-pills-selector {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-customer-dialog {
    max-height: 96vh;
    border-radius: 18px;
  }
  .dialog-header, .dialog-scroll-body, .dialog-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
}
   -------------------------------------------------------------------------- */
.users-main-container {
  padding-top: 40px;
  padding-bottom: 80px;
}

.users-hero-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 32px;
}

.users-hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.users-hero-sub {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin-top: 6px;
}

.users-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.user-kpi-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.u-kpi-icon { font-size: 1.8rem; }
.u-kpi-val { font-family: var(--font-display); font-size: 1.8rem; font-weight: 900; color: #ffffff; line-height: 1.1; }
.u-kpi-lbl { font-size: 0.82rem; color: var(--text-tertiary); font-weight: 600; }

.user-kpi-card.glow-admin { border-color: rgba(168, 85, 247, 0.35); }
.user-kpi-card.glow-user { border-color: rgba(59, 130, 246, 0.35); }
.user-kpi-card.glow-secure { border-color: rgba(16, 185, 129, 0.35); }

.users-dual-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  align-items: flex-start;
}

.admin-glass-box {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.box-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}

.box-icon-tag {
  width: 42px;
  height: 42px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.box-head h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.box-sub {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.box-head-grow { flex-grow: 1; }

.admin-box-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-text-action {
  background: transparent;
  border: none;
  color: #818cf8;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-text-action:hover { color: #a5b4fc; text-decoration: underline; }

.btn-copy-pwd {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.users-search-box {
  position: relative;
  margin-bottom: 16px;
}

.users-search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.users-search-box input {
  width: 100%;
  background: rgba(7, 10, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 10px 14px 10px 40px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.user-meta-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.user-avatar-circle.admin { background: rgba(168, 85, 247, 0.2); border: 1px solid rgba(168, 85, 247, 0.4); }
.user-avatar-circle.sales { background: rgba(59, 130, 246, 0.2); border: 1px solid rgba(59, 130, 246, 0.4); }

.cell-username { color: #ffffff; font-size: 0.95rem; }
.cell-realname { color: var(--text-tertiary); font-size: 0.8rem; }
.tag-self { color: #34d399; font-size: 0.75rem; font-weight: 700; margin-left: 4px; }

.permission-denied-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: 22px;
  padding: 48px 24px;
  text-align: center;
  max-width: 520px;
  margin: 60px auto;
}

.denied-icon { font-size: 3rem; margin-bottom: 16px; }
.permission-denied-box h3 { font-size: 1.4rem; color: #ffffff; margin-bottom: 8px; }
.permission-denied-box p { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.95rem; }

@media (max-width: 1024px) {
  .users-dual-grid { grid-template-columns: 1fr; }
  .users-kpis-grid { grid-template-columns: repeat(2, 1fr); }
  .users-hero-section { flex-direction: column; align-items: flex-start; }
}


