/* ===========================
   Base & Reset
   =========================== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: #f0f2f5;
  color: #2d3748;
  line-height: 1.85;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===========================
   Header
   =========================== */
header {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  color: #e2e8f0;
  padding: 52px 20px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(99, 179, 237, 0.12) 0%, transparent 65%);
  pointer-events: none;
}

header h1 {
  margin: 0;
  font-size: 2.4em;
  font-weight: 700;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
}

header p.tagline {
  color: #90cdf4;
  margin: 10px 0 0;
  font-size: 1em;
  position: relative;
  z-index: 1;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #90cdf4;
  text-decoration: none;
  font-size: 0.9em;
  margin-top: 16px;
  transition: color 0.2s, gap 0.2s;
  position: relative;
  z-index: 1;
}

.nav-back:hover {
  color: #ffffff;
  gap: 8px;
}

/* ===========================
   Main Layout
   =========================== */
main {
  flex: 1;
  max-width: 780px;
  margin: 48px auto;
  padding: 0 20px;
  width: 100%;
}

/* ===========================
   Article Cards (Index)
   =========================== */
.article-card {
  background: #ffffff;
  padding: 32px;
  margin-bottom: 28px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05), 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #4299e1, #667eea);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.article-card:hover::before {
  opacity: 1;
}

/* ===========================
   Tag / Category Badge
   =========================== */
.tag {
  display: inline-block;
  background: #ebf8ff;
  color: #2b6cb0;
  font-size: 0.75em;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 20px;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}

/* ===========================
   Article Title & Meta
   =========================== */
.article-title {
  margin: 0 0 10px;
  font-size: 1.45em;
  font-weight: 700;
  line-height: 1.4;
}

.article-title a {
  color: #1a202c;
  text-decoration: none;
  transition: color 0.2s;
}

.article-title a:hover { color: #4299e1; }

.article-meta {
  font-size: 0.85em;
  color: #a0aec0;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.article-excerpt {
  color: #4a5568;
  margin-bottom: 20px;
  font-size: 0.96em;
  line-height: 1.75;
}

/* ===========================
   Read More Link
   =========================== */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4299e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9em;
  transition: gap 0.2s;
}

.read-more:hover { gap: 10px; }

/* ===========================
   Article Content Page
   =========================== */
.article-content {
  background: #ffffff;
  padding: 48px 52px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05), 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.article-content .article-title {
  margin: 0 0 16px;
  font-size: 2em;
  color: #1a202c;
  line-height: 1.3;
  font-weight: 800;
}

.article-content .article-meta {
  padding-bottom: 24px;
  border-bottom: 2px solid #f7fafc;
  margin-bottom: 28px;
}

.article-content p {
  color: #4a5568;
  margin-bottom: 18px;
  font-size: 1.02em;
}

.article-content h3 {
  font-size: 1.2em;
  font-weight: 700;
  color: #2d3748;
  margin: 36px 0 16px;
  padding-left: 14px;
  border-left: 4px solid #4299e1;
  line-height: 1.4;
}

/* ===========================
   Inline Code
   =========================== */
code {
  background: #f7fafc;
  color: #d53f8c;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: "JetBrains Mono", Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9em;
  border: 1px solid #e2e8f0;
}

/* ===========================
   Code Block
   =========================== */
.code-block {
  background: #1a202c;
  color: #a8d8a8;
  padding: 22px 26px;
  border-radius: 10px;
  font-family: "JetBrains Mono", Consolas, Monaco, "Courier New", monospace;
  font-size: 0.88em;
  line-height: 1.75;
  margin: 22px 0;
  overflow-x: auto;
  position: relative;
}

.code-block::before {
  content: 'YAML';
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 0.72em;
  color: #4a5568;
  font-family: inherit;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: #2d3748;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===========================
   Footer
   =========================== */
footer {
  text-align: center;
  padding: 32px 20px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  font-size: 0.875em;
  color: #a0aec0;
  margin-top: auto;
}

footer p { margin: 0 0 6px; }

footer a {
  color: #a0aec0;
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover { color: #4299e1; }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 640px) {
  header h1 { font-size: 1.8em; }
  header { padding: 36px 20px 30px; }
  .article-content { padding: 28px 22px; }
  .article-card { padding: 24px 22px; }
  main { margin: 28px auto; }
}
