/* ============================================================
   靈犀源點 Lingxi Origin — 共用設計系統
   包含：設計變數、Reset、字體、佈局、按鈕、標籤、卡片、
         Navbar、Hero（共用部分）、FAQ、CTA、Footer、動畫、響應式
   ============================================================ */

/* ===== 設計系統：變數定義 ===== */
:root {
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020617;
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --accent-50: #f0fdfa;
  --accent-100: #ccfbf1;
  --accent-200: #99f6e4;
  --accent-300: #5eead4;
  --accent-400: #2dd4bf;
  --accent-500: #14b8a6;
  --accent-600: #0d9488;
  --success: #22c55e;
  --warning: #f59e0b;
  --font-sans: 'Inter', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
  --radius-xl: 20px; --radius-2xl: 24px; --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.10);
  --max-w: 1200px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset / 基礎樣式 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  color: var(--gray-700);
  background: var(--white);
  line-height: 1.6;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===== 字體階層 ===== */
.h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800; line-height: 1.08;
  letter-spacing: -0.03em; color: var(--gray-900);
}
.h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700; line-height: 1.15;
  letter-spacing: -0.025em; color: var(--gray-900);
}
.h3 {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700; line-height: 1.25;
  letter-spacing: -0.02em; color: var(--gray-900);
}
.h4 { font-size: 18px; font-weight: 600; line-height: 1.35; color: var(--gray-800); }
.body-lg { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.7; color: var(--gray-600); }
.body { font-size: 16px; line-height: 1.65; color: var(--gray-600); }
.body-sm { font-size: 14px; line-height: 1.6; color: var(--gray-500); }
.caption { font-size: 13px; line-height: 1.5; color: var(--gray-400); }
.label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand-600);
}

/* ===== 佈局 ===== */
.container { width: min(calc(100% - 48px), var(--max-w)); margin: 0 auto; }
.section { padding: var(--sp-24) 0; }
.section-alt { background: var(--gray-50); }

.section-header { max-width: 680px; margin-bottom: var(--sp-16); }
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-header .label { margin-bottom: var(--sp-3); display: block; }
.section-header .h2 { margin-bottom: var(--sp-4); }
.section-header .body-lg { margin-top: var(--sp-4); }

/* ===== 按鈕 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); font-weight: 600; font-size: 15px;
  border-radius: var(--radius-md); padding: 13px 28px;
  transition: all 0.2s var(--ease); white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn-primary {
  background: var(--brand-600); color: var(--white);
  box-shadow: 0 1px 3px rgba(37,99,235,0.3), 0 4px 12px rgba(37,99,235,0.15);
}
.btn-primary:hover {
  background: var(--brand-700);
  box-shadow: 0 2px 6px rgba(37,99,235,0.35), 0 8px 20px rgba(37,99,235,0.2);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--white); color: var(--gray-700);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--gray-50); border-color: var(--gray-300);
  transform: translateY(-1px);
}
.btn-ghost { background: transparent; color: var(--brand-600); padding: 13px 16px; }
.btn-ghost:hover { background: var(--brand-50); }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: var(--radius-lg); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== 標籤 ===== */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
  background: var(--brand-50); color: var(--brand-600);
  border: 1px solid var(--brand-100);
}
.tag-accent { background: var(--accent-50); color: var(--accent-600); border-color: var(--accent-100); }
.tag-neutral { background: var(--gray-100); color: var(--gray-600); border-color: var(--gray-200); }

