:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1f2630;
  --border: #2a313c;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --gold: #f5b400;
  --green: #2ea043;
  --red: #f85149;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--gold); }

.hero {
  background: linear-gradient(135deg, #1a1f2a 0%, #0a1f3a 60%, #051226 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px 36px;
  text-align: center;
}
.hero-compact { padding: 18px 24px; text-align: left; }
.hero-compact .hero-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}
.hero-inner { max-width: 960px; margin: 0 auto; }

.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1a5fb4);
  color: #fff;
  font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(88,166,255,0.3);
}
.hero h1 { margin: 0 0 8px; font-size: 24px; }
.tagline {
  color: var(--muted); font-size: 14px;
  margin: 0 0 20px;
  max-width: 540px;
  margin-left: auto; margin-right: auto;
}

.hero-nav {
  display: flex; gap: 10px;
  justify-content: center; flex-wrap: wrap;
}
.hero-nav a {
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
}
.hero-nav a:hover { color: var(--text); border-color: var(--accent); }
.hero-nav a.active { color: var(--accent); border-color: var(--accent); }

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

.strip-title {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 14px;
  font-weight: 600;
}

.strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 14px;
  gap: 12px;
}
.strip-head .strip-title { margin: 0; }
.upload-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}
.upload-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.06);
}
button.upload-link {
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.article-actions { position: relative; }
.article-actions-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.article-actions.open .article-actions-menu { display: block; }
.article-actions-menu a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  border-radius: 4px;
  text-decoration: none;
}
.article-actions-menu a:hover { background: var(--surface-2); color: var(--accent); }

/* Projects strip on homepage */
.projects-strip { margin-bottom: 36px; }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.project-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.15s;
  color: var(--text) !important;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.project-icon { font-size: 24px; line-height: 1; }
.project-icon.big { font-size: 40px; }
.project-meta { min-width: 0; }
.project-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.project-tagline { color: var(--muted); font-size: 12px; line-height: 1.5; }
.more-link {
  display: inline-block; margin-top: 12px;
  font-size: 13px; color: var(--accent);
}

/* Post list */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  border-bottom: 1px solid var(--border);
}
.post-list li:last-child { border-bottom: none; }
.post-link {
  display: block; padding: 18px 6px;
  color: var(--text) !important;
}
.post-link:hover { background: rgba(255,255,255,0.02); }
.post-link:hover h3 { color: var(--accent); }
.post-date { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.post-link h3 {
  margin: 0 0 6px; font-size: 18px;
  transition: color 0.15s;
}
.post-summary {
  color: var(--muted); font-size: 13px;
  margin: 0 0 8px;
}
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.post-tags.inline { display: inline-flex; gap: 4px; }
.tag {
  font-size: 11px;
  color: var(--muted);
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

/* Article page */
.article-container { max-width: 720px; }
.post-meta-line {
  display: flex; gap: 8px; align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.post-title-h1 {
  font-size: 30px; line-height: 1.3;
  margin: 0 0 16px;
}
.post-summary.lead {
  font-size: 16px; color: var(--muted);
  padding: 14px 18px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  margin-bottom: 24px;
}
.post-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Markdown — GitHub-style typography */
.markdown-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
               Helvetica, Arial, "PingFang SC", "Microsoft YaHei",
               "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  word-wrap: break-word;
}
.markdown-body > *:first-child { margin-top: 0 !important; }
.markdown-body > *:last-child { margin-bottom: 0 !important; }

/* Headings — GitHub spacing scale */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}
.markdown-body h1 {
  font-size: 2em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}
.markdown-body h2 {
  font-size: 1.5em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1em; }
.markdown-body h5 { font-size: 0.875em; }
.markdown-body h6 { font-size: 0.85em; color: var(--muted); }

/* Paragraph & blocks */
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
  margin-top: 0;
  margin-bottom: 16px;
}
.markdown-body ul, .markdown-body ol { padding-left: 2em; }
.markdown-body ul ul, .markdown-body ul ol,
.markdown-body ol ul, .markdown-body ol ol {
  margin-top: 0; margin-bottom: 0;
}
.markdown-body li { margin: 0.25em 0; }
.markdown-body li > p { margin-top: 16px; }
.markdown-body li + li { margin-top: 0.25em; }

/* Links */
.markdown-body a {
  color: #58a6ff;
  text-decoration: none;
  border-bottom: none;
}
.markdown-body a:hover { text-decoration: underline; }

/* Inline code */
.markdown-body code {
  padding: 0.2em 0.4em;
  font-size: 85%;
  background: rgba(110, 118, 129, 0.4);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
  color: var(--text);
}
/* Code blocks */
.markdown-body pre {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
}
.markdown-body pre code {
  background: transparent;
  padding: 0;
  font-size: 100%;
  color: #e6edf3;
  border: 0;
  white-space: pre;
}

/* Blockquote */
.markdown-body blockquote {
  padding: 0 1em;
  color: var(--muted);
  border-left: 0.25em solid var(--border);
  background: none;
  border-radius: 0;
}
.markdown-body blockquote > :first-child { margin-top: 0; }
.markdown-body blockquote > :last-child { margin-bottom: 0; }

/* Tables — GitHub style: zebra-stripe, bordered */
.markdown-body table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow: auto;
  border-spacing: 0;
  border-collapse: collapse;
  font-size: 14px;
}
.markdown-body table th,
.markdown-body table td {
  padding: 6px 13px;
  border: 1px solid var(--border);
}
.markdown-body table th { font-weight: 600; background: var(--surface-2); }
.markdown-body table tr { background: transparent; border-top: 1px solid var(--border); }
.markdown-body table tr:nth-child(2n) { background: rgba(110, 118, 129, 0.08); }

/* Image */
.markdown-body img {
  max-width: 100%;
  box-sizing: content-box;
  background: transparent;
  border-radius: 6px;
}

/* Horizontal rule */
.markdown-body hr {
  height: 0.25em;
  padding: 0;
  margin: 24px 0;
  background: var(--border);
  border: 0;
}

/* Inline emphasis */
.markdown-body strong { font-weight: 600; color: var(--text); }
.markdown-body em { font-style: italic; color: var(--text); }

/* Task lists */
.markdown-body input[type="checkbox"] { margin-right: 0.5em; }

/* Projects page */
.projects-page { display: grid; gap: 28px; }
.project-full {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 24px 28px;
}
.project-head {
  display: flex; gap: 18px; align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.project-head h2 { margin: 0 0 6px; font-size: 22px; }
.status-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--green);
  color: #6ddc8a;
  background: rgba(46,160,67,0.1);
  margin-left: 8px;
  font-weight: normal;
  vertical-align: middle;
}
.project-links { display: flex; gap: 12px; margin-top: 10px; }
.project-links a {
  font-size: 13px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.project-links a:hover { border-color: var(--accent); }

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 60px 20px;
}
.empty-state code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: 12px;
  max-width: 960px; margin: 32px auto 0;
  flex-wrap: wrap; gap: 8px;
}

.muted { color: var(--muted); }
