@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

/* ============================================================
   VELKA — Teenage Engineering Theme
   Warm industrial minimalism. Every pixel is intentional.
   ============================================================ */

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

:root {
  /* ── 暖中性配色 · Warm-Neutral ──
     介于冷灰与暖米之间：米白卡片浮于暖石底色，明亮且不压抑 */
  --bg:             #eeecea;   /* 页面底色：极淡暖石色，带一丝温度感 */
  --surface:        #f8f6f3;   /* 卡片面：米白，与底色层次鲜明 */
  --surface-raised: #ffffff;   /* 凸起元素：纯白，最明层 */
  --border:         #e0dad4;   /* 边框：暖灰，柔和不刺 */
  --border-dark:    #c4bbb3;   /* 深边框：hover/focus 时 */
  --text-primary:   #1e1c1a;   /* 主文字：微暖深黑，柔于纯黑 */
  --text-secondary: #5e5751;   /* 次要文字：暖中灰 */
  --text-tertiary:  #9a9390;   /* 三级文字：暖浅灰 */
  --accent:         #ff6b35;   /* 强调色：保留橙色品牌感 */
  --accent-dim:     #e85d2c;   /* 深橙：链接/hover */
  --accent-glow:    rgba(255, 107, 53, 0.16);

  /* 白卡+冷背景时阴影需略深才能保住拟物层次感 */
  --shadow-xs:      0 1px 2px rgba(0,0,0,0.07);
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:      0 3px 6px rgba(0,0,0,0.09), 0 6px 16px rgba(0,0,0,0.06);
  --shadow-lg:      0 6px 12px rgba(0,0,0,0.10), 0 14px 30px rgba(0,0,0,0.07);
  --shadow-inset:   inset 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 2px rgba(0,0,0,0.05);
  --shadow-button:  0 1px 0 rgba(255,255,255,0.9) inset, 0 2px 4px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.07);

  --radius:    6px;
  --radius-lg: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  /* 细网格纹理：仅在卡片之间的底色区域隐约可见，增强质感 */
  background-image:
    linear-gradient(rgba(0,0,0,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.045) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   READING PROGRESS
   ============================================================ */
.reading-progress {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 200;
  pointer-events: none;
}
.reading-progress .bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: var(--text-primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.15s ease;
  white-space: nowrap;
  display: inline-block;
}
.topbar-logo:hover { background: #333; }

.topbar-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf50;
  flex-shrink: 0;
  animation: status-pulse 2.5s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0.5); }
  50%       { box-shadow: 0 0 0 4px rgba(76,175,80,0); }
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.topbar-nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: all 0.15s ease;
}
.topbar-nav a:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.04);
}
.topbar-nav a.active {
  color: var(--text-primary);
  background: var(--bg);
  box-shadow: var(--shadow-inset);
}

/* ============================================================
   LAYOUT CONTAINERS
   ============================================================ */
.main-container {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 24px 72px;
}
.article-outer,
.archive-outer,
.page-outer {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

/* Page entrance animation */
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main-container,
.article-outer,
.archive-outer,
.page-outer {
  animation: page-in 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.75);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.hero-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 480px;
}

.hero-meta-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-inset);
  min-width: 178px;
  flex-shrink: 0;
}
.hero-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-family: 'JetBrains Mono', monospace;
}
.hero-meta-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
  padding-bottom: 7px;
  margin-bottom: 3px;
}
.hero-meta-label {
  font-size: 9px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.hero-meta-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================================
   ACTIVITY BAR
   ============================================================ */
.activity-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.activity-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.activity-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.activity-icon {
  width: 36px; height: 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-inset);
  font-size: 15px;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.activity-text {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}
.activity-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
}

/* Waveform */
.waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 20px;
}
.waveform-bar {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}
.waveform-bar:nth-child(1) { height: 8px;  animation-delay: 0s; }
.waveform-bar:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.waveform-bar:nth-child(3) { height: 6px;  animation-delay: 0.3s; }
.waveform-bar:nth-child(4) { height: 18px; animation-delay: 0.45s; }
.waveform-bar:nth-child(5) { height: 10px; animation-delay: 0.6s; }
.waveform-bar:nth-child(6) { height: 14px; animation-delay: 0.75s; }
.waveform-bar:nth-child(7) { height: 8px;  animation-delay: 0.9s; }
@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(0.35); }
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}
.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.section-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ============================================================
   FILTER BAR  (search + category pills)
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-field {
  flex: 1;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-primary);
  box-shadow: var(--shadow-inset);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  letter-spacing: 0.2px;
}
.search-field::placeholder {
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
}
.search-field:focus {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-inset), 0 0 0 2px var(--accent-glow);
}

