/* ==========================================================================
   中達證券 CWSI — Website Revamp Design System
   Palette: crimson seal on warm paper; ink navy; champagne accents.
   Type: Noto Serif TC (display) / Noto Sans TC (body).
   ========================================================================== */

:root {
  /* Color tokens */
  --crimson: #B82C2B;
  --crimson-deep: #8E1F1F;
  --crimson-tint: #FBF1F0;
  --ink: #16222F;
  --ink-soft: #3D4C5C;
  --ink-mute: #6B7885;
  --paper: #FCFCFB;
  --cloud: #F3F5F7;
  --panel: #EFF2F5;
  --line: #DFE4E9;
  --line-soft: #EAEDF0;
  --white: #FFFFFF;
  --gold: #B9974E;
  --up: #C43C3C;     /* HK convention: red = up */
  --down: #1E7F4F;   /* HK convention: green = down */
  --navy-link: #1D5992;

  /* Type */
  --font-display: "Noto Serif TC", "Songti TC", serif;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;

  /* Layout */
  --maxw: 1180px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-1: 0 1px 3px rgba(22, 34, 47, 0.07), 0 1px 2px rgba(22, 34, 47, 0.05);
  --shadow-2: 0 8px 28px rgba(22, 34, 47, 0.12);
  --header-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
/* The closed drawer is position:fixed and translated off-screen, so it is clipped by
   the viewport, not by body. `clip` contains it without creating a scroll container,
   which keeps the sticky header working (`hidden` would break it). */
html, body { overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-link); text-decoration: none; }
a:hover { color: var(--crimson); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.35; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
table { border-collapse: collapse; width: 100%; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Utility bar ---------- */
.utility-bar { background: var(--cloud); color: var(--ink-soft); font-size: 13px; border-bottom: 1px solid var(--line); }
.utility-bar .wrap {
  display: flex; align-items: center; gap: 18px;
  min-height: 38px; flex-wrap: wrap;
}
.utility-bar a { color: var(--ink-soft); }
.utility-bar a:hover { color: var(--crimson); }
.hotline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hotline strong { color: var(--ink); font-weight: 600; letter-spacing: 0.02em; }
.hotline svg { width: 14px; height: 14px; fill: var(--crimson); flex: none; }
.utility-spacer { flex: 1; }
.social-links { display: inline-flex; gap: 12px; align-items: center; }
.social-links svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; }
.lang-switch a, .lang-switch span[aria-current] { padding: 2px 8px; border-radius: 4px; color: var(--ink-soft); }
.lang-switch span[aria-current] { background: var(--crimson); color: #fff; font-weight: 600; }
.lang-switch a:hover { background: rgba(22,34,47,0.06); color: var(--ink); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid var(--line);
}
/* The frosted-glass blur lives on a pseudo-element: a backdrop-filter on the header itself
   would make it the containing block for the position:fixed mobile drawer inside it,
   shrinking the drawer to the header's 64px box. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 28px;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand img { height: 40px; width: auto; }

.main-nav { flex: 1; }
.main-nav > ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: flex-end; gap: 2px;
}
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  display: block; padding: 20px 13px;
  color: var(--ink); font-weight: 500; font-size: 15px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li.open > a,
.main-nav > ul > li.active > a {
  color: var(--crimson);
  border-bottom-color: var(--crimson);
}
.main-nav .submenu {
  list-style: none; margin: 0; padding: 8px 0;
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 180px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.main-nav li:hover > .submenu,
.main-nav li.open > .submenu,
.main-nav li:focus-within > .submenu {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.main-nav .submenu a {
  display: block; padding: 9px 20px;
  color: var(--ink-soft); font-size: 14px;
}
.main-nav .submenu a:hover { background: var(--crimson-tint); color: var(--crimson); }

.nav-cta {
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--crimson); color: #fff !important;
  padding: 9px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  transition: background 0.15s ease;
}
.nav-cta:hover { background: var(--crimson-deep); color: #fff; }
.nav-cta svg { width: 14px; height: 14px; fill: currentColor; }

.nav-toggle {
  display: none;
  position: relative; z-index: 1001;          /* above the open drawer (z 999) */
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; stroke: var(--ink); }
/* while the drawer is open the same button shows a × */
.main-nav.is-open ~ .nav-toggle svg { display: none; }
.main-nav.is-open ~ .nav-toggle::before,
.main-nav.is-open ~ .nav-toggle::after {
  content: ""; position: absolute; left: 11px; top: 19px;
  width: 18px; height: 2px; background: var(--ink); border-radius: 1px;
}
.main-nav.is-open ~ .nav-toggle::before { transform: rotate(45deg); }
.main-nav.is-open ~ .nav-toggle::after  { transform: rotate(-45deg); }

/* ---------- Hero slider ---------- */
.hero { position: relative; background: var(--panel); overflow: hidden; }
.hero-slides { position: relative; aspect-ratio: 1000 / 320; max-height: 420px; width: 100%; }
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 0.7s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide a { position: absolute; inset: 0; text-indent: -9999px; }
.hero-dots {
  position: absolute; bottom: 14px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 8px; z-index: 5;
}
.hero-dots button {
  width: 26px; height: 4px; border: 0; border-radius: 2px;
  background: rgba(255,255,255,0.45); padding: 0;
  transition: background 0.2s ease;
}
.hero-dots button.is-active { background: var(--crimson); }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; border: 0; border-radius: 50%; width: 40px; height: 40px; background: rgba(255,255,255,0.85); color: var(--ink); font-size: 18px; line-height: 1; box-shadow: var(--shadow-1); transition: background 0.2s ease, color 0.2s ease; }
.hero-arrow:hover { background: var(--crimson); color: #fff; }
.hero-arrow.prev { left: 16px; }
.hero-arrow.next { right: 16px; }

/* ---------- Section headers with seal signature ---------- */
.section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 18px;
}
.seal {
  flex: none;
  width: 38px; height: 38px;
  background: var(--crimson);
  color: #fff;
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35), inset 0 0 0 3px var(--crimson);
}
.section-head h1, .section-head h2 {
  margin: 0; font-size: 22px; font-weight: 700; color: var(--ink);
}
.section-head .more {
  margin-left: auto;
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--ink-mute);
  display: inline-flex; align-items: center; gap: 4px;
}
.section-head .more:hover { color: var(--crimson); }

