/* ============================================================
   Dark Tech Theme — dehu's blog
   ============================================================ */

:root {
  --bg:          #0d1117;
  --bg-2:        #161b22;
  --bg-3:        #21262d;
  --border:      #30363d;
  --border-muted:#1c2128;
  --text:        #e6edf3;
  --text-2:      #8b949e;
  --text-3:      #484f58;
  --accent:      #58d8a4;
  --accent-2:    #79c0ff;
  --accent-dim:  rgba(88, 216, 164, 0.08);
  --danger:      #f85149;
  --radius:      8px;
  --radius-sm:   4px;
  --ease:        0.15s ease;
  --font-mono:   "SFMono-Regular", "Fira Code", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a, a:link, a:visited {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--ease), opacity var(--ease);
}
a:hover { color: var(--text); }

img { max-width: 100%; }

/* ============================================================
   Layout
   ============================================================ */

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.main { min-height: calc(100vh - 52px - 97px); padding-top: 40px; }

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-muted);
}

.navbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 52px;
  gap: 8px;
}

.navbar-logo {
  font-size: 15px;
  font-weight: 700;
  color: var(--text) !important;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-right: 4px;
}
.navbar-logo-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.navbar-nav {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0;
}
.navbar-nav li a {
  display: block;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 5px;
  transition: color var(--ease), background var(--ease);
}
.navbar-nav li a:hover {
  color: var(--text);
  background: var(--bg-3);
}
.navbar-nav li.active a { color: var(--text); }

.navbar-search {
  margin-left: auto;
  flex-shrink: 0;
}
.navbar-search-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  width: 160px;
  transition: border-color var(--ease), width var(--ease), box-shadow var(--ease);
}
.navbar-search-input:focus {
  border-color: var(--accent);
  width: 200px;
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.navbar-search-input::placeholder { color: var(--text-3); }

/* ============================================================
   Hero — homepage
   ============================================================ */

.hero {
  padding: 60px 0 44px;
}
.hero-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: block;
  margin-bottom: 20px;
  border: 2px solid var(--border);
}
.hero-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  margin: 0 0 4px;
}
.hero-role {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 14px;
  font-family: var(--font-mono);
}
.hero-desc {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 24px;
  max-width: 460px;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  gap: 20px;
}
.hero-stat {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.hero-stat strong {
  color: var(--text-2);
  font-weight: 600;
}

/* ============================================================
   Section divider / label
   ============================================================ */

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0 16px;
}
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  white-space: nowrap;
}
.section-line {
  flex: 1;
  height: 1px;
  background: var(--border-muted);
}

/* ============================================================
   Post list (home + archives)
   ============================================================ */

.post-list {
  list-style: none;
  padding: 0;
  margin: 0 0 48px;
  display: flex;
  flex-direction: column;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 13px 14px;
  margin: 0 -14px;
  border-radius: var(--radius);
  transition: background var(--ease);
  text-decoration: none !important;
  cursor: pointer;
}
.post-item:hover { background: var(--bg-2); }

.post-item-date {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  min-width: 56px;
}
.post-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--ease);
}
.post-item:hover .post-item-title { color: var(--text); }

.post-item-cat {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border-muted);
  border-radius: 3px;
  padding: 1px 7px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color var(--ease), border-color var(--ease);
}
.post-item:hover .post-item-cat {
  color: var(--accent);
  border-color: var(--accent);
}

/* Year group (archives) */
.year-block { margin-bottom: 36px; }
.year-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border-muted);
  margin-bottom: 0;
}

/* ============================================================
   Page header (archives / categories / tags / about)
   ============================================================ */

.page-header {
  padding: 48px 0 36px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  margin: 0 0 6px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
}
.page-divider {
  border: none;
  border-top: 1px solid var(--border-muted);
  margin: 0 0 36px;
}

/* Search result banner */
.search-info {
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
}
.search-info strong { color: var(--accent); }

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 0 16px;
  font-size: 13px;
}
.pagination a {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  background: var(--bg-2);
  transition: all var(--ease);
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.pagination-info { color: var(--text-3); }

/* ============================================================
   Post page
   ============================================================ */

.post-page { padding-bottom: 64px; }

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  margin: 32px 0 36px;
  transition: color var(--ease);
}
.post-back:hover { color: var(--text-2); }
.post-back::before { content: "←"; }

.post-title {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  margin: 0 0 16px;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 28px;
  font-family: var(--font-mono);
}
.post-meta a { color: var(--text-3); }
.post-meta a:hover { color: var(--accent); }
.post-meta-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
  display: inline-block;
}

.post-divider {
  border: none;
  border-top: 1px solid var(--border-muted);
  margin: 0 0 36px;
}

