/* ============================================================
   香港九寬科技官網 - 統一設計系統
   設計語言：深色底 + 玻璃擬態 + 藍→青漸變 + 微交互
   ============================================================ */

/* ---------- 主題變量 ---------- */
:root {
  --bg: #070b16;
  --bg-soft: #0d1326;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-border: rgba(255, 255, 255, 0.10);
  --text: #e8edf7;
  --text-soft: #93a0bd;
  --accent: #4f8cff;
  --accent-2: #38e8c8;
  --accent-grad: linear-gradient(120deg, #4f8cff 0%, #38e8c8 100%);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 28px 70px rgba(79, 140, 255, 0.22);
  --radius: 20px;
  --radius-sm: 14px;
  --nav-h: 70px;
}

[data-theme="light"] {
  --bg: #f4f7fd;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-2: rgba(255, 255, 255, 0.85);
  --surface-border: rgba(15, 30, 60, 0.10);
  --text: #0d1626;
  --text-soft: #516079;
  --accent: #2563eb;
  --accent-2: #0fb9a0;
  --accent-grad: linear-gradient(120deg, #2563eb 0%, #0fb9a0 100%);
  --shadow: 0 20px 50px rgba(30, 50, 90, 0.12);
  --shadow-hover: 0 24px 60px rgba(37, 99, 235, 0.18);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.7;
  transition: background 0.5s ease, color 0.5s ease;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ---------- 通用容器 ---------- */
.container { width: 92%; max-width: 1200px; margin: 0 auto; }
.gradient-text {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 999px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; color: #fff; background: var(--accent-grad);
  box-shadow: 0 8px 24px rgba(79, 140, 255, 0.35);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 14px 34px rgba(79, 140, 255, 0.5); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--surface-border); box-shadow: none; backdrop-filter: blur(12px); }
.btn.ghost:hover { box-shadow: 0 10px 30px rgba(79, 140, 255, 0.18); }
.btn.sm { padding: 9px 20px; font-size: 13.5px; }

/* ---------- 導航欄 ---------- */
nav#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 6vw; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: padding 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
nav#nav.scrolled { padding-top: 10px; padding-bottom: 10px; border-bottom-color: var(--surface-border); }
.logo { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: 0.3px; }
.logo img { height: 42px; width: auto; object-fit: contain; }
.logo .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent-grad); box-shadow: 0 0 18px var(--accent); flex-shrink: 0; }

.nav-links { display: flex; gap: 32px; }
.nav-links a {
  color: var(--text-soft); font-size: 14.5px; font-weight: 500; position: relative;
  transition: color 0.25s; padding: 4px 0;
}
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--accent-grad); transition: width 0.3s; }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--surface-border);
  background: var(--surface); cursor: pointer; display: grid; place-items: center; font-size: 17px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s;
  font-family: inherit;
}
.theme-toggle:hover { transform: scale(1.1) rotate(15deg); }

.hamburger {
  display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--surface-border);
  background: var(--surface); cursor: pointer; place-items: center; font-size: 18px; color: var(--text);
  font-family: inherit;
}
.nav-overlay { display: none; }

/* ---------- 頁面通用內容區（子頁用） ---------- */
.page-main { margin-top: var(--nav-h); }
.page-hero { padding: 70px 6vw 30px; text-align: center; }
.page-hero h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.5px; margin-bottom: 12px; }
.page-hero .eyebrow { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.top-img { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); margin: 30px auto 10px; box-shadow: var(--shadow); }

/* ---------- 玻璃卡片（通用） ---------- */
.glass-card {
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius);
  padding: 38px 34px; backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s, box-shadow 0.4s;
  position: relative; overflow: hidden;
}
.glass-card::before { content: ""; position: absolute; inset: 0; background: var(--accent-grad); opacity: 0; transition: opacity 0.4s; }
.glass-card:hover { transform: translateY(-8px); border-color: transparent; box-shadow: var(--shadow-hover); }
.glass-card:hover::before { opacity: 0.06; }
.glass-card > * { position: relative; z-index: 1; }
.glass-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 18px; color: var(--accent); }
.glass-card h2.gradient-text { color: transparent; }
.glass-card p { color: var(--text-soft); font-size: 15.5px; line-height: 1.9; margin-bottom: 16px; }
.glass-card ul li { color: var(--text-soft); font-size: 15px; line-height: 2; padding-left: 24px; position: relative; }
.glass-card ul li::before { content: "▸"; position: absolute; left: 0; color: var(--accent-2); }
.glass-card ul li strong { color: var(--text); font-weight: 600; }

