@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');

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

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

body {
  margin: 0;
  background: #ffffff;
  color: #000000;
  font-family: "Noto Sans TC", "PingFang TC", "Hiragino Sans GB", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

a { color: inherit; }

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid #000000;
  outline-offset: 3px;
}

/* ---------- 顶部栏：aside > nav > ul > li > a ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.65rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid #000000;
  background: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 17px;
}

.mark-b {
  width: 13px;
  height: 13px;
  background: #000000;
  display: block;
}

.mark { display: block; width: 26px; height: 26px; object-fit: contain; }

.mark-t { font-size: 17px; line-height: 1; }

.primary { margin-left: auto; min-width: 0; }

.primary ul {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.primary ul::-webkit-scrollbar { height: 0; }

.primary a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.65rem;
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 0.22s ease, opacity 0.22s ease;
}

.primary a:hover { border-bottom-color: #000000; }

.tick {
  width: 6px;
  height: 6px;
  background: #000000;
  display: block;
  transition: transform 0.22s ease;
}

.primary a:hover .tick { transform: rotate(45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 5rem 1.5rem;
  background: #000000;
  color: #ffffff;
  overflow: hidden;
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
}

.hero-fig img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  opacity: 0.62;
  transform: scale(1.06);
  will-change: transform;
}

.hero-fig::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
}

.badge {
  position: absolute;
  left: clamp(1rem, 4vw, 3rem);
  bottom: 1.6rem;
  z-index: 2;
  border: 1px solid #ffffff;
  padding: 0.35rem 0.9rem;
  font-size: 13px;
  letter-spacing: 0.2em;
  background: rgba(0, 0, 0, 0.25);
}

.hero-in {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 26ch;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.12;
  font-weight: 600;
}

/* ---------- 粘性锚点条 ---------- */
.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid #000000;
}

.rail ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.rail ul::-webkit-scrollbar { height: 0; }

.rail a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 44px;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.12em;
  border-right: 1px solid #000000;
  transition: background 0.2s ease, color 0.2s ease;
}

.rail a:hover,
.rail a[aria-current] {
  background: #000000;
  color: #ffffff;
}

/* ---------- 主体网格 ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 3.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
}

.content { min-width: 0; }

.content > article {
  padding-block: 2.6rem;
  border-top: 1px solid #000000;
  scroll-margin-top: 64px;
}

.content > article:first-child {
  border-top: 0;
  padding-top: 0;
}

.content > article:last-child { padding-bottom: 0; }

.content small {
  display: block;
  font-size: 13px;
  letter-spacing: 0.22em;
  opacity: 0.6;
  margin-bottom: 0.35rem;
}

.content h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 1.1rem;
}

.content h3 {
  font-size: 1.18rem;
  margin: 2rem 0 0.7rem;
}

.content p {
  margin: 0 0 1.15rem;
  max-width: 66ch;
}

.content ul,
.content ol {
  margin: 0 0 1.2rem;
  padding-left: 1.25rem;
  max-width: 66ch;
}

.content li { margin-bottom: 0.45rem; }

.content a {
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness 0.2s ease;
}

.content a:hover { text-decoration-thickness: 2px; }

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6rem 0;
  border-radius: 10px;
}

.content figure { margin: 1.6rem 0; }

.content figcaption {
  font-size: 14px;
  opacity: 0.7;
  margin-top: 0.5rem;
}

.content blockquote {
  margin: 1.6rem 0;
  padding: 0.15rem 0 0.15rem 1.2rem;
  border-left: 3px solid #000000;
  font-family: "Noto Serif TC", Georgia, serif;
}

.content blockquote p { margin-bottom: 0.6rem; }

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 16px;
}

.content th,
.content td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #dcdcdc;
  vertical-align: top;
}

.content th { border-bottom-color: #000000; }

.content pre {
  overflow-x: auto;
  padding: 1rem;
  background: #f2f2f2;
  border-radius: 10px;
  font-size: 15px;
}

.content code { font-size: 15px; }

.content hr {
  border: 0;
  border-top: 1px solid #000000;
  margin: 2rem 0;
}

/* ---------- 右侧目录 ---------- */
.side {
  position: sticky;
  top: 70px;
  align-self: start;
  border-left: 1px solid #000000;
  padding-left: 1.25rem;
}

.side small {
  display: block;
  font-size: 13px;
  letter-spacing: 0.22em;
  opacity: 0.6;
}

.side-h {
  font-size: 1.1rem;
  margin: 0.2rem 0 1rem;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-list a {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  min-height: 40px;
  padding: 0.4rem 0;
  font-size: 15px;
  line-height: 1.45;
  text-decoration: none;
  border-bottom: 1px solid #dcdcdc;
  transition: padding-left 0.2s ease;
}

.side-list a:hover { padding-left: 0.35rem; }

.side-list .no {
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.55;
  min-width: 1.7em;
}

/* ---------- 页脚：footer > article × n ---------- */
.foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem 2rem;
  margin-top: 3rem;
  padding: clamp(2.2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 3rem) 1.5rem;
  background: #000000;
  color: #ffffff;
}

.foot small {
  display: block;
  font-size: 13px;
  letter-spacing: 0.22em;
  opacity: 0.6;
  margin-bottom: 0.4rem;
}

.foot h2 {
  font-size: 1.3rem;
  margin: 0 0 0.9rem;
  color: #ffffff;
}

.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot li { border-bottom: 1px solid #333333; }

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 16px;
  transition: opacity 0.2s ease;
}

.foot a:hover { text-decoration: underline; text-underline-offset: 4px; }

.f-top { border-top: 1px solid #333333; width: 100%; margin-top: 0.5rem; }

.foot form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.foot input {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  background: transparent;
  border: 1px solid #ffffff;
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  border-radius: 0;
}

.foot input::placeholder { color: rgba(255, 255, 255, 0.6); }

.foot button {
  min-height: 44px;
  padding: 0.45rem 1.15rem;
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.foot button:hover { background: #000000; color: #ffffff; }

.copy {
  grid-column: 1 / -1;
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid #333333;
  font-size: 14px;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }

  .topbar { padding: 0.55rem 1rem; gap: 0.5rem; }

  .primary { width: 100%; margin-left: 0; }

  .hero { min-height: 62vh; padding: 4rem 1.25rem; }

  .hero-in { max-width: 100%; }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: 2rem 1rem 2.5rem;
  }

  .content > article { scroll-margin-top: 56px; }

  .side {
    position: static;
    border-left: 0;
    border-top: 1px solid #000000;
    padding-left: 0;
    padding-top: 1.5rem;
  }

  .foot { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }

  .content p,
  .content ul,
  .content ol { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .hero-fig img { transform: none !important; }
}

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