@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 {
  --ink: #261717;
  --red: #ff0000;
  --violet: #8b00ff;
  --text: #f3e6e4;
  --dim: rgba(243, 230, 228, 0.66);
  --faint: rgba(243, 230, 228, 0.44);
  --line: rgba(255, 255, 255, 0.2);
  --hair: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-soft: rgba(255, 255, 255, 0.055);
  --radius: 4px;
  --serif: "Noto Serif TC", "Songti SC", "Times New Roman", serif;
  --sans: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  --pad: clamp(1rem, 4vw, 2.6rem);
  --py: 0px;
  --shadow: 0 22px 48px -28px rgba(0, 0, 0, 0.9);
}

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

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

html.lock { overflow: hidden; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.78;
  color: var(--text);
  background: #261717;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: -25% -12% -12%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38rem 28rem at 16% 8%, rgba(255, 0, 0, 0.4), transparent 64%),
    radial-gradient(34rem 26rem at 84% 2%, rgba(139, 0, 255, 0.46), transparent 62%),
    radial-gradient(52rem 36rem at 62% 94%, rgba(255, 0, 0, 0.18), transparent 68%),
    linear-gradient(160deg, #2e1919, #1a0f0f 55%, #241414);
  transform: translate3d(0, var(--py), 0);
  will-change: transform;
}

img { max-width: 100%; }

a { color: inherit; }

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

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

/* ---------- 顶栏 ---------- */
.mast {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(38, 23, 23, 0.62);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.mast-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem var(--pad);
  animation: rise 0.5s both;
}

.mast-find {
  border-top: 1px solid var(--hair);
  padding-block: 0.5rem;
  animation-delay: 0.06s;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  text-decoration: none;
}

.mark-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ff6a6a, var(--red) 42%, var(--violet) 100%);
  box-shadow: 0 0 0 1px var(--line), 0 8px 20px -8px var(--violet);
}

.mark-img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
}

.mark-name {
  font-family: var(--serif);
  font-size: 1.06rem;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.burger {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.burger-bar {
  display: block;
  width: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--violet));
}

.burger-word { letter-spacing: 0.1em; }