.section-img { width: 100%; border-radius: var(--radius-sm); margin: 18px 0; box-shadow: var(--shadow); }

/* ---------- 首頁 Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: calc(var(--nav-h) + 60px) 6vw 80px; overflow: hidden; }
#bg-canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.hero-glow { position: absolute; z-index: 0; border-radius: 50%; filter: blur(120px); opacity: 0.35; pointer-events: none; }
.hero-glow.g1 { width: 480px; height: 480px; background: var(--accent); top: -80px; left: -100px; }
.hero-glow.g2 { width: 420px; height: 420px; background: var(--accent-2); bottom: -120px; right: -80px; }
.hero-content { position: relative; z-index: 2; max-width: 920px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--surface-border); font-size: 13px; color: var(--text-soft); margin-bottom: 28px; backdrop-filter: blur(10px); }
.badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }
.hero h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 800; line-height: 1.16; letter-spacing: -1px; margin-bottom: 22px; }
.hero p.lead { font-size: clamp(15px, 2vw, 19px); color: var(--text-soft); max-width: 660px; margin: 0 auto 38px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- 數據統計 ---------- */
.stats { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1000px; margin: 70px auto 0; width: 100%; padding: 0 6vw; }
.stat { text-align: center; padding: 18px 10px; }
.stat .num { font-size: clamp(26px, 4vw, 40px); font-weight: 800; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; line-height: 1.1; }
.stat .label { font-size: 13.5px; color: var(--text-soft); margin-top: 8px; }

/* ---------- 區塊通用 ---------- */
section.block { padding: 110px 6vw; max-width: 1200px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 60px; }
.section-head .eyebrow { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.section-head h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; margin: 12px 0 14px; letter-spacing: -0.5px; }
.section-head p { color: var(--text-soft); max-width: 580px; margin: 0 auto; }

/* ---------- 三大業務卡片 ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 760px; margin: 0 auto; }
.biz-card { display: flex; flex-direction: column; }
.biz-card .icon { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--surface-border); display: grid; place-items: center; font-size: 24px; margin-bottom: 22px; }
.biz-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.biz-card p { color: var(--text-soft); font-size: 14.5px; line-height: 1.85; margin-bottom: 20px; flex-grow: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tag { display: inline-block; padding: 6px 14px; background: var(--surface-2); border: 1px solid var(--surface-border); color: var(--accent); border-radius: 999px; font-size: 12.5px; font-weight: 500; }

/* ---------- 核心優勢 feature-grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.feature { display: flex; gap: 16px; align-items: flex-start; padding: 24px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--surface-border); transition: transform 0.35s, border-color 0.35s; }
.feature:hover { transform: translateX(6px); border-color: var(--accent); }
.feature .f-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 19px; color: var(--accent); flex-shrink: 0; }
.feature h4 { font-size: 16.5px; margin-bottom: 4px; }
.feature span { font-size: 13.5px; color: var(--text-soft); }

/* ---------- CTA Band ---------- */
.cta-band { text-align: center; padding: 70px 6vw; border-radius: var(--radius); margin: 40px auto; max-width: 1100px; background: var(--surface); border: 1px solid var(--surface-border); position: relative; overflow: hidden; backdrop-filter: blur(18px); }
.cta-band h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 800; margin-bottom: 14px; }
.cta-band p { color: var(--text-soft); margin-bottom: 28px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--surface-border); padding: 56px 6vw 30px; background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; max-width: 1200px; margin: 0 auto; }
.footer-col h4 { font-size: 15px; font-weight: 700; margin-bottom: 18px; color: var(--text); }
.footer-col p, .footer-col li { color: var(--text-soft); font-size: 13.5px; line-height: 2; }
.footer-col a { transition: color 0.25s; }
.footer-col a:hover { color: var(--accent); }
.footer-col .brand-name { color: var(--text); font-weight: 700; font-size: 16px; }
.copyright { text-align: center; color: var(--text-soft); font-size: 13px; padding: 24px 6vw 0; margin-top: 36px; border-top: 1px solid var(--surface-border); }

