:root {
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #8dd6ff;
  --primary-500: #2ea4f0;
  --primary-600: #1a85d6;
  --primary-700: #1668ad;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;
  --paper: #ffffff;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Comfortaa, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
}

html[lang="zh-HK"] {
  --font: Inter, "Noto Sans TC", "PingFang HK", "Microsoft JhengHei", sans-serif;
  --display: Comfortaa, "Noto Sans TC", "PingFang HK", "Microsoft JhengHei", sans-serif;
}
html[lang="zh-CN"] {
  --font: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: Comfortaa, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--gray-900); font-family: var(--font); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
img { display: block; max-width: 100%; object-fit: contain; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.25; letter-spacing: -0.025em; }
p { color: var(--gray-500); }
[hidden] { display: none !important; }
.container { width: min(1200px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 12px; padding: 10px 16px; border-radius: 8px; transform: translateY(-160%); background: var(--gray-900); color: white; }
.skip-link:focus { transform: none; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 3px; }

.site-header { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid rgba(229, 231, 235, 0.85); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px); }
.header-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }
.brand img { width: auto; height: 48px; }
.brand span { padding-left: 16px; border-left: 1px solid var(--gray-200); color: var(--gray-500); font-size: 14px; font-weight: 500; }
.desktop-nav { display: flex; align-items: center; gap: 30px; color: var(--gray-500); font-size: 14px; font-weight: 500; }
.desktop-nav > a:not(.button):hover { color: var(--gray-900); }
.desktop-nav details { position: relative; }
.desktop-nav summary { display: flex; min-height: 40px; align-items: center; gap: 7px; list-style: none; }
.desktop-nav summary::-webkit-details-marker { display: none; }
.desktop-nav summary svg { flex: 0 0 auto; }
.desktop-nav details > div { position: absolute; top: 44px; right: 0; width: 210px; padding: 6px; border: 1px solid var(--gray-200); border-radius: 12px; background: white; box-shadow: var(--shadow-md); }
.desktop-nav details a { display: block; padding: 9px 11px; border-radius: 8px; }
.desktop-nav details a:hover, .desktop-nav details a[aria-current] { background: var(--primary-50); color: var(--primary-700); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 22px; border: 0; border-radius: 12px; background: var(--primary-500); color: white; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-sm); }
.button:hover { background: var(--primary-600); }
.button-small { min-height: 40px; padding: 9px 18px; }
.nav-toggle { display: none; padding: 8px; border: 0; background: transparent; color: var(--gray-600); }
.mobile-nav { border-top: 1px solid var(--gray-100); padding: 12px 24px 18px; background: white; }
.mobile-nav a { display: block; padding: 9px 0; color: var(--gray-600); font-size: 14px; font-weight: 500; }

.hero { background: linear-gradient(135deg, var(--primary-100) 0%, rgba(240, 249, 255, 0.72) 48%, white 100%); }
.hero-inner { padding-block: 88px 72px; text-align: center; }
.hero h1 { font-size: clamp(36px, 5vw, 50px); }
.hero-inner > p { max-width: 650px; margin: 18px auto 0; font-size: 18px; line-height: 1.75; }
.search-form { display: flex; width: min(100%, 720px); align-items: center; gap: 13px; padding: 7px 7px 7px 18px; border: 1px solid var(--gray-300); border-radius: 14px; background: white; box-shadow: 0 8px 24px rgba(46, 164, 240, 0.08); }
.search-form-large { min-height: 58px; margin: 30px auto 0; }
.search-form svg { flex: 0 0 auto; color: var(--gray-400); }
.search-form input { min-width: 0; flex: 1 1 auto; height: 42px; border: 0; outline: 0; background: transparent; color: var(--gray-900); }
.search-form input::placeholder { color: var(--gray-400); }
.search-form button { min-height: 42px; padding: 8px 20px; border: 0; border-radius: 10px; background: var(--primary-500); color: white; font-size: 14px; font-weight: 600; }
.search-form button:hover { background: var(--primary-600); }
.popular-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 22px; color: var(--gray-500); font-size: 13px; }
.popular-links > span { font-weight: 600; color: var(--gray-600); }
.popular-links a { color: var(--primary-700); }
.popular-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

