/* ========================================
   极简博客样式 - Minimal Blog Stylesheet
   ======================================== */

/* ========================================
   CSS Variables - Light Theme (default)
   ======================================== */
:root {
  --bg: #f8f9fb;
  --bg-grid-color: rgba(208, 213, 221, 0.5);
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-hover-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(208, 213, 221, 0.3);
  --card-hover-border: rgba(208, 213, 221, 0.6);
  --text-primary: #1a1a1a;
  --text-body: #2c2c2c;
  --text-body-alt: #1e293b;
  --text-secondary: #777;
  --text-muted: #999;
  --text-muted-light: #aaa;
  --text-nav: #888;
  --border-light: #eaeaea;
  --code-bg: #f0f0f0;
  --pre-bg: #f5f5f5;
  --tag-bg: #f5f5f5;
  --tag-text: #888;
  --blockquote-bg: #f8f8f8;
  --blockquote-border: #1a1a1a;
  --blockquote-text: #555;
  --table-th-bg: #f8f8f8;
  --table-border: #eaeaea;
  --link-underline: #ccc;
  --footer-text: #bbb;
  --hover-shadow: rgba(0, 0, 0, 0.06);
  --theme-toggle-hover-bg: rgba(0, 0, 0, 0.06);
}

/* ========================================
   CSS Variables - Dark Theme
   ======================================== */
html.dark {
  --bg: #0d1117;
  --bg-grid-color: rgba(255, 255, 255, 0.035);
  --card-bg: rgba(22, 27, 34, 0.85);
  --card-hover-bg: rgba(22, 27, 34, 0.95);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-hover-border: rgba(255, 255, 255, 0.14);
  --text-primary: #e6edf3;
  --text-body: #c9d1d9;
  --text-body-alt: #c9d1d9;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-muted-light: #6e7681;
  --text-nav: #6e7681;
  --border-light: #30363d;
  --code-bg: rgba(240, 246, 252, 0.12);
  --pre-bg: #161b22;
  --tag-bg: rgba(240, 246, 252, 0.08);
  --tag-text: #8b949e;
  --blockquote-bg: rgba(240, 246, 252, 0.05);
  --blockquote-border: #58a6ff;
  --blockquote-text: #8b949e;
  --table-th-bg: rgba(240, 246, 252, 0.05);
  --table-border: #30363d;
  --link-underline: #484f58;
  --footer-text: #484f58;
  --hover-shadow: rgba(0, 0, 0, 0.4);
  --theme-toggle-hover-bg: rgba(255, 255, 255, 0.1);
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 隐藏滚动条但保持滚动功能 */
html::-webkit-scrollbar {
  display: none;
}

html {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-body-alt);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid-color) 1px, transparent 1px);
  background-size: 20px 20px;
  transition: background-color 0.3s, color 0.3s;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========================================
   Header / Navigation
   ======================================== */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--card-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo a {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--text-nav);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.25rem 0;
}

nav a:hover {
  color: var(--text-primary);
}

nav a.active {
  color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-nav);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background-color: var(--theme-toggle-hover-bg);
}

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

/* ========================================
   Main Content
   ======================================== */

main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* Page Header */
.page-header {
  margin-bottom: 2.5rem;
}

.page-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ========================================
   Loading & Empty States
   ======================================== */

.loading-state,
.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.empty-state code {
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ========================================
   Article List (Home)
   ======================================== */

.article-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.article-card {
  background-color: var(--card-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.article-card:hover {
  border-color: var(--card-hover-border);
  background-color: var(--card-hover-bg);
  box-shadow: 0 4px 16px var(--hover-shadow);
}

.article-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted-light);
}

.article-meta time {
  color: var(--text-muted-light);
}

.category-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  font-weight: 500;
}

.article-card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  letter-spacing: -0.3px;
}

.article-summary {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.25rem;
  transition: opacity 0.2s;
}

.article-card:hover .read-more {
  opacity: 0.7;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 0.75rem;
  border: none;
  border-radius: 8px;
  background: var(--card-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--card-border);
  color: var(--text-nav);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.page-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--card-hover-border);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-num {
  width: 34px;
  padding: 0;
  font-variant-numeric: tabular-nums;
}

.page-num.active {
  color: var(--text-primary);
  border-color: var(--card-hover-border);
  background-color: var(--card-hover-bg);
  font-weight: 600;
}

.page-numbers {
  display: flex;
  gap: 0.4rem;
}

/* ========================================
   Article Detail Page
   ======================================== */

.article-detail {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-detail-card {
  background-color: var(--card-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem 2.25rem;
}

.article-detail-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.article-detail-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted-light);
}

.article-detail-meta time {
  color: var(--text-muted-light);
}

/* Article Content - Markdown rendered */
.article-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-body);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.article-content h1 { font-size: 1.6rem; }
.article-content h2 { font-size: 1.35rem; }
.article-content h3 { font-size: 1.15rem; }

.article-content h1:first-child,
.article-content h2:first-child {
  margin-top: 0;
}

.article-content p {
  margin-bottom: 1.25rem;
}

.article-content a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--link-underline);
  transition: text-decoration-color 0.2s;
}

.article-content a:hover {
  text-decoration-color: var(--text-primary);
}

.article-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.25rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.4rem;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--blockquote-border);
  background: var(--blockquote-bg);
  color: var(--blockquote-text);
  font-style: normal;
}

.article-content blockquote p {
  margin-bottom: 0;
}

.article-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--text-body);
}

.article-content pre {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--pre-bg);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.article-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 2rem 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

.article-content th,
.article-content td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--table-border);
  text-align: left;
}

.article-content th {
  background: var(--table-th-bg);
  font-weight: 600;
}

/* Article Footer */
.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-nav);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-primary);
}

/* ========================================
   About Page
   ======================================== */

.page-about {
  animation: fadeIn 0.25s ease;
}

.page-about .article-detail-card {
  padding: 2rem 2.25rem;
}

.about-content {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text-body);
}

.about-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.about-content p {
  margin-bottom: 1.25rem;
}

.about-content ul,
.about-content ol {
  margin: 0 0 1.25rem 1.5rem;
}

.about-content li {
  margin-bottom: 0.4rem;
}

.about-content code {
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ========================================
   Footer
   ======================================== */

footer {
  border-top: 1px solid var(--card-border);
  background-color: var(--card-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
}

footer p {
  font-size: 0.82rem;
  color: var(--footer-text);
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 640px) {
  main {
    padding: 2rem 1rem 3rem;
  }

  .header-inner {
    padding: 0 1rem;
  }

  .article-card {
    padding: 1.25rem 1.25rem;
  }

  .article-detail-header h1 {
    font-size: 1.45rem;
  }

  .article-content {
    font-size: 0.95rem;
  }

  .article-content h2 {
    font-size: 1.2rem;
  }

  .page-header h2 {
    font-size: 1.4rem;
  }

  .pagination {
    gap: 0.5rem;
  }

  .page-btn {
    font-size: 0.8rem;
    padding: 0 0.55rem;
  }

  .page-num {
    width: 32px;
  }
}
