:root {
  color-scheme: light dark;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-muted: #eef3fb;
  --text: #172033;
  --muted: #5d6a80;
  --line: #dce3ee;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --shadow: 0 16px 40px rgba(30, 41, 59, .09);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1422;
  --surface: #151f31;
  --surface-muted: #1b2940;
  --text: #e6edf8;
  --muted: #a5b3c9;
  --line: #2b3a53;
  --accent: #75a7ff;
  --accent-strong: #a6c5ff;
  --accent-soft: #1b365f;
  --shadow: 0 16px 40px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font: 16px/1.7 Inter, "Segoe UI", "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input { font: inherit; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: .55rem 1rem; border-radius: .45rem; background: var(--accent); color: white; }
.skip-link:focus { top: 1rem; }
.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); }
.header-inner { min-height: 70px; display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; letter-spacing: -.04em; }
.brand span { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: .2rem; align-items: center; }
.site-nav a, .theme-toggle { padding: .45rem .7rem; border-radius: .5rem; color: var(--muted); font-size: .93rem; }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.theme-toggle { cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.theme-toggle:hover { border-color: var(--accent); }
main { min-height: calc(100vh - 150px); }
.hero { padding: clamp(4.5rem, 10vw, 8rem) 0 5rem; }
.hero-grid { display: grid; grid-template-columns: 1.4fr .6fr; align-items: center; gap: 3rem; }
.eyebrow { margin: 0 0 .75rem; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.035em; }
h1 { max-width: 760px; margin: 0; font-size: clamp(2.5rem, 7vw, 5rem); }
h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.35rem); }
h3 { margin: 0; font-size: 1.15rem; }
.lead { max-width: 650px; margin: 1.4rem 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--accent); border-radius: .55rem; background: var(--accent); color: #fff; font-weight: 700; }
.button:hover { color: #fff; background: var(--accent-strong); }
.button.secondary { color: var(--text); border-color: var(--line); background: transparent; }
.avatar { width: min(240px, 65vw); aspect-ratio: 1; display: grid; place-items: center; margin-left: auto; border: 1px solid var(--line); border-radius: 28% 72% 62% 38% / 35% 37% 63% 65%; background: linear-gradient(135deg, var(--accent-soft), var(--surface)); box-shadow: var(--shadow); color: var(--accent); font-size: clamp(4rem, 10vw, 7rem); font-weight: 850; letter-spacing: -.12em; }
.section { padding: 4.5rem 0; }
.section.alt { background: var(--surface-muted); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section-heading p { max-width: 590px; margin: .55rem 0 0; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.card { display: flex; flex-direction: column; min-height: 100%; padding: 1.45rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card p { color: var(--muted); }
.card .card-link { margin-top: auto; color: var(--accent); font-weight: 750; }
.tag-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0; padding: 0; list-style: none; }
.tag { padding: .18rem .55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 700; }
.page-hero { padding: 4rem 0 2.5rem; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 4rem); white-space: nowrap; }
.page-hero p { max-width: 680px; color: var(--muted); font-size: 1.07rem; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.info-block { padding: 1.5rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--surface); }
.info-block p, .info-block li { color: var(--muted); }
.info-block ul { padding-left: 1.2rem; }
.timeline { border-left: 2px solid var(--accent); margin: 1rem 0; padding-left: 1.25rem; }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before { position: absolute; left: -1.63rem; top: .45rem; width: .62rem; height: .62rem; border: 3px solid var(--bg); border-radius: 50%; background: var(--accent); content: ""; }
.search-box { width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .6rem; outline: none; background: var(--surface); color: var(--text); }
.search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-meta { margin: .7rem 0 1.4rem; color: var(--muted); font-size: .9rem; }
.hidden { display: none !important; }
.empty-state { padding: 2.5rem 1rem; border: 1px dashed var(--line); border-radius: .85rem; color: var(--muted); text-align: center; }
.project-status { display: inline-flex; width: fit-content; margin-bottom: .85rem; padding: .16rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 800; }
.article { width: min(760px, calc(100% - 2rem)); margin: 0 auto; padding: 4rem 0 5rem; }
.article-meta { color: var(--muted); font-size: .9rem; }
.article h2 { margin-top: 2.2rem; font-size: 1.6rem; }
.article p, .article li { color: var(--muted); }
.article code { padding: .08rem .3rem; border-radius: .25rem; background: var(--surface-muted); color: var(--accent); }
.article pre { overflow: auto; padding: 1rem; border-radius: .65rem; background: var(--surface-muted); }
.article pre code { padding: 0; background: transparent; }
.privacy-note { padding: 1.4rem; border-left: 4px solid var(--accent); border-radius: .2rem .7rem .7rem .2rem; background: var(--accent-soft); }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }

@media (max-width: 760px) {
  .header-inner { padding: .8rem 0; align-items: flex-start; flex-direction: column; }
  .site-nav { width: 100%; justify-content: space-between; }
  .site-nav a, .theme-toggle { padding: .35rem .45rem; font-size: .82rem; }
  .hero-grid, .content-grid { grid-template-columns: 1fr; }
  .page-hero h1 { white-space: normal; }
  .avatar { margin: 0; }
  .card-grid { grid-template-columns: 1fr; }
  .section-heading, .footer-inner { align-items: flex-start; flex-direction: column; }
}