.cat-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
/* shared pill/button style */
.cat-pill,
.tag-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-button);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  position: relative;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.cat-pill::before,
.tag-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255,255,255,0.28);
  border-radius: 3px 3px 0 0;
  pointer-events: none;
}
.cat-pill:hover,
.tag-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-dark);
  transform: translateY(-0.5px);
  box-shadow: var(--shadow-md);
}
.cat-pill.active,
.tag-btn.active {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   FEATURED POST
   ============================================================ */
.featured-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.featured-post::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.featured-post:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  border-color: var(--border-dark);
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(255,107,53,0.3);
}

.featured-post h2 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
}
.featured-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
  max-width: 640px;
}
.featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   POST META  (dates, read-time, tags inline)
   ============================================================ */
.post-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.meta-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 3px;
  box-shadow: var(--shadow-inset);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.meta-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* ============================================================
   POST LIST  (compact rows)
   ============================================================ */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 20px;
}
.post-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}
.post-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}
.post-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-0.5px);
  border-color: var(--border-dark);
}

.post-item-left { min-width: 0; }
.post-item-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.post-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.post-item-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.post-item-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.post-item-arrow {
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1;
  transition: transform 0.15s, color 0.15s;
}
.post-item:hover .post-item-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ============================================================
   WIDGET GRID  (2-col sidebar blocks on homepage)
   ============================================================ */
.widget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.widget::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.widget-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Tags cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 14px;
}
.stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 10px;
  text-align: center;
  box-shadow: var(--shadow-inset);
}
.stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
}

/* Archive list in widget */
.widget-archive-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.widget-archive-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.widget-archive-item:hover { background: rgba(0,0,0,0.03); }
.widget-archive-month { font-size: 12px; font-weight: 600; }
.widget-archive-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* Decorative dial */
.dial-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.dial {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f4f2ef, #e6e1db);
  border: 2px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.5);
  position: relative;
  flex-shrink: 0;
}
.dial::after {
  content: '';
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 10px;
  background: var(--accent);
  border-radius: 2px;
}
.dial-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-secondary);
}
.dial-dot {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 0;
}
.pagination a,
.pagination .page-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-button);
  text-decoration: none;
  position: relative;
}
.pagination a::before,
.pagination .page-num::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255,255,255,0.28);
  border-radius: 5px 5px 0 0;
  pointer-events: none;
}
.pagination a:hover {
  transform: translateY(-0.5px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}
.pagination .page-num {
  background: var(--bg);
  box-shadow: var(--shadow-inset);
  color: var(--text-tertiary);
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.footer-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}
.footer-brand strong { font-weight: 800; color: var(--text-secondary); }
.footer-links { display: flex; gap: 14px; }
.footer-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--accent); }

/* ============================================================
   BACK BUTTON  (article / archive nav)
   ============================================================ */
.article-back-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-button);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  text-decoration: none;
}
.back-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255,255,255,0.3);
  border-radius: 5px 5px 0 0;
  pointer-events: none;
}
.back-btn:hover {
  transform: translateY(-0.5px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.article-header-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.article-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-wrap: wrap;
}
.article-header-meta .sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border-dark);
  flex-shrink: 0;
}
.article-header-meta a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}
.article-header-meta a:hover { color: var(--accent); }

.article-header-card h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.article-header-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Content card */
.article-content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px 40px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.article-content-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}

/* Typography */
.article-body {
  font-size: 15px;
  line-height: 1.85;
  color: #3d3a36;  /* 正文用比 text-secondary 稍深的暖灰，阅读对比舒适 */
}
.article-body > *:first-child { margin-top: 0 !important; }
.article-body > *:last-child  { margin-bottom: 0 !important; }

.article-body p  { margin-bottom: 20px; }

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin: 32px 0 14px;
}
.article-body h1 { font-size: 26px; letter-spacing: -0.5px; }
.article-body h2 {
  font-size: 20px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}
