/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #2563eb;
  --primary-d:  #1d4ed8;
  --bg:         #f8fafc;
  --surface:    #ffffff;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --text-muted: #64748b;
  --radius:     10px;
  --shadow:     0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

.site-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== 导航栏 ===== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.navbar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  white-space: nowrap;
}
.navbar-brand:hover { text-decoration: none; color: var(--primary); }

/* ===== Tab 导航 ===== */
.tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  padding: 0;
  list-style: none;
}
.tabs .tab-btn {
  background: none;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.tabs .tab-btn:hover { background: var(--bg); color: var(--text); }
.tabs .tab-btn.active { background: var(--primary); color: #fff; }

/* ===== 主内容区 ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.site-page .container {
  flex: 1;
  width: 100%;
}

/* ===== 文章卡片列表 ===== */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .article-grid { grid-template-columns: 1fr 1fr; }
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.1); }
.article-card-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg);
}
.article-card-cover-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #e0e7ff 0%, #f0f9ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.article-card-body { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.article-card-title { font-size: 1rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.article-card-meta { font-size: 0.8rem; color: var(--text-muted); }
.article-card-category {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 20px;
  font-weight: 500;
}

/* ===== 文章详情 ===== */
.article-detail { background: var(--surface); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.article-detail-cover { width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--radius); margin-bottom: 2rem; }
.article-detail h1 { font-size: 1.8rem; margin-bottom: 0.75rem; line-height: 1.3; }
.article-detail-meta { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.article-body { line-height: 1.85; }
.article-body h1,.article-body h2,.article-body h3 { margin: 1.5rem 0 0.75rem; }
.article-body p { margin-bottom: 1rem; }
.article-body ul,.article-body ol { margin: 0.75rem 0 0.75rem 1.5rem; }
.article-body li { margin-bottom: 0.3rem; }
.article-body blockquote { border-left: 4px solid var(--primary); padding: 0.75rem 1rem; background: #eff6ff; border-radius: 0 var(--radius) var(--radius) 0; margin: 1rem 0; color: var(--text-muted); }
.article-body code { background: #f1f5f9; padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em; font-family: 'JetBrains Mono', Menlo, monospace; }
.article-body pre { background: #1e293b; color: #e2e8f0; padding: 1.2rem; border-radius: var(--radius); overflow-x: auto; margin: 1rem 0; }
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body img { border-radius: var(--radius); margin: 1rem 0; }
.article-body a { color: var(--primary); }

/* ===== 联系信息 ===== */
.contact-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.contact-icon { font-size: 1.5rem; width: 2.5rem; text-align: center; color: var(--primary); }
.contact-label { font-weight: 600; font-size: 0.9rem; color: var(--text-muted); }
.contact-value { font-size: 1rem; color: var(--text); }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: 2rem; }
.pagination button {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background .15s;
}
.pagination button:hover { background: var(--bg); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }

/* ===== 返回按钮 ===== */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: color .15s;
}
.btn-back:hover { color: var(--primary); text-decoration: none; }

/* ===== Footer ===== */
footer { text-align: center; padding: 2rem 1rem; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--border); margin-top: 3rem; }
.site-page footer {
  margin-top: auto;
  padding-bottom: 32px;
}

/* ===== Loading ===== */
.loading { text-align: center; padding: 3rem; color: var(--text-muted); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 0.75rem; }
@keyframes spin { to { transform: rotate(360deg); } }
