/* my-website — 基础样式，纯 CSS，无依赖 */

:root {
  --bg: #ffffff;
  --fg: #17181c;
  --muted: #62666f;
  --card: #f5f6f8;
  --border: #e3e5e9;
  --accent: #2f6fed;
  --radius: 12px;
  --max-width: 960px;
}

html[data-theme="dark"] {
  --bg: #0f1115;
  --fg: #e8eaed;
  --muted: #9aa0a6;
  --card: #171a20;
  --border: #262a31;
  --accent: #7aa2ff;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0f1115;
    --fg: #e8eaed;
    --muted: #9aa0a6;
    --card: #171a20;
    --border: #262a31;
    --accent: #7aa2ff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
  background: var(--card);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}

/* 顶部导航 */

.site-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
}

.site-nav {
  display: flex;
  gap: 1rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* 主体 */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.hero {
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 40em;
}

.hero-actions {
  margin-top: 1.75rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 1rem 0 2.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.about {
  padding: 1rem 0 3rem;
  border-top: 1px solid var(--border);
}

.about h2 {
  font-size: 1.15rem;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
}
