:root {
  --paper: #f4f6f3;
  --paper-deep: #e9ede8;
  --ink: #17251f;
  --muted: #66706b;
  --line: #d5dbd5;
  --accent: #a7c46b;
  --accent-dark: #365846;
  --white: #fbfcfa;
  --shadow: 0 18px 42px rgba(29, 49, 40, 0.09);
  --max-width: 1420px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; }
a { color: inherit; }

.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;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid rgba(213, 219, 213, 0.86);
  background: rgba(244, 246, 243, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}

.brand-mark {
  width: 37px;
  height: 37px;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 9px;
  color: var(--white);
  background: var(--ink);
  border-radius: 5px;
}

.brand-mark i { width: 4px; background: var(--accent); }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 12px; }
.brand strong { display: block; font-size: 16px; line-height: 1.1; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; letter-spacing: 1.35px; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #6e9b52; box-shadow: 0 0 0 4px rgba(110, 155, 82, 0.12); }
.header-divider { width: 1px; height: 14px; margin: 0 6px; background: var(--line); }

main { min-height: calc(100vh - 184px); }

.intro {
  position: relative;
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 80px;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 66px 28px 58px;
}

.intro::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 1px;
  background: linear-gradient(var(--line) 55%, transparent 55%);
  background-size: 1px 8px;
  opacity: .8;
}

.intro-copy { padding-left: 46px; }
.eyebrow, .section-kicker { margin: 0 0 20px; color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: 1.9px; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow span { width: 22px; height: 2px; background: var(--accent); }

h1 {
  max-width: 790px;
  margin: 0;
  font-family: "Songti SC", SimSun, serif;
  font-size: clamp(43px, 5vw, 72px);
  line-height: 1.12;
  font-weight: 600;
}

h1 em { color: var(--accent-dark); font-style: normal; }
.intro-text { max-width: 610px; margin: 26px 0 0; color: var(--muted); font-size: 16px; line-height: 1.9; }

.intro-index {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 0 20px 44px;
  border-left: 1px solid var(--line);
}

.index-label, .index-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1.3px; }
.index-number { display: flex; align-items: baseline; gap: 14px; margin: 30px 0 19px; }
.index-number strong { font-family: Georgia, serif; font-size: 92px; line-height: .8; font-weight: 400; }
.index-number span { color: var(--muted); font-size: 12px; }
.index-track { height: 4px; margin-bottom: 14px; overflow: hidden; background: var(--line); }
.index-track span { display: block; width: 72%; height: 100%; background: var(--accent); }

