:root {
  color-scheme: light;
  --ink: #162321;
  --muted: #60706c;
  --paper: #f7f7f2;
  --surface: #ffffff;
  --line: #d9e0dc;
  --green: #0f5145;
  --green-soft: #dff0e9;
  --gold: #d9a441;
  --blue-soft: #e2edf6;
  --shadow: 0 18px 45px rgba(18, 52, 45, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--green);
  border-radius: 0.5rem;
}

.skip-link:focus { top: 1rem; }

.hero {
  position: relative;
  overflow: hidden;
  color: white;
  background: linear-gradient(125deg, #0b302b 0%, #10584a 64%, #18715e 100%);
}

.hero::after {
  content: "";
  position: absolute;
  width: 28rem;
  height: 28rem;
  right: -9rem;
  top: -15rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem rgba(255,255,255,.035), 0 0 0 10rem rgba(255,255,255,.025);
}

.hero__inner, main, footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero__inner { position: relative; z-index: 1; padding: 3rem 0 2.5rem; }

.brand { display: flex; align-items: center; gap: 1rem; }

.brand__mark {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 1rem;
  color: #103c34;
  background: #f4d07c;
  font-weight: 800;
  letter-spacing: -.04em;
}

.eyebrow {
  margin: 0 0 .25rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  opacity: .72;
}

h1, h2, h3, p { margin-top: 0; }

h1 { margin-bottom: 0; font-size: clamp(1.85rem, 4vw, 3.1rem); line-height: 1.15; letter-spacing: -.03em; }

.hero__copy { max-width: 43rem; margin: 1.4rem 0 2rem; color: rgba(255,255,255,.82); font-size: 1.05rem; }

.summary { display: flex; gap: 2.75rem; }

.summary div { display: flex; align-items: baseline; gap: .55rem; }
.summary strong { color: #f7d98f; font-family: Georgia, serif; font-size: 2rem; line-height: 1; }
.summary span { color: rgba(255,255,255,.7); font-size: .84rem; }

main { padding: 2.25rem 0 4rem; }

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.7rem;
}

.search-wrap { width: min(35rem, 100%); }
.search-wrap label, .filters legend { display: block; margin-bottom: .5rem; color: var(--muted); font-size: .8rem; font-weight: 700; }

.search-control { position: relative; }
.search-control span { position: absolute; left: 1rem; top: 50%; transform: translateY(-55%); color: var(--green); font-size: 1.35rem; }

input[type="search"] {
  width: 100%;
  height: 3.25rem;
  padding: 0 1rem 0 2.8rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  box-shadow: 0 7px 20px rgba(28, 53, 48, .04);
}

input[type="search"]:focus { border-color: #3a8876; box-shadow: 0 0 0 3px rgba(58,136,118,.14); }

.filters { display: flex; gap: .45rem; margin: 0; padding: 0; border: 0; }

.filter {
  padding: .66rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
}

.filter span { margin-left: .2rem; opacity: .65; }
.filter:hover, .filter:focus-visible { border-color: #6e9f92; color: var(--green); }
.filter.is-active { border-color: var(--green); color: white; background: var(--green); }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 1.1rem; }
.section-heading h2 { margin: 0; font-size: 1.6rem; }
.section-heading > p { margin: 0; color: var(--muted); font-size: .88rem; }

.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.document-card {
  display: flex;
  min-width: 0;
  min-height: 25rem;
  flex-direction: column;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(20,45,40,.02);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.document-card:hover { transform: translateY(-3px); border-color: #b8ccc6; box-shadow: var(--shadow); }
.document-card[hidden] { display: none; }
.document-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.35rem; }

.pdf-badge {
  display: inline-flex;
  padding: .35rem .55rem;
  border-radius: .38rem;
  color: #873b32;
  background: #f7e6e1;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.type-tag { padding: .3rem .6rem; border-radius: 999px; color: #1f6455; background: var(--green-soft); font-size: .72rem; font-weight: 700; }
.type-tag--blue { color: #275e7e; background: var(--blue-soft); }
.document-card h3 { margin-bottom: .12rem; font-size: 1.25rem; letter-spacing: -.01em; }
.english-name { min-height: 2.5rem; margin-bottom: 1.1rem; color: var(--muted); font-family: Georgia, serif; font-size: .9rem; font-style: italic; line-height: 1.35; }

dl { margin: 0 0 1.35rem; }
dl div { display: grid; grid-template-columns: 4.1rem minmax(0, 1fr); gap: .35rem; padding: .58rem 0; border-top: 1px solid #edf0ee; font-size: .81rem; }
dt { color: #73807c; }
dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: #273b36; font-weight: 650; }

.document-card__actions { display: flex; gap: .55rem; margin-top: auto; }
.document-card__actions a { flex: 1; padding: .68rem .75rem; border-radius: .65rem; text-align: center; text-decoration: none; font-size: .84rem; font-weight: 750; }
.primary { color: white; background: var(--green); }
.secondary { border: 1px solid var(--line); color: var(--green); background: white; }
.primary:hover, .primary:focus-visible { background: #0a3c33; }
.secondary:hover, .secondary:focus-visible { border-color: var(--green); background: #f2f7f5; }

.empty-state { padding: 4rem 1rem; border: 1px dashed #b8c7c2; border-radius: 1rem; text-align: center; background: rgba(255,255,255,.45); }
.empty-state strong { font-size: 1.1rem; }
.empty-state p { margin: .35rem 0 1rem; color: var(--muted); }
.empty-state button { padding: .6rem 1rem; border: 0; border-radius: .6rem; color: white; background: var(--green); cursor: pointer; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
footer p { margin: 0; }

.not-found-page { display: grid; min-height: 100vh; place-items: center; }
.not-found { max-width: 32rem; padding: 2rem; text-align: center; }
.not-found__code { color: var(--green); font: 700 5rem/1 Georgia, serif; }
.not-found a { display: inline-block; margin-top: 1rem; padding: .7rem 1rem; border-radius: .65rem; color: white; background: var(--green); text-decoration: none; }

@media (max-width: 900px) {
  .toolbar { align-items: stretch; flex-direction: column; }
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .hero__inner { padding-top: 2rem; }
  .summary { gap: 1rem; justify-content: space-between; }
  .summary div { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .document-grid { grid-template-columns: 1fr; }
  .document-card { min-height: auto; }
  .filters { flex-wrap: wrap; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: .4rem; }
  footer { flex-direction: column; }
}

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