/* ==========================================================================
   Magpie 非官方介紹頁 - 樣式表 (styles.css)
   設計風格：暖白基底 / 墨黑文字 / 亮青綠與珊瑚點綴 / 大留白 / 精緻線條
   ========================================================================== */

:root {
  /* 基礎色彩系統 */
  --bg-page: #fbfaf6;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f2ea;
  --bg-card-dark: #0d121c;
  --bg-card-darker: #070a10;

  --ink-primary: #121826;
  --ink-secondary: #3e4859;
  --ink-muted: #6b778c;
  --ink-inverse: #f3f5f8;

  --border-light: #e6e3d8;
  --border-subtle: #ece9df;
  --border-dark: #222d42;

  /* 強調色（亮青綠與珊瑚暖調） */
  --accent-emerald: #059669;
  --accent-mint: #10b981;
  --accent-cyan: #06b6d4;
  --accent-coral: #f97316;
  --accent-coral-deep: #ea580c;
  --accent-indigo: #6366f1;

  /* 陰影與圓角 */
  --shadow-sm: 0 1px 3px rgba(18, 24, 38, 0.05);
  --shadow-md: 0 4px 12px rgba(18, 24, 38, 0.07);
  --shadow-lg: 0 12px 32px rgba(18, 24, 38, 0.1);
  --shadow-dark: 0 12px 36px rgba(0, 0, 0, 0.4);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* 排版設定 */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --container-max: 1200px;
  --transition-base: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 基本重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-page);
  color: var(--ink-primary);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 0% 50%, rgba(249, 115, 22, 0.03) 0%, transparent 45%);
  background-attachment: fixed;
}

/* 鍵盤可見 focus 樣式 */
:focus-visible {
  outline: 2px solid var(--accent-mint);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* 跳至主要內容 */
.skip-link {
  position: absolute;
  top: -60px;
  left: 20px;
  padding: 10px 16px;
  background: var(--ink-primary);
  color: var(--bg-page);
  font-weight: 600;
  z-index: 9999;
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
  text-decoration: none;
}

.skip-link:focus {
  top: 15px;
}

/* 版心容器 */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* 頂部非官方告示橫條 */
.notice-bar {
  background-color: #f0eee4;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.notice-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}

.notice-badge {
  display: inline-block;
  padding: 2px 8px;
  background-color: var(--ink-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
}

.notice-link {
  color: var(--accent-coral-deep);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-coral-deep);
  margin-left: 4px;
}

.notice-link:hover {
  border-bottom-style: solid;
}

/* 頂部主導覽列 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-primary);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #182234, #0f141e);
  color: var(--accent-mint);
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
}

/* 桌面導覽連結 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-item {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
  transition: color var(--transition-base);
}

.nav-item:hover {
  color: var(--ink-primary);
}

.nav-item::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-mint);
  transition: width var(--transition-base);
}

.nav-item:hover::after {
  width: 100%;
}

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

/* 按鈕元件系統 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-base);
}

.btn-primary {
  background: var(--ink-primary);
  color: #ffffff;
  border-color: var(--ink-primary);
  box-shadow: 0 2px 6px rgba(18, 24, 38, 0.12);
}

.btn-primary:hover {
  background: #232d40;
  border-color: #232d40;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(18, 24, 38, 0.18);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #fbfbf8;
  border-color: #d8d3c5;
  transform: translateY(-1px);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-large-cta {
  padding: 16px 32px;
  font-size: 1.05rem;
  background: var(--accent-mint);
  color: #032b1d;
  border-color: var(--accent-mint);
  font-weight: 700;
}

.btn-large-cta:hover {
  background: #0db37b;
  border-color: #0db37b;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.28);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.icon-ext {
  transition: transform var(--transition-base);
}

.btn:hover .icon-ext {
  transform: translate(2px, -2px);
}

/* 行動版漢堡切換按鈕 */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--ink-primary);
  transition: all var(--transition-base);
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 行動抽屜 */
.mobile-drawer {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 20px 24px;
  box-shadow: var(--shadow-lg);
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-item {
  color: var(--ink-primary);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg-subtle);
}

.mobile-cta-wrap {
  margin-top: 10px;
}

/* ==========================================================================
   Hero 區塊
   ========================================================================== */
.hero-section {
  padding: 56px 0 72px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 20px;
}

.pill-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-mint);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.hero-title {
  font-size: 2.85rem;
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 1.12rem;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin-bottom: 32px;
  max-width: 560px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-meta-points {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.meta-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-secondary);
}

.meta-tag svg {
  color: var(--accent-emerald);
}

/* ==========================================================================
   Hero Visual / 本機架構圖 (Agent → Magpie 本地閘道 → 多種模型供應商)
   ========================================================================== */