/* ---------- Cards & panels ---------- */
.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 22px;
}
.card + .card { margin-top: 20px; }

/* Quick actions rail */
.quick-rail { display: grid; gap: 12px; }
.quick-action {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 18px;
  color: var(--ink); font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow-1);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--crimson);
  color: var(--crimson);
}
.quick-action .qa-icon {
  flex: none; width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--crimson-tint); color: var(--crimson);
  display: flex; align-items: center; justify-content: center;
}
.quick-action .qa-icon svg { width: 20px; height: 20px; fill: currentColor; }
.quick-action small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-mute); }
.quick-action.primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.quick-action.primary small { color: rgba(255,255,255,0.75); }
.quick-action.primary .qa-icon { background: rgba(255,255,255,0.16); color: #fff; }
.quick-action.primary:hover { background: var(--crimson-deep); color: #fff; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.tabs button, .tabs a {
  border: 0; background: none;
  padding: 9px 16px; margin-bottom: -2px;
  font-size: 14px; font-weight: 600; color: var(--ink-mute);
  border-bottom: 2px solid transparent;
}
.tabs button:hover, .tabs a:hover { color: var(--crimson); }
.tabs button.is-active, .tabs a.is-active {
  color: var(--crimson);
  border-bottom-color: var(--crimson);
}
.tab-panel[hidden] { display: none; }

/* Sort pills */
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.pill-row button, .pill-row a {
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 4px 14px;
  font-size: 13px; color: var(--ink-soft);
}
.pill-row button:hover, .pill-row a:hover { border-color: var(--crimson); color: var(--crimson); }
.pill-row button.is-active, .pill-row a.is-active { background: var(--crimson); border-color: var(--crimson); color: #fff; }

/* ---------- Data tables ---------- */
.table-scroll { overflow-x: auto; }
.data-table { font-variant-numeric: tabular-nums; font-size: 14px; }
.data-table th {
  text-align: left; font-weight: 600; font-size: 13px;
  color: var(--ink-mute);
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
  background: none;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.data-table tbody tr:hover { background: var(--panel); }
.data-table .num { text-align: right; }
.data-table th.num { text-align: right; }
.up { color: var(--up); }
.down { color: var(--down); }
.up::before { content: "▲ "; font-size: 0.8em; }
.down::before { content: "▼ "; font-size: 0.8em; }

/* ---------- News lists ---------- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  display: flex; align-items: baseline; gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.news-list li:last-child { border-bottom: 0; }
.news-list a { color: var(--ink-soft); flex: 1; min-width: 0; }
.news-list a:hover { color: var(--crimson); }
.news-list time, .news-list .date {
  flex: none; font-size: 13px; color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.news-list .badge {
  flex: none; font-size: 11px; font-weight: 700;
  color: var(--crimson); border: 1px solid currentColor;
  border-radius: 4px; padding: 0 6px; line-height: 1.6;
}

/* ---------- Notice board (replaces popup) ---------- */
.notice-board { border-left: 4px solid var(--crimson); }
.notice-board summary {
  cursor: pointer; font-weight: 700; font-size: 15px;
  color: var(--crimson);
  display: flex; align-items: center; gap: 8px;
  list-style: none;
}
.notice-board summary::-webkit-details-marker { display: none; }
.notice-board summary::after { content: "＋"; margin-left: auto; color: var(--ink-mute); }
.notice-board[open] summary::after { content: "－"; }

/* ---------- Page header & breadcrumb ---------- */
.page-head { background: linear-gradient(135deg, #FFFFFF 0%, var(--crimson-tint) 100%); color: var(--ink); padding: 40px 0 34px; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.page-head::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border: 2px solid rgba(184,44,43,0.10); border-radius: 24px; transform: rotate(12deg); }
.page-head .breadcrumb { font-size: 13px; color: var(--ink-mute); margin-bottom: 10px; }
.page-head .breadcrumb a { color: var(--ink-soft); }
.page-head .breadcrumb a:hover { color: var(--crimson); }
.page-head .breadcrumb .sep { margin: 0 8px; color: #B9C2CC; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 700; display: flex; align-items: center; gap: 14px; color: var(--ink); }
.page-head .seal { width: 44px; height: 44px; font-size: 23px; }
.page-head .lede { margin: 10px 0 0; max-width: 720px; color: var(--ink-soft); font-size: 15px; }

/* ---------- Inner page layout ---------- */
.page-body { padding: 36px 0 64px; }
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
}
.side-col { display: grid; gap: 12px; position: sticky; top: calc(var(--header-h) + 20px); }
.side-nav { padding: 6px 0; }
.side-nav h3 {
  font-size: 14px; color: var(--ink-mute); font-family: var(--font-body);
  font-weight: 600; margin: 8px 16px;
}
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a {
  display: block; padding: 9px 16px;
  color: var(--ink-soft); font-size: 14.5px;
  border-left: 3px solid transparent;
}
.side-nav a:hover { color: var(--crimson); background: var(--crimson-tint); }
.side-nav a[aria-current="page"] {
  color: var(--crimson); font-weight: 700;
  border-left-color: var(--crimson);
  background: var(--crimson-tint);
}

/* ---------- Prose ---------- */
.prose { font-size: 15.5px; color: var(--ink-soft); }
.prose h2 { font-size: 21px; color: var(--ink); margin: 1.6em 0 0.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 17px; color: var(--ink); margin: 1.4em 0 0.5em; }
.prose ul { padding-left: 1.3em; }
.prose li { margin: 0.45em 0; }
.prose li::marker { color: var(--crimson); }
.prose table td, .prose table th { white-space: normal; }
.prose strong { color: var(--ink); }

/* Step flow (開戶流程 etc.) */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li {
  position: relative;
  padding: 0 0 26px 58px;
  counter-increment: step;
}
.steps > li::before {
  content: counter(step, cjk-ideographic);
  position: absolute; left: 0; top: 0;
  width: 38px; height: 38px;
  background: var(--crimson); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35), inset 0 0 0 3px var(--crimson);
}
.steps > li::after {
  content: "";
  position: absolute; left: 19px; top: 44px; bottom: 6px;
  width: 2px; background: var(--line);
}
.steps > li:last-child::after { display: none; }
.steps h3 { margin: 0 0 6px; font-size: 16.5px; }

/* Download rows */
.download-list { list-style: none; margin: 0; padding: 0; }
.download-list li { border-bottom: 1px solid var(--line-soft); }
.download-list li:last-child { border-bottom: 0; }
.download-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; color: var(--ink-soft); font-size: 14.5px;
}
.download-list a:hover { color: var(--crimson); }
.download-list .doc-icon {
  flex: none; width: 34px; height: 34px;
  border-radius: 8px; background: var(--crimson-tint); color: var(--crimson);
  display: flex; align-items: center; justify-content: center;
}
.download-list .doc-icon svg { width: 16px; height: 16px; fill: currentColor; }
.download-list .ext {
  margin-left: auto; flex: none;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--ink-mute);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 7px;
}

.download-list .download-list-dead {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; color: var(--ink-mute); font-size: 14.5px; cursor: not-allowed;
}
.download-list .download-list-dead .doc-icon { background: var(--panel); color: var(--ink-mute); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--crimson); color: #fff !important;
  border: 0; border-radius: 999px;
  padding: 11px 26px;
  font-size: 15px; font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--crimson-deep); transform: translateY(-1px); }
