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

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e0e0e0;
  --link: #0066cc;
  --code-bg: #f5f5f5;
}

[data-theme='dark'] {
  --bg: #1a1d24;
  --text: #e4e6eb;
  --text-muted: #9ca3af;
  --border: #2d3139;
  --link: #60a5fa;
  --code-bg: #23262e;
}

html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-bottom: 40px;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Monaco', 'Courier New', 'Consolas', monospace;
  font-weight: 600;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
}

.nav-links a:hover {
  color: var(--link);
}

main {
  min-height: 60vh;
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 20px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* 首页样式 */
.hero {
  margin-bottom: 60px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.intro {
  font-size: 1.1rem;
  line-height: 1.8;
}

.tech-stack {
  margin-bottom: 60px;
}

.tech-stack h2 {
  margin-bottom: 20px;
}

.tech-stack ul {
  list-style-position: inside;
}

.tech-stack li {
  padding: 8px 0;
}

.recent-posts h2 {
  margin-bottom: 20px;
}

.view-all {
  display: inline-block;
  color: var(--link);
  text-decoration: none;
}

.view-all:hover {
  text-decoration: underline;
}

/* 文章列表样式 */
.posts-list h1 {
  margin-bottom: 40px;
}

.post-item {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item h2 {
  margin-bottom: 8px;
}

.post-item h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-item h2 a:hover {
  color: var(--link);
}

.post-item time {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-item p {
  margin: 10px 0;
  color: var(--text-muted);
}

.tags {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  background: var(--code-bg);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 文章详情样式 */
.post-header {
  margin-bottom: 40px;
}

.post-header h1 {
  margin-bottom: 10px;
  font-size: 2.2rem;
}

.post-header time {
  color: var(--text-muted);
}

.post-content {
  line-height: 1.8;
}

.post-content h2 {
  margin: 40px 0 20px;
  font-size: 1.8rem;
}

.post-content h3 {
  margin: 30px 0 15px;
  font-size: 1.4rem;
}

.post-content p {
  margin: 15px 0;
}

.post-content ul,
.post-content ol {
  margin: 15px 0;
  padding-left: 30px;
}

.post-content li {
  margin: 8px 0;
}

.post-content a {
  color: var(--link);
  text-decoration: none;
}

.post-content a:hover {
  text-decoration: underline;
}

.post-content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 20px 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.9rem;
}

.post-content blockquote {
  border-left: 4px solid var(--border);
  padding-left: 20px;
  margin: 20px 0;
  color: var(--text-muted);
}

/* Dark theme adjustments */
[data-theme='dark'] .post-content pre {
  background: #1e2129;
  border: 1px solid var(--border);
}

[data-theme='dark'] .post-content code {
  color: var(--text);
}

[data-theme='dark'] {
  color-scheme: dark;
}

[data-theme='dark'] header {
  border-bottom-color: var(--border);
}

[data-theme='dark'] footer {
  border-top-color: var(--border);
}