.hero-visual {
  position: relative;
}

.diagram-card {
  background: var(--bg-card-dark);
  color: var(--ink-inverse);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-dark);
  padding: 24px;
  box-shadow: var(--shadow-dark);
  position: relative;
  overflow: hidden;
}

.diagram-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #10b981, #06b6d4, #f97316);
}

.diagram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-dark);
}

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

.status-indicator {
  width: 10px;
  height: 10px;
  background-color: var(--accent-mint);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  animation: pulse-ring 2.4s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.diagram-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.diagram-subbadge {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  background: #182234;
  color: #7dd3fc;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #233550;
}

/* 協定分頁按鈕 */
.proto-tabs {
  display: flex;
  background: #131a29;
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
  border: 1px solid var(--border-dark);
}

.proto-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  white-space: nowrap;
}

.proto-tab:hover {
  color: #ffffff;
}

.proto-tab.active {
  background: #1f2b42;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* 架構流向展示面板 (3 節點水準佈局) */
.pipeline-board {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
  position: relative;
}

.pipe-node {
  flex: 1;
  background: #141b28;
  border: 1px solid #222f46;
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform var(--transition-base), border-color var(--transition-base);
}

.pipe-node:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.node-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  background: #1e293b;
  color: #94a3b8;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.highlight-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.node-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #1a2334;
  color: #60a5fa;
}

.gateway-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  color: #34d399;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.pipe-node-gateway {
  border-color: #10b981;
  background: #0f1c29;
}

.node-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}

.node-detail {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 10px;
}

.protocol-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #38bdf8;
  background: #0c4a6e;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  width: 100%;
  word-break: break-all;
}

.gateway-features {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.feat-tag {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  padding: 3px 6px;
  border-radius: 4px;
  border-left: 2px solid var(--accent-mint);
  text-align: left;
}

.providers-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.provider-pill {
  font-size: 0.73rem;
  font-weight: 600;
  background: #1e293b;
  color: #cbd5e1;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid #334155;
  transition: all var(--transition-base);
}

.provider-pill.active-provider {
  background: #14532d;
  color: #86efac;
  border-color: #22c55e;
}

/* 連接線視覺 */
.pipe-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  flex-shrink: 0;
  position: relative;
}

.connector-line {
  width: 100%;
  height: 2px;
  background: #27354d;
  position: relative;
  overflow: hidden;
}

.flow-pulse {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 18px;
  background: linear-gradient(90deg, transparent, #34d399, transparent);
  animation: flow-run 1.8s infinite linear;
}

.delay-pulse {
  animation-delay: 0.9s;
}

@keyframes flow-run {
  0% { transform: translateX(-20px); }
  100% { transform: translateX(50px); }
}

.connector-label {
  font-size: 0.65rem;
  color: #64748b;
  margin-top: 6px;
  white-space: nowrap;
}

/* 傳輸保真度橫條 */
.fidelity-bar {
  background: #131a29;
  border: 1px solid #202b3d;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fidelity-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #34d399;
}

.fidelity-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fidelity-tag {
  font-size: 0.75rem;
  color: #cbd5e1;
  background: #1e293b;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #334155;
}

.diagram-footer-note {
  font-size: 0.72rem;
  color: #64748b;
  text-align: right;
  line-height: 1.4;
}

/* ==========================================================================
   通論章節容器
   ========================================================================== */
.section {
  padding: 80px 0;
  position: relative;
}

.section-head {
  max-width: 680px;
  margin: 0 auto 52px;
}

.text-center {
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-emerald);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  line-height: 1.25;
  margin-bottom: 14px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   核心能力卡片區 (Capabilities Grid)
   ========================================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #d1ccbe;
}