.btn.ghost {
  background: none; color: var(--crimson) !important;
  border: 1.5px solid var(--crimson);
}
.btn.ghost:hover { background: var(--crimson-tint); transform: none; }

/* Contact cards */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.contact-card h3 { font-size: 16.5px; margin-bottom: 10px; }
.contact-card dl { margin: 0; font-size: 14.5px; }
.contact-card dt { font-weight: 600; color: var(--ink-mute); font-size: 12.5px; margin-top: 8px; }
.contact-card dd { margin: 0; color: var(--ink-soft); }

/* ---------- Homepage layout ---------- */
.home-main { padding: 30px 0 60px; }
.home-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.home-side { display: grid; gap: 20px; }
.home-content { display: grid; gap: 26px; }
.about-teaser { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; align-items: start; }
.about-teaser img { border-radius: var(--radius-sm); }
.about-teaser h3 { font-size: 18px; margin: 0 0 8px; }
.about-teaser p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

/* Grid and flex children default to min-width:auto, so wide content (data tables,
   large tabular numbers) can inflate a fixed track and spill over the next column.
   Pin them to 0 and let the inner .table-scroll wrappers do the scrolling. */
.home-grid > *, .page-grid > *,
.home-side > *, .home-content > *, .side-col > * { min-width: 0; }
.card, .quick-rail, .quick-action { min-width: 0; }
.quick-action > span { min-width: 0; }

