:root {
  color-scheme: light;
  --blue: #0869b6;
  --blue-dark: #064f8a;
  --green: #087a55;
  --amber: #a7660a;
  --ink: #17201d;
  --muted: #68736e;
  --line: #d6dedb;
  --canvas: #eef2f0;
  --surface: #fff;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { min-width: 320px; scroll-behavior: smooth; background: var(--canvas); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { width: 19px; height: 19px; stroke-width: 1.9; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(8,105,182,.28); outline-offset: 3px; }

.site-header { min-height: 166px; background: #2563eb; color: #fff; }
.header-inner { width: min(1240px, 100%); min-height: 166px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px; }
.header-title { min-width: 0; }
.header-title > span { color: rgba(255,255,255,.86); font: 600 14px/1.2 Consolas, sans-serif; }
.header-title h1 { margin-top: 7px; color: #fff; font-size: 38px; line-height: 1.2; font-weight: 650; }
.header-title p { margin-top: 8px; color: #fff; font-size: 15px; line-height: 1.55; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 30px; font-size: 15px; }
.header-actions > a { color: #fff; }
.home-link { height: 40px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(255,255,255,.38); border-radius: 5px; color: #fff; font-size: 14px; white-space: nowrap; }
.home-link:hover { background: rgba(255,255,255,.12); }
.home-link svg { width: 17px; height: 17px; }

.catalog-band { min-height: calc(100vh - 200px); padding: 24px 0 58px; background: var(--surface); }
.page-inner { width: min(1240px, 100%); margin: 0 auto; padding: 0 24px; }
.principles-heading > span { color: var(--blue); font: 600 14px/1.2 Consolas, sans-serif; }
.catalog-count { min-width: 96px; padding-left: 22px; display: grid; border-left: 1px solid var(--line); }
.catalog-count strong { font: 600 30px/1.1 Consolas, sans-serif; color: var(--blue); }
.catalog-count span { margin-top: 5px; color: var(--muted); font-size: 12px; }

.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.search-box { width: min(410px, 100%); height: 44px; padding: 0 13px; display: flex; align-items: center; gap: 10px; border: 1px solid #cbd6d1; border-radius: 6px; background: #fff; }
.search-box svg { flex: 0 0 auto; color: #75817b; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.search-box input::placeholder { color: #929c97; }
.filter-tabs { display: inline-grid; grid-template-columns: repeat(4, auto); padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #f3f6f4; }
.filter-tabs button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 4px; background: transparent; color: #5e6964; font-size: 13px; }
.filter-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(24,44,35,.1); }

.project-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr; gap: 13px; }
.project-card { width: 100%; min-width: 0; min-height: 0; padding: 8px 24px; display: grid; grid-template-columns: minmax(0, 1fr) 170px; grid-template-areas: "title link" "description link"; align-content: center; column-gap: 26px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.project-license { color: #748079; font: 12px/1.2 Consolas, monospace; }
.project-card h2 { grid-area: title; font-size: 22px; line-height: 1.35; font-weight: 650; }
.project-card > p { grid-area: description; max-width: 760px; margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.project-link { grid-area: link; width: 100%; min-height: 100%; padding-left: 26px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border-left: 1px solid #e3e9e6; color: var(--blue); font-size: 14px; }
.project-action { display: inline-flex; align-items: center; gap: 8px; }
.project-link svg { width: 17px; height: 17px; }
.project-link .project-license { margin-top: 6px; }
.project-link-unavailable { color: #8a7160; cursor: default; }

.empty-state { min-height: 270px; margin-top: 24px; padding: 45px 20px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed #c4d0ca; border-radius: 7px; background: #f8faf9; }
.empty-state[hidden] { display: none; }
.empty-state > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 6px; background: #e5eef8; color: var(--blue); }
.empty-state > span svg { width: 25px; height: 25px; }
.empty-state h2 { margin-top: 16px; font-size: 20px; }
.empty-state p { max-width: 520px; margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.principles-band { padding: 46px 0 50px; background: #e9efec; }
.principles-layout { display: grid; grid-template-columns: 260px 1fr; gap: 54px; }
.principles-heading h2 { margin-top: 7px; font-size: 29px; font-weight: 650; }
.principle-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.principle-list article { min-width: 0; padding: 18px; display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 12px; border: 1px solid #ccd6d1; border-radius: 6px; background: rgba(255,255,255,.72); }
.principle-list article > svg { width: 25px; height: 25px; color: var(--blue); }
.principle-list article:nth-child(2) > svg { color: var(--amber); }
.principle-list article:nth-child(3) > svg { color: var(--green); }
.principle-list h3 { font-size: 16px; font-weight: 650; }
.principle-list p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.65; }

.site-footer { background: #10283e; color: rgba(255,255,255,.72); }
.footer-inner { width: min(1240px, 100%); min-height: 70px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 13px; }

@media (max-width: 900px) {
  .principles-layout { grid-template-columns: 1fr; gap: 25px; }
}

@media (max-width: 700px) {
  .site-header { min-height: 164px; }
  .header-inner { min-height: 164px; grid-template-columns: minmax(0, 1fr) auto; padding: 20px 16px; align-items: start; gap: 12px; }
  .header-title > span { font-size: 12px; }
  .header-title h1 { margin-top: 7px; font-size: 31px; }
  .header-title p { max-width: 255px; margin-top: 8px; font-size: 14px; line-height: 1.55; }
  .header-actions > a:not(.home-link) { display: none; }
  .home-link { width: 40px; padding: 0; }
  .home-link span { display: none; }
  .catalog-band { padding: 18px 0 44px; }
  .page-inner { padding: 0 16px; }
  .catalog-count { min-width: 72px; padding-left: 15px; align-self: stretch; }
  .catalog-count strong { font-size: 25px; }
  .catalog-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .search-box { width: 100%; }
  .project-card { min-height: 0; padding: 8px 20px; grid-template-columns: 1fr; grid-template-areas: "title" "description" "link"; }
  .project-link { min-height: 42px; margin-top: 10px; padding: 9px 0 0; border-top: 1px solid #e3e9e6; border-left: 0; }
  .project-link .project-license { margin-top: 4px; }
  .empty-state { min-height: 240px; }
  .principles-band { padding: 38px 0 42px; }
  .principle-list { grid-template-columns: 1fr; }
  .footer-inner { min-height: 84px; padding: 18px 16px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; }
}
