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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --faint: #e3e3e3;
  --mute: #575757;
  --r: 28px;
  --serif: "Noto Serif TC", "Songti TC", "Songti SC", Georgia, serif;
  --sans: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --shell: clamp(1.15rem, 4vw, 4.5rem);
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.8;
  font-weight: 400;
  padding-bottom: 104px;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

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

figure {
  margin: 1.6rem 0;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper);
}

figure img { width: 100%; border-radius: calc(var(--r) - 2px); }

/* ---------- bottom dock ---------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem var(--shell);
  background: var(--ink);
  color: var(--paper);
  border-top: 2px solid var(--ink);
}

.dock ol {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(0.1rem, 1.2vw, 1rem);
  margin: 0;
  padding: 0;
}

.dock-left { justify-content: flex-start; }
.dock-right { justify-content: flex-end; }
.dock li { flex: 0 0 auto; }

.dock a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.4rem;
  color: var(--paper);
  text-decoration: none;
  font-size: 1rem;
  white-space: nowrap;
}

.dock a:hover,
.dock a:focus-visible {
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.dock .brand {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  padding: 0 0.75rem;
}

/* ---------- shell ---------- */

main { padding: 0 var(--shell); }

@media (min-width: 1024px) {
  main {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
    padding-top: 1.5rem;
  }
}

/* ---------- rail ---------- */

.rail { padding: 1rem 0 0.25rem; }

.rail h2 {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin: 0 0 0.6rem;
}

.rail h2 span { display: inline-block; }

.rail-list {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0 0 0.4rem;
  overflow-x: auto;
}

.rail-list li { flex: 0 0 auto; }

.rail-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0.95rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

@media (min-width: 1024px) {
  .rail {
    position: sticky;
    top: 1.5rem;
    border: 2px solid var(--ink);
    border-radius: var(--r);
    padding: 1.5rem 1.35rem;
  }

  .rail-list {
    flex-direction: column;
    gap: 0;
    overflow: visible;
  }

  .rail-list li { flex: 0 0 auto; }

  .rail-list a {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0;
    border: 0;
    border-bottom: 1px solid var(--faint);
    border-radius: 0;
  }

  .rail-list li:last-child a { border-bottom: 0; }
}

/* ---------- hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  gap: 1.5rem;
  min-height: 62vh;
  padding: clamp(2.5rem, 9vh, 6rem) 0 clamp(2rem, 5vh, 3.5rem);
}

@media (min-width: 1024px) {
  .hero { min-height: 70vh; }
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.7rem, 10vw, 8rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.lede {
  margin: 0;
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--mute);
}

.hero-figure {
  width: 100%;
  margin: 0.5rem 0 0;
}

.hero-img { width: 100%; }

/* ---------- content ---------- */

.sheet article {
  border-top: 2px solid var(--ink);
  padding: clamp(2.5rem, 7vw, 5.5rem) 0;
  scroll-margin-top: 1.5rem;
}

.sheet article h2 {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.06;
  margin: 0 0 1.4rem;
  overflow-wrap: anywhere;
}

.sheet article h2 span { display: inline; }

.sheet article h3 {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2.2rem 0 1rem;
}

.sheet article h3 span { display: inline; }

.sheet article p {
  max-width: 42rem;
  margin: 0 0 1.15rem;
}

.sheet article ul,
.sheet article ol {
  max-width: 42rem;
  margin: 0 0 1.2rem;
  padding-left: 1.35rem;
}

.sheet article li { margin-bottom: 0.55rem; }

.sheet article blockquote {
  margin: 1.6rem 0;
  padding: 1.1rem 1.4rem;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  max-width: 42rem;
}

.sheet article blockquote p { margin: 0; }

.sheet article a:hover,
.sheet article a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  outline: none;
}

.sheet article strong { font-weight: 700; }

.sheet article table {
  width: 100%;
  max-width: 42rem;
  border-collapse: collapse;
  margin: 0 0 1.2rem;
}

.sheet article th,
.sheet article td {
  border-bottom: 2px solid var(--ink);
  padding: 0.6rem 0.5rem;
  text-align: left;
}

/* ---------- footer ---------- */

.foot {
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: clamp(2.2rem, 5vw, 3.5rem) var(--shell) 2.2rem;
  border-top: 2px solid var(--ink);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 4vw, 3rem);
}

.foot dl { margin: 0; }

.foot dt {
  font-family: var(--serif);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 0.7rem;
}

.foot dd {
  margin: 0;
  font-size: 1rem;
  color: var(--mute);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1rem;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.foot-links a:hover,
.foot-links a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
  outline: none;
}

.foot-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.2rem;
  border-top: 2px solid var(--ink);
  font-size: 1rem;
}

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.3rem;
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
}

.foot-base a:hover,
.foot-base a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

/* ---------- mobile dock ---------- */

@media (max-width: 860px) {
  body { padding-bottom: 96px; }

  .dock {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0;
    padding: 0 0.5rem;
  }

  .dock ol { display: contents; }

  .dock li { flex: 0 0 auto; }

  .dock .brand {
    order: -1;
    flex: 0 0 auto;
    padding: 0 0.6rem;
  }

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

@media (max-width: 520px) {
  .hero { min-height: 56vh; gap: 1.1rem; }
  .lede { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

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