/* FQ忠隆基金 — 夜藍閱讀風，紙頁結構參考 Arta */

:root {
  --navy: #071222;
  --navy-2: #10233c;
  --gold: #c6a36a;
  --gold-light: #e8d7b0;
  --gold-dark: #8d6840;
  --ivory: #f4efe4;
  --paper: #fbf8f1;
  --ink: #161410;
  --text: #2a261c;
  --text-secondary: #4a453a;
  --text-muted: #7a7366;
  --rule: #ddd4c4;
  --border: #d4cbb8;
  --header-h: 64px;
  --wrap: min(1080px, calc(100% - 48px));
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-display: "Noto Serif TC", "Source Han Serif TC", serif;
  --font-latin: "Cormorant Garamond", "Noto Serif TC", serif;
  --shadow: 0 18px 50px rgba(7, 18, 34, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--text);
  background: var(--ivory);
  letter-spacing: 0.015em;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.wrap { width: var(--wrap); margin-inline: auto; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  background: var(--gold);
  color: var(--navy);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 40% at 8% 0%, rgba(7, 18, 34, 0.08), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 12%, rgba(198, 163, 106, 0.14), transparent 50%),
    linear-gradient(180deg, #ebe4d4 0%, var(--ivory) 40%, #e8e0d0 100%);
}
.page-bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: repeating-linear-gradient(-18deg, transparent, transparent 3px, rgba(7, 18, 34, 0.02) 3px, rgba(7, 18, 34, 0.02) 4px);
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 130;
  pointer-events: none;
}
.reading-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid rgba(198, 163, 106, 0.28);
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-light);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.98rem;
}
.brand img { width: 36px; height: 36px; object-fit: contain; }
.nav { display: flex; gap: 4px 18px; }
.nav a {
  color: rgba(247, 243, 234, 0.72);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 4px 0;
}
.nav a:hover,
.nav a.is-active { color: var(--gold-light); }
.nav a.is-active::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 4px;
  background: var(--gold);
}
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(198, 163, 106, 0.35);
  position: relative;
}
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--gold-light);
}
.nav-toggle::before { top: 14px; box-shadow: 0 5px 0 var(--gold-light); }
.nav-toggle::after { bottom: 14px; opacity: 0; }
.nav-toggle[aria-expanded="true"]::before {
  top: 19px;
  box-shadow: none;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"]::after {
  opacity: 1;
  bottom: 19px;
  transform: rotate(-45deg);
}

.hero {
  position: relative;
  min-height: 100vh;
  padding: calc(var(--header-h) + 48px) 0 0;
  color: var(--ivory);
  background:
    radial-gradient(ellipse 80% 60% at 78% 18%, rgba(198, 163, 106, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 8% 80%, rgba(16, 35, 60, 0.85), transparent 52%),
    linear-gradient(165deg, #050d18 0%, var(--navy) 46%, #10243f 100%);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 28px;
  align-items: center;
  padding-bottom: 56px;
}
.hero__kicker {
  margin: 0 0 1rem;
  font-family: var(--font-latin);
  font-style: italic;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-size: 1.05rem;
}
.hero h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.08em;
  color: #fbf8f1;
}
.hero__en {
  margin: 0 0 0.85rem;
  font-family: var(--font-latin);
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--gold-light);
}
.hero__roles {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.hero__lede {
  margin: 0 0 1.5rem;
  max-width: 38em;
  color: rgba(247, 243, 234, 0.78);
}
.hero__stats {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: 440px;
  background: rgba(198, 163, 106, 0.28);
  border: 1px solid rgba(198, 163, 106, 0.28);
}
.hero__stats li {
  background: rgba(7, 18, 34, 0.55);
  padding: 0.9rem 0.6rem;
  text-align: center;
}
.hero__stats strong {
  display: block;
  font-family: var(--font-display);
  color: var(--gold-light);
  font-size: 1.15rem;
}
.hero__stats span {
  font-family: var(--font-latin);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.5);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.78rem 1.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  border: 1px solid transparent;
}
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--gold-light); }
.btn--ghost { color: var(--gold-light); border-color: rgba(198, 163, 106, 0.45); }
.btn--ghost:hover { border-color: var(--gold); color: #fff; }
.hero__visual { display: grid; place-items: center; min-height: 360px; }
.hero__visual img {
  width: min(100%, 420px);
  filter: drop-shadow(0 22px 48px rgba(0, 0, 0, 0.45));
}

.principles {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(198, 163, 106, 0.22);
  background: rgba(5, 13, 24, 0.55);
}
.principles li {
  padding: 1.15rem 1.15rem 1.25rem;
  border-right: 1px solid rgba(198, 163, 106, 0.16);
}
.principles li:last-child { border-right: 0; }
.principles span {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-latin);
  color: var(--gold);
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}
.principles strong {
  font-family: var(--font-display);
  color: #fbf8f1;
  font-weight: 600;
}

.section { padding: 3.2rem 0 0.4rem; }
.section--toc { padding-top: 2.6rem; }
.section__head { margin-bottom: 1.2rem; }
.section__label {
  margin: 0 0 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.section h2,
.chapter h2,
.closing-sheet h2 {
  margin: 0 0 1.05rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--navy);
  letter-spacing: 0.04em;
}

