:root {
  color-scheme: dark;
  --bg: #081121;
  --bg-elevated: rgba(15, 23, 42, 0.84);
  --bg-panel: rgba(30, 41, 59, 0.72);
  --border: rgba(148, 163, 184, 0.18);
  --text: #dbe4f2;
  --muted: #91a3bd;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.16);
  --accent-strong: #8cb4ff;
  --serif: "Noto Serif TC", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Noto Sans TC", "Segoe UI", sans-serif;
  --max-width: 1160px;
  --article-width: 760px;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(79, 140, 255, 0.2), transparent 40%),
    linear-gradient(180deg, #0b1220 0%, #081121 45%, #060d18 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 17, 33, 0.84);
  backdrop-filter: blur(18px);
}

.nav-inner,
.page-section,
.site-footer-inner {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.brand-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.nav-link {
  color: var(--muted);
  transition: color 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
}

.nav-link.is-active {
  position: relative;
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.4rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.main {
  flex: 1;
  padding-bottom: 4rem;
}

.hero {
  padding: 5.5rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 2rem;
  align-items: start;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero h1,
.article-header h1,
.section-heading {
  margin: 0;
  font-family: var(--serif);
  color: #fff;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1.02;
  margin-bottom: 1.2rem;
}

.hero p,
.section-copy,
.article-summary,
.meta-line,
.card-summary,
.chip-row,
.toc,
.empty-state,
.footer-copy,
.article-content,
.tag-summary,
.series-summary {
  color: var(--muted);
}

.hero p {
  font-size: 1.05rem;
  line-height: 1.9;
  max-width: 60ch;
}

.hero-panel,
.card,
.toc,
.meta-panel {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 1.5rem;
}

.hero-panel h2,
.aside-title {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero-panel p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
}

.section-block {
  padding: 1.5rem 0 0;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.section-heading {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.card {
  padding: 1.4rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 140, 255, 0.45);
  background: rgba(30, 41, 59, 0.88);
}

.card-title {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  line-height: 1.4;
  color: #fff;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.card-summary,
.tag-summary,
.series-summary {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.75;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 140, 255, 0.24);
  background: var(--accent-soft);
  color: #d9e7ff;
  font-size: 0.83rem;
}

.chip:hover {
  border-color: rgba(79, 140, 255, 0.4);
  background: rgba(79, 140, 255, 0.2);
}

.article-shell {
  padding: 3rem 0 0;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 2rem;
  align-items: start;
}

.article-column {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: #fff;
}

.article-header {
  max-width: var(--article-width);
}

.article-header h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.article-summary {
  margin: 1.2rem 0 0;
  font-size: 1rem;
  line-height: 1.85;
}

.article-content {
  max-width: var(--article-width);
  font-size: 1.03rem;
  line-height: 1.95;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 2.2rem 0 0.9rem;
  font-family: var(--serif);
  color: #fff;
  scroll-margin-top: 6rem;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre {
  margin: 0 0 1.15rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.3rem;
}

.article-content li + li {
  margin-top: 0.5rem;
}

.article-content a {
  color: #9ac2ff;
  text-decoration: underline;
  text-decoration-color: rgba(154, 194, 255, 0.35);
  text-underline-offset: 0.16rem;
}

.article-content a:hover {
  color: #dce9ff;
}

.article-content blockquote {
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 16px 16px 0;
  background: rgba(15, 23, 42, 0.75);
}

.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.14rem 0.35rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
}

.article-content pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.92);
}

.article-content pre code {
  padding: 0;
  background: transparent;
}

.toc,
.meta-panel {
  padding: 1.2rem;
  position: sticky;
  top: 5.6rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
}

.toc li + li {
  margin-top: 0.55rem;
}

.toc a {
  color: var(--muted);
}

.toc a:hover {
  color: #fff;
}

.meta-panel {
  margin-top: 1rem;
}

.language-links,
.related-list,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.related-list {
  margin-top: 1.2rem;
}

.related-link,
.language-link,
.footer-link,
.text-link {
  color: #d9e7ff;
}

.related-link:hover,
.language-link:hover,
.footer-link:hover,
.text-link:hover {
  color: #fff;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.92rem;
}

.feed-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #d9e7ff;
}

.top-gap {
  margin-top: 1rem;
}

.feed-link:hover {
  color: #fff;
}

@media (max-width: 960px) {
  .hero-grid,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .toc,
  .meta-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .hero {
    padding-top: 4rem;
  }

  .nav-inner,
  .site-footer-inner {
    align-items: flex-start;
  }

  .nav-links {
    gap: 0.8rem;
    font-size: 0.88rem;
  }
}