:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-muted: #eef1f4;
  --text: #17202a;
  --muted: #68727d;
  --line: #dce1e6;
  --accent: #176b5b;
  --accent-soft: #e4f1ed;
  --blue: #2c5f91;
  --blue-soft: #e6eef7;
  --amber: #986719;
  --amber-soft: #f7eedc;
  --red: #a33b32;
  --red-soft: #f7e8e6;
  --shadow: 0 8px 24px rgba(23, 32, 42, 0.07);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

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

button, input { font: 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;
}

.topbar {
  min-height: 70px;
  padding: 12px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand, .brand > span:last-child, .card-foot {
  display: flex;
  align-items: center;
}

.brand { gap: 12px; }

.brand-mark {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand > span:last-child { align-items: flex-start; flex-direction: column; gap: 1px; }
.brand strong { font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; }

main {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 64px;
}

.intro {
  display: flex;
  margin-bottom: 36px;
}

h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.1; font-weight: 760; }
.intro p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.intro p strong { color: var(--text); }

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.search-box {
  width: min(340px, 100%);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.search-box:focus-within { border-color: #7d9b94; box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box svg { width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.search-box input::placeholder { color: #9aa2aa; }

.filters { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow-x: auto; }
.filter { min-height: 32px; padding: 0 12px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; cursor: pointer; white-space: nowrap; font-size: 13px; }
.filter:hover { color: var(--text); background: var(--surface-muted); }
.filter.is-active { color: #fff; background: var(--text); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  min-width: 0;
  min-height: 235px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.project-card:hover { transform: translateY(-2px); border-color: #bdc6ce; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.category { color: var(--muted); font-size: 11px; }

.project-icon {
  width: 38px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
}

.project-icon[data-tone="blue"] { color: var(--blue); background: var(--blue-soft); }
.project-icon[data-tone="amber"] { color: var(--amber); background: var(--amber-soft); }
.project-icon[data-tone="red"] { color: var(--red); background: var(--red-soft); }

.card-body { flex: 1; padding: 22px 0 18px; }
.project-card h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; }
.description { margin: 0; min-height: 42px; color: var(--muted); font-size: 13px; line-height: 1.65; }

.card-foot { justify-content: flex-end; padding-top: 15px; border-top: 1px solid var(--line); }
.open-link { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; color: var(--text); text-decoration: none; font-size: 12px; font-weight: 700; }
.open-link:hover { color: var(--accent); }
.open-link svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }

@media (max-width: 920px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .filters { width: max-content; max-width: 100%; }
}

@media (max-width: 620px) {
  .topbar { padding: 11px 20px; }
  main { width: min(100% - 28px, 1240px); padding-top: 36px; }
  .intro { margin-bottom: 26px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 225px; }
}

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