.doc-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.doc-toc li { border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.doc-toc li:nth-child(2n) { border-right: 0; }
.doc-toc li:nth-last-child(-n + 2) { border-bottom: 0; }
.doc-toc a {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 3.3rem;
  padding: 0.85rem 1.1rem;
  color: var(--text);
  font-size: 0.92rem;
}
.doc-toc a:hover { background: rgba(198, 163, 106, 0.12); color: var(--navy); }
.doc-toc__idx {
  font-family: var(--font-latin);
  color: var(--gold-dark);
  font-weight: 600;
  text-align: center;
}

.part-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem 1rem;
  align-items: center;
  margin: 2.4rem auto 0.2rem;
  padding: 1.15rem 1.3rem;
  background: var(--navy);
  color: var(--ivory);
  box-shadow: var(--shadow);
}
.part-banner__mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(198, 163, 106, 0.5);
  font-family: var(--font-latin);
  color: var(--gold-light);
  font-size: 1.15rem;
}
.part-banner__title {
  margin: 0 0 0.15rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}
.part-banner__sub { margin: 0; font-size: 0.86rem; color: rgba(232, 215, 176, 0.75); }

.paper-sheet,
.closing-sheet {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: clamp(1.8rem, 4vw, 2.8rem) clamp(1.4rem, 4vw, 2.8rem);
  overflow: hidden;
}
.paper-sheet { border-top: 3px solid var(--navy); }
.closing-sheet { border-bottom: 3px solid var(--navy); }
.chapter { padding-bottom: 1.4rem; scroll-margin-top: 84px; }
.chapter__watermark {
  position: absolute;
  top: 0.15rem;
  right: 1rem;
  font-family: var(--font-latin);
  font-size: clamp(4.4rem, 12vw, 7.2rem);
  line-height: 1;
  color: rgba(7, 18, 34, 0.055);
  pointer-events: none;
  user-select: none;
}
.prose h3 {
  margin: 1.45rem 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--navy);
  letter-spacing: 0.04em;
}
.prose p { margin: 0 0 1.05rem; color: var(--text-secondary); }
.prose p:last-child { margin-bottom: 0; }
.points {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  border-left: 1px solid var(--gold);
}
.points li {
  padding: 0.55rem 0 0.55rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-display);
  color: var(--ink);
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0.2rem 0 1.2rem;
}
.cards article {
  padding: 0.95rem 1.05rem 0.15rem;
  background: #fffdf8;
  border: 1px solid var(--border);
  border-top: 2px solid var(--navy);
}
.cards h3 { margin-top: 0.15rem; }
.pull-quote {
  margin: 1.3rem 0;
  padding: 1rem 0 1rem 1.15rem;
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgba(198, 163, 106, 0.12), transparent 78%);
}
.pull-quote p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--ink);
}
.manifesto {
  margin: 1.5rem 0 1.2rem;
  padding: 1.4rem 1.4rem 1.25rem;
  background: var(--navy);
  color: var(--gold-light);
}
.manifesto p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 2.4vw, 1.35rem);
  line-height: 1.75;
  letter-spacing: 0.05em;
  color: var(--gold-light);
}
.closing-sheet__tagline {
  margin: 0;
  text-align: center;
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--gold-dark);
}
.section--closing { padding-bottom: 3.5rem; }

.site-footer {
  background: var(--navy);
  color: rgba(247, 243, 234, 0.62);
  padding: 1.7rem 0 2rem;
  border-top: 1px solid rgba(198, 163, 106, 0.25);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  align-items: flex-start;
}
.footer-brand strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-display);
  color: var(--gold-light);
  letter-spacing: 0.06em;
}
.footer-brand span,
.footer-note { font-size: 0.78rem; line-height: 1.65; }
.footer-note { margin: 0.45rem 0 0; max-width: 46em; }
.footer-top { color: var(--gold); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; white-space: nowrap; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 90;
    flex-direction: column;
    background: var(--navy);
    border-bottom: 1px solid rgba(198, 163, 106, 0.28);
    padding: 8px 0 14px;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 22px; font-size: 0.95rem; }
  .nav a.is-active::after { display: none; }
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; min-height: 260px; }
  .hero__visual img { width: min(280px, 72vw); margin: 0 auto; }
  .principles { grid-template-columns: 1fr 1fr; }
  .principles li:nth-child(2) { border-right: 0; }
  .principles li:nth-child(-n + 2) { border-bottom: 1px solid rgba(198, 163, 106, 0.16); }
}
@media (max-width: 700px) {
  :root { --wrap: min(100%, calc(100% - 28px)); }
  .doc-toc { grid-template-columns: 1fr; }
  .doc-toc li { border-right: 0; }
  .doc-toc li:nth-last-child(-n + 2) { border-bottom: 1px solid var(--rule); }
  .doc-toc li:last-child { border-bottom: 0; }
  .cards { grid-template-columns: 1fr; }
  .hero__stats { grid-template-columns: 1fr; max-width: none; }
  .principles { grid-template-columns: 1fr; }
  .principles li { border-right: 0; border-bottom: 1px solid rgba(198, 163, 106, 0.16); }
  .footer-inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
