/* ════════════════════════════════════════════
   hongdihe.github.io — 全站共享样式
   index.html / en.html / blog/** 共用
   ════════════════════════════════════════════ */

:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --border: #30363d;
  --green: #3fb950;
  --green-dim: #238636;
  --cyan: #58a6ff;
  --orange: #f78166;
  --purple: #bc8cff;
  --yellow: #e3b341;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --text-muted: #484f58;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Nav ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(13,17,23,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-family: var(--font-mono); font-size: 14px; color: var(--green); letter-spacing: .05em; white-space: nowrap; }
.nav-logo span { color: var(--text-dim); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); text-decoration: none; transition: color .2s; white-space: nowrap; }
.nav-links a:hover { color: var(--cyan); }

/* ── Hero ── */
#hero {
  min-height: 80vh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px 40px;
  position: relative; overflow: hidden;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(48,54,61,.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48,54,61,.35) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 40%, transparent 100%);
}
.hero-content { max-width: 720px; width: 100%; position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 14px;
  font-family: var(--font-mono); font-size: 12px; color: var(--green);
  margin-bottom: 28px;
}
.hero-badge::before {
  content: ''; width: 7px; height: 7px;
  background: var(--green); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.hero-name { font-size: clamp(36px,6vw,60px); font-weight: 600; line-height: 1.15; margin-bottom: 16px; letter-spacing: -.02em; }
.hero-name .en { color: var(--text-dim); font-size: .65em; font-weight: 300; display: block; margin-top: 4px; }

.hero-tagline { font-family: var(--font-mono); font-size: 14px; color: var(--cyan); margin-bottom: 20px; }
.hero-tagline .caret { display: inline-block; animation: blink 1s step-end infinite; color: var(--green); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-desc { color: var(--text-dim); font-size: 15px; max-width: 560px; margin-bottom: 32px; line-height: 1.7; }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 20px; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 13px;
  text-decoration: none; transition: all .2s; cursor: pointer;
}
.btn-primary { background: var(--green-dim); border: 1px solid var(--green); color: var(--text); }
.btn-primary:hover { background: var(--green); color: #000; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── Section ── */
section { padding: 80px 24px; max-width: 1000px; margin: 0 auto; }
.section-label { font-family: var(--font-mono); font-size: 12px; color: var(--green); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.section-title { font-size: 26px; font-weight: 600; margin-bottom: 40px; color: var(--text); }
.section-title span { color: var(--text-dim); }

/* ── Terminal ── */
.terminal { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; max-width: 680px; }
.terminal-bar { background: var(--bg3); padding: 10px 16px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.terminal-body { padding: 20px 24px; font-family: var(--font-mono); font-size: 13px; line-height: 1.8; }
.t-prompt { color: var(--green); } .t-cmd { color: var(--text); } .t-key { color: var(--cyan); }
.t-val { color: var(--yellow); } .t-comment { color: var(--text-muted); }
.t-link { color: var(--purple); text-decoration: none; }
.t-link:hover { text-decoration: underline; }

/* ── Project Groups ── */
.project-group-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .1em;
  margin: 32px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.project-group-label span { color: var(--green); }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px;
  transition: border-color .2s, transform .2s;
  text-decoration: none; display: block;
}
.project-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.project-card.featured { border-color: var(--green-dim); }
.project-card.featured:hover { border-color: var(--green); }

.project-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.project-name { font-family: var(--font-mono); font-size: 15px; color: var(--cyan); font-weight: 500; }
.project-tag {
  font-family: var(--font-mono); font-size: 10px;
  padding: 2px 8px; border-radius: 10px;
  background: var(--bg3); border: 1px solid var(--border); color: var(--text-dim);
}
.project-tag.core { color: var(--green); border-color: var(--green); }
.project-tag.tool { color: var(--purple); border-color: var(--purple); }
.project-tag.solo { color: var(--cyan); border-color: var(--cyan); }
.project-tag.mcp { color: var(--orange); border-color: var(--orange); }

.project-desc { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; line-height: 1.6; }
.project-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-pill { font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--bg3); color: var(--text-muted); }
.stack-pill.py  { color: #3572a5; } .stack-pill.go  { color: #00acd7; }
.stack-pill.java { color: #b07219; } .stack-pill.ai  { color: var(--purple); }

/* ── 紧凑项目行（更多项目）── */
.projects-compact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.project-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 16px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; transition: border-color .2s;
  min-width: 0;
}
.project-row:hover { border-color: var(--cyan); }
.pr-name { font-family: var(--font-mono); font-size: 13px; color: var(--cyan); white-space: nowrap; flex-shrink: 0; }
.pr-desc { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Architecture ── */
.arch-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.arch-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px;
}
.arch-card-title { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.arch-flow { font-family: var(--font-mono); font-size: 12.5px; line-height: 2; }
.af-g { color: var(--green); } .af-c { color: var(--cyan); }
.af-p { color: var(--purple); } .af-o { color: var(--orange); }
.af-y { color: var(--yellow); } .af-d { color: var(--text-muted); }
.arch-note { font-size: 12px; color: var(--text-muted); margin-top: 12px; line-height: 1.6; border-top: 1px solid var(--border); padding-top: 10px; }

/* ── Skills ── */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.skill-group { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; }
.skill-group-title { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.skill-list { list-style: none; }
.skill-list li { font-size: 13px; color: var(--text-dim); padding: 3px 0; display: flex; align-items: center; gap: 8px; }
.skill-list li::before { content: '▸'; color: var(--green); font-size: 10px; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 0; width: 1px; background: var(--border); }
.tl-item { position: relative; margin-bottom: 32px; }
.tl-dot { position: absolute; left: -28px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--green-dim); border: 2px solid var(--green); }
.tl-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.tl-title { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.tl-org { font-family: var(--font-mono); font-size: 13px; color: var(--cyan); margin-bottom: 6px; }
.tl-desc { font-size: 13px; color: var(--text-dim); line-height: 1.7; }

/* ── Contact ── */
.contact-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 20px;
  text-decoration: none; color: var(--text);
  transition: border-color .2s; min-width: 220px;
}
.contact-card:hover { border-color: var(--cyan); }
.contact-icon { font-size: 20px; }
.contact-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.contact-value { font-size: 14px; color: var(--cyan); }

footer { text-align: center; padding: 40px 24px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
footer span { color: var(--green); }
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ── Blog：列表页 ── */
.blog-main { max-width: 760px; margin: 0 auto; padding: 108px 24px 80px; }
.page-label { font-family: var(--font-mono); font-size: 13px; color: var(--green); margin-bottom: 8px; }
.blog-main h1 { font-size: 32px; font-weight: 600; margin-bottom: 12px; }
.page-desc { color: var(--text-dim); margin-bottom: 48px; }

.post-item {
  display: block; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2); margin-bottom: 16px; color: inherit;
  text-decoration: none;
  transition: border-color .15s ease;
}
.post-item:hover { border-color: var(--green); }
.post-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.post-title { font-size: 18px; font-weight: 500; color: var(--text); margin: 4px 0; }
.post-excerpt { font-size: 14px; color: var(--text-dim); }
.post-tags { margin-top: 10px; }
.post-tags span {
  font-family: var(--font-mono); font-size: 11px; color: var(--cyan);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; margin-right: 6px;
}

/* ── Blog：文章页 ── */
.blog-post { max-width: 720px; margin: 0 auto; padding: 108px 24px 80px; font-size: 16px; line-height: 1.8; }
.blog-post a { color: var(--cyan); text-decoration: none; }
.blog-post a:hover { text-decoration: underline; }
.blog-post .post-date { margin-bottom: 8px; font-size: 13px; }
.blog-post h1 { font-size: 30px; font-weight: 600; line-height: 1.35; margin-bottom: 32px; }
.blog-post h2 { font-size: 21px; font-weight: 600; margin: 40px 0 14px; }
.blog-post p { margin-bottom: 18px; color: var(--text); }
.blog-post li { margin-bottom: 8px; margin-left: 22px; }
.blog-post code {
  font-family: var(--font-mono); font-size: 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
}
.blog-post pre {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; overflow-x: auto; margin-bottom: 18px;
}
.blog-post pre code { background: none; border: none; padding: 0; }
.blog-post blockquote { border-left: 3px solid var(--green); padding-left: 16px; color: var(--text-dim); margin-bottom: 18px; }
.post-footer { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 13px; }

/* ── 响应式 ── */
@media (max-width: 680px) {
  .arch-wrap { grid-template-columns: 1fr; }
  .projects-compact { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  nav { padding: 0 12px; }
  .nav-logo { display: none; }
  .nav-links { gap: 14px; width: 100%; justify-content: space-between; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-links a { font-size: 12px; }
  .hero-name { font-size: 32px; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
}

/* ── 动效降级 ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
