:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #8b5cf6;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-hover: 0 10px 25px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(rgba(248,250,252,0.88), rgba(248,250,252,0.88)), url(/images/ai-bg.png) center/cover fixed;
  color: var(--text);
  line-height: 1.8;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

header {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #8b5cf6 100%);
  color: #fff;
  padding: 60px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: url(/images/ai-icon.svg) no-repeat center/contain;
  opacity: 0.06;
  pointer-events: none;
}

header .container { position: relative; z-index: 1; }
header h1 { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
header h1 a { color: #fff; text-decoration: none; }
header .subtitle { font-size: 16px; opacity: 0.85; margin-top: 8px; }

main { min-height: 60vh; padding: 40px 0; }

/* ===== 双栏布局 ===== */
.article-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.article-list article.gc {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
  overflow: hidden;
  display: flex;
  margin-bottom: 0;
}

.article-list article.gc:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.gc-bar {
  width: 5px;
  flex-shrink: 0;
}

.gc-body {
  padding: 18px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gc-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  display: inline-block;
}

.gc-body h2 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}

.gc-body h2 a {
  color: var(--text);
  text-decoration: none;
}

.gc-body h2 a:hover {
  color: var(--primary);
}

.gc-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* 分页 */
.pag {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 30px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.pag a, .pag span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}

.pag a {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.pag a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pag-cur {
  background: var(--primary) !important;
  color: #fff !important;
  border: 1px solid var(--primary) !important;
  font-weight: 600;
}

/* 文章详情 */
.post {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.post h1 { font-size: 28px; font-weight: 700; line-height: 1.4; margin-bottom: 10px; }
.post .date { color: var(--text-light); font-size: 14px; margin-bottom: 24px; }
.post h2 { font-size: 22px; font-weight: 600; margin: 30px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--primary-light); }
.post h3 { font-size: 18px; font-weight: 600; margin: 24px 0 10px; }
.post p { margin: 14px 0; font-size: 16px; color: #334155; }
.post ul, .post ol { margin: 12px 0 12px 24px; }
.post li { margin: 6px 0; }
.post code { background: #f1f5f9; padding: 2px 8px; border-radius: 4px; font-size: 14px; color: var(--primary-dark); font-family: monospace; }
.post pre { background: #1e293b; color: #e2e8f0; padding: 20px 24px; border-radius: 10px; overflow-x: auto; margin: 16px 0; }
.post pre code { background: none; padding: 0; color: inherit; }
.post blockquote { border-left: 4px solid var(--primary); padding: 12px 20px; margin: 16px 0; background: #f1f5f9; border-radius: 0 8px 8px 0; }
.post table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.post th, .post td { padding: 10px 16px; border: 1px solid var(--border); }
.post th { background: #f1f5f9; font-weight: 600; }
.post tr:nth-child(even) { background: #fafbfc; }

.nav-links { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); gap: 20px; }
.nav-links a { color: var(--primary); text-decoration: none; font-size: 15px; font-weight: 500; max-width: 45%; }
.nav-links a:hover { color: var(--primary-dark); }

/* Footer */
footer { background: #1e293b; color: #94a3b8; text-align: center; padding: 30px 0; font-size: 14px; margin-top: 40px; }
footer a { color: #94a3b8; text-decoration: none; }
footer a:hover { color: #fff; }

@media (max-width: 768px) {
  header { padding: 40px 0 35px; }
  header h1 { font-size: 26px; }
  .article-list { grid-template-columns: 1fr; }
  .gc-body { padding: 14px 16px; }
  .gc-body h2 { font-size: 15px; }
  .post { padding: 24px 20px; }
  .nav-links { flex-direction: column; }
  .nav-links a { max-width: 100%; }
}

/* ===== 相关文章 ===== */
.related-articles {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.related-articles h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.related-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.25s ease;
}

.related-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.related-item a {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.ri-bar {
  width: 4px;
  flex-shrink: 0;
}

.ri-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 70px;
}

.ri-cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.ri-body h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin: 0;
}

.ri-body h3:hover {
  color: var(--primary);
}

.ri-date {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
}

@media (max-width: 768px) {
  .related-grid { grid-template-columns: 1fr; }
  .ri-body { padding: 12px 14px; }
  .ri-body h3 { font-size: 13px; }
}

/* 面包屑导航 */
.breadcrumb {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a {
  color: #64748b;
  text-decoration: none;
  transition: color .2s;
}
.breadcrumb a:hover {
  color: #2563eb;
}
.bc-sep {
  color: #cbd5e1;
  font-size: 14px;
}
.bc-current {
  color: #1e293b;
  font-weight: 500;
}