/* ===== 卡片 ===== */
.card {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl); padding: var(--sp-8);
  transition: all 0.25s var(--ease);
}
.card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: all 0.3s var(--ease);
}
.navbar.scrolled { box-shadow: 0 1px 12px rgba(0,0,0,0.06); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.navbar-brand { display: flex; align-items: center; gap: var(--sp-3); }
.navbar-logo {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.navbar-logo::after {
  content: ""; position: absolute; inset: 5px;
  border-radius: calc(var(--radius-md) - 3px);
  border: 1.5px solid rgba(255,255,255,0.35);
}
.navbar-logo svg { width: 20px; height: 20px; color: white; }
.navbar-brand-text { font-weight: 800; font-size: 17px; color: var(--gray-900); letter-spacing: -0.02em; }
.navbar-brand-sub {
  font-size: 11px; font-weight: 600; color: var(--brand-500);
  letter-spacing: 0.02em; line-height: 1;
}
.navbar-brand-group { display: flex; flex-direction: column; gap: 2px; }

.navbar-links { display: flex; align-items: center; gap: var(--sp-1); }
.navbar-links a {
  padding: 8px 14px; font-size: 14px; font-weight: 500;
  color: var(--gray-600); border-radius: var(--radius-sm);
  transition: all 0.15s var(--ease);
}
.navbar-links a:hover { color: var(--gray-900); background: var(--gray-50); }
.navbar-cta { margin-left: var(--sp-4); }
.navbar-cta .btn { padding: 9px 20px; font-size: 14px; }

.menu-toggle {
  display: none; width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--gray-700);
}
.menu-toggle:hover { background: var(--gray-100); }
.menu-toggle svg { width: 24px; height: 24px; }

.mobile-menu {
  display: none; position: fixed; top: 72px; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 99; padding: var(--sp-6);
  opacity: 0; transform: translateY(-8px);
  transition: all 0.25s var(--ease); pointer-events: none;
}
.mobile-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.mobile-menu a {
  display: block; padding: 14px 16px; font-size: 16px;
  font-weight: 500; color: var(--gray-700);
  border-radius: var(--radius-md); transition: background 0.15s;
}
.mobile-menu a:hover { background: var(--gray-50); }
.mobile-menu .btn { width: 100%; margin-top: var(--sp-4); }

/* ===== Hero（共用部分）===== */
.hero {
  padding-top: 140px; padding-bottom: var(--sp-24);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; top: -200px; right: -200px;
  width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.06), transparent 65%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; bottom: -100px; left: -150px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(20,184,166,0.05), transparent 65%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-16); align-items: center; }
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px; background: var(--brand-50);
  border: 1px solid var(--brand-100); border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; color: var(--brand-600);
  margin-bottom: var(--sp-6);
}
.hero-badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-500); animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}
.hero .h1 { margin-bottom: var(--sp-5); }
.hero .h1 .gradient-text {
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: clamp(16px, 1.4vw, 18px); line-height: 1.75;
  color: var(--gray-500); max-width: 520px; margin-bottom: var(--sp-8);
}
.hero-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

.hero-visual { position: relative; z-index: 1; }
.hero-panel {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl); padding: var(--sp-6);
  box-shadow: var(--shadow-xl); position: relative;
}
.hero-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-5); padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--gray-100);
}
.hero-panel-title { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.hero-panel-chip {
  font-size: 12px; font-weight: 600; color: var(--accent-600);
  background: var(--accent-50); border: 1px solid var(--accent-100);
  padding: 4px 10px; border-radius: var(--radius-full);
}
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.metric-card { background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: var(--radius-lg); padding: var(--sp-4); }
.metric-value { font-size: 24px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.03em; line-height: 1; margin-bottom: 4px; }
.metric-label { font-size: 12px; color: var(--gray-400); font-weight: 500; }
.panel-list-items { display: grid; gap: var(--sp-2); }
.panel-list-item {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-md);
  background: var(--gray-50); border: 1px solid transparent;
  transition: all 0.2s var(--ease);
}
.panel-list-item:hover { border-color: var(--gray-200); }
.panel-list-icon {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-100), var(--accent-100));
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--brand-600);
}
.panel-list-text { font-size: 14px; font-weight: 500; color: var(--gray-700); line-height: 1.4; }
.panel-list-text span { display: block; font-size: 12px; font-weight: 400; color: var(--gray-400); margin-top: 2px; }

.hero-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4);
  margin-top: var(--sp-12); position: relative; z-index: 1;
}
.hero-kpi {
  text-align: center; padding: var(--sp-5) var(--sp-4);
  border-radius: var(--radius-lg); background: var(--white);
  border: 1px solid var(--gray-100); box-shadow: var(--shadow-sm);
}
.hero-kpi-value { font-size: 28px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.03em; line-height: 1; margin-bottom: 6px; }
.hero-kpi-label { font-size: 13px; color: var(--gray-400); font-weight: 500; }

