/**
 * 股票投資專區 · 共用視覺（對齊紀律之眼）
 */
:root {
  --bg: #faf8f4;
  --paper: #ffffff;
  --ink: #0f1729;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --line: #e5e1d8;
  --line-strong: #c8c0b0;
  --green: #15803d;
  --green-bg: #dcfce7;
  --yellow: #a16207;
  --yellow-bg: #fef3c7;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --accent: #1e3a5f;
  --shadow: 0 1px 2px rgba(15, 23, 41, 0.04), 0 4px 12px rgba(15, 23, 41, 0.04);
  /* RWD 斷點 token */
  --hub-bp-sm: 640px;
  --hub-bp-md: 768px;
  --hub-bp-lg: 1024px;
  --hub-container-narrow: 720px;
  --hub-container-wide: 920px;
  --hub-container-dashboard: 1080px;
  --hub-bottom-nav-h: 56px;
  --hub-top-nav-h: 52px;
  --hub-page-hdr-h: 72px;
  font-variant-numeric: tabular-nums;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body.hub-page {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

.hub-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

.hub-container--wide {
  max-width: var(--hub-container-wide);
}

@media (min-width: 1024px) {
  .hub-container--wide {
    max-width: var(--hub-container-dashboard);
  }
}

/* 頁首（綜合入口型） */
.hub-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}

.hub-title {
  font-family: Georgia, "Source Han Serif TC", serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
  color: var(--ink);
}

.hub-subtitle {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
}

.hub-lead {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 8px 0 0;
  line-height: 1.55;
}

/* 黏頂頁首（子工具頁） */
.hub-page-hdr {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.hub-page-hdr h1 {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hub-page-hdr .hub-lead {
  font-size: 12px;
  margin: 0;
}

.hub-page-hdr-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.hub-page-hdr-row .hub-page-hdr-main {
  flex: 1;
  min-width: 0;
}

/* 分頁（紀律之眼 tabs） */
.hub-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 12px;
  background: var(--paper);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.hub-tab {
  flex: 1 0 auto;
  min-width: max-content;
  padding: 10px 12px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.hub-tab:hover {
  color: var(--ink);
}

.hub-tab.active {
  background: var(--ink);
  color: var(--paper);
}

/* 區塊標題 */
.hub-section-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* 卡片 */
.hub-card-grid {
  display: grid;
  gap: 10px;
}

@media (min-width: 640px) {
  .hub-card-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .hub-card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.hub-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hub-card-link:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 10px rgba(15, 23, 41, 0.08);
}

.hub-card-link.featured,
.hub-card-link--primary {
  border-color: var(--line-strong);
  background: linear-gradient(165deg, #fff 0%, #faf8f5 100%);
}

.hub-card-link--primary {
  padding: 18px 18px;
  border-width: 2px;
  border-color: var(--accent);
}

.hub-card-link--primary strong {
  font-size: 17px;
}

.hub-card-link--secondary {
  border-color: var(--line);
}

.hub-card-link--reference {
  padding: 12px 14px;
  background: #fafaf8;
}

.hub-card-link--reference strong {
  font-size: 15px;
}

.hub-card-link--compact span {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 639px) {
  .hub-card-link--mobile-advanced {
    display: none;
  }
}

.hub-card-link strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--accent);
  font-weight: 700;
}

.hub-card-link span {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.hub-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

/* 按鈕 */
.hub-btn {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.hub-btn:hover {
  background: #f5f2ec;
  border-color: var(--accent);
}

.hub-btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.hub-btn--primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.hub-btn--soft {
  background: #f5f2ec;
  color: var(--accent);
  border-color: var(--line);
}

/* 狀態 pill */
.hub-pill {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 600;
}

.hub-pill.ok {
  border-color: #86efac;
  color: var(--green);
  background: var(--green-bg);
}

.hub-pill.bad {
  border-color: #fcd34d;
  color: var(--yellow);
  background: var(--yellow-bg);
}

.hub-pill.note {
  border-color: var(--line-strong);
  color: var(--accent);
  background: #f5f2ec;
}

.hub-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

/* 導覽列 */
.hub-nav-strip {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
}

.hub-nav-strip a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-right: 12px;
}

.hub-nav-strip a:hover {
  text-decoration: underline;
}

/* 內容區 */
.hub-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 14px 80px;
}

.hub-wrap--wide {
  max-width: 960px;
}

/* 摺疊／列表 */
.hub-details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.hub-details summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
  color: var(--accent);
  list-style: none;
}

.hub-details summary::-webkit-details-marker {
  display: none;
}

.hub-details-body {
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.65;
  border-top: 1px solid var(--line);
}

code {
  font-size: 12px;
  background: #ebe6dc;
  color: #334155;
  padding: 2px 6px;
  border-radius: 6px;
}

.hub-footer {
  margin-top: 32px;
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.6;
}

.hub-footer strong {
  color: var(--ink-soft);
}

/* iframe 面板 */
.hub-iframe-panel {
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hub-iframe-panel iframe {
  display: block;
  width: 100%;
  border: none;
}

/* ── 今日工作台（綜合入口） ── */
.hub-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hub-header-row .hub-header-main {
  flex: 1;
  min-width: 0;
}

.hub-status-row--compact {
  margin-bottom: 0;
  justify-content: flex-end;
  flex: 0 1 auto;
}

.hub-workspace {
  margin-bottom: 28px;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: linear-gradient(165deg, #fff 0%, #f8f5ef 100%);
  box-shadow: var(--shadow);
}

.hub-workspace-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.hub-workspace-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .hub-workspace-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.hub-scenario-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.hub-scenario-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  background: var(--paper);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.hub-scenario-chip:hover {
  background: #f5f2ec;
  border-color: var(--line-strong);
}

.hub-section--collapsible summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding: 4px 0;
}

.hub-section--collapsible summary::-webkit-details-marker {
  display: none;
}

.hub-section--collapsible summary::after {
  content: " ▸";
  font-weight: 400;
}

.hub-section--collapsible[open] summary::after {
  content: " ▾";
}

.hub-pill--short {
  display: none;
}

@media (max-width: 639px) {
  .hub-pill--long {
    display: none;
  }

  .hub-pill--short {
    display: inline-flex;
  }

  .hub-section--below-fold {
    display: none;
  }

  .hub-section--below-fold.is-expanded {
    display: block;
  }

  .hub-more-tools-toggle {
    display: block;
    width: 100%;
    margin: 8px 0 16px;
  }

  body.hub-page {
    padding-bottom: calc(var(--hub-bottom-nav-h) + 16px);
  }
}

@media (min-width: 640px) {
  .hub-pill--short {
    display: none;
  }

  .hub-more-tools-toggle {
    display: none;
  }
}

.hub-more-tools-toggle {
  display: none;
}

/* 手機底部導覽 */
.hub-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99998;
  height: var(--hub-bottom-nav-h);
  padding: 0 4px env(safe-area-inset-bottom, 0);
  background: var(--paper);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -2px 12px rgba(15, 23, 41, 0.08);
}

.hub-bottom-nav__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
}

.hub-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  min-width: 0;
}