.article-body h3 { font-size: 17px; }
.article-body h4 { font-size: 15px; }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  margin: 24px 0;
  background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  box-shadow: var(--shadow-inset);
}
.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent-dim);
}
.article-body pre {
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 22px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
  border: 1px solid #2d2d2d;
  box-shadow: var(--shadow-md);
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}
.article-body ul,
.article-body ol  { margin: 16px 0; padding-left: 22px; color: var(--text-secondary); }
.article-body li  { font-size: 15px; line-height: 1.8; margin-bottom: 6px; }
.article-body a   {
  color: var(--accent-dim);
  text-decoration: underline;
  text-decoration-color: rgba(232,93,44,0.35);
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.article-body a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.article-body img {
  width: 100%;
  border-radius: var(--radius);
  margin: 20px 0;
  border: 1px solid var(--border);
  display: block;
}
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.article-body th,
.article-body td  { border: 1px solid var(--border); padding: 9px 14px; text-align: left; }
.article-body th  {
  background: var(--bg);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
}
.article-body tr:nth-child(even) { background: rgba(0,0,0,0.015); }

/* ============================================================
   ARCHIVE PAGE
   ============================================================ */
.archive-page-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.archive-page-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.archive-page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.archive-page-sub { font-size: 13px; color: var(--text-secondary); }

.archive-year-group { margin-bottom: 20px; }
.archive-year-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.archive-year-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.archive-month-group  { margin-bottom: 10px; }
.archive-month-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 6px 6px;
}

.archive-post-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.archive-post-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}
.archive-post-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}
.archive-post-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-0.5px);
  border-color: var(--border-dark);
}
.archive-post-title {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}
.archive-post-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.archive-post-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ============================================================
   CATEGORIES PAGE
   ============================================================ */
.page-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.page-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.page-header-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.page-header-sub { font-size: 13px; color: var(--text-secondary); }

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.15s ease;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.category-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--border-dark);
}
.category-card-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 5px;
}
.category-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.category-card-slug {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: block;
}

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
}
.search-form-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.search-input-full {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-primary);
  box-shadow: var(--shadow-inset);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  letter-spacing: 0.2px;
}
.search-input-full:focus {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-inset), 0 0 0 2px var(--accent-glow);
}
.search-submit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--text-primary);
  border: 1px solid #111;
  padding: 9px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  white-space: nowrap;
}
.search-submit::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255,255,255,0.12);
  border-radius: 5px 5px 0 0;
  pointer-events: none;
}
.search-submit:hover { background: #333; transform: translateY(-0.5px); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.empty-state::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}
.empty-state-icon { font-size: 28px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p    { font-size: 14px; color: var(--text-secondary); }
.empty-state .empty-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

/* ============================================================
   404 PAGE
   ============================================================ */
.error-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 60px 24px;
  text-align: center;
}
.error-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 80px;
  font-weight: 800;
  color: var(--border-dark);
  line-height: 1;
  letter-spacing: -4px;
  margin-bottom: 16px;
}
.error-title  { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.error-desc   { font-size: 13px; color: var(--text-secondary); margin-bottom: 28px; line-height: 1.6; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-dark); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .topbar-status { display: none; }

  .main-container               { padding: 16px 16px 48px; }
  .article-outer,
  .archive-outer,
  .page-outer                   { padding: 16px 16px 48px; }

  .hero-grid                    { grid-template-columns: 1fr; }
  .hero-meta-card               { display: none; }
  .hero-title                   { font-size: 22px; }

  .widget-grid                  { grid-template-columns: 1fr; }
  .categories-grid              { grid-template-columns: 1fr 1fr; }

  .post-item                    { grid-template-columns: 1fr; gap: 8px; }
  .post-item-right              { justify-content: flex-start; }

  .featured-post h2             { font-size: 18px; }

  .article-header-card          { padding: 20px; }
  .article-header-card h1       { font-size: 22px; }
  .article-content-card         { padding: 22px 20px 28px; }
  .article-body                 { font-size: 14px; }

  .search-form-card             { flex-direction: column; }
  .search-submit                { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
  .topbar-nav a     { padding: 6px 8px; font-size: 10px; }
  .categories-grid  { grid-template-columns: 1fr; }
  .filter-bar       { flex-direction: column; align-items: stretch; }
  .search-field     { width: 100%; }
  .site-footer      { flex-direction: column; gap: 10px; text-align: center; }
  .footer-links     { justify-content: center; }
}