/* ===== FAQ ===== */
.faq-list { max-width: 800px; margin: 0 auto; display: grid; gap: var(--sp-3); }
.faq-item {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all 0.2s var(--ease);
}
.faq-item:hover { border-color: var(--gray-300); }
.faq-item.open { border-color: var(--brand-200); box-shadow: 0 2px 12px rgba(59,130,246,0.06); }
.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); width: 100%; padding: var(--sp-5) var(--sp-6);
  font-size: 16px; font-weight: 600; color: var(--gray-800);
  text-align: left; transition: color 0.2s;
}
.faq-item.open .faq-question { color: var(--brand-600); }
.faq-chevron { width: 20px; height: 20px; flex-shrink: 0; color: var(--gray-400); transition: transform 0.3s var(--ease); }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s var(--ease); }
.faq-answer-inner { padding: 0 var(--sp-6) var(--sp-5); color: var(--gray-500); line-height: 1.7; font-size: 15px; }

/* ===== CTA ===== */
.cta-section { padding: var(--sp-24) 0; background: var(--gray-900); position: relative; overflow: hidden; }
.cta-section::before {
  content: ""; position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.12), transparent 60%);
  pointer-events: none;
}
.cta-inner { text-align: center; position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.cta-inner .h2 { color: var(--white); margin-bottom: var(--sp-4); }
.cta-inner .body-lg { color: var(--gray-400); margin-bottom: var(--sp-8); }
.cta-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }
.cta-actions .btn-primary {
  background: var(--white); color: var(--gray-900);
  box-shadow: 0 2px 12px rgba(255,255,255,0.15);
}
.cta-actions .btn-primary:hover { background: var(--gray-100); transform: translateY(-2px); }
.cta-actions .btn-secondary {
  background: transparent; color: var(--gray-300);
  border-color: rgba(255,255,255,0.15);
}
.cta-actions .btn-secondary:hover {
  background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.3); color: var(--white);
}

/* ===== 表單 ===== */
.contact-form {
  max-width: 560px; margin: var(--sp-12) auto 0;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl); padding: var(--sp-8);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.form-group { margin-bottom: var(--sp-4); }
.form-group:last-of-type { margin-bottom: var(--sp-6); }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-300); margin-bottom: 6px; }
.form-input, .form-textarea {
  width: 100%; padding: 11px 14px; font-size: 14px; font-family: var(--font-sans);
  color: var(--white); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-md);
  outline: none; transition: all 0.2s var(--ease);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--gray-500); }
.form-input:focus, .form-textarea:focus {
  border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
  background: rgba(255,255,255,0.08);
}
.form-textarea { resize: vertical; min-height: 100px; }
.contact-form .btn-primary { width: 100%; background: var(--brand-600); color: var(--white); }
.contact-form .btn-primary:hover { background: var(--brand-500); }

/* ===== Footer ===== */
.footer { background: var(--gray-950); padding: var(--sp-12) 0 var(--sp-8); }
.footer-brand .navbar-brand { margin-bottom: var(--sp-4); }
.footer-brand .navbar-brand-text { color: var(--white); }
.footer-brand p { font-size: 14px; line-height: 1.7; color: var(--gray-400); max-width: 300px; }
.footer-col-title { font-size: 13px; font-weight: 700; color: var(--gray-300); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: var(--sp-4); }
.footer-col a { display: block; font-size: 14px; color: var(--gray-400); padding: 4px 0; transition: color 0.15s; }
.footer-col a:hover { color: var(--white); }
.footer-line {
  border-top: 1px solid rgba(255,255,255,0.06); padding-top: var(--sp-6);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--sp-4);
}
.footer-line p { font-size: 13px; color: var(--gray-500); }

/* ===== 動畫 ===== */
.fade-up { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ===== 響應式（共用斷點）===== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-10); }
  .hero-visual { max-width: 520px; }
  .hero-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .navbar-links { display: none; }
  .navbar-cta { display: none; }
  .menu-toggle { display: flex; }
  .mobile-menu { display: block; }
}
@media (max-width: 680px) {
  .container { width: calc(100% - 32px); }
  .section { padding: var(--sp-16) 0; }
  .hero { padding-top: 110px; padding-bottom: var(--sp-16); }
  .hero-grid { gap: var(--sp-8); }
  .hero-kpi-row { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .hero-kpi { padding: var(--sp-4) var(--sp-3); }
  .hero-kpi-value { font-size: 22px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
  .metric-value { font-size: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .form-row { grid-template-columns: 1fr; }
  .faq-question { padding: var(--sp-4) var(--sp-5); font-size: 15px; }
  .faq-answer-inner { padding: 0 var(--sp-5) var(--sp-4); font-size: 14px; }
}
@media (max-width: 420px) {
  .hero-kpi-row { grid-template-columns: 1fr 1fr; }
}