.hub-bottom-nav a[aria-current="page"] {
  color: var(--accent);
}

.hub-bottom-nav a .hub-bottom-nav__icon {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 639px) {
  .hub-bottom-nav {
    display: block;
  }

  body.hub-has-bottom-nav {
    padding-bottom: calc(var(--hub-bottom-nav-h) + 12px);
  }
}

/* 浮動返回首頁（子頁） */
.hub-nav-home {
  position: fixed;
  z-index: 99999;
  right: 14px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  text-decoration: none;
  color: #1e3a5f;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 41, 0.1);
  border: 1px solid #c8c0b0;
  transition: transform 0.15s, box-shadow 0.15s;
}

.hub-nav-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(15, 23, 41, 0.12);
  color: #0f1729;
  background: #f5f2ec;
}

.hub-nav-home:active {
  transform: translateY(0);
}

.hub-nav-home--icon-only .hub-nav-home__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 640px) {
  .hub-nav-home--icon-only {
    padding: 10px 12px;
    font-size: 18px;
  }
}

@media (max-width: 639px) {
  .hub-nav-home {
    display: none !important;
  }
}

/* 鍵盤焦點 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hub-card-link:focus-visible,
.hub-btn:focus-visible,
.hub-tab:focus-visible,
.hub-bottom-nav a:focus-visible,
.hub-nav-home:focus-visible,
.hub-top-nav a:focus-visible,
.hub-top-nav__search-input:focus-visible,
.hub-top-nav__search-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── 頂部固定導覽 ── */
body.hub-has-top-nav {
  padding-top: var(--hub-top-nav-h);
}

