:root {
  color-scheme: light;
  --ink: #18231f;
  --ink-soft: #4d5b55;
  --paper: #f4f1e8;
  --paper-deep: #e9e3d4;
  --card: #fffdf7;
  --line: #d8d1c1;
  --green: #174c3a;
  --green-soft: #dce9df;
  --orange: #d96732;
  --orange-soft: #f8e2d4;
  --yellow-soft: #f4eecf;
  --shadow: 0 16px 48px rgba(24, 35, 31, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}

a {
  color: var(--green);
}

button,
input,
select {
  font: inherit;
}

.hero {
  position: relative;
  overflow: hidden;
  color: #f8f3e8;
  background:
    radial-gradient(circle at 78% 20%, rgba(234, 144, 79, 0.26), transparent 25rem),
    linear-gradient(135deg, #113e31, #153329 70%);
}

.hero::after {
  content: "";
  position: absolute;
  width: 30rem;
  height: 30rem;
  right: -8rem;
  bottom: -18rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 4rem rgba(255, 255, 255, 0.025), 0 0 0 8rem rgba(255, 255, 255, 0.02);
}

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

.hero__inner {
  position: relative;
  z-index: 1;
  padding: 3.5rem 0 5rem;
}

.hub-return {
  display: inline-flex;
  margin-bottom: 2.4rem;
  color: #dbe5de;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.hub-return:hover {
  color: #fff;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--orange);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero h1 span {
  color: #efb185;
}

.hero__summary {
  max-width: 720px;
  margin: 1.5rem 0;
  color: #dbe5de;
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.principles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.principles span {
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #eef4ef;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

main {
  padding: 0 0 6rem;
}

.search-panel {
  position: relative;
  z-index: 2;
  margin: -2.8rem 0 2.5rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.4rem;
}

.section-heading h2,
.stop-rule h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.result-count {
  flex: none;
  margin: 0;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 76, 58, 0.12);
}

.search-box svg {
  width: 1.25rem;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  padding: 1rem 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 16rem);
  gap: 1.2rem;
  margin-top: 1.3rem;
}

.filter-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.segmented button,
select {
  min-height: 2.65rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: var(--ink);
  background: #fff;
}

.segmented button {
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.segmented button:hover,
.segmented button.is-active {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

select {
  width: 100%;
  padding: 0.45rem 0.75rem;
}

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

.entry-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 1rem;
  background: var(--card);
}

.entry-card--medium {
  border-top-color: #b68828;
}

.entry-card--high {
  border-top-color: var(--orange);
}

.entry-card__meta,
.entry-card__footer,
.source-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.kind,
.risk,
.pill,
.original-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.kind,
.risk {
  padding: 0.35rem 0.62rem;
}

.kind {
  color: var(--green);
  background: var(--green-soft);
}

.risk {
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.risk--high {
  color: #8e3516;
  background: var(--orange-soft);
}

.entry-card h3,
.source-card h3 {
  margin: 1rem 0 0.55rem;
  font-size: 1.24rem;
  line-height: 1.35;
}

.entry-card__summary,
.source-card > p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pill {
  padding: 0.25rem 0.55rem;
  color: var(--green);
  background: #edf3ed;
}

.pill--muted {
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.entry-block {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.entry-block h4 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
}

.entry-block ul,
.entry-block ol,
.caution ul {
  margin: 0;
  padding-left: 1.25rem;
}

.entry-block li,
.caution li {
  margin: 0.3rem 0;
}

.entry-block--steps li::marker {
  color: var(--orange);
  font-weight: 800;
}

.caution {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.7rem;
  color: #5a3b11;
  background: var(--yellow-soft);
  font-size: 0.86rem;
}

.caution strong {
  display: block;
  margin-bottom: 0.25rem;
}

.entry-card__footer {
  align-items: end;
  margin-top: auto;
  padding-top: 1.2rem;
}

.review-date,
.original-label {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.45rem;
}

.source-links a,
.source-card__open {
  font-size: 0.76rem;
  font-weight: 700;
  text-underline-offset: 0.18em;
}

.empty-state,
.error-state {
  padding: 4rem 1rem;
  text-align: center;
}

.empty-state p,
.error-state p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.empty-state span,
.error-state span {
  color: var(--ink-soft);
}

.source-section {
  margin-top: 6rem;
  padding-top: 4rem;
  border-top: 1px solid var(--line);
}

.source-note {
  max-width: 28rem;
  margin: 0;
  color: var(--ink-soft);
  text-align: right;
}

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

.source-card {
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(255, 253, 247, 0.58);
}

.source-card__title h3 {
  margin-top: 0;
}

.source-card dl {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.35rem 0.7rem;
  margin: 1rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
}

.source-card dt {
  color: var(--ink-soft);
}

.source-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.stop-rule {
  margin-top: 5rem;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border-radius: 1.25rem;
  color: #f8f3e8;
  background: var(--green);
}

.stop-rule h2 {
  max-width: 750px;
}

.stop-rule > p:last-child {
  max-width: 800px;
  margin: 1.3rem 0 0;
  color: #dbe7df;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

footer p {
  margin: 0;
}

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

@media (max-width: 850px) {
  .entry-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .section-heading,
  footer {
    align-items: start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .source-note {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .hero__inner {
    padding: 2.5rem 0 5rem;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  main {
    padding-top: 0;
  }

  .entry-card__footer {
    align-items: start;
    flex-direction: column;
  }

  .source-links {
    justify-content: start;
  }
}

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