@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;500;600;700&display=swap');

:root {
  --bg: #000000;
  --surface: #121212;
  --surface-2: #0a0a0d;
  --ink: #ededf0;
  --ink-2: #cfcfd6;
  --ink-dim: #9b9ba5;
  --line: #202027;
  --line-soft: #16161b;
  --accent: #6f8cff;
  --accent-deep: #16224a;
  --gold: #d8b26a;
  --radius: 10px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.035);
  --serif: 'Noto Serif TC', Georgia, 'Songti SC', 'PingFang TC', serif;
  --sans: 'Noto Sans TC', system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

[id] {
  scroll-margin-top: 11.5rem;
}

a {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-deep);
  color: #fff;
}

.read-progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 2px;
  width: 0;
  z-index: 99;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  box-shadow: 0 0 10px rgba(111, 140, 255, 0.85);
  pointer-events: none;
}

/* ---------- 页头：品牌行在上，菜单行在下 ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.42rem clamp(1rem, 4vw, 2.6rem);
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--ink-dim);
}

.topline-brand {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topline-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.brandbar {
  padding: 0.6rem clamp(1rem, 4vw, 2.6rem) 0.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.12rem, 3.4vw, 1.32rem);
  letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 0 14px rgba(111, 140, 255, 0.28);
}

.brand .mark,
.foot-brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex: none;
}

.brand:hover .brand-txt {
  color: #dbe4ff;
}

.menu {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 clamp(0.5rem, 3vw, 2rem);
  border-top: 1px solid var(--line-soft);
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu p {
  display: flex;
  gap: 0.1rem;
  margin: 0;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.82rem;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.menu a:hover,
.menu a:focus-visible {
  color: #fff;
  background: var(--surface);
  border-bottom-color: var(--accent);
}

.menu a.is-active {
  color: #fff;
  border-bottom-color: var(--accent);
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 70vh;
  display: flex;
  padding: clamp(1.6rem, 6vw, 3.4rem) clamp(1rem, 5vw, 3rem) 0;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(90% 70% at 12% 0%, rgba(22, 34, 74, 0.55) 0%, rgba(0, 0, 0, 0) 62%),
    #000;
}

.hero-ghost {
  position: absolute;
  right: -0.6rem;
  top: -1.6rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(8rem, 30vw, 22rem);
  line-height: 0.82;
  color: transparent;
  -webkit-text-stroke: 1px rgba(111, 140, 255, 0.2);
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  max-width: 68rem;
  margin: 0 auto;
  width: 100%;
}

.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 6.6vw, 4rem);
  line-height: 1.18;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 26px rgba(111, 140, 255, 0.2);
  max-width: 16em;
}

.hero-fig {
  margin: auto 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 46rem;
}

.hero-fig img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- 版心：左栏目录 + 正文 ---------- */

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.4rem) clamp(1rem, 4vw, 2.5rem) clamp(2.4rem, 6vw, 3.6rem);
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(1.2rem, 3vw, 2.6rem);
  align-items: start;
}

.side {
  position: sticky;
  top: 11.5rem;
  padding: 0.95rem 1rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.side-t {
  margin: 0 0 0.7rem;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--ink-dim);
}

.side-t span {
  display: inline-block;
}

.side-list {
  list-style: none;
  counter-reset: side;
  display: grid;
  gap: 0.12rem;
  margin: 0;
  padding: 0;
}

.side-list li {
  counter-increment: side;
}

.side-list a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-height: 40px;
  padding: 0.42rem 0.3rem;
  border-radius: 6px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease;
}

.side-list a::before {
  content: counter(side, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  opacity: 0.8;
}

.side-list a:hover,
.side-list a:focus-visible,
.side-list a.is-active {
  color: #fff;
  background: #17171c;
}

.col {
  min-width: 0;
}

.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.15rem, 3vw, 2.4rem);
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.92;
  color: var(--ink-2);
  overflow-wrap: break-word;
}

.prose section {
  padding: clamp(1.3rem, 3.4vw, 2.1rem) 0;
  border-bottom: 1px solid var(--line-soft);
}

.prose section:first-child {
  padding-top: 0;
}

.prose section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.prose h2 {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.3rem, 3.2vw, 1.85rem);
  line-height: 1.34;
  letter-spacing: 0.02em;
  color: #fff;
}