.find {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.find-label {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  color: var(--faint);
  flex: 0 0 auto;
}

.find-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0.45rem 0.8rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.find-input::placeholder { color: var(--faint); }

/* ---------- 全屏遮罩菜单 ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0.9rem var(--pad) 2rem;
  overflow-y: auto;
  background:
    radial-gradient(30rem 24rem at 84% 6%, rgba(139, 0, 255, 0.42), transparent 66%),
    radial-gradient(28rem 22rem at 10% 92%, rgba(255, 0, 0, 0.34), transparent 68%),
    rgba(24, 14, 14, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.veil.open { opacity: 1; visibility: visible; }

.veil-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.veil-word {
  font-family: var(--sans);
  font-size: 0.86rem;
  letter-spacing: 0.3em;
  color: var(--faint);
}

.veil-close {
  min-height: 44px;
  padding: 0.4rem 1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.veil-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0 0;
  counter-reset: v;
}

.veil-nav li { border-bottom: 1px solid var(--hair); }

.veil-nav li.hide { display: none; }

.veil-nav li a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 52px;
  padding: 0.7rem 0.2rem;
  text-decoration: none;
  font-size: clamp(1.15rem, 4.4vw, 1.75rem);
  letter-spacing: 0.05em;
}

.veil-nav li a::before {
  counter-increment: v;
  content: counter(v, decimal-leading-zero);
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: #d3b0ff;
}

.veil-nav li a:hover { color: #fff; }

.veil-empty {
  margin: 1.4rem 0 0;
  font-size: 0.95rem;
  color: var(--dim);
}

/* ---------- 头图 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.028));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.3rem;
  max-width: 72rem;
  min-height: 45vh;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) var(--pad);
}

.hero-text {
  flex: 1 1 16rem;
  min-width: 0;
  animation: rise 0.6s both;
}

.hero-title {
  margin: 0 0 0.7rem;
  font-size: clamp(1.8rem, 5.6vw, 3rem);
  line-height: 1.22;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 26px rgba(255, 0, 0, 0.28);
}

.hero-lead {
  margin: 0;
  max-width: 44ch;
  color: var(--dim);
  font-size: 0.98rem;
  animation: rise 0.6s 0.08s both;
}

.hero-art {
  margin: 0;
  flex: 0 0 auto;
  width: 108px;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.6s 0.14s both;
}

.hero-img { display: block; width: 100%; height: auto; border-radius: 2px; }

/* ---------- 主栅格 ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(1.1rem, 3vw, 2.2rem);
  align-items: start;
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(1.3rem, 4vw, 2.4rem) var(--pad);
}

main { min-width: 0; }

.entry { min-width: 0; }

.prose {
  padding: clamp(1rem, 3.2vw, 2.1rem);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: var(--glass-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.prose > section[id] {
  padding-block: 1.8rem;
  border-top: 1px solid var(--hair);
  scroll-margin-top: 9rem;
  animation: rise 0.5s both;
}

.prose > section[id]:first-child { border-top: 0; padding-top: 0.2rem; }

.prose h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.2rem, 3.4vw, 1.5rem);
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #fff;
}

.prose h2::after {
  content: "";
  display: block;
  width: 2.6rem;
  height: 3px;
  margin-top: 0.6rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--red), var(--violet));
}

.prose h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1.08rem;
  color: #ffe9e7;
}

.prose p { margin: 0 0 1rem; }

.prose ul,
.prose ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }

.prose li { margin-bottom: 0.4rem; }

.prose li::marker { color: #d3b0ff; }

.prose a {
  color: #ffd2d2;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 0, 0, 0.5);
}

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

.prose strong { color: #fff; }

.prose blockquote {
  margin: 0 0 1.1rem;
  padding: 0.6rem 1rem;
  border-left: 2px solid var(--violet);
  background: rgba(255, 255, 255, 0.05);
  color: var(--dim);
}

.prose table {
  width: 100%;
  margin-bottom: 1.1rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--hair);
  text-align: left;
}

.prose img { border-radius: var(--radius); }

/* ---------- 侧栏 ---------- */
.side {
  padding: 1rem 1rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.side-title {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  letter-spacing: 0.18em;
  color: #ffe4e2;
}

.side hr {
  margin: 0 0 0.8rem;
  border: 0;
  border-top: 1px solid var(--line);
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: t;
}

.toc li {
  counter-increment: t;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  animation: rise 0.45s both;
}

.toc li:nth-child(2) { animation-delay: 0.04s; }
.toc li:nth-child(3) { animation-delay: 0.08s; }
.toc li:nth-child(4) { animation-delay: 0.12s; }
.toc li:nth-child(5) { animation-delay: 0.16s; }
.toc li:nth-child(6) { animation-delay: 0.2s; }
.toc li:nth-child(7) { animation-delay: 0.24s; }

.toc li:first-child { border-top: 0; }

.toc a {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.55rem 0;
  font-size: 0.94rem;
  color: var(--dim);
  text-decoration: none;
}

.toc a::before {
  content: counter(t, decimal-leading-zero);
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: #cf9bff;
}

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

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.2rem 2rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.8rem var(--pad) 2.6rem;
  border-top: 1px solid var(--line);
}

.foot-brand { flex: 1 1 9rem; }

.foot-nav { flex: 2 1 18rem; }

.foot-nav dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1.1rem;
  margin: 0;
}

.foot-nav dt {
  flex: 1 1 100%;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  color: var(--faint);
}

.foot-nav dd { margin: 0; }

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.92rem;
  color: var(--dim);
  text-decoration: none;
}

.foot-nav a:hover { color: #fff; }

.foot-sub { flex: 1 1 14rem; }

.sub {
  display: flex;
  gap: 0.5rem;
}

.sub-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 0.45rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
}

.sub-input::placeholder { color: var(--faint); }

.sub-btn {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0.45rem 0.95rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: #1d1010;
  background: linear-gradient(135deg, #ff8a8a, #d9b3ff);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
  cursor: pointer;
}

.foot-legal {
  flex: 1 1 12rem;
  align-self: center;
  text-align: center;
}

.foot-legal p { margin: 0; }

.copy { font-size: 0.92rem; letter-spacing: 0.06em; }

.note { font-size: 0.82rem; color: var(--faint); }

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { order: 2; }
  main { order: 1; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero-in { min-height: 0; padding-block: 1.5rem 1.7rem; }
  .hero-art { width: 76px; }
  .find-label { display: none; }
  .foot { flex-direction: column; gap: 1rem; }
  .foot-legal { align-self: stretch; text-align: left; }
  .toc { columns: 1; }
}

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

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