/* ---------- 返回首頁按鈕（子頁） ---------- */
.back-home { text-align: center; margin: 56px 0 20px; }

/* ---------- 滾動揭示動畫 ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 規格表 spec-table ---------- */
.spec-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--surface-border); }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.spec-table thead th {
  background: var(--accent-grad); color: #fff; font-weight: 700; padding: 14px 16px; text-align: left;
  font-size: 13.5px; white-space: nowrap;
}
.spec-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--surface-border); color: var(--text-soft); }
.spec-table tbody tr:last-child td { border-bottom: none; }
.spec-table tbody tr:hover td { background: var(--surface); }
.spec-table td strong { color: var(--text); font-weight: 600; }
.spec-table .col-label { color: var(--text); font-weight: 600; white-space: nowrap; }

/* ---------- FAQ 手風琴 ---------- */
.faq-item {
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius-sm);
  margin-bottom: 14px; overflow: hidden; transition: border-color 0.3s;
}
.faq-item.open { border-color: var(--accent); }
.faq-q {
  width: 100%; text-align: left; padding: 20px 24px; font-size: 15.5px; font-weight: 600; color: var(--text);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: none; border: none; font-family: inherit;
}
.faq-q .faq-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 14px; color: var(--accent); flex-shrink: 0; transition: transform 0.3s; }
.faq-item.open .faq-icon { transform: rotate(45deg); background: var(--accent-grad); color: #fff; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.faq-a-inner { padding: 0 24px 20px; color: var(--text-soft); font-size: 14.5px; line-height: 1.85; }

/* ---------- 代碼塊 ---------- */
.code-block {
  background: #0a0f1e; border: 1px solid var(--surface-border); border-radius: var(--radius-sm);
  padding: 22px 24px; margin: 18px 0; overflow-x: auto; position: relative;
}
.code-block .code-label { font-size: 12px; color: var(--text-soft); margin-bottom: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.code-block pre { margin: 0; }
.code-block code { font-family: "SF Mono", "Fira Code", "Consolas", monospace; font-size: 13.5px; line-height: 1.75; color: #c8d5f0; }
.code-block .c-key { color: var(--accent-2); }
.code-block .c-str { color: #f0c674; }
.code-block .c-cmt { color: #5c6b85; font-style: italic; }

/* ---------- 時間線/步驟流程 ---------- */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(to bottom, var(--accent), var(--accent-2)); opacity: 0.4; }
.tl-item { position: relative; margin-bottom: 28px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-dot { position: absolute; left: -32px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-soft); border: 2px solid var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent); }
.tl-item h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.tl-item p { font-size: 13.5px; color: var(--text-soft); line-height: 1.8; }

/* ---------- 行業場景卡片（複用 feature） ---------- */
.industry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.industry-card {
  padding: 28px 24px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--surface-border); transition: transform 0.35s, border-color 0.35s;
}
.industry-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.industry-card .f-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 21px; color: var(--accent); margin-bottom: 16px; }
.industry-card h4 { font-size: 16.5px; font-weight: 700; margin-bottom: 8px; }
.industry-card p { font-size: 13.5px; color: var(--text-soft); line-height: 1.75; }

/* ---------- 響應式 ---------- */
@media (max-width: 980px) {
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .industry-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: grid; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards-3, .cards-2 { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .industry-grid { grid-template-columns: 1fr; }
  .nav-right .btn { display: none; }
  /* 移動端抽屜菜單 */
  .nav-links.open {
    display: flex; flex-direction: column; position: fixed; top: var(--nav-h); right: 0;
    width: 70%; max-width: 320px; height: calc(100vh - var(--nav-h));
    background: var(--bg-soft); padding: 30px 26px; gap: 6px;
    border-left: 1px solid var(--surface-border); box-shadow: -20px 0 60px rgba(0,0,0,0.3);
    z-index: 99; overflow-y: auto; backdrop-filter: blur(30px);
  }
  .nav-links.open a { font-size: 17px; padding: 14px 0; border-bottom: 1px solid var(--surface-border); }
  .nav-overlay.show { display: block; position: fixed; inset: var(--nav-h) 0 0 0; background: rgba(0,0,0,0.5); z-index: 98; backdrop-filter: blur(4px); }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding-top: calc(var(--nav-h) + 40px); }
  .glass-card { padding: 30px 24px; }
  .container { width: 90%; }
}
