/* 开源方案 —— 简洁大方 · 流式布局 · 暗色默认 */
:root {
  --accent: #60a5fa;
  --accent-soft: #1e293b;
  --ink: #e5e7eb;
  --ink-soft: #94a3b8;
  --paper: #0f172a;
  --line: #1e293b;
  color-scheme: dark;
}

[data-theme="light"] {
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --ink: #1f2937;
  --ink-soft: #6b7280;
  --paper: #ffffff;
  --line: #e5e7eb;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
}

/* 流式布局：内容区最大 720px，随视口收缩 */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* 吸顶 head bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: inherit;
  text-decoration: none;
}

.topbar-title svg {
  width: 22px;
  height: 22px;
  display: block;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* 图标随主题切换：暗色显示太阳（点击到亮色），亮色显示月亮 */
.icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

.site-header {
  padding-top: 64px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.site-title {
  font-size: 2rem;
  letter-spacing: 0.05em;
}

.site-tagline {
  color: var(--ink-soft);
  margin-top: 8px;
}

.post-list {
  padding-top: 8px;
  padding-bottom: 40px;
}

.post-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding-top: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.post-art {
  flex: none;
  display: flex;
  padding: 16px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.post-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.post-excerpt {
  color: var(--ink-soft);
  margin-top: 6px;
}

.post-date {
  display: block;
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.site-footer {
  padding-top: 32px;
  padding-bottom: 48px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.site-footer .beian {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 18px;
}

.beian a {
  color: var(--ink-soft);
  text-decoration: none;
}

.beian a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.beian-ga-icon {
  width: 20px;
  height: 20px;
  vertical-align: -5px;
  margin-right: 4px;
}

@media (max-width: 480px) {
  .site-header {
    padding-top: 48px;
    padding-bottom: 32px;
  }

  .post-card {
    flex-direction: column;
    gap: 12px;
  }
}