/* Post content */
.post-content {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-2);
}
.post-content > *:first-child { margin-top: 0 !important; }

.post-content h1, .post-content h2,
.post-content h3, .post-content h4,
.post-content h5, .post-content h6 {
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 36px 0 12px;
  color: var(--text);
  line-height: 1.3;
}
.post-content h1 { font-size: 1.65em; }
.post-content h2 {
  font-size: 1.3em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-muted);
}
.post-content h3 { font-size: 1.1em; }
.post-content h4 { font-size: 1em; color: var(--text-2); }

.post-content p { margin: 0 0 18px; }

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(88,216,164,0.35);
  text-underline-offset: 3px;
}
.post-content a:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

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

.post-content code {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.45em;
  font-size: 85%;
  font-family: var(--font-mono);
  color: var(--accent);
}
.post-content code::before,
.post-content code::after { content: none; }

.post-content pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  margin: 0 0 22px;
  line-height: 1.65;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
  border-radius: 0;
}

.post-content blockquote {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-left: 2px solid var(--accent);
  background: var(--bg-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-style: italic;
}

.post-content ul,
.post-content ol { padding-left: 1.6em; margin: 0 0 18px; }
.post-content li { margin-bottom: 5px; }

.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  margin: 0 0 18px;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 13px;
}
.post-content th,
.post-content td {
  padding: 8px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th { background: var(--bg-2); font-weight: 600; color: var(--text); }
.post-content tr:nth-child(even) { background: rgba(255,255,255,0.02); }

.post-content kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--text-2);
}

/* highlight.js figure blocks */
figure.highlight {
  margin: 0 0 22px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
figure.highlight pre {
  margin: 0;
  padding: 20px 22px;
  font-size: 13px;
  line-height: 1.65;
}
figure.highlight .gutter { display: none; }
figure.highlight .line { color: var(--text-2); font-size: 13px; }

.highlight {
  background: var(--bg-2);
  color: var(--text-2);
  overflow-x: auto;
}

/* Syntax colors */
.highlight .comment, .highlight .meta { color: #6e7681; }
.highlight .string, .highlight .template-variable { color: #a5d6ff; }
.highlight .keyword, .highlight .selector-tag { color: #ff7b72; }
.highlight .literal, .highlight .symbol { color: #79c0ff; }
.highlight .name, .highlight .section { color: var(--accent); }
.highlight .attr, .highlight .title { color: #d2a8ff; }
.highlight .addition { color: #3fb950; }
.highlight .deletion  { color: var(--danger); }
.highlight .variable  { color: #ffa657; }

pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}

/* ============================================================
   Tag cloud
   ============================================================ */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 56px;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-2);
  transition: all var(--ease);
}
.tag-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.tag-pill-count {
  font-size: 10px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.tag-pill:hover .tag-pill-count { color: var(--accent); }

/* ============================================================
   Category grid
   ============================================================ */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 56px;
}
.category-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: all var(--ease);
}
.category-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.category-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.category-card:hover .category-card-name { color: var(--accent); }
.category-card-count {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* ============================================================
   About page
   ============================================================ */

.about-content {
  padding: 0 0 64px;
  line-height: 1.85;
  color: var(--text-2);
  font-size: 15px;
}
.about-content h2, .about-content h3 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-top: 32px;
  margin-bottom: 12px;
}
.about-content h2 { font-size: 1.3em; }
.about-content h3 { font-size: 1.1em; }
.about-content p { margin: 0 0 16px; }
.about-content ul { padding-left: 1.4em; margin: 0 0 16px; }
.about-content li { margin-bottom: 5px; }
.about-content strong { color: var(--text); }
.about-content a { color: var(--accent); }
.about-content a:hover { color: var(--text); }

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}
.tech-badge {
  padding: 3px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--font-mono);
}

/* ============================================================
   404
   ============================================================ */

.error-page {
  text-align: center;
  padding: 100px 0;
}
.error-code {
  font-size: 80px;
  font-weight: 700;
  color: var(--text-3);
  line-height: 1;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  letter-spacing: -2px;
}
.error-msg {
  color: var(--text-2);
  margin: 0 0 28px;
  font-size: 15px;
}
.btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  transition: all var(--ease);
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

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

.footer {
  border-top: 1px solid var(--border-muted);
  padding: 28px 0;
}
.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-3);
  flex-wrap: wrap;
  gap: 10px;
}
.footer-copy { font-family: var(--font-mono); }
.footer-links {
  display: flex;
  gap: 16px;
}
.footer-links a { color: var(--text-3); transition: color var(--ease); }
.footer-links a:hover { color: var(--text-2); }
