/* ===== 全局变量（浅色 / 深色） ===== */
:root {
  --bg: #f5f5f5;
  --bg-alt: #ffffff;
  --text: #222222;
  --muted: #777777;
  --accent: #0077cc;
  --border: #e0e0e0;
}

body.dark {
  --bg: #111111;
  --bg-alt: #181818;
  --text: #f5f5f5;
  --muted: #aaaaaa;
  --accent: #4aa3ff;
  --border: #333333;
}

/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ===== Layout ===== */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ===== Header ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

nav a {
  margin-left: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}
nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.toggle-theme {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 1rem;
}

/* ===== Main Layout ===== */
main {
  margin-top: 1rem;
}

/* ===== Posts List ===== */
.posts {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post {
  background: var(--bg-alt);
  border-radius: 0.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.post:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.post-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.post-excerpt {
  font-size: 0.9rem;
  color: var(--text);
}

/* ===== Archive ===== */
.archive-list {
  list-style: none;
  margin-top: 1rem;
}
.archive-list li {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
}

/* ===== Post Content ===== */
.post-content h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}
.post-content p {
  margin: 0.8rem 0;
  font-size: 1rem;
}

/* ===== Footer ===== */
footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* ===== Loading Bar ===== */
.loading-bar {
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.4s ease;
  margin-bottom: 0.5rem;
}
.loading-bar.active {
  width: 100%;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  nav a {
    margin-left: 0.5rem;
  }
}
