:root {
  --bg-color: #ffffff;
  --text-main: #111111;
  --text-secondary: #666666;
  --text-meta: #888888;
  --link-border: #cccccc;
  --accent-color: #0066cc;
  --border-color: #e0e0e0;
  --code-bg: #f5f5f5;
  
  /* Toggle button specific */
  --toggle-icon: #333;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a; /* 柔和的深色背景，比纯黑更护眼 */
  --text-main: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-meta: #777777;
  --link-border: #555555;
  --accent-color: #66b3ff;
  --border-color: #333333;
  --code-bg: #2a2a2a;
  
  --toggle-icon: #ccc;
}

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

body {
  max-width: 720px;
  padding: 120px 20px 40px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.65;
  font-size: 16px;
  color: var(--text-main);
  background-color: var(--bg-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

header {
  margin-bottom: 50px;
  position: relative; /* 为定位 toggle 按钮做准备 */
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--toggle-icon);
  position: absolute;
  top: -60px; /* 向上移动一些，不要干扰标题 */
  right: 0;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  opacity: 1;
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.site-title {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.site-description {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

.social-links {
  display: inline-block;
  margin-top: 8px;
}

.social-links a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--link-border);
  transition: color 0.2s, border-color 0.2s;
}

.social-links a:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

main {
  margin-bottom: 60px;
}

.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 38px;
  line-height: 1.5;
}

.post-list .date {
  color: var(--text-meta);
  font-size: 15px;
  display: inline-block;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.post-list a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 19px;
  font-weight: 500;
  transition: color 0.2s ease;
  display: inline-block;
}

.post-list a:hover {
  color: var(--accent-color);
}

footer {
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 14px;
}

h1, h2, h3 {
  line-height: 1.3;
  font-weight: 600;
  color: var(--text-main);
}

@media (max-width: 768px) {
  body {
    padding: 80px 20px 30px;
  }
  
  header {
    margin-bottom: 40px;
  }
  
  .theme-toggle {
    top: -40px; /* 移动端调整位置 */
  }
  
  .site-title {
    font-size: 28px;
  }
  
  .site-description {
    font-size: 15px;
  }
  
  .post-list li {
    margin-bottom: 32px;
  }
  
  .post-list a {
    font-size: 18px;
  }
}