/* ---------- Commentator / analyst profiles ---------- */
.commentator-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: start; }
.commentator-photo { border-radius: var(--radius-sm); width: 100%; }
.commentator-body h2 {
  margin: 0 0 10px; font-size: 20px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
}
.commentator-body h2 .role {
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--crimson); background: var(--crimson-tint);
  border-radius: 999px; padding: 2px 12px;
}
.commentator-mail { font-size: 14px; color: var(--ink-mute); margin: 10px 0 0; }

/* Analyst teaser (中達研究 sidebar widget in the original) */
.analyst-teaser { display: flex; gap: 16px; align-items: center; }
.analyst-teaser img { width: 92px; border-radius: var(--radius-sm); flex: none; }
.analyst-teaser .name { font-weight: 700; color: var(--ink); display: block; }
.analyst-teaser .role { font-size: 13px; color: var(--crimson); display: block; margin-bottom: 4px; }
.analyst-teaser p { font-size: 14px; color: var(--ink-soft); margin: 0; }

@media (max-width: 560px) {
  .commentator-card { grid-template-columns: 1fr; }
  .commentator-photo { max-width: 180px; }
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; align-items: center;
  margin: 26px 0 0; padding: 0; list-style: none;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-soft);
  font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.pagination a:hover { border-color: var(--crimson); color: var(--crimson); }
.pagination [aria-current="page"] {
  background: var(--crimson); border-color: var(--crimson);
  color: #fff; font-weight: 700;
}

