:root {
  --site-bg: var(--bs-body-bg);
  --surface-1: var(--bs-body-bg);
  --surface-2: var(--bs-secondary-bg);
  --surface-3: var(--bs-tertiary-bg);
  --text-primary: var(--bs-emphasis-color);
  --text-secondary: var(--bs-secondary-color);
  --text-muted: var(--bs-tertiary-color);
  --border-subtle: var(--bs-border-color-translucent);
  --border-strong: color-mix(in srgb, var(--bs-border-color) 72%, transparent);
  --content-width: 1180px;
  --hero-text-width: 720px;
  --radius-card: 16px;
  --radius-control: 12px;
  --font-sans: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

:root,
[data-bs-theme="light"] {
  --brand-accent: #7c3aed;
  --focus-ring: #7c3aed;
  --shadow-soft: 0 22px 70px rgba(15, 23, 42, 0.13);
  --header-bg: rgba(247, 248, 251, 0.82);
  --header-solid: rgba(247, 248, 251, 0.96);
  --menu-bg: #ffffff;
  --interactive-hover: rgba(23, 32, 51, 0.05);
  --brand-soft-bg: rgba(124, 58, 237, 0.08);
  --brand-soft-bg-hover: rgba(124, 58, 237, 0.13);
  --brand-border: rgba(124, 58, 237, 0.30);
  --card-surface: rgba(255, 255, 255, 0.90);
  --card-surface-hover: #ffffff;
  --panel-surface: rgba(255, 255, 255, 0.78);
  --article-body-text: #344054;
  --article-question-surface: rgba(255, 255, 255, 0.88);
  --callout-surface: rgba(23, 32, 51, 0.035);
  --observation-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 250, 0.94));
  --observation-row: #ffffff;
  --portal-glow-indigo: rgba(99, 102, 241, 0.10);
  --portal-glow-violet: rgba(124, 58, 237, 0.08);
  --portal-glow-soft: rgba(124, 58, 237, 0.04);
  --article-human-glow: rgba(251, 191, 36, 0.08);
}

[data-bs-theme="dark"] {
  --brand-accent: #a78bfa;
  --focus-ring: #c4b5fd;
  --shadow-soft: 0 22px 70px rgba(0, 0, 0, 0.18);
  --header-bg: rgba(16, 21, 29, 0.74);
  --header-solid: rgba(16, 21, 29, 0.94);
  --menu-bg: #151c26;
  --interactive-hover: rgba(255, 255, 255, 0.045);
  --brand-soft-bg: rgba(167, 139, 250, 0.10);
  --brand-soft-bg-hover: rgba(167, 139, 250, 0.15);
  --brand-border: rgba(167, 139, 250, 0.34);
  --card-surface: rgba(22, 29, 39, 0.72);
  --card-surface-hover: rgba(28, 37, 49, 0.80);
  --panel-surface: rgba(22, 29, 39, 0.54);
  --article-body-text: #d9dfe6;
  --article-question-surface: rgba(22, 29, 39, 0.62);
  --callout-surface: rgba(255, 255, 255, 0.028);
  --observation-surface: linear-gradient(145deg, rgba(28, 37, 49, 0.82), rgba(22, 29, 39, 0.58));
  --observation-row: rgba(16, 21, 29, 0.88);
  --portal-glow-indigo: rgba(129, 140, 248, 0.12);
  --portal-glow-violet: rgba(167, 139, 250, 0.08);
  --portal-glow-soft: rgba(167, 139, 250, 0.045);
  --article-human-glow: rgba(251, 191, 36, 0.055);
}


*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--site-bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text-primary);
  background: var(--site-bg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  color: #111827;
  background: var(--text-primary);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--border-subtle);
}

.site-header__inner,
.site-footer__inner {
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto;
}

.site-header__inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 720;
  letter-spacing: 0.02em;
  text-decoration: none;
}


.site-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.theme-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  background: transparent;
  line-height: 1;
  box-shadow: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--interactive-hover);
}

.theme-toggle__icon {
  width: 1.1em;
  display: inline-flex;
  justify-content: center;
  font-size: 1rem;
}

.theme-toggle__text {
  font-size: 0.84rem;
  font-weight: 650;
}

@media (max-width: 520px) {
  .theme-toggle {
    width: 40px;
    padding-inline: 0;
  }

  .theme-toggle__text {
    display: none;
  }

  .site-actions {
    gap: 6px;
  }
}

.experience-switcher {
  position: relative;
}

.experience-switcher summary {
  list-style: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  cursor: pointer;
  user-select: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

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

.experience-switcher summary::after {
  content: "⌄";
  color: var(--text-muted);
  line-height: 1;
}

.experience-switcher[open] summary,
.experience-switcher summary:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--interactive-hover);
}

.experience-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 150px;
  padding: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--menu-bg);
  box-shadow: var(--shadow-soft);
}

.experience-menu a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text-secondary);
  text-decoration: none;
}

.experience-menu a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.experience-menu a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--brand-soft-bg);
}

.experience-menu a[aria-current="page"]::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--brand-accent);
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.65);
}

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--border-subtle);
}

.site-footer__inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
}