.prose h2 span,
.prose h3 span {
  display: inline-block;
  position: relative;
  padding-bottom: 0.38rem;
}

.prose h2 span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.05rem;
  width: 2.2rem;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(111, 140, 255, 0.8);
}

.prose h3 {
  margin: 1.5rem 0 0.6rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.16rem;
  line-height: 1.4;
  color: #f2f2f5;
}

.prose p {
  margin: 0 0 1.05em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.prose li {
  margin: 0.34em 0;
}

.prose li::marker {
  color: var(--accent);
}

.prose a {
  color: #aab9ff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: #d6dfff;
}

.prose strong,
.prose b {
  color: #fff;
  font-weight: 600;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 0.75em 1.1em;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #0e0e13;
  color: #c8c8d2;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-family: var(--sans);
  font-size: 0.94rem;
}

.prose th,
.prose td {
  border: 1px solid #24242b;
  padding: 0.55em 0.72em;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: #16161c;
  color: #fff;
  font-weight: 500;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.prose hr {
  border: 0;
  border-top: 1px solid #23232a;
  margin: 1.6em 0;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #1a1a21;
  padding: 0.1em 0.36em;
  border-radius: 4px;
}

.prose pre {
  overflow-x: auto;
  padding: 0.9em 1em;
  border-radius: var(--radius);
  background: #101015;
  border: 1px solid var(--line);
}

/* ---------- 页脚 ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #08080b 0%, #000 100%);
  padding: clamp(1.4rem, 4vw, 2.4rem) clamp(1rem, 4vw, 2.5rem) 1.6rem;
}

.foot-cta {
  display: block;
  max-width: 78rem;
  margin: 0 auto clamp(1.4rem, 4vw, 2.1rem);
  padding: clamp(1.3rem, 4vw, 2.1rem);
  text-align: center;
  text-decoration: none;
  border: 1px solid #1d2444;
  border-radius: var(--radius);
  background: radial-gradient(120% 170% at 50% 0%, #101a3a 0%, #0a0a0e 62%);
  box-shadow: 0 0 0 1px rgba(111, 140, 255, 0.07), 0 14px 44px rgba(18, 34, 92, 0.35);
}

.foot-cta h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.25rem, 4vw, 1.9rem);
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow: 0 0 18px rgba(111, 140, 255, 0.45);
}

.foot-cta:hover h2 {
  color: #dbe4ff;
}

.foot-row {
  max-width: 78rem;
  margin: 0 auto;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.1rem;
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  font-family: var(--serif);
  letter-spacing: 0.12em;
  color: #e7e7ec;
  text-decoration: none;
}

.foot-nav p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.1rem;
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--ink-dim);
  text-decoration: none;
}

.foot-nav a:hover,
.foot-nav a:focus-visible {
  color: #fff;
  background: #16161b;
}

.foot-copy {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #6f6f7a;
}

/* ---------- 动效 ---------- */

.side-list li,
.prose section {
  animation: rise 0.5s ease both;
}

.side-list li:nth-child(2),
.prose section:nth-child(2) { animation-delay: 0.05s; }
.side-list li:nth-child(3),
.prose section:nth-child(3) { animation-delay: 0.1s; }
.side-list li:nth-child(4),
.prose section:nth-child(4) { animation-delay: 0.15s; }
.side-list li:nth-child(5),
.prose section:nth-child(5) { animation-delay: 0.2s; }
.side-list li:nth-child(6),
.prose section:nth-child(6) { animation-delay: 0.25s; }
.side-list li:nth-child(7),
.prose section:nth-child(7) { animation-delay: 0.3s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 断点 ---------- */

@media (max-width: 900px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
    order: -1;
  }

  .side-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.12rem 0.5rem;
  }

  .side-list a {
    font-size: 0.84rem;
  }
}

@media (max-width: 560px) {
  [id] {
    scroll-margin-top: 12.5rem;
  }

  .hero {
    min-height: 62vh;
  }

  .hero-ghost {
    right: -1.2rem;
    top: -0.8rem;
  }

  .prose {
    padding: 1.1rem;
    font-size: 1rem;
  }

  .side-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-row {
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .side-list li,
  .prose section {
    animation: none;
  }

  .menu a,
  .side-list a {
    transition: none;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
