:root{
  color-scheme: light;
  --bg:#ffffff;
  --text:#111111;
  --muted:#444444;
  --border:#e6e6e6;
  --card:#ffffff;
  --cardHover:#fafafa;
  --max:1100px;
}

*{ box-sizing:border-box; }

html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height:1.65;
}

.container{
  max-width:var(--max);
  margin:0 auto;
  padding:44px 22px;
}

/* Typography */
h1,h2,h3{
  line-height:1.25;
  margin:0 0 12px 0;
}
h1{ font-size:34px; letter-spacing:-0.02em; }
h2{ font-size:22px; margin-top:30px; }
h3{ font-size:18px; }

p{
  margin:0 0 16px 0;
  max-width:78ch;
  color:var(--text);
}
small{ color:var(--muted); }

ul,ol{
  padding-left:22px;
  margin:0 0 16px 0;
}
li{ margin:8px 0; }

hr{
  border:0;
  border-top:1px solid var(--border);
  margin:22px 0;
}

/* Links (document-like) */
a{
  color:inherit;
  text-decoration:none;
  border-bottom:1px solid #cfcfcf;
  padding-bottom:1px;
}
a:hover{ border-bottom-color:var(--text); }

/* =========================
   Top nav (brand + links)
   ========================= */
.top-nav{
  position:sticky;
  top:0;
  z-index:50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(0,0,0,.08);
}

.top-nav .nav-inner{
  max-width:var(--max);
  margin:0 auto;
  padding:10px 22px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap; /* 手机自动换行 */
}

/* Brand (logo + title) */
.top-nav .brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:.02em;
  border-bottom:0;     /* 避免全局 a 的下划线 */
  padding-bottom:0;
  margin-right:auto;   /* 把链接推到右侧 */
  min-width:0;
}

.brand-logo{
  height:30px;
  width:auto;
  display:block;
}

.brand-text{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Nav links */
.top-nav a{
  border-bottom:0;      /* nav 链接不要底部线 */
  padding-bottom:0;
  font-size:14px;
  opacity:.92;
}

.top-nav a:hover{
  opacity:1;
}

.top-nav .nav-inner > a:not(.brand){
  padding:8px 10px;
  border-radius:10px;
}

.top-nav .nav-inner > a:not(.brand):hover{
  background: rgba(0,0,0,.05);
}

.top-nav a.is-archive{
  font-weight:600;
  opacity:.95;
}

/* Homepage header text */
.container > header:first-child h1{ text-align:center; }
.container > header:first-child p{
  text-align:center;
  color:var(--muted);
  margin-left:auto;
  margin-right:auto;
  max-width:72ch;
}

/* Cards */
.card-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
  margin-top:12px;
}
.card{
  display:block;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card);
}
.card:hover{
  background:var(--cardHover);
  border-color:#d8d8d8;
}
.card h3{ margin:0 0 6px 0; }
.card p{
  margin:0;
  color:var(--muted);
  max-width:none;
}

/* CTA */
.cta a{
  display:inline-block;
  border:1px solid #d7d7d7;
  border-radius:12px;
  padding:10px 14px;
  font-weight:650;
  background:#fafafa;
}
.cta a:hover{
  background:#f2f2f2;
  border-color:#cfcfcf;
}

/* Footer */
.site-footer{ margin-top:10px; }
.footer-note{
  font-size:13px;
  color:var(--muted);
}

/* Responsive */
@media (min-width: 720px){
  .card-grid{ grid-template-columns:repeat(2, 1fr); }
}
@media (min-width: 980px){
  .card-grid{ grid-template-columns:repeat(3, 1fr); }
}
@media (max-width: 768px){
  .container{ padding:28px 16px; }
  .top-nav .nav-inner{ padding:10px 16px; }
}
@media (max-width: 640px){
  .brand-text{ font-size:14px; }
  .brand-logo{ height:26px; }
  .top-nav a{ font-size:13px; }
}