/* ---------- Reveal animation (JS-gated: without JS everything stays visible) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-slide { transition: none; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--cloud); color: var(--ink-soft); margin-top: 0; font-size: 13.5px; border-top: 1px solid var(--line); }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--crimson); }
.footer-top { border-bottom: 1px solid var(--line); padding: 38px 0 30px; }
.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}
.footer-brand > img { height: 44px; width: auto; }
.footer-brand p { margin: 14px 0 0; line-height: 1.7; color: var(--ink-soft); }
.footer-qr { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 18px; }
.footer-qr-label { flex-basis: 100%; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink); }
.footer-qr img { width: 88px; height: 88px; border-radius: 6px; background: #fff; border: 1px solid var(--line); padding: 3px; filter: none; opacity: 1; }
.footer-cols h3 { font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink); margin: 0 0 12px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: 7px 0; }
.footer-bottom { padding: 18px 0 26px; }
.footer-bottom .wrap {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  align-items: center; justify-content: space-between;
}
.footer-credit { font-size: 12.5px; color: var(--ink-mute); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .home-grid, .page-grid { grid-template-columns: 1fr; }
  .side-col { position: static; }
  .home-side { order: 2; }
  .home-content { order: 1; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed; inset: 0; top: 0;
    height: 100vh; height: 100dvh;
    background: #fff;
    padding: 80px 24px 32px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 999;
  }
  .main-nav.is-open { transform: none; }
  .main-nav > ul { flex-direction: column; gap: 0; }
  .main-nav > ul > li > a {
    padding: 14px 4px; font-size: 17px;
    border-bottom: 1px solid var(--line-soft);
  }
  .main-nav .submenu {
    position: static; transform: none;
    opacity: 1; visibility: visible;
    border: 0; box-shadow: none; border-radius: 0;
    padding: 0 0 10px 14px;
    display: block;                                 /* all items visible in the drawer */
  }
  .main-nav .submenu a { padding: 8px 8px; font-size: 15px; }
  .main-nav > ul > li > a { font-weight: 700; }
  .nav-cta span { display: none; }
  .nav-cta { padding: 9px 12px; }
  .about-teaser { grid-template-columns: 1fr; }
  .hero-slides { aspect-ratio: 16 / 7; }
  .utility-bar .hide-m { display: none; }
  .page-head h1 { font-size: 24px; }
}
@media (max-width: 560px) {
  .footer-cols { grid-template-columns: 1fr; }
  .hero-arrow { display: none; }
}

/* Between the drawer and full width the CJK nav needs tightening: 9 labels + brand
   + CTA want 1100px of content, more than a 1024px laptop offers. */
@media (min-width: 961px) and (max-width: 1140px) {
  html:not([lang="en"]) .site-header .wrap { gap: 16px; }
  html:not([lang="en"]) .main-nav > ul > li > a { padding: 20px 7px; font-size: 14.5px; }
  html:not([lang="en"]) .nav-cta span { display: none; }
  html:not([lang="en"]) .nav-cta { padding: 9px 12px; }
}

/* ---------- English variant ----------
   English nav labels run roughly twice the width of their Chinese equivalents,
   so the EN header needs tighter metrics and an earlier switch to the drawer. */
html[lang="en"] .site-header .wrap { gap: 16px; }
html[lang="en"] .main-nav > ul > li > a { padding: 20px 8px; font-size: 14px; }
html[lang="en"] .nav-cta { padding: 9px 14px; font-size: 13.5px; }
html[lang="en"] .footer-cols { grid-template-columns: 1.5fr 1fr 1fr 1fr; }

@media (max-width: 1200px) {
  html[lang="en"] .nav-toggle { display: inline-flex; }
  html[lang="en"] .main-nav {
    position: fixed; inset: 0; top: 0;
    height: 100vh; height: 100dvh;
    background: #fff;
    padding: 80px 24px 32px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 999;
  }
  html[lang="en"] .main-nav.is-open { transform: none; }
  html[lang="en"] .main-nav > ul { flex-direction: column; gap: 0; }
  html[lang="en"] .main-nav > ul > li > a {
    padding: 14px 4px; font-size: 17px;
    border-bottom: 1px solid var(--line-soft);
  }
  html[lang="en"] .main-nav .submenu {
    position: static; transform: none;
    opacity: 1; visibility: visible;
    border: 0; box-shadow: none; border-radius: 0;
    padding: 0 0 10px 14px;
    display: block;                                 /* all items visible in the drawer */
  }
  html[lang="en"] .main-nav .submenu a { padding: 8px 8px; font-size: 15px; }
  html[lang="en"] .main-nav > ul > li > a { font-weight: 700; }
}

/* ---------- English sub-heading under page titles (from the original title images) ---------- */
.page-head .page-sub { margin: 4px 0 0 58px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--crimson); opacity: 0.8; }
@media (max-width: 960px) { .page-head .page-sub { margin-left: 0; } }

/* ==========================================================================
   Mirror of what the LIVE site hides (as of 2026-09-02)
   common.css on the live site hides the 期貨交易 menu entry (`#topMenu > li:nth-child(3)`) and the
   futures quick button (`.width-3 > a:nth-child(2)`): the futures line is discontinued. The futures
   pages are still built (download_form links their forms) — delete this block to show them again.
   The 市場信息 / market-data section was removed from this build altogether (client decision).
   ========================================================================== */
.main-nav > ul > li:has(> a[href$="/futures/system_download/"]),
.footer-cols li:has(> a[href$="/futures/system_download/"]),
.quick-rail > .quick-action[href$="/futures/system_download/"] { display: none !important; }
