:root {
  --ink: #202622;
  --muted: #737c76;
  --paper: #f3f5f2;
  --white: #ffffff;
  --line: #d6ddd8;
  --line-strong: #bac6be;
  --green: #2f7148;
  --green-dark: #1f5134;
  --green-soft: #e8f2eb;
  --green-pale: #f4f8f5;
  --amber: #a96f27;
  --side: #edf0ed;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Songti SC", STSong, "Noto Serif CJK SC", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(47, 113, 72, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 113, 72, .025) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: var(--font-sans);
}

button,
input { font: inherit; }
button,
a { -webkit-tap-highlight-color: transparent; }
button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(47, 113, 72, .48);
  outline-offset: 2px;
}

.topbar {
  height: 68px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid #ccd4ce;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.brand img { border-radius: 5px; }
.brand-copy { display: flex; align-items: baseline; gap: 7px; }
.brand-copy strong { font-family: var(--font-serif); font-size: 20px; }
.brand-copy small { color: var(--muted); font-size: 11px; font-weight: 700; }

.topnav { height: 100%; margin-left: 56px; display: flex; }
.topnav a {
  padding: 0 21px;
  display: grid;
  place-items: center;
  border-bottom: 3px solid transparent;
  color: #6e7771;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.topnav a.active { border-color: var(--green); color: var(--green); }
.topnav a:hover { color: var(--green-dark); background: var(--green-pale); }

.data-status {
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid #bdc9c1;
  color: #526159;
  background: #f7f9f7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
}

.app-shell {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
}

.sidebar {
  min-width: 0;
  border-right: 1px solid #ccd4ce;
  background: rgba(235, 239, 235, .95);
}
.sidebar-inner {
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
}
.sidebar-title {
  height: 54px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #cfd7d1;
}
.sidebar-title strong { font-family: var(--font-serif); font-size: 17px; }
.sidebar-title span { color: #89918c; font-size: 10px; }
.side-home {
  width: calc(100% - 20px);
  height: 43px;
  margin: 10px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #28623f;
  border-radius: 4px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}
.side-home em { margin-left: auto; color: #dcebe1; font-size: 10px; font-style: normal; }

details.side-group { border-top: 1px solid #d1d8d3; }
details.side-group:last-of-type { border-bottom: 1px solid #d1d8d3; }
.side-group summary {
  height: 45px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #424b45;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 800;
}
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary .chevron { margin-left: auto; font-size: 20px; transition: transform .2s ease; }
.side-group[open] summary .chevron { transform: rotate(90deg); }
.side-options { padding: 0 10px 10px; }
.side-filter {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #536058;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
}
.side-filter:hover { border-color: #c8d1cb; background: #f8faf8; }
.side-filter.active { border-color: #aac2b2; color: var(--green-dark); background: #fff; font-weight: 800; }
.side-filter > span:first-child { width: 17px; color: #748179; text-align: center; font-size: 10px; }
.side-filter b { margin-left: auto; color: #8b958f; font-size: 9px; }
.sidebar-note {
  margin: 14px 12px 18px;
  padding: 13px;
  border: 1px solid #d1d9d3;
  border-left: 3px solid var(--green);
  color: #6d7771;
  background: rgba(255, 255, 255, .7);
  font-size: 10px;
  line-height: 1.7;
}

.content { min-width: 0; padding: 28px 30px 60px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 30px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--green); }
.hero h1 {
  margin: 8px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.hero p { max-width: 680px; margin: 10px 0 0; color: #69736d; font-size: 13px; line-height: 1.75; }
.stats { display: flex; border: 1px solid var(--line); background: #fff; }
.stats div { min-width: 92px; padding: 12px 15px; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats small { display: block; color: #8a928d; font-size: 9px; }
.stats strong { display: block; margin-top: 2px; color: var(--green); font-family: Georgia, serif; font-size: 22px; }

.category-gateway {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.category-gateway-card {
  min-height: 190px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid #b8c6bc;
  border-radius: 2px;
  color: #254533;
  background: linear-gradient(145deg, #f7fbf8 0%, #dfece3 100%);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 9px 25px rgba(31, 81, 52, .06);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
  animation: category-enter .48s ease both;
}
.category-gateway-card:nth-child(2) { animation-delay: .07s; }
.category-gateway-card:nth-child(3) { animation-delay: .14s; }
.category-gateway-card::after {
  content: "";
  width: 150px;
  height: 150px;
  position: absolute;
  right: -70px;
  bottom: -76px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: .12;
  transition: transform .35s ease;
}
.category-gateway-card:hover,
.category-gateway-card.active { z-index: 2; border-color: var(--green-dark); box-shadow: 0 18px 34px rgba(31, 81, 52, .17); transform: translateY(-5px); }
.category-gateway-card:hover::after,
.category-gateway-card.active::after { transform: scale(1.22); }
.category-gateway-card.tone-2 { border-color: var(--green-dark); color: #fff; background: linear-gradient(145deg, #315f42 0%, #173d28 100%); }
.category-gateway-card.tone-3 { background: linear-gradient(145deg, #edf2ed 0%, #cbdccf 100%); }
.category-card-index { color: currentColor; font-family: Georgia, serif; font-size: 12px; font-weight: 800; letter-spacing: .12em; opacity: .55; }
.category-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 18px;
  opacity: .82;
}
.category-card-copy { min-width: 0; display: flex; flex-direction: column; grid-column: 1 / 3; align-self: end; }
.category-card-copy small { margin-bottom: 7px; font-size: 9px; font-weight: 800; letter-spacing: .1em; opacity: .65; }
.category-card-copy strong { font-family: var(--font-serif); font-size: clamp(26px, 2.55vw, 41px); line-height: 1.04; letter-spacing: -.06em; white-space: nowrap; }
.category-card-copy em { margin-top: 13px; max-width: 250px; font-size: 10px; font-style: normal; line-height: 1.65; opacity: .68; }
.category-card-arrow { position: absolute; right: 22px; bottom: 20px; font-family: Georgia, serif; font-size: 24px; transition: transform .24s ease; }
.category-gateway-card:hover .category-card-arrow { transform: translateX(5px); }

.guide-bar {
  margin-top: 22px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #cfd8d1;
  color: #5d6961;
  background: rgba(255, 255, 255, .72);
  font-size: 11px;
}
.guide-icon { color: var(--green); font-size: 16px; }
.guide-bar b { color: #244d34; }
.guide-bar span:last-child { margin-left: auto; color: #939a96; font-size: 9px; }

.matrix-card { margin-top: 12px; border: 1px solid var(--line-strong); background: #fff; box-shadow: 0 8px 24px rgba(35, 56, 42, .045); }
.matrix-toolbar {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #f4f7f4;
}
.matrix-toolbar label {
  width: min(360px, 100%);
  height: 36px;
  display: flex;
  align-items: center;
  border: 1px solid #aebbb2;
  background: #fff;
}
.matrix-toolbar label:focus-within { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.matrix-toolbar label > span { margin: 0 11px; color: #667269; font-size: 18px; }
.matrix-toolbar input { width: 100%; height: 100%; padding-right: 10px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.toolbar-caption { color: #7b847f; font-size: 10px; }
.toolbar-caption b { color: var(--green); }
.text-button { margin-left: auto; padding: 7px 10px; border: 0; color: var(--green); background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; }
.text-button:hover { background: var(--green-soft); }
.matrix-scroll { overflow: auto; }
.matrix { width: 100%; min-width: 780px; border-collapse: collapse; table-layout: fixed; }
.matrix th,
.matrix td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.matrix tr:last-child th,
.matrix tr:last-child td { border-bottom: 0; }
.axis-corner { width: 170px; height: 78px; position: relative; color: #7d8780; background: #eef2ef; font-size: 9px; font-weight: 700; }
.axis-corner::after { content: ""; width: 116%; height: 1px; position: absolute; left: -8%; top: 50%; background: #cbd4ce; transform: rotate(24deg); }
.axis-corner span { position: absolute; z-index: 1; }
.axis-corner span:first-child { right: 14px; top: 14px; }
.axis-corner span:last-child { left: 14px; bottom: 14px; }
.category-head { height: 78px; background: #f8faf8; }
.category-head button {
  width: 100%;
  height: 100%;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  color: #344139;
  background: transparent;
  cursor: pointer;
}
.category-head button:hover,
.category-head button.active { color: var(--green-dark); background: var(--green-soft); }
.category-head b { font-family: var(--font-serif); font-size: 14px; }
.category-head small { color: #8b958f; font-size: 9px; font-weight: 500; }
.brand-head { width: 170px; background: #f4f7f4; }
.brand-head button {
  width: 100%;
  min-height: 58px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  color: #354139;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.brand-head button:hover,
.brand-head button.active { color: var(--green-dark); background: var(--green-soft); }
.brand-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 800; }
.brand-head small { margin-left: auto; color: #7e8982; font-family: Georgia, serif; font-size: 10px; }
.matrix-cell { height: 58px; padding: 5px; background: #fff; }
.matrix-cell button {
  width: 100%;
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid transparent;
  color: #a6ada8;
  background: transparent;
}
.matrix-cell button.has-data { color: var(--green-dark); background: #eef6f0; cursor: pointer; }
.matrix-cell button.has-data:hover,
.matrix-cell button.active { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.matrix-cell button.level-2 { background: #dcecdf; }
.matrix-cell button.level-3 { background: #c6dfcc; }
.matrix-cell button.level-4 { color: #fff; background: var(--green); }
.matrix-cell button span { font-family: Georgia, serif; font-size: 15px; font-weight: 800; }
.matrix-cell button small { font-size: 8px; opacity: .72; }
.matrix-legend { min-height: 37px; padding: 8px 12px; display: flex; align-items: center; gap: 5px; color: #7d8780; background: #f7f9f7; font-size: 9px; }
.matrix-legend i { width: 11px; height: 11px; border: 1px solid #c7d3ca; background: #eef6f0; }
.matrix-legend i:nth-of-type(2) { background: #dcecdf; }
.matrix-legend i:nth-of-type(3) { background: #c6dfcc; }
.matrix-legend i:nth-of-type(4) { background: var(--green); }
.matrix-legend b { margin-left: auto; color: #68736b; }

.result-section { margin-top: 30px; scroll-margin-top: 88px; }
.result-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.result-header h2 { margin: 0; font-family: var(--font-serif); font-size: 27px; }
.result-header p { margin: 6px 0 0; color: #758078; font-size: 11px; }
.clear-selection { padding: 8px 11px; border: 1px solid #bbc7bf; color: #667169; background: transparent; cursor: pointer; font-size: 10px; }
.clear-selection:hover { color: var(--green); border-color: var(--green); background: #fff; }
.result-tools { min-height: 49px; margin-top: 13px; padding: 8px 10px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #f4f7f4; color: #7b857f; font-size: 10px; }
.type-chip { padding: 6px 10px; border: 1px solid #c8d2cb; color: #667169; background: #fff; cursor: pointer; font-size: 10px; }
.type-chip:hover,
.type-chip.active { border-color: var(--green); color: #fff; background: var(--green); }
.result-count { margin-left: auto; }
.result-count b { color: var(--green); }
.result-table { border: 1px solid var(--line-strong); border-top: 0; background: #fff; overflow-x: auto; }
.result-row {
  min-width: 820px;
  display: grid;
  grid-template-columns: 58px minmax(320px, 1fr) 94px 120px 128px;
  border-bottom: 1px solid var(--line);
}
.result-row:last-child { border-bottom: 0; }
.result-row > * { min-width: 0; padding: 11px 12px; display: flex; align-items: center; border-right: 1px solid var(--line); }
.result-row > *:last-child { border-right: 0; }
.result-row.header { min-height: 39px; color: #59645d; background: #e7ece8; font-size: 9px; font-weight: 800; }
.result-index { color: #8a938d; justify-content: center; font-family: Georgia, serif; font-size: 11px; }
.result-title { flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; }
.result-title strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.result-title small { max-width: 100%; overflow: hidden; color: #7f8983; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.result-type,
.result-brand { color: #5f6c64; font-size: 10px; }
.result-status { gap: 6px; color: #56745f; font-size: 9px; }
.result-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.result-link { justify-content: center; color: var(--green); text-decoration: none; font-size: 10px; font-weight: 800; }
.result-link:hover { color: #fff; background: var(--green); }
.empty-result { padding: 28px; color: #7d8781; text-align: center; font-size: 11px; }
.page-footnote { margin-top: 22px; padding: 14px; border-left: 3px solid var(--green); color: #7b857f; background: rgba(255, 255, 255, .72); font-size: 10px; line-height: 1.75; }

@keyframes category-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1060px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .content { padding-inline: 22px; }
  .topnav { margin-left: 22px; }
  .topnav a { padding-inline: 12px; }
  .hero { align-items: start; }
  .stats div { min-width: 76px; padding-inline: 11px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid #ccd4ce; }
  .sidebar-inner { position: static; max-height: none; }
  .sidebar-title,
  .side-home,
  .sidebar-note { display: none; }
  .sidebar { padding: 8px 10px; overflow-x: auto; }
  .sidebar-inner { display: flex; min-width: max-content; gap: 7px; }
  details.side-group { border: 0; position: relative; }
  .side-group summary { height: 35px; padding: 0 12px; border: 1px solid #cbd4ce; background: #fff; }
  .side-group .side-options { width: 220px; max-height: 310px; padding: 8px; position: absolute; top: 40px; z-index: 20; overflow-y: auto; border: 1px solid #bdc8c0; background: #fff; box-shadow: 0 12px 30px rgba(31, 52, 39, .15); }
  .hero { grid-template-columns: 1fr; }
  .stats { width: fit-content; }
  .category-gateway { grid-template-columns: 1fr; }
  .category-gateway-card { min-height: 150px; }
  .category-card-copy strong { font-size: 34px; }
}

@media (max-width: 680px) {
  .topbar { height: 60px; padding: 0 14px; }
  .brand img { width: 34px; height: 34px; }
  .brand-copy strong { font-size: 17px; }
  .brand-copy small,
  .data-status { display: none; }
  .topnav { margin-left: auto; }
  .topnav a { padding: 0 7px; font-size: 10px; }
  .topnav a:nth-child(2) { display: none; }
  .content { padding: 22px 14px 42px; }
  .hero h1 { font-size: 31px; }
  .hero p { font-size: 12px; }
  .stats { width: 100%; }
  .stats div { min-width: 0; flex: 1; }
  .category-gateway { margin-top: 20px; gap: 9px; }
  .category-gateway-card { min-height: 136px; padding: 17px; }
  .category-card-copy strong { font-size: 28px; }
  .category-card-copy em { margin-top: 8px; }
  .guide-bar { align-items: flex-start; line-height: 1.6; }
  .guide-bar span:last-child { display: none; }
  .matrix-toolbar { align-items: stretch; flex-wrap: wrap; }
  .matrix-toolbar label { width: 100%; }
  .text-button { margin-left: auto; }
  .matrix { min-width: 660px; }
  .axis-corner,
  .brand-head { width: 138px; }
  .matrix-legend b { display: none; }
  .result-header { align-items: flex-start; }
  .result-header h2 { font-size: 23px; }
  .result-tools { flex-wrap: wrap; }
  .result-count { width: 100%; margin-left: 0; padding-top: 3px; }
}

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