.card-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.icon-cyan { background: #e0f2fe; color: #0284c7; }
.icon-teal { background: #ccfbf1; color: #0d9488; }
.icon-indigo { background: #e0e7ff; color: #4f46e5; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-rose { background: #ffe4e6; color: #e11d48; }
.icon-emerald { background: #dcfce7; color: #16a34a; }

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 12px;
  line-height: 1.35;
}

.card-text {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-tags span {
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

/* 官方說明安全特別卡片 */
.highlight-card {
  background: linear-gradient(180deg, #ffffff, #f7fdf9);
  border: 1px solid #a7f3d0;
}

.official-note-tag {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #d1fae5;
  color: #065f46;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.security-disclaimer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #bbf7d0;
  color: #047857;
  font-size: 0.78rem;
  line-height: 1.45;
}

/* ==========================================================================
   工作流程區塊 (Workflow)
   ========================================================================== */
.workflow-section {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.flow-steps-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 48px;
}

.step-card {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card-active {
  border-color: var(--accent-mint);
  box-shadow: 0 0 0 1px var(--accent-mint), var(--shadow-sm);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.step-arrow {
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 官方說明特性聚焦框 */
.official-focus-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.focus-icon {
  color: var(--accent-emerald);
  flex-shrink: 0;
  margin-top: 2px;
}

.focus-text h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.focus-text p {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   平台相容與開源規格 (Specifications)
   ========================================================================== */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.spec-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base);
}

.spec-card:hover {
  transform: translateY(-2px);
}

.spec-metric {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink-primary);
  margin-bottom: 8px;
}

.spec-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-coral-deep);
  margin-bottom: 8px;
}

.spec-desc {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* 費用防誤導警語區塊 */
.billing-clarification {
  background: #fff8f0;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  color: #7c2d12;
}

.clarification-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.clarification-header svg {
  color: #ea580c;
}

.billing-clarification p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #9a3412;
}

/* ==========================================================================
   官方引導 CTA 區塊
   ========================================================================== */
.official-cta-section {
  padding: 60px 0 80px;
}

.cta-banner {
  background: linear-gradient(135deg, #0e1524 0%, #152236 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 56px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid #23344d;
  position: relative;
  overflow: hidden;
}

.cta-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.cta-heading {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.cta-subheading {
  font-size: 1.05rem;
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.cta-action-area {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.cta-direct-link {
  font-size: 0.85rem;
  color: #64748b;
}

.cta-direct-link code {
  font-family: var(--font-mono);
  color: #38bdf8;
  background: rgba(15, 23, 42, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   頁尾與非官方聲明 (Footer)
   ========================================================================== */
.site-footer {
  background: #111622;
  color: #cbd5e1;
  border-top: 1px solid #1e283b;
  padding: 56px 0 32px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.footer-brand .brand-link {
  color: #ffffff;
  margin-bottom: 10px;
}

.footer-brand .brand-sub {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}

.footer-tagline {
  font-size: 0.9rem;
  color: #94a3b8;
  max-width: 320px;
}

.footer-links {
  display: flex;
  gap: 60px;
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-base);
}

.footer-col a:hover {
  color: #ffffff;
}

.footer-official-link {
  color: #34d399 !important;
  font-weight: 600;
}

/* 非官方聲明強調框 */
.footer-disclaimer-box {
  background: #0b0f19;
  border: 1px solid #1f293d;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 36px;
}

.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: #f1f5f9;
  font-size: 0.95rem;
}

.disclaimer-tag {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.disclaimer-text {
  font-size: 0.84rem;
  line-height: 1.65;
  color: #94a3b8;
  margin-bottom: 6px;
}

.disclaimer-text:last-child {
  margin-bottom: 0;
}

/* 頁尾底部橫條 */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid #1e283b;
  font-size: 0.84rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 16px;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a2233;
  color: #e2e8f0;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #28354d;
  transition: all var(--transition-base);
}

.back-to-top:hover {
  background: #25334d;
  color: #ffffff;
}

/* ==========================================================================
   響應式設計 (Responsive Styles)
   嚴格避免橫向溢出
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: 2.35rem;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .flow-steps-wrap {
    flex-direction: column;
    gap: 16px;
  }

  .step-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-cta {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .hero-section {
    padding: 36px 0 48px;
  }

  .hero-title {
    font-size: 1.95rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .pipeline-board {
    flex-direction: column;
    gap: 16px;
  }

  .pipe-connector {
    width: 100%;
    height: 36px;
  }

  .connector-line {
    width: 2px;
    height: 100%;
  }

  .flow-pulse {
    width: 100%;
    height: 14px;
    animation: flow-run-v 1.8s infinite linear;
  }

  @keyframes flow-run-v {
    0% { transform: translateY(-15px); }
    100% { transform: translateY(40px); }
  }

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

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

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

  .cta-heading {
    font-size: 1.6rem;
  }

  .footer-links {
    gap: 36px;
  }
}

/* 手機版防止 Grid 內含最小內容寬度造成橫向裁切 */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .hero-grid > *,
  .hero-content,
  .hero-visual {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .hero-title,
  .hero-desc {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .hero-cta-group,
  .hero-cta-group .btn {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .hero-cta-group .btn {
    white-space: normal;
  }

  .diagram-card,
  .pipeline-board {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero-title {
    font-size: clamp(1.55rem, 7.4vw, 1.8rem);
    line-height: 1.2;
  }

  .hero-desc {
    font-size: 0.98rem;
  }

  .diagram-card {
    padding: 16px;
  }
}

/* 降低動態效果 (Accessibility: prefers-reduced-motion) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
