/* ============================================================
   张义飞个人博客 · 科技简约风格
   Tech Minimal: 深色背景 / 青色点缀 / 等宽字体 / 网格背景
   ============================================================ */

:root {
  --bg: #0a0e14;
  --bg-soft: #0f1520;
  --bg-card: #111826;
  --border: #1e2a3d;
  --text: #c9d4e3;
  --text-dim: #6b7a90;
  --accent: #22d3ee;
  --accent-dim: #0e7490;
  --accent-glow: rgba(34, 211, 238, 0.15);
  --success: #34d399;
  --danger: #f87171;
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", "Cascadia Code",
    Consolas, "Courier New", monospace;
  --maxw: 1080px;
  --radius: 6px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ---- 网格背景 ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 50% at 50% -10%,
    rgba(34, 211, 238, 0.07),
    transparent
  );
  pointer-events: none;
  z-index: 0;
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ---- 通用容器 ---- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   导航栏
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.brand .prompt {
  color: var(--accent);
}

.brand .cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: var(--accent-dim);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 13px;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 20px 20px;
    gap: 8px;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    display: block;
  }
}

/* ============================================================
   首页 Hero
   ============================================================ */
.hero {
  padding: 80px 0 60px;
}

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

.hero-avatar {
  position: relative;
}

.avatar-box {
  width: 220px;
  height: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-dim);
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 40px var(--accent-glow);
}

.avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-box::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: var(--radius);
  pointer-events: none;
}

.avatar-status {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.hero-text h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.hero-text h1 .accent {
  color: var(--accent);
}

.hero-text .sub {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 20px;
}

.typing {
  color: var(--accent);
  min-height: 24px;
  margin-bottom: 24px;
  font-size: 15px;
}

.typing::before {
  content: "$ ";
  color: var(--text-dim);
}

.typing .cursor {
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

.hero-text p {
  color: var(--text-dim);
  max-width: 560px;
}

/* ---- 终端窗口 ---- */
.terminal {
  margin-top: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.terminal-bar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal-bar .dot.red { background: #ff5f57; }
.terminal-bar .dot.yellow { background: #febc2e; }
.terminal-bar .dot.green { background: #28c840; }

.terminal-bar .title {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.terminal-body {
  padding: 20px;
  font-size: 13.5px;
  line-height: 2;
}

.terminal-body .line {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-body .cmd {
  color: var(--accent);
}

.terminal-body .dim {
  color: var(--text-dim);
}

.terminal-body .ok {
  color: var(--success);
}

.terminal-body .prompt {
  color: var(--text-dim);
}

/* ============================================================
   区块标题
   ============================================================ */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "#";
  color: var(--text-dim);
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ============================================================
   卡片 / 网格
   ============================================================ */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .hero-text p {
    margin: 0 auto;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.25s;
  position: relative;
}

.card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.card h3 {
  font-size: 15.5px;
  color: var(--text);
  margin-bottom: 10px;
  font-weight: 700;
}

.card h3 a {
  color: inherit;
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--accent);
}

.card .desc {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 14px;
}

.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  border-radius: 3px;
  background: var(--accent-glow);
  font-family: var(--mono);
}

.card .links {
  margin-top: 14px;
  display: flex;
  gap: 14px;
}

.card .links a {
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: none;
}

.card .links a:hover {
  text-decoration: underline;
}

.card .year {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 3px;
}

.featured-badge {
  position: absolute;
  top: 16px;
  left: -1px;
  font-size: 10px;
  color: var(--bg);
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 0 3px 3px 0;
  letter-spacing: 0.5px;
}

/* ============================================================
   博客列表
   ============================================================ */
.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 18px 4px;
  border-bottom: 1px dashed var(--border);
  text-decoration: none;
  transition: all 0.2s;
}

.post-item:hover {
  padding-left: 12px;
  background: var(--accent-glow);
}

.post-item:hover .post-title {
  color: var(--accent);
}

.post-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-title {
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
  transition: color 0.2s;
}

.post-excerpt {
  font-size: 12.5px;
  color: var(--text-dim);
}

.post-date {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.post-date::before {
  content: "[";
  color: var(--accent-dim);
}

.post-date::after {
  content: "]";
  color: var(--accent-dim);
}

.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .post-item {
    flex-direction: column;
    gap: 8px;
  }
}

/* ============================================================
   文章页
   ============================================================ */
.article {
  padding: 56px 0 80px;
}

.article-header {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.article-header h1 {
  font-size: 26px;
  color: var(--text);
  margin-bottom: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-dim);
}

.article-body {
  max-width: 720px;
  font-size: 15px;
  line-height: 2;
  color: var(--text);
}

.article-body h2 {
  font-size: 20px;
  color: var(--accent);
  margin: 36px 0 16px;
  font-weight: 700;
}

.article-body h3 {
  font-size: 16.5px;
  color: var(--text);
  margin: 28px 0 12px;
}

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

.article-body ul,
.article-body ol {
  margin: 0 0 18px 24px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body strong {
  color: var(--accent);
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
}

.article-body code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--accent);
  font-family: var(--mono);
}

.article-body pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 24px 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.8;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

.article-body hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 36px 0;
}

.article-body em {
  color: var(--text-dim);
}

.back-link {
  display: inline-block;
  margin-top: 40px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13.5px;
}

.back-link:hover {
  text-decoration: underline;
}

.back-link::before {
  content: "← ";
}

/* ============================================================
   时间线（经历）
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.tl-item {
  position: relative;
  margin-bottom: 36px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.tl-period {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 4px;
}

.tl-title {
  font-size: 16px;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 2px;
}

.tl-org {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.tl-desc {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.9;
  margin-bottom: 10px;
}

.tl-desc li {
  list-style: none;
  margin-bottom: 4px;
}

.tl-desc li::before {
  content: "› ";
  color: var(--accent);
}

/* ============================================================
   技能条
   ============================================================ */
.skill-group {
  margin-bottom: 28px;
}

.skill-group h4 {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.skill-bar {
  margin-bottom: 12px;
}

.skill-bar .row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 5px;
}

.skill-bar .name {
  color: var(--text);
}

.skill-bar .val {
  color: var(--text-dim);
}

.skill-bar .track {
  height: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.skill-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 3px;
  width: 0;
  transition: width 1s ease;
}

/* ============================================================
   社交链接
   ============================================================ */
.socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.socials a:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-glow);
}

.socials .ico {
  font-size: 15px;
}

.photo-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}

.notice {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.notice strong {
  color: var(--accent);
}

/* ============================================================
   关于页标签
   ============================================================ */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud .tag {
  font-size: 12.5px;
  padding: 5px 14px;
}

/* ============================================================
   页脚
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 60px;
  text-align: center;
}

.footer p {
  font-size: 12.5px;
  color: var(--text-dim);
}

.footer .heart {
  color: var(--danger);
}

/* ============================================================
   通用
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.page-head {
  padding: 60px 0 30px;
}

.page-head h1 {
  font-size: 28px;
  color: var(--text);
  margin-bottom: 10px;
}

.page-head p {
  color: var(--text-dim);
  font-size: 14px;
}

.page-head h1 .accent {
  color: var(--accent);
}

.text-center {
  text-align: center;
}

.mt-2 { margin-top: 24px; }
.mt-3 { margin-top: 36px; }
.mt-4 { margin-top: 48px; }