.home-main { padding-block: 92px 104px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.section-heading h2 { font-size: 30px; }
.section-heading p { max-width: 620px; margin-top: 10px; font-size: 17px; }
.section-heading > span { color: var(--gray-400); font-size: 13px; white-space: nowrap; }
.topic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.topic-row { display: flex; min-height: 162px; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 26px 28px; border: 1px solid var(--gray-200); border-radius: 16px; background: white; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.topic-row:hover { transform: translateY(-1px); border-color: var(--primary-200); box-shadow: var(--shadow-md); }
.topic-copy strong { display: block; font-family: var(--display); font-size: 18px; font-weight: 600; line-height: 1.35; }
.topic-copy small { display: block; max-width: 480px; margin-top: 10px; color: var(--gray-500); font-size: 14px; line-height: 1.65; }
.topic-count { margin-top: 20px; color: var(--primary-600); font-size: 12px; font-weight: 600; }
.contact-band { display: flex; align-items: center; justify-content: space-between; gap: 36px; margin-top: 88px; padding: 46px 52px; border: 1px solid var(--primary-100); border-radius: 20px; background: linear-gradient(135deg, var(--primary-50), white 55%, var(--primary-100)); }
.contact-band h2 { font-size: 28px; }
.contact-band p { max-width: 680px; margin-top: 10px; font-size: 15px; }

.interior { padding-block: 34px 96px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: var(--gray-400); font-size: 13px; }
.breadcrumbs a:hover { color: var(--primary-600); }
.page-intro { max-width: 760px; padding-block: 48px 42px; }
.page-intro h1 { font-size: clamp(32px, 4vw, 42px); }
.page-intro > p { margin-top: 14px; font-size: 17px; line-height: 1.7; }
.page-count { display: block; margin-top: 16px; color: var(--gray-400); font-size: 13px; }
.brand-kicker { color: var(--primary-600); font-size: 13px; font-weight: 600; }
.guide-list { border-top: 1px solid var(--gray-200); }
.guide-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 30px; padding: 23px 0; border-bottom: 1px solid var(--gray-200); }
.guide-link strong { display: block; font-family: var(--display); font-size: 17px; font-weight: 600; line-height: 1.45; }
.guide-link small { display: block; max-width: 760px; margin-top: 5px; color: var(--gray-500); font-size: 14px; line-height: 1.6; }
.guide-link-action { color: var(--primary-600); font-size: 13px; font-weight: 600; white-space: nowrap; }
.guide-link:hover strong { color: var(--primary-600); }

.reading-layout { display: grid; grid-template-columns: 205px minmax(0, 700px) 160px; align-items: start; gap: 46px; margin-top: 44px; }
.topic-sidebar, .toc { position: sticky; top: 106px; }
.topic-sidebar { display: flex; flex-direction: column; gap: 2px; }
.topic-sidebar a { padding: 7px 9px; border-radius: 8px; color: var(--gray-500); font-size: 13px; line-height: 1.45; }
.topic-sidebar a:hover { color: var(--primary-600); }
.topic-sidebar a[aria-current] { background: var(--primary-50); color: var(--primary-700); font-weight: 600; }
.topic-sidebar .sidebar-title { margin-bottom: 8px; padding: 0 9px 12px; border-bottom: 1px solid var(--gray-200); border-radius: 0; color: var(--gray-800); font-family: var(--display); font-size: 14px; font-weight: 600; }
.article header { padding-bottom: 28px; border-bottom: 1px solid var(--gray-200); }
.article h1 { max-width: 680px; font-size: clamp(32px, 4vw, 42px); }
.article-summary { max-width: 650px; margin-top: 15px; font-size: 17px; line-height: 1.7; }
.article-meta { margin-top: 14px; color: var(--gray-400); font-size: 12px; }
.article-prose section { scroll-margin-top: 104px; margin-top: 40px; }
.article-prose h2, .related h2 { margin-bottom: 14px; font-size: 22px; }
.article-prose p { color: var(--gray-600); font-size: 16px; line-height: 1.8; }
.steps { counter-reset: steps; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: steps; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--gray-200); }
.steps li::before { content: counter(steps) "."; padding-top: 1px; color: var(--primary-600); font-size: 14px; font-weight: 600; }
.steps p { color: var(--gray-700); }
.troubleshooting { padding: 22px 24px; border: 1px solid var(--primary-100); border-radius: 14px; background: var(--primary-50); }
.troubleshooting h2 { color: var(--gray-900); }
.plan-note { margin-top: 38px; padding-top: 18px; border-top: 1px solid var(--gray-200); color: var(--gray-400); font-size: 12px; }
.article-actions { display: flex; justify-content: space-between; gap: 20px; margin-top: 26px; }
.article-actions a, .article-actions button { padding: 0; border: 0; background: transparent; color: var(--primary-600); font-size: 13px; font-weight: 600; }
.related { margin-top: 58px; }
.toc { display: flex; flex-direction: column; gap: 8px; padding-left: 16px; border-left: 1px solid var(--gray-200); }
.toc strong { margin-bottom: 4px; color: var(--gray-700); font-size: 12px; }
.toc a { color: var(--gray-500); font-size: 12px; line-height: 1.45; }
.toc a:hover { color: var(--primary-600); }
.mobile-toc { display: none; }