.noscript-message {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  max-width: 680px;
  margin: auto;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-primary);
  background: #151c26;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 640px) {
  .site-header__inner,
  .site-footer__inner {
    width: min(calc(100% - 28px), var(--content-width));
  }

  .site-header__inner {
    min-height: 58px;
  }

  .site-footer {
    margin-top: 56px;
  }

  .site-footer__inner {
    min-height: 96px;
    flex-wrap: wrap;
    align-content: center;
  }
}

@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;
  }
}


/* Article experience */
.article-view {
  background:
    radial-gradient(circle at 82% 0%, var(--article-human-glow), transparent 28rem),
    var(--site-bg);
}

.article-top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-top-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.article-top-nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.article-page {
  width: min(calc(100% - 40px), 900px);
  margin: 0 auto;
}

.article {
  --category-accent: #fbbf24;
  padding-top: clamp(54px, 7vw, 92px);
}

.article-header {
  max-width: 790px;
}

.article-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--category-accent) 34%, var(--border-subtle));
  border-radius: 999px;
  color: var(--category-accent);
  background: color-mix(in srgb, var(--category-accent) 7%, transparent);
  font-size: 0.82rem;
  font-weight: 720;
  text-decoration: none;
}

.article-category::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--category-accent);
  box-shadow: 0 0 13px color-mix(in srgb, var(--category-accent) 45%, transparent);
}

.article-title {
  margin: 22px 0 0;
  font-size: clamp(2.25rem, 6.2vw, 4.25rem);
  line-height: 1.11;
  letter-spacing: -0.045em;
}

.article-summary {
  max-width: 42em;
  margin: 24px 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.06rem, 2vw, 1.23rem);
  line-height: 1.8;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.article-question {
  margin-top: clamp(34px, 5vw, 48px);
  padding: 22px 24px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--category-accent);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  background: var(--article-question-surface);
}

.article-question-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.article-question p {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.05rem, 2vw, 1.18rem);
  line-height: 1.65;
}

.article-content {
  max-width: 760px;
  margin-top: clamp(52px, 8vw, 82px);
  font-size: clamp(1.02rem, 1.5vw, 1.09rem);
  line-height: 1.92;
}

.article-content p {
  margin: 0 0 1.5em;
  color: var(--article-body-text);
}

.article-content strong {
  color: var(--text-primary);
  font-weight: 760;
}

.article-content h2 {
  margin: 2.65em 0 0.75em;
  color: var(--text-primary);
  font-size: clamp(1.45rem, 3vw, 1.88rem);
  line-height: 1.34;
  letter-spacing: -0.025em;
}

.article-content h3 {
  margin: 2em 0 0.65em;
  font-size: 1.15rem;
}

.article-callout {
  margin: 1.8em 0 !important;
  padding: 17px 19px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  color: var(--text-primary) !important;
  background: var(--callout-surface);
  font-weight: 650;
}

.article-ending {
  margin-top: 1.8em !important;
  color: var(--text-primary) !important;
  font-size: clamp(1.28rem, 3vw, 1.65rem);
  font-weight: 760;
  line-height: 1.55;
}

.article-sources,
.ai-observations {
  max-width: 800px;
  margin-top: clamp(66px, 9vw, 96px);
  padding-top: 30px;
  border-top: 1px solid var(--border-subtle);
}

.article-sources h2,
.ai-observations h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
}

.article-sources ol {
  margin: 24px 0 0;
  padding-left: 1.25rem;
}

.article-sources li {
  margin-bottom: 18px;
  padding-left: 8px;
  color: var(--text-muted);
}

.article-sources a {
  color: var(--text-primary);
  font-weight: 650;
  text-underline-offset: 3px;
}

.article-sources span {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.section-heading-inline > span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ai-observation {
  margin-top: 22px;
  padding: clamp(22px, 4vw, 30px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--observation-surface);
}

.ai-observation__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.ai-observation__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--border-subtle);
}

.ai-observation__grid > div {
  padding: 20px;
  background: var(--observation-row);
}

.ai-observation dt {
  margin-bottom: 8px;
  color: var(--brand-accent);
  font-size: 0.75rem;
  font-weight: 780;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ai-observation dd {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.75;
}

.article-navigation {
  max-width: 800px;
  margin-top: clamp(66px, 9vw, 96px);
  padding: 26px 0 0;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.article-navigation__label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 720;
  letter-spacing: 0.09em;
}

.article-navigation a:not(.article-action) {
  color: var(--text-primary);
  font-weight: 680;
  text-underline-offset: 4px;
}

.article-navigation__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.article-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-secondary);
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
}

.article-action:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--interactive-hover);
}

@media (max-width: 700px) {
  .article-page {
    width: min(calc(100% - 28px), 900px);
  }

  .article {
    padding-top: 44px;
  }

  .article-title {
    margin-top: 18px;
  }

  .article-summary {
    margin-top: 19px;
    line-height: 1.72;
  }

  .article-question {
    margin-top: 30px;
    padding: 18px;
  }

  .article-content {
    margin-top: 48px;
    line-height: 1.85;
  }

  .article-content h2 {
    margin-top: 2.35em;
  }

  .ai-observation__grid {
    grid-template-columns: 1fr;
  }

  .article-navigation {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-navigation__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .article-top-nav a:first-child {
    display: none;
  }

  .article-title {
    font-size: clamp(2.05rem, 12vw, 3rem);
  }

  .article-meta {
    gap: 6px 12px;
  }
}
