:root {
  color-scheme: light;
  --ink: #232b32;
  --muted: #66727d;
  --line: #e1e6ec;
  --quiet: #f4f6f8;
  --accent: #2563eb;
  --accent-light: #ecf3ff;
  --content-width: 1240px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; color: var(--ink); background: #fff; }
main { background: var(--quiet); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { width: 18px; height: 18px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.site-header { position: sticky; top: 0; z-index: 20; height: 64px; border-bottom: 1px solid #ededed; background: #fff; }
.header-inner { width: min(var(--content-width), calc(100% - 64px)); height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 24px; }
.site-brand { min-width: 240px; display: inline-flex; align-items: center; }
.brand-word { color: #17191d; font: italic 900 26px/1 Arial, sans-serif; white-space: nowrap; }
.brand-word b { font-weight: 900; }
.header-actions { min-width: 0; margin-left: auto; display: flex; align-items: center; gap: 10px; }
.section-link, .lab-link { min-width: 90px; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 24px; white-space: nowrap; font-size: 16px; font-weight: 400; }
.section-link { color: #26282b; background: #f5f5f5; }
.section-link:hover { background: #eaecef; }
.lab-link { color: #fff; background: #222; }
.lab-link:hover { background: #3b3b3b; }
.site-footer a:hover { color: var(--accent); }
#catalog, #principles { scroll-margin-top: 64px; }

.hero { padding: 36px max(32px, calc((100vw - var(--content-width)) / 2)) 38px; border-bottom: 1px solid #e8edf3; background: #fff; }
.hero-grid { width: min(var(--content-width), 100%); margin: 0 auto; display: flex; align-items: end; justify-content: space-between; gap: 50px; }
.hero-copy { min-width: 0; }
.hero-title-line { display: flex; align-items: baseline; gap: 22px; }
.hero h1 { flex: 0 0 auto; font-size: clamp(38px, 3vw, 48px); line-height: 1.22; letter-spacing: -.025em; font-weight: 700; }
.hero-lead { color: #5d6874; font-size: 18px; line-height: 1.65; white-space: nowrap; }
.hero-stats { flex: 0 0 auto; display: flex; gap: 32px; padding-bottom: 5px; }
.hero-stats > div { min-width: 100px; padding-left: 22px; display: flex; align-items: baseline; gap: 8px; border-left: 1px solid #d1dae5; white-space: nowrap; }
.hero-stats strong { color: var(--accent); font: 650 31px/1.2 Arial, sans-serif; }
.hero-stats span { color: var(--muted); font-size: 15px; }

.catalog-section { padding: 36px max(32px, calc((100vw - var(--content-width)) / 2)) 66px; background: #f5f6f8; }
.section-heading { width: min(var(--content-width), 100%); margin: 0 auto; display: flex; align-items: baseline; gap: 20px; }
.section-heading h2 { font-size: 28px; line-height: 1.3; }
.section-heading p { color: var(--muted); font-size: 16px; }
.catalog-tools { width: min(var(--content-width), 100%); min-height: 56px; margin: 20px auto 0; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 6px 18px rgba(32, 51, 75, .04); }
.search-field { min-width: 0; flex: 1; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.search-field > svg { flex: 0 0 auto; color: #7e8a96; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 17px; }
.search-field input::placeholder { color: #8b96a2; }
.search-field kbd { flex: 0 0 auto; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; color: #87929e; font: 11px/1 Arial, sans-serif; }
.result-count { min-width: 124px; padding: 0 17px; display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--line); }
.result-count strong { font-size: 22px; }
.result-count span { color: var(--muted); font-size: 14px; }

.archive-browser { width: min(var(--content-width), 100%); margin: 20px auto 0; display: grid; grid-template-columns: 226px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 14px 34px rgba(32, 51, 75, .06); }
.archive-rail { min-width: 0; border-right: 1px solid var(--line); background: #fafbfc; }
.rail-heading { padding: 16px 18px 10px; }
.rail-heading p { color: #586576; font-size: 15px; font-weight: 700; }
.category-filters { padding: 0 10px 12px; display: grid; gap: 1px; }
.category-filters button { min-height: 36px; padding: 0 11px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 0; border-radius: 7px; color: #596574; background: transparent; text-align: left; }
.category-filters button:hover { color: var(--ink); background: #f0f3f7; }
.category-filters button.is-active { color: #1d55bf; background: var(--accent-light); }
.category-filters button > span { display: none; }
.category-filters strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 500; }
.category-filters .is-active strong { font-weight: 700; }
.category-filters small { color: #84909c; font-size: 14px; }

.archive-content { min-width: 0; }
.archive-heading { min-height: 82px; padding: 16px 29px; display: flex; align-items: end; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--line); }
.archive-heading span { color: #7f8a96; font-size: 13px; }
.archive-heading h3 { margin-top: 4px; font-size: 25px; line-height: 1.3; font-weight: 650; }
.archive-heading > p { padding-bottom: 2px; color: var(--muted); font-size: 14px; text-align: right; }
.project-grid { display: block; }
.project-card { padding: 16px 28px; display: grid; gap: 5px; border-bottom: 1px solid var(--line); }
.project-card:last-child { border-bottom: 0; }
.project-card:hover { background: #f8fbff; }
.project-detail-row { min-width: 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: baseline; gap: 16px; font-size: 16px; line-height: 1.5; }
.project-detail-label { color: var(--ink); white-space: nowrap; }
.project-summary { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.project-summary h3 { overflow-wrap: anywhere; font-size: 17px; line-height: 1.5; font-weight: 500; }
.project-summary p { color: var(--muted); font-size: 16px; }
.project-detail-link { min-width: 0; width: fit-content; max-width: 100%; display: inline-flex; align-items: baseline; gap: 8px; color: #0869b6; }
.project-detail-link span { min-width: 0; overflow-wrap: anywhere; }
.project-detail-link:hover span { text-decoration: underline; text-underline-offset: 3px; }
.project-detail-link svg { width: 16px; height: 16px; flex: 0 0 auto; align-self: center; }
.project-detail-pending { color: #9ca6af; }
.loading-state { min-height: 210px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 14px; }
.loading-state > span { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state[hidden] { display: none; }
.empty-state { min-height: 220px; padding: 48px 20px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state > span { color: var(--muted); font-size: 12px; }
.empty-state h3 { margin-top: 11px; font-size: 18px; }
.empty-state p { margin-top: 9px; color: var(--muted); font-size: 14px; }

.principles-section { padding: 36px max(32px, calc((100vw - var(--content-width)) / 2)) 54px; border-top: 1px solid var(--line); background: #f5f6f8; }
.principle-list { width: min(var(--content-width), 100%); margin: 20px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.principle-list article { padding: 20px 22px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 12px 28px rgba(32, 51, 75, .05); }
.principle-list h3 { font-size: 18px; line-height: 1.4; }
.principle-list p { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.site-footer { padding: 24px max(32px, calc((100vw - var(--content-width)) / 2)); border-top: 1px solid var(--line); background: #fff; }
.footer-inner { width: min(var(--content-width), 100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 26px; }
.footer-brand { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.footer-brand strong { font-size: 18px; }
.footer-brand span, .site-footer p { color: var(--muted); font-size: 15px; }
.site-footer a { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 16px; }
.footer-inner > a { justify-self: end; }
.site-footer svg { width: 15px; height: 15px; }

@media (max-width: 1100px) {
  .hero-grid { align-items: start; flex-direction: column; gap: 25px; }
}

@media (max-width: 980px) {
  .archive-browser { grid-template-columns: 185px minmax(0, 1fr); }
  .project-detail-row { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
  .principle-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .header-inner { width: calc(100% - 32px); gap: 12px; }
  .site-brand { min-width: 0; }
  .brand-word { font-size: 18px; }
  .header-actions { gap: 6px; }
  .section-link { display: none; }
  .lab-link { min-width: 86px; height: 40px; padding: 0 8px; }
  .hero, .catalog-section, .principles-section, .site-footer { padding-right: 16px; padding-left: 16px; }
  .hero { padding-top: 36px; padding-bottom: 38px; }
  .hero h1 { font-size: 34px; }
  .hero-title-line { flex-wrap: wrap; gap: 4px 16px; }
  .hero-lead { font-size: 14px; white-space: normal; }
  .catalog-section { padding-top: 40px; padding-bottom: 56px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 5px; }
  .search-field kbd { display: none; }
  .result-count { min-width: 90px; padding: 0 10px; }
  .result-count span { font-size: 11px; }
  .archive-browser { grid-template-columns: 1fr; }
  .archive-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-heading { padding: 16px 16px 8px; }
  .category-filters { display: flex; overflow-x: auto; padding: 0 12px 13px; }
  .category-filters button { flex: 0 0 auto; min-height: 34px; display: inline-flex; gap: 7px; }
  .archive-heading { min-height: 75px; padding: 16px; }
  .archive-heading > p { display: none; }
  .project-card { padding: 18px 16px; }
  .principle-list { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr auto; }
  .site-footer p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loading-state > span { animation: none; }
}
