:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #65706c;
  --line: #d9dfdc;
  --paper: #f7f9f8;
  --surface: #ffffff;
  --green: #087f5b;
  --green-dark: #075e49;
  --coral: #d85d3f;
  --yellow: #f0b429;
  --navy: #183b56;
  --page-gutter: clamp(24px, 4vw, 72px);
}

* { 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", Arial, sans-serif; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.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 { width: 100%; height: 68px; padding: 0 var(--page-gutter); display: flex; align-items: center; gap: 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; color: white; background: var(--green); font-weight: 900; }
.site-header nav { display: flex; align-items: stretch; gap: 28px; height: 100%; }
.site-header nav a, .admin-link { display: flex; align-items: center; font-size: 14px; color: #3d4a45; border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--green); border-color: var(--green); }
.admin-link { margin-left: auto; padding: 8px 13px; height: auto; border: 1px solid var(--line); }
.admin-link:hover { border-color: var(--green); color: var(--green); }

.home-hero { width: 100%; min-height: min(620px, calc(100vh - 118px)); padding: clamp(48px, 6vh, 74px) var(--page-gutter) 48px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); align-items: center; gap: clamp(40px, 6vw, 96px); }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
.hero-copy h1 { margin: 0; font-size: 96px; line-height: .92; letter-spacing: 0; color: var(--navy); }
.hero-lead { max-width: 680px; margin: 28px 0; color: #3d4945; font-size: 21px; }
.hero-search { display: flex; max-width: 650px; background: white; border: 1px solid #aeb9b4; box-shadow: 0 12px 36px rgba(20,45,36,.08); }
.hero-search input { min-width: 0; flex: 1; height: 54px; padding: 0 18px; border: 0; outline: 0; background: transparent; }
.hero-search input:focus { box-shadow: inset 0 0 0 2px var(--green); }
.hero-search button, .filter-bar button { border: 0; background: var(--green); color: white; padding: 0 22px; font-weight: 700; }
.hero-search button:hover, .filter-bar button:hover { background: var(--green-dark); }
.trust-row { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; }
.trust-row span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; background: var(--yellow); vertical-align: 1px; }

.market-map { padding: 22px; background: #102d2a; color: white; box-shadow: 18px 18px 0 #dfe8e3; }
.map-title { display: flex; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.2); font-size: 13px; }
.map-title strong { color: #82d1b2; font-size: 11px; }
.map-level { min-height: 75px; margin-top: 12px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; border-left: 3px solid #82d1b2; background: rgba(255,255,255,.07); }
.map-level span, .map-branch span { color: #c4d8d1; font-size: 13px; }
.map-level b, .map-branch b { font-size: 28px; }
.map-branch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.map-branch div { min-height: 90px; padding: 15px 18px; display: flex; flex-direction: column; justify-content: space-between; background: #1a4740; }
.map-branch.accent div:first-child { background: var(--coral); }
.map-branch.accent div:last-child { background: #b6840e; }
.map-branch.accent span { color: white; }

.section-band { width: 100%; padding: 72px var(--page-gutter); background: var(--surface); border-top: 1px solid var(--line); }
.section-band.assurance { background: #eef2f0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-head h2, .assurance h2 { margin: 0; font-size: 31px; line-height: 1.2; }
.section-head > a { color: var(--green); font-size: 14px; font-weight: 700; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.app-card { min-width: 0; min-height: 210px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.app-card:hover { border-color: #8aa59a; box-shadow: 0 10px 26px rgba(20,45,36,.07); transform: translateY(-2px); }
.card-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 12px; }
.card-meta span + span::before { content: "/"; margin-right: 7px; color: #a9b0ad; }
.app-card h3 { margin: 16px 0 8px; font-size: 21px; }
.app-card h3 a:hover { color: var(--green); }
.app-card p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.card-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #edf0ee; color: #46524e; font-size: 12px; }
.assurance { display: grid; grid-template-columns: .7fr 1.3fr; gap: 70px; }
.assurance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.assurance-grid article { border-top: 3px solid var(--ink); }
.assurance-grid b { display: block; margin-top: 15px; color: var(--coral); }
.assurance-grid h3 { margin: 26px 0 6px; font-size: 17px; }
.assurance-grid p { margin: 0; color: var(--muted); font-size: 14px; }

.page-title { width: 100%; padding: 64px var(--page-gutter) 42px; background: #102d2a; color: white; }
.page-title .eyebrow { color: #82d1b2; }
.page-title h1 { margin: 0; font-size: 56px; line-height: 1.1; }
.page-title > p:last-child { max-width: 720px; margin: 16px 0 0; color: #bfd0ca; font-size: 17px; }
.market-layout { width: 100%; padding: 34px var(--page-gutter) 72px; display: grid; grid-template-columns: minmax(220px, 18vw) minmax(0,1fr); gap: clamp(24px, 3vw, 48px); }
.filter-bar { align-self: start; padding: 18px; display: grid; gap: 15px; background: white; border: 1px solid var(--line); }
.filter-bar label { display: grid; gap: 6px; color: #4d5955; font-size: 12px; font-weight: 700; }
.filter-bar input:not([type="checkbox"]), .filter-bar select { width: 100%; height: 42px; padding: 0 10px; color: var(--ink); background: white; border: 1px solid #bdc6c2; }
.filter-bar .check { display: flex; grid-template-columns: auto 1fr; align-items: center; }
.filter-bar button { min-height: 44px; }
.result-count { display: flex; align-items: baseline; gap: 8px; margin-bottom: 18px; }
.result-count strong { font-size: 28px; }
.result-count span { color: var(--muted); font-size: 13px; }
.results .card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.empty-state { width: 100%; padding: 48px 24px; text-align: center; border: 1px dashed #afbab5; background: rgba(255,255,255,.55); }
.empty-state strong { font-size: 19px; }
.empty-state p { margin: 8px 0 0; color: var(--muted); }

.catalog-tree, .industry-grid, .rules { width: 100%; padding: 36px var(--page-gutter) 80px; }
.app-set { display: grid; grid-template-columns: minmax(240px, 22vw) minmax(0,1fr); gap: clamp(24px, 3vw, 48px); padding: 30px 0; border-bottom: 1px solid var(--line); }
.app-set > header span { color: var(--green); font-size: 11px; font-weight: 800; }
.app-set > header h2 { margin: 8px 0; font-size: 28px; }
.app-set > header p, .capability-list section > p { color: var(--muted); font-size: 14px; }
.capability-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.capability-list section { padding: 20px; background: white; border-left: 3px solid var(--green); }
.capability-list h3 { margin: 0; font-size: 18px; }
.capability-list ul { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid #edf0ee; }
.capability-list li a { padding: 11px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0ee; }
.capability-list li a:hover { color: var(--green); }
.capability-list small { color: var(--muted); }
.industry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.industry-grid > a { min-height: 150px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); background: white; }
.industry-grid strong { font-size: 21px; }
.industry-grid span { margin-top: auto; color: var(--green); font-weight: 700; }
.industry-grid small { color: var(--muted); }
.industry-grid .empty-state { grid-column: 1 / -1; }
.rules { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--line); }
.rules article { min-height: 230px; padding: 32px; background: white; }
.rules b { color: var(--coral); }
.rules h2 { margin: 28px 0 8px; }
.rules p { color: var(--muted); }

.detail-hero { width: 100%; padding: 64px var(--page-gutter); display: grid; grid-template-columns: minmax(0,1fr) minmax(260px, 20vw); gap: clamp(36px, 5vw, 80px); background: #102d2a; color: white; }
.breadcrumb { display: flex; gap: 8px; margin-bottom: 40px; color: #a9c6bc; font-size: 13px; }
.detail-hero h1 { margin: 0; font-size: 64px; }
.detail-hero p:last-child { max-width: 720px; color: #bfd0ca; }
.identity-panel { align-self: end; padding: 20px; display: grid; gap: 8px; border: 1px solid #42655b; }
.identity-panel span { color: #9fc0b5; font-size: 12px; }
.identity-panel code { overflow-wrap: anywhere; }
.identity-panel strong { font-size: 32px; color: #82d1b2; }
.detail-content { width: 100%; padding: 42px var(--page-gutter) 80px; display: grid; grid-template-columns: minmax(0,1fr) minmax(280px, 22vw); gap: clamp(24px, 3vw, 48px); }
.version-row { margin-bottom: 16px; padding: 24px; background: white; border: 1px solid var(--line); }
.version-row > header, .version-row > footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.version-row > header strong { font-size: 22px; }
.version-row time { color: var(--muted); font-size: 13px; }
.status { margin-left: 10px; padding: 3px 7px; color: var(--green-dark); background: #dff3eb; font-size: 11px; }
.changelog { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 22px 0; }
.changelog section { padding-top: 14px; border-top: 1px solid var(--line); }
.changelog h3 { margin: 0 0 6px; font-size: 13px; }
.changelog p { margin: 0; color: var(--muted); font-size: 14px; }
.version-row dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.version-row dl div { padding: 12px; background: #f8faf9; }
dt { color: var(--muted); font-size: 11px; }
dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.version-row > footer { margin-top: 18px; }
.version-row code { font-size: 11px; color: var(--muted); }
.version-row footer a { color: var(--green); font-size: 13px; font-weight: 700; }
.detail-aside { align-self: start; padding: 22px; background: white; border-top: 4px solid var(--coral); }
.detail-aside h2 { margin-top: 0; }
.detail-aside dl { display: grid; gap: 4px; }
.detail-aside dd { margin-bottom: 12px; }
.primary-link { margin-top: 18px; padding: 12px; display: block; text-align: center; color: white; background: var(--green); font-weight: 700; }

.admin-head { width: 100%; padding: 42px var(--page-gutter) 24px; display: flex; justify-content: space-between; align-items: end; }
.admin-head h1 { margin: 0; font-size: 40px; }
.admin-status { color: var(--green); font-size: 13px; font-weight: 700; }
.admin-status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; background: var(--green); }
.admin-metrics { width: 100%; padding: 0 var(--page-gutter) 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.admin-metrics div { min-height: 100px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; background: #102d2a; color: white; }
.admin-metrics span { color: #b6cec5; font-size: 11px; overflow-wrap: anywhere; }
.admin-metrics strong { font-size: 28px; }
.admin-table-section { width: 100%; padding: 20px var(--page-gutter) 80px; }
.table-scroll { overflow-x: auto; background: white; border: 1px solid var(--line); }
table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 15px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: #f0f4f2; font-size: 11px; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.state { padding: 3px 6px; font-size: 10px; font-weight: 800; background: #edf0ee; }
.state-published { color: var(--green-dark); background: #dff3eb; }
.state-auto_rejected { color: #9b331f; background: #f9e4df; }
.state-auto_checking { color: #765600; background: #fff0c2; }

footer { width: 100%; min-height: 100px; padding: 28px var(--page-gutter); display: flex; align-items: center; gap: 22px; color: #aabbb5; background: #102d2a; font-size: 12px; }
footer strong { color: white; font-size: 18px; }
footer span:last-child { margin-left: auto; }

@media (max-width: 900px) {
  :root { --page-gutter: 20px; }
  .site-header { height: auto; min-height: 64px; padding: 12px 18px; flex-wrap: wrap; gap: 12px 22px; }
  .site-header nav { order: 3; width: 100%; height: auto; gap: 20px; overflow-x: auto; }
  .site-header nav a { padding: 6px 0; white-space: nowrap; }
  .admin-link { margin-left: auto; }
  .home-hero { min-height: 0; grid-template-columns: 1fr; padding: 36px 20px; gap: 24px; }
  .hero-copy h1 { font-size: 72px; }
  .market-map { max-width: 580px; width: 100%; }
  .card-grid, .results .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .assurance { grid-template-columns: 1fr; gap: 36px; }
  .market-layout { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .filter-bar button { min-height: 42px; }
  .app-set { grid-template-columns: 1fr; }
  .industry-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-hero { grid-template-columns: 1fr; }
  .identity-panel { max-width: 360px; }
  .detail-content { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 600px) {
  :root { --page-gutter: 18px; }
  .brand { font-size: 17px; }
  .site-header nav { gap: 16px; }
  .site-header nav a { font-size: 12px; }
  .admin-link { font-size: 0; width: 38px; height: 38px; padding: 0; justify-content: center; }
  .admin-link::after { content: "A"; font-size: 13px; font-weight: 800; }
  .home-hero { padding: 16px 18px 20px; gap: 12px; }
  .hero-copy h1 { font-size: 52px; }
  .hero-copy .eyebrow { margin-bottom: 6px; font-size: 10px; }
  .hero-lead { margin: 12px 0; font-size: 15px; line-height: 1.45; }
  .hero-search { display: flex; }
  .hero-search input { width: 100%; }
  .hero-search button { min-height: 48px; padding: 0 12px; white-space: nowrap; }
  .trust-row { margin-top: 12px; gap: 4px 12px; font-size: 11px; }
  .market-map { padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; box-shadow: 8px 8px 0 #dfe8e3; }
  .map-title { grid-column: 1 / -1; padding-bottom: 8px; }
  .map-level { min-height: 48px; margin-top: 0; padding: 8px 10px; }
  .map-level b, .map-branch b { font-size: 22px; }
  .map-branch { display: contents; }
  .map-branch div { min-height: 48px; padding: 8px 10px; }
  .section-band { padding: 52px 18px; }
  .card-grid, .results .card-grid, .assurance-grid, .capability-list, .industry-grid, .rules { grid-template-columns: 1fr; }
  .page-title { padding: 44px 18px 34px; }
  .market-layout, .catalog-tree, .industry-grid, .rules { padding-left: 18px; padding-right: 18px; }
  .filter-bar { grid-template-columns: 1fr; }
  .app-set { padding: 20px 0; }
  .rules { gap: 1px; }
  .detail-hero { padding: 44px 18px; gap: 36px; }
  .detail-content { padding: 30px 18px 60px; }
  .version-row { padding: 18px; }
  .changelog, .version-row dl { grid-template-columns: 1fr; }
  .version-row > footer { align-items: flex-start; flex-direction: column; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  footer { align-items: flex-start; flex-direction: column; }
  footer span:last-child { margin-left: 0; }
}

@media (min-width: 1600px) {
  .hero-copy h1 { font-size: 112px; }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
  .results .card-grid { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
