/* ---------------------------------------------------------------
   作品集 · 样式表
   零依赖、零构建。浅色为默认，跟随系统自动切换深色。
--------------------------------------------------------------- */

:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --panel-2: #fbfbf9;
  --text: #14161a;
  --text-2: #3d424b;
  --muted: #71767f;
  --line: #e5e5e0;
  --line-strong: #d6d6d0;
  --accent: #2563eb;
  --accent-soft: #eef3ff;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px -12px rgba(20, 22, 26, .12);
  --shadow-hover: 0 2px 4px rgba(20, 22, 26, .05), 0 18px 40px -18px rgba(20, 22, 26, .22);
  --radius: 14px;
  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1013;
    --panel: #17181c;
    --panel-2: #1c1e23;
    --text: #e9eaed;
    --text-2: #c3c7cf;
    --muted: #8d939d;
    --line: #272a31;
    --line-strong: #34383f;
    --accent: #7aa2ff;
    --accent-soft: #1a2337;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-hover: 0 18px 40px -18px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1000px 320px at 18% -12%, var(--accent-soft), transparent 70%),
    var(--bg);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 700;
}

.lead {
  margin: 0;
  max-width: 640px;
  color: var(--text-2);
  font-size: 15.5px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.btn:hover {
  border-color: var(--muted);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.btn-primary:hover { border-color: var(--text); }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin: 40px 0 0;
  padding: 0;
}

.stats div { min-width: 96px; }

.stats dt {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
}

.stats dd {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.01em;
}

/* ---------- Section ---------- */

main { padding: 44px 0 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .01em;
}

.section-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 24px 0 8px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}

.card:focus-within {
  border-color: var(--accent);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--accent);
}

.icon svg {
  width: 21px;
  height: 21px;
  display: block;
}

.card h3 {
  margin: 2px 0 0;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -.005em;
  line-height: 1.4;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

/* 让整张卡片可点，但只在标题链接上保留焦点语义 */
.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card h3 a:focus-visible { outline: none; }

.card-en {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.card p.desc {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.card .note {
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding-top: 12px;
}

.tag {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
}

.state.live { color: #15803d; }
.state.live::before { background: #16a34a; opacity: 1; }
.state.code { color: #a16207; }
.state.code::before { background: #ca8a04; opacity: 1; }

@media (prefers-color-scheme: dark) {
  .state.live { color: #4ade80; }
  .state.code { color: #facc15; }
}

.go {
  position: relative;
  z-index: 1;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.go:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Footer ---------- */

footer {
  margin-top: 56px;
  padding-top: 22px;
  padding-bottom: 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

footer p { margin: 0; max-width: 640px; }

.noscript {
  padding: 24px 0;
  color: var(--muted);
}

@media (max-width: 560px) {
  .hero { padding: 48px 0 32px; }
  .wrap { padding: 0 18px; }
  .stats { gap: 24px; }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .card:hover, .btn:hover { transform: none; }
}
