/* ===== CJH 的技术博客 - 样式表 ===== */

/* --- 基础重置与变量 --- */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1a1a1a;
  --text-secondary: #6c757d;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --max-width: 960px;
  --font-stack: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  --transition: 0.25s ease;
  --transition-slow: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 暗黑模式变量 */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-light: rgba(59, 130, 246, 0.12);
  --border: #334155;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.92);
}

[data-theme="dark"] .nav-links {
  background: rgba(15, 23, 42, 0.98);
}

[data-theme="dark"] .hero-code {
  background: #1e293b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .hero-code:hover {
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .intro-overlay {
  background: #0f172a;
}

[data-theme="dark"] .copy-toast {
  background: #f1f5f9;
  color: #0f172a;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a:hover {
  color: #1d4ed8;
}

/* --- 开场动画 --- */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: clip-path 1s cubic-bezier(0.76, 0, 0.24, 1);
  clip-path: inset(0 0 0 0);
}

.intro-overlay.exit {
  clip-path: inset(0 0 100% 0);
}

.intro-logo {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: scale(0.8);
  animation: introLogoIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.intro-bracket {
  color: var(--accent);
}

.intro-name {
  display: inline-block;
  animation: introNameGlow 1.5s ease 0.5s forwards;
}

.intro-line {
  width: 0;
  height: 2px;
  background: var(--accent);
  margin-top: 16px;
  animation: introLineExpand 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
}

@keyframes introLogoIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes introNameGlow {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 20px rgba(37, 99, 235, 0.6); }
}

@keyframes introLineExpand {
  from { width: 0; }
  to { width: 80px; }
}

/* --- 鼠标光晕 --- */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.cursor-glow.active {
  opacity: 1;
}

/* --- 滚动进度条 --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 200;
  width: 0%;
  transition: none;
}

/* --- 导航栏 --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

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

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: opacity var(--transition);
}

.nav-logo:hover {
  opacity: 0.7;
}

.nav-logo span {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color var(--transition);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* 汉堡菜单 */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero 首屏 --- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  min-height: calc(100vh - 64px);
  padding-top: 40px;
  padding-bottom: 40px;
  position: relative;
  overflow: hidden;
}

/* 点阵背景 */
.hero-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-grid.visible {
  opacity: 1;
}

.hero-content {
  max-width: 480px;
}

.hero-label {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(12px);
  animation: heroReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(20px);
  animation: heroReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

/* 逐字动画 */
.hero-title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(40deg);
  animation: charReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-title .char-space {
  display: inline-block;
  width: 0.3em;
}

@keyframes charReveal {
  from { opacity: 0; transform: translateY(30px) rotateX(40deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(16px);
  animation: heroReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0;
  transform: translateY(12px);
  animation: heroReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(12px);
  animation: heroReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

.hero-cta-alt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0;
  transform: translateY(12px);
  animation: heroReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.65s forwards;
}

.hero-cta-alt:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.hero-cta-alt .alt-arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-cta-alt:hover .alt-arrow {
  transform: translateX(4px);
}

.hero-cta:hover {
  background: #1d4ed8;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.hero-cta span {
  display: inline-block;
  animation: bounce 2s ease infinite;
}

/* 代码装饰 */
.hero-visual {
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  animation: heroCodeReveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
  will-change: transform;
}

.hero-code {
  background: #0f172a;
  border-radius: 12px;
  padding: 28px 32px;
  padding-top: 36px;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 2;
  color: #e2e8f0;
  position: relative;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
  transition: box-shadow 0.4s ease;
}

.hero-code:hover {
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.22);
}

.hero-code::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 16px 0 0 #f59e0b, 32px 0 0 #22c55e;
}

/* 代码行逐行入场 */
.hero-code .code-line {
  display: block;
  opacity: 0;
  transform: translateX(-8px);
  animation: codeLineReveal 0.5s ease forwards;
}

.hero-code .code-line:nth-child(1) { animation-delay: 0.9s; }
.hero-code .code-line:nth-child(2) { animation-delay: 1.05s; }
.hero-code .code-line:nth-child(3) { animation-delay: 1.2s; }
.hero-code .code-line:nth-child(4) { animation-delay: 1.35s; }
.hero-code .code-line:nth-child(5) { animation-delay: 1.5s; }

.hero-code .code-indent {
  padding-left: 24px;
}

.hero-code .code-indent2 {
  padding-left: 48px;
}

.hero-code .code-keyword {
  color: #c084fc;
}

.hero-code .code-func {
  color: #60a5fa;
}

.hero-code .code-string {
  color: #4ade80;
}

/* 代码光标闪烁 */
.hero-code::after {
  content: "";
  position: absolute;
  bottom: 28px;
  right: 32px;
  width: 2px;
  height: 18px;
  background: #60a5fa;
  animation: cursorBlink 1.2s step-end infinite;
  animation-delay: 1.8s;
  opacity: 0;
}

@keyframes heroReveal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroCodeReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes codeLineReveal {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(4px); }
  60% { transform: translateY(2px); }
}

/* --- 主内容区 --- */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 64px;
}

section {
  margin-bottom: 80px;
  position: relative;
}

/* 板块间分隔装饰线 */
section::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.6s ease, width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

section.section-visible::before {
  opacity: 1;
  width: 80px;
}