body.hub-has-top-nav.hub-page--home {
  padding-top: 0;
}

body.hub-has-top-nav.hub-page--home .hub-container {
  padding-top: calc(var(--hub-top-nav-h) + 8px);
}

.hub-top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100000;
  height: var(--hub-top-nav-h);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  box-shadow: var(--shadow);
  overflow: visible;
}

.hub-top-nav__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
  height: 100%;
  overflow: visible;
}

.hub-top-nav__brand {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.hub-top-nav__links {
  display: none;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hub-top-nav__link {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.hub-top-nav__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.hub-top-nav__link--menu {
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.hub-top-nav__link:hover {
  background: #f5f2ec;
  color: var(--ink);
}

.hub-top-nav__link.is-active {
  background: var(--ink);
  color: var(--paper);
}

.hub-top-nav__submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
  display: none;
  z-index: 100001;
}

.hub-top-nav__item:hover .hub-top-nav__submenu,
.hub-top-nav__item:focus-within .hub-top-nav__submenu,
.hub-top-nav__item.is-open .hub-top-nav__submenu,
.hub-top-nav__link--menu[aria-expanded="true"] + .hub-top-nav__submenu {
  display: grid;
  gap: 4px;
}

.hub-top-nav__sub-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #9a5f24;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.hub-top-nav__sub-link:hover {
  background: #fff4e6;
  color: #7a3f12;
}

.hub-top-nav__sub-link--main {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 4px 4px;
  margin-bottom: 3px;
}

.hub-top-nav__search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  max-width: 280px;
  margin-left: auto;
}

.hub-top-nav__search-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
}

.hub-top-nav__search-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.hub-top-nav__search-btn:hover {
  background: var(--accent);
}

.hub-top-nav__menu-btn {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.hub-top-nav__mobile-panel {
  position: fixed;
  top: var(--hub-top-nav-h);
  left: 0;
  right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 12px;
  box-shadow: var(--shadow);
  z-index: 99999;
}

.hub-top-nav__mobile-panel[hidden] {
  display: none !important;
}

.hub-top-nav__mobile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.hub-top-nav__mobile-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 132px;
}

.hub-top-nav__mobile-sub {
  display: grid;
  gap: 2px;
  padding-left: 8px;
}

.hub-top-nav__mobile-sub .hub-top-nav__sub-link {
  padding: 5px 8px;
  font-size: 12px;
}

.hub-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;
}

@media (min-width: 768px) {
  .hub-top-nav__links {
    display: flex;
    overflow: visible;
    -webkit-overflow-scrolling: auto;
  }

  .hub-top-nav__menu-btn {
    display: none;
  }

  .hub-top-nav__mobile-panel {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .hub-top-nav__search {
    display: none;
  }

  .hub-top-nav__inner .hub-top-nav__search {
    display: none;
  }
}

/* 首頁搜尋 + 最近使用 */
.hub-home-search {
  margin-bottom: 20px;
}

.hub-home-search .hub-top-nav__search {
  display: flex;
  max-width: none;
  margin-left: 0;
}

.hub-recent-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 8px;
}

.hub-recent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hub-recent-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  background: var(--paper);
  border: 1px solid var(--line);
}

.hub-recent-chip:hover {
  background: #f5f2ec;
}

.hub-has-top-nav .hub-page-hdr {
  top: var(--hub-top-nav-h);
}

/* 大盤 / 行情頁 RWD */
.hub-wrap--market {
  max-width: 960px;
}

@media (min-width: 1024px) {
  .hub-wrap--market {
    max-width: 1120px;
  }
}

.hub-mo-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .hub-mo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .hub-mo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 紀律之眼銜接頂部 nav */
body.hub-discipline-bridge #disciplineHubNav {
  display: none !important;
}

body.hub-discipline-bridge.hub-has-top-nav .container {
  padding-top: 8px;
}