.search-page-form { margin: 0 0 34px; }
.search-clear { background: transparent !important; color: var(--primary-600) !important; }
.search-section { min-height: 240px; }
.search-section > h2 { font-size: 20px; }
.search-section > p { margin-top: 8px; }
.search-results { margin-top: 18px; border-top: 1px solid var(--gray-200); }
.search-result { display: flex; flex-direction: column; gap: 5px; padding: 20px 0; border-bottom: 1px solid var(--gray-200); }
.search-result-topic { color: var(--primary-600); font-size: 12px; font-weight: 600; }
.search-result strong { font-family: var(--display); font-size: 17px; font-weight: 600; }
.search-result > span:last-child { color: var(--gray-500); font-size: 14px; }
.search-result:hover strong { color: var(--primary-600); }
.search-browse { margin-top: 64px; }
.search-browse > h2 { margin-bottom: 24px; font-size: 26px; }
.contact-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 20px; }
.contact-grid > section, .contact-grid > aside { padding: 30px; border: 1px solid var(--gray-200); border-radius: 16px; }
.contact-grid h2 { font-size: 22px; }
.contact-grid p { margin-top: 10px; }
.contact-grid .button { margin-top: 22px; }
.contact-grid aside { background: var(--gray-50); }
.contact-grid aside a { color: var(--primary-600); font-weight: 600; }
.not-found { min-height: 60vh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.not-found h1 { max-width: 700px; margin-top: 8px; font-size: clamp(34px, 5vw, 48px); }
.not-found > p:not(.brand-kicker) { max-width: 620px; margin-top: 15px; }
.not-found .button { margin-top: 26px; }

.site-footer { background: var(--gray-950); color: white; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 64px; padding-block: 58px; }
.footer-grid img { width: auto; height: 48px; filter: brightness(0) invert(1); }
.footer-grid p { max-width: 460px; margin-top: 14px; color: var(--gray-400); font-size: 14px; }
.footer-grid small { display: block; margin-top: 20px; color: var(--gray-500); font-size: 12px; }
.footer-grid nav { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); align-content: start; gap: 10px 30px; color: var(--gray-400); font-size: 13px; }
.footer-grid nav a:hover { color: white; }

@media (max-width: 1040px) {
  .desktop-nav { display: none; }
  .nav-toggle { display: grid; }
  .reading-layout { grid-template-columns: 185px minmax(0, 1fr); gap: 36px; }
  .toc { display: none; }
  .mobile-toc { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 24px; padding: 15px 17px; border-radius: 12px; background: var(--gray-50); }
  .mobile-toc strong { width: 100%; color: var(--gray-700); font-size: 12px; }
  .mobile-toc a { color: var(--primary-600); font-size: 12px; font-weight: 600; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 32px, 680px); }
  .header-inner { min-height: 70px; }
  .brand { gap: 11px; }
  .brand img { height: 42px; }
  .brand span { padding-left: 11px; font-size: 12px; }
  .hero-inner { padding-block: 58px 50px; }
  .hero h1 { font-size: 36px; }
  .hero-inner > p { font-size: 16px; }
  .search-form { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 9px 10px 10px 15px; }
  .search-form button { grid-column: 1 / -1; width: 100%; }
  .search-page-form .search-clear { grid-column: 1 / -1; }
  .popular-links { align-items: center; flex-direction: column; gap: 7px; }
  .home-main { padding-block: 64px 76px; }
  .section-heading { align-items: flex-start; flex-direction: column; margin-bottom: 26px; }
  .section-heading h2 { font-size: 26px; }
  .section-heading p { font-size: 15px; }
  .topic-list { grid-template-columns: 1fr; gap: 12px; }
  .topic-row { min-height: 0; padding: 22px; }
  .contact-band { align-items: flex-start; flex-direction: column; margin-top: 56px; padding: 30px 25px; }
  .contact-band h2 { font-size: 24px; }
  .interior { padding-block: 26px 72px; }
  .page-intro { padding-block: 38px 34px; }
  .page-intro h1 { font-size: 32px; }
  .page-intro > p { font-size: 16px; }
  .guide-link { grid-template-columns: 1fr; gap: 9px; padding-block: 19px; }
  .reading-layout { display: block; margin-top: 34px; }
  .topic-sidebar { display: none; }
  .article h1 { font-size: 32px; }
  .article-summary { font-size: 16px; }
  .article-prose section { margin-top: 34px; }
  .article-prose h2, .related h2 { font-size: 20px; }
  .troubleshooting { padding: 20px; }
  .article-actions { align-items: flex-start; flex-direction: column; }
  .contact-grid, .footer-grid { grid-template-columns: 1fr; }
  .contact-grid > section, .contact-grid > aside { padding: 24px; }
  .footer-grid { gap: 36px; }
  .footer-grid nav { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

@media print {
  .site-header, .site-footer, .topic-sidebar, .toc, .mobile-toc, .article-actions, .related { display: none !important; }
  .container { width: 100%; }
  .interior { padding: 0; }
  .reading-layout { display: block; margin: 0; }
  .article h1 { font-size: 32px; }
  .article-prose section { break-inside: avoid; }
  .troubleshooting { border: 1px solid var(--gray-300); background: white; }
}
