:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #66706c;
  --paper: #f5f6f4;
  --white: #ffffff;
  --line: #d9deda;
  --green: #174c3c;
  --green-soft: #dfece7;
  --red: #a54032;
  --gold: #c29a4a;
  --max-width: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  line-height: 1.65;
}
button, input { font: inherit; }
a { color: inherit; }
img { display: block; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(23, 32, 29, .12);
  background: rgba(255, 255, 255, .96);
}
.header-inner {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--green);
  border-radius: 4px;
}
.brand-mark img { width: 19px; filter: invert(1); }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: #39423f;
  text-decoration: none;
  font-size: 14px;
}
.nav-links a:hover { color: var(--red); }

.intro-band {
  min-height: 480px;
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.intro-inner {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
  align-items: center;
  gap: 72px;
}
.eyebrow, .section-index {
  margin: 0 0 16px;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}
h1 {
  margin: 0;
  max-width: 8em;
  font-family: "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  font-size: clamp(48px, 7vw, 82px);
  line-height: 1.08;
  font-weight: 700;
}
.intro-text {
  max-width: 31em;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 18px;
}
.archive-visual {
  position: relative;
  width: 100%;
  height: 310px;
}
.folder {
  position: absolute;
  left: 0;
  right: 0;
  height: 150px;
  padding: 28px 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border: 1px solid rgba(23, 32, 29, .18);
  box-shadow: 0 16px 35px rgba(23, 32, 29, .08);
  border-radius: 6px 6px 3px 3px;
  font-size: 14px;
}
.folder::before {
  content: "";
  position: absolute;
  left: 24px;
  top: -18px;
  width: 112px;
  height: 19px;
  background: inherit;
  border: inherit;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}
.folder b { font-family: Georgia, serif; font-size: 32px; font-weight: 400; }
.folder-back { top: 18px; background: #d8c184; transform: rotate(-4deg); }
.folder-middle { top: 86px; background: #c9d9d2; transform: rotate(3deg); }
.folder-front { top: 154px; background: #fafafa; }

.library, .about {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 88px 0;
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}
h2 {
  margin: 0;
  font-family: "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  font-size: 34px;
  line-height: 1.25;
}
.result-count { margin: 0; color: var(--muted); font-size: 14px; }
.library-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.search-box {
  width: min(440px, 100%);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #c8cfca;
  background: var(--white);
  border-radius: 5px;
}
.search-box:focus-within { outline: 2px solid rgba(23, 76, 60, .22); border-color: var(--green); }
.search-box img { width: 18px; opacity: .58; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filter-tabs { display: flex; gap: 3px; }
.filter-button {
  min-width: 58px;
  min-height: 38px;
  padding: 6px 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
}
.filter-button:hover { color: var(--ink); background: #e9ece9; }
.filter-button.active { color: var(--white); background: var(--green); }
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 28px;
}
.resource-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  padding: 25px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
}
.resource-card:hover { border-color: #9da8a2; transform: translateY(-2px); transition: transform .18s ease; }
.resource-top { display: flex; align-items: center; justify-content: space-between; }
.resource-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  border-radius: 5px;
}
.resource-icon img { width: 20px; }
.resource-tag { color: var(--red); font-size: 12px; font-weight: 700; }
.resource-card h3 { margin: 28px 0 10px; font-size: 20px; line-height: 1.35; }
.resource-card p { margin: 0; color: var(--muted); font-size: 14px; }
.read-button {
  margin-top: auto;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid #e7eae8;
  background: transparent;
  color: var(--green);
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}
.read-button:hover { color: var(--red); }
.empty-state { padding: 64px 0; text-align: center; color: var(--muted); }
.empty-state img { width: 36px; margin: 0 auto 12px; opacity: .45; }

.principles-band { background: var(--green); color: var(--white); }
.principles-inner { width: min(calc(100% - 40px), var(--max-width)); margin: 0 auto; padding: 88px 0; }
.light-heading .section-index { color: #e6c77f; }
.principle-list { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid rgba(255,255,255,.24); }
.principle-list li {
  display: grid;
  grid-template-columns: 70px 180px 1fr;
  align-items: baseline;
  gap: 20px;
  padding: 25px 0;
  border-bottom: 1px solid rgba(255,255,255,.24);
}
.principle-list span { color: #e6c77f; font-family: Georgia, serif; }
.principle-list strong { font-size: 19px; }
.principle-list p { margin: 0; color: #cbdad5; }
.about { max-width: 780px; margin-left: max(20px, calc((100% - var(--max-width)) / 2)); }
.about p:last-child { max-width: 42em; color: var(--muted); font-size: 17px; }

.site-footer {
  min-height: 90px;
  padding: 24px max(20px, calc((100% - var(--max-width)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
}
.footer-meta, .footer-records { display: flex; align-items: center; gap: 22px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--red); text-decoration: underline; }
.footer-records a { display: inline-flex; align-items: center; gap: 6px; }
.footer-records img { flex: 0 0 18px; }

.article-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 40px));
  padding: 42px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0,0,0,.24);
}
.article-dialog::backdrop { background: rgba(18, 25, 23, .62); }
.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
}
.dialog-close img { width: 18px; }
.dialog-meta { color: var(--red); font-size: 12px; font-weight: 700; }
.dialog-body { margin-top: 24px; color: #3e4844; }
.dialog-body h3 { margin: 26px 0 8px; color: var(--ink); font-size: 17px; }
.dialog-body ol, .dialog-body ul { padding-left: 1.3em; }
.dialog-body code { padding: 2px 5px; background: #eef0ee; border-radius: 3px; }

@media (max-width: 800px) {
  .header-inner { width: min(calc(100% - 28px), var(--max-width)); }
  .nav-links { gap: 14px; }
  .nav-links a:last-child { display: none; }
  .intro-band { min-height: 620px; }
  .intro-inner { width: min(calc(100% - 28px), var(--max-width)); grid-template-columns: 1fr; gap: 42px; padding: 64px 0 38px; }
  h1 { font-size: 52px; }
  .archive-visual { height: 240px; }
  .folder { height: 112px; padding: 20px; }
  .folder-back { top: 12px; }
  .folder-middle { top: 62px; }
  .folder-front { top: 112px; }
  .library, .principles-inner, .about { width: min(calc(100% - 28px), var(--max-width)); padding: 64px 0; margin-left: auto; margin-right: auto; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  h2 { font-size: 29px; }
  .library-tools { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .filter-tabs { overflow-x: auto; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-card { min-height: 250px; }
  .principle-list li { grid-template-columns: 44px 90px 1fr; gap: 12px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .footer-meta, .footer-records { align-items: flex-start; flex-direction: column; gap: 3px; }
  .article-dialog { padding: 36px 24px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .resource-card:hover { transform: none; }
}