/* 板块入场动画（渐进增强：默认可见，JS正常时再播动画） */
section .section-inner {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

section.section-animate .section-inner {
  opacity: 0;
  transform: translateY(40px);
}

section.section-animate.section-visible .section-inner {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 32px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-header:hover h2::after {
  width: 100%;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* --- 分类标签栏 --- */
.category-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.category-tag {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.category-tag::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 20px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: -1;
}

.category-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.category-tag.active {
  border-color: var(--accent);
  color: #fff;
}

.category-tag.active::before {
  transform: scaleX(1);
}

/* --- 文章卡片 --- */
#article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 1;
  transform: translateY(0);
  animation: cardReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
}

.article-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
  opacity: 0;
  transform: scaleY(0);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: transparent;
}

.article-card:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.article-category {
  display: inline-block;
  padding: 2px 10px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.article-card:hover .article-category {
  background: var(--accent);
  color: #fff;
}

.article-date {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.article-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
  color: var(--text-primary);
  transition: color var(--transition);
}

.article-card:hover .article-title {
  color: var(--accent);
}

.article-summary {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 14px;
}

.article-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.3s ease;
}

.article-link .link-arrow {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-link:hover {
  gap: 8px;
}

.article-link:hover .link-arrow {
  transform: translateX(3px);
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 关于我 --- */
.about-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 40px;
}

.about-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.about-avatar:hover {
  transform: scale(1.08);
}

.about-name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.about-tagline {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* 技能标签云 */
.skills-section {
  margin-bottom: 40px;
}

.skills-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  padding: 6px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-tag:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

/* 时间线 */
.timeline-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
  transition: background 0.4s ease;
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
  opacity: 1;
  transform: translateX(0);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-animate .timeline-item {
  opacity: 0;
  transform: translateX(-8px);
}

.timeline-animate .timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  transition: all 0.3s ease;
}

.timeline-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.timeline-item .item-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  line-height: 1.6;
}

.timeline-item .item-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* --- 联系方式 --- */
.contact-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-card {
  flex: 1;
  min-width: 260px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.contact-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-light), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.contact-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--accent);
}

.contact-card:hover::after {
  opacity: 1;
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 1;
}

.contact-card:hover .contact-icon {
  background: var(--accent);
  transform: scale(1.08);
}

.contact-card:hover .contact-icon svg {
  color: #fff;
}

.contact-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  transition: color 0.3s ease;
}

.contact-info {
  position: relative;
  z-index: 1;
}

.contact-info h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.contact-info p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  word-break: break-all;
}

/* 复制提示 */
.copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 200;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- 页脚 --- */
.footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.footer a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

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

/* --- 响应式 --- */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    min-height: auto;
    padding-top: 80px;
    padding-bottom: 48px;
    gap: 32px;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .hero-code {
    padding: 20px 24px;
    padding-top: 28px;
    font-size: 0.8125rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
  }

  .hamburger {
    display: flex;
  }

  .about-hero {
    flex-direction: column;
    text-align: center;
  }

  .contact-cards {
    flex-direction: column;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0 16px 48px;
  }

  .hero-title {
    font-size: 1.875rem;
  }

  .hero-code {
    font-size: 0.75rem;
    padding: 16px 18px;
    padding-top: 24px;
  }

  .article-card {
    padding: 18px 20px;
  }

  .category-tag {
    padding: 5px 12px;
    font-size: 0.8125rem;
  }
}

/* ===== 暗黑模式切换按钮 ===== */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-toggle:hover svg {
  transform: rotate(20deg);
}

.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }

[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* ===== 搜索栏 ===== */
.search-bar {
  position: relative;
  margin-bottom: 24px;
}

.search-bar input {
  width: 100%;
  padding: 12px 20px 12px 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-stack);
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.3s ease;
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-bar .search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: none;
  transition: color 0.2s ease;
}

.search-bar .search-clear:hover {
  color: var(--accent);
}

.search-bar .search-clear.visible {
  display: block;
}

.search-highlight {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
}

[data-theme="dark"] .search-highlight {
  background: rgba(59, 130, 246, 0.25);
}

.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.no-results .no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.no-results p {
  font-size: 1rem;
}

/* ===== 回到顶部按钮 ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 90;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #1d4ed8;
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ===== 打字机光标 ===== */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 1s step-end infinite;
}

/* ===== 评论区域 ===== */
.comments-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.comments-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ===== 访问统计 ===== */
.site-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.site-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ===== 文章详情页 ===== */
.article-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg-primary);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.article-detail-overlay.active {
  opacity: 1;
  visibility: visible;
}

.article-detail-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px 64px;
}

.article-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 32px;
}

.article-detail-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.article-detail-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.article-detail-content {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-primary);
}

.article-detail-content p {
  margin-bottom: 16px;
}

.article-detail-content .external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  margin-top: 16px;
  transition: all 0.3s ease;
}

.article-detail-content .external-link:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

/* ===== 暗黑模式过渡 ===== */
body,
.navbar,
.hero-code,
.contact-card,
.article-card,
.skill-tag,
.category-tag,
.search-bar input {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== 响应式补充 ===== */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  .nav-inner {
    gap: 8px;
  }

  .article-detail-title {
    font-size: 1.5rem;
  }
}