body.hub-discipline-bridge .tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

body.hub-discipline-bridge .tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* 搜尋下拉建議 */
.hub-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 280px;
}

.hub-home-search .hub-search-wrap {
  max-width: none;
}

.hub-top-nav__mobile-panel .hub-search-wrap {
  max-width: none;
  width: 100%;
}

.hub-search-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 41, 0.12);
  z-index: 100001;
  max-height: 280px;
  overflow-y: auto;
}

.hub-search-suggest li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.hub-search-suggest li:hover,
.hub-search-suggest li.is-active {
  background: #f5f2ec;
}

.hub-search-suggest__icon {
  flex-shrink: 0;
}

.hub-search-suggest__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 試算工具 · 筆電右側摘要 */
.calc-desk-only {
  display: none;
}

@media (min-width: 1024px) {
  body.hub-page .main {
    grid-template-columns: 300px 1fr 200px;
  }

  .calc-desk-only {
    display: block;
  }

  .calc-desk-summary {
    padding: 12px 10px;
    background: var(--bg2);
    border-left: 1px solid var(--bdr);
    overflow-y: auto;
    height: 100%;
    position: sticky;
    top: 0;
  }

  .calc-desk-summary h2 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text3);
    margin: 0 0 10px;
  }

  .calc-desk-summary .calc-desk-row {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--bdr);
  }

  .calc-desk-summary .calc-desk-row:last-child {
    border-bottom: none;
  }

  .calc-desk-summary .calc-desk-label {
    font-size: 10px;
    color: var(--text3);
    margin-bottom: 2px;
  }

  .calc-desk-summary .calc-desk-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
  }

  .calc-desk-summary .calc-desk-val.accent {
    color: #60a5fa;
  }

  body.light .calc-desk-summary .calc-desk-val.accent {
    color: #1e3a5f;
  }
}

/* ── 深色主題（hub-theme-mode.js） ── */
body.hub-theme-dark {
  --bg: #0f1729;
  --paper: #1e293b;
  --ink: #e2e8f0;
  --ink-soft: #94a3b8;
  --ink-faint: #64748b;
  --line: #334155;
  --line-strong: #475569;
  --green: #4ade80;
  --green-bg: #14532d;
  --yellow: #fbbf24;
  --yellow-bg: #422006;
  --red: #f87171;
  --red-bg: #450a0a;
  --accent: #93c5fd;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.hub-theme-dark .hub-top-nav {
  background: var(--paper);
  border-bottom-color: var(--ink);
}

body.hub-theme-dark .hub-top-nav__search-input {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--line);
}

body.hub-theme-dark .hub-search-suggest {
  background: var(--paper);
  border-color: var(--line-strong);
}

body.hub-theme-dark .hub-search-suggest li:hover,
body.hub-theme-dark .hub-search-suggest li.is-active {
  background: #334155;
}

body.hub-theme-dark .hub-bottom-nav {
  background: var(--paper);
  border-top-color: var(--line-strong);
}

.hub-top-nav__theme-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-soft);
}

.hub-top-nav__theme-btn:hover {
  background: #f5f2ec;
  color: var(--ink);
}

body.hub-theme-dark .hub-top-nav__theme-btn:hover {
  background: #334155;
}

/* 辭典搜尋 */
.hub-glossary-search-row {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.hub-glossary-search-row .hub-top-nav__search {
  max-width: none;
  margin: 0;
}

.hub-glossary-mark {
  background: #fde68a;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

body.hub-theme-dark .hub-glossary-mark {
  background: #854d0e;
  color: #fef3c7;
}

.hub-glossary-stats {
  font-size: 13px;
  color: var(--ink);
  margin: 10px 0 0;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.hub-glossary-stats strong {
  color: var(--accent);
  font-weight: 700;
}

.hub-glossary-stats-none {
  color: var(--ink-faint);
}

.hub-glossary-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 8px 0 0;
}

.map-search-stats {
  flex: 1 1 100%;
  font-size: 12px;
  color: var(--ink-soft);
  margin: 6px 0 0;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.map-search-stats strong {
  color: var(--accent);
  font-weight: 700;
}

.hub-glossary-empty {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 8px 0;
}