.catalog {
  padding: 55px max(28px, calc((100vw - var(--max-width)) / 2)) 90px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.catalog-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.section-kicker { margin-bottom: 8px; }
h2 { margin: 0; font-family: "Songti SC", SimSun, serif; font-size: 34px; font-weight: 600; }

.search-box {
  width: min(420px, 100%);
  height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: #fff;
}

.search-box:focus-within { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(54, 88, 70, .08); }
.search-box svg { width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-box input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #929b96; }
.search-box kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: var(--paper); font-size: 10px; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 35px 0 20px; }
.filter-button {
  min-height: 35px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}
.filter-button:hover { color: var(--ink); border-color: #9fa9a3; }
.filter-button.is-active { color: var(--white); border-color: var(--ink); background: var(--ink); }

.result-line { display: flex; justify-content: space-between; padding: 15px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .5px; }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.resource-card {
  position: relative;
  min-width: 0;
  height: 330px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(23, 37, 31, .03);
  text-decoration: none;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.resource-card:hover { transform: translateY(-4px); border-color: #b8c2bc; box-shadow: var(--shadow); }
.card-visual { position: relative; height: 134px; flex: 0 0 134px; overflow: hidden; background: var(--card-bg, #e5ebe5); }
.card-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(19, 34, 27, .12)); }
.card-visual img { width: 100%; height: 100%; display: block; object-fit: cover; filter: saturate(.72) contrast(.93); transition: transform .35s ease; }
.resource-card:hover .card-visual img { transform: scale(1.035); }
.visual-pattern { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px); background-size: 25px 25px; }
.visual-glyph { position: absolute; right: 21px; bottom: 10px; z-index: 1; color: rgba(255, 255, 255, .78); font-family: Georgia, serif; font-size: 68px; line-height: 1; }
.card-code { position: absolute; top: 14px; left: 15px; z-index: 2; padding: 5px 7px; color: var(--ink); background: rgba(250,252,249,.82); backdrop-filter: blur(7px); font-size: 9px; font-weight: 800; letter-spacing: 1px; }

.card-body { min-height: 0; flex: 1; display: flex; flex-direction: column; padding: 20px 20px 17px; }
.card-category { margin: 0 0 9px; color: var(--accent-dark); font-size: 9px; font-weight: 800; letter-spacing: 1.25px; }
.card-body h3 { margin: 0; font-family: "Songti SC", SimSun, serif; font-size: 20px; line-height: 1.3; font-weight: 700; }
.card-description { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 13px; border-top: 1px solid #e6eae6; color: var(--muted); font-size: 10px; }
.card-enter { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 700; }
.card-enter span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: var(--white); background: var(--ink); transition: transform .2s ease; }
.resource-card:hover .card-enter span { transform: translateX(2px); }

.empty-state { padding: 70px 20px; border: 1px dashed var(--line); text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state span { margin-top: 8px; color: var(--muted); font-size: 13px; }

.site-footer {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px max(28px, calc((100vw - var(--max-width)) / 2));
  color: #bec8c1;
  background: var(--ink);
}
.site-footer strong, .site-footer span { display: block; }
.site-footer strong { color: var(--white); font-size: 13px; }
.site-footer div > span { margin-top: 7px; font-size: 10px; }
.site-footer a { display: flex; align-items: center; gap: 10px; font-size: 11px; text-decoration: none; }
.site-footer a span { color: var(--accent); font-size: 18px; }

.feedback-trigger {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 18;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: var(--ink);
  box-shadow: 0 10px 28px rgba(23, 37, 31, 0.2);
  color: var(--white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.feedback-trigger:hover {
  background: var(--accent-dark);
  box-shadow: 0 12px 32px rgba(23, 37, 31, 0.26);
  transform: translateY(-2px);
}

.feedback-trigger:focus-visible,
.feedback-close:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.feedback-dialog {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 28px 72px rgba(16, 29, 23, 0.28);
  color: var(--ink);
}

.feedback-dialog::backdrop {
  background: rgba(12, 22, 18, 0.58);
  backdrop-filter: blur(4px);
}

.feedback-panel {
  position: relative;
  padding: 28px;
}

.feedback-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.feedback-close:hover { background: var(--paper-deep); }

.feedback-heading { padding-right: 48px; }
.feedback-heading p { margin: 0 0 8px; color: var(--accent-dark); font-size: 9px; font-weight: 800; letter-spacing: 1.6px; }
.feedback-heading h2 { font-size: 28px; line-height: 1.2; }
.feedback-heading span { display: block; margin-top: 9px; color: var(--muted); font-size: 12px; }

.feedback-qr { margin: 22px 0 0; }
.feedback-qr img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.feedback-qr figcaption { margin-top: 10px; color: var(--muted); font-size: 11px; text-align: center; }

body.feedback-open { overflow: hidden; }

@media (max-width: 1120px) {
  .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intro { grid-template-columns: minmax(0, 1fr) 280px; gap: 50px; }
}

@media (max-width: 800px) {
  .site-header { height: 68px; padding: 0 20px; }
  .header-meta span:not(.status-dot) { display: none; }
  .header-divider { display: none; }
  .intro { min-height: auto; display: block; padding: 54px 20px 45px; }
  .intro::before { left: 20px; }
  .intro-copy { padding-left: 24px; }
  h1 { font-size: 43px; }
  .intro-index { margin: 45px 0 0 24px; padding: 28px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .index-number strong { font-size: 70px; }
  .catalog { padding: 42px 20px 65px; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .brand small { display: none; }
  h1 { font-size: 38px; }
  .intro-text { font-size: 14px; }
  .filter-row { flex-wrap: nowrap; margin-right: -20px; padding-right: 20px; overflow-x: auto; scrollbar-width: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-button { flex: 0 0 auto; }
  .result-line span:last-child { display: none; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-card { height: 338px; }
  .card-visual { height: 142px; flex-basis: 142px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .feedback-trigger {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    min-height: 40px;
    padding: 0 13px;
  }
  .feedback-panel { padding: 22px; }
  .feedback-close { top: 10px; right: 10px; }
}

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