/* ===== 主题变量 ===== */
:root {
  --bg: #f7f8fc;
  --bg-alt: #eef1f8;
  --card: #ffffff;
  --text: #1e2333;
  --text-secondary: #5c6478;
  --primary: #5b6cff;
  --primary-dark: #4053e8;
  --accent: #ff7a59;
  --border: #e3e7f2;
  --shadow: 0 10px 30px rgba(40, 50, 90, 0.10);
  --shadow-hover: 0 16px 40px rgba(40, 50, 90, 0.18);
  --navbar-bg: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] {
  --bg: #12141d;
  --bg-alt: #1a1d2a;
  --card: #1e2233;
  --text: #eceef6;
  --text-secondary: #9aa3bb;
  --primary: #7c8aff;
  --primary-dark: #96a3ff;
  --accent: #ff8f70;
  --border: #2c3148;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.5);
  --navbar-bg: rgba(18, 20, 29, 0.85);
}

/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.35s ease, color 0.35s ease;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ===== 导航栏 ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease;
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.nav-links { display: flex; gap: 28px; }
.nav-link {
  position: relative; font-size: 15px; color: var(--text-secondary);
  padding: 6px 2px; transition: color 0.25s;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s ease, background 0.35s;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.08); }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
.menu-btn {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.menu-btn span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

/* ===== 首屏 ===== */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; position: relative; overflow: hidden; padding: 96px 24px 40px;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
  animation: float 14s ease-in-out infinite;
}
.blob-1 { width: 420px; height: 420px; background: var(--primary); top: -120px; left: -100px; }
.blob-2 { width: 360px; height: 360px; background: var(--accent); bottom: -120px; right: -80px; animation-delay: -4s; }
.blob-3 { width: 260px; height: 260px; background: #35d0ba; top: 40%; left: 60%; opacity: 0.3; animation-delay: -8s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 25px) scale(0.95); }
}
.hero-content { position: relative; z-index: 1; max-width: 760px; }
.hero-greeting {
  display: inline-block; font-size: 14px; letter-spacing: 4px; text-transform: uppercase;
  color: var(--primary); background: var(--card);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 20px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.hero-title {
  font-size: clamp(32px, 6vw, 56px); font-weight: 800; line-height: 1.3;
  margin-bottom: 20px; min-height: 1.3em;
}
.hero-title .cursor {
  display: inline-block; width: 4px; height: 0.95em; margin-left: 4px;
  background: var(--accent); vertical-align: -0.12em;
  animation: blink 0.8s step-end infinite; border-radius: 2px;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-subtitle { font-size: clamp(16px, 2.5vw, 20px); color: var(--text-secondary); margin-bottom: 36px; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }
.btn {
  display: inline-block; padding: 13px 32px; border-radius: 999px;
  font-size: 15px; font-weight: 600; transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: var(--shadow-hover); }
.btn-outline { border: 1.5px solid var(--border); background: var(--card); }
.btn-outline:hover { border-color: var(--primary); }
.hero-stats { display: flex; gap: 56px; justify-content: center; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 30px; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 13px; color: var(--text-secondary); }
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary); z-index: 1;
}
.mouse { width: 24px; height: 38px; border: 2px solid var(--text-secondary); border-radius: 14px; display: flex; justify-content: center; padding-top: 6px; }
.wheel { width: 4px; height: 8px; border-radius: 2px; background: var(--text-secondary); animation: wheel 1.6s ease infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }

/* ===== 板块通用 ===== */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-header { text-align: center; margin-bottom: 56px; }
.section-title { font-size: 34px; font-weight: 800; margin-bottom: 12px; }
.section-desc { color: var(--text-secondary); }

/* ===== 文章卡片 ===== */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.article-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; flex-direction: column;
}
.article-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.article-cover {
  height: 160px; display: flex; align-items: center; justify-content: center;
  font-size: 52px; position: relative;
}
.article-category {
  position: absolute; top: 14px; left: 14px;
  font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px);
  padding: 4px 12px; border-radius: 999px;
}
.article-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.article-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; line-height: 1.45; }
.article-excerpt { font-size: 14px; color: var(--text-secondary); margin-bottom: 18px; flex: 1; }
.article-meta { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-secondary); }
.article-more { color: var(--primary); font-weight: 600; }
.article-card:hover .article-more { text-decoration: underline; }

/* ===== 关于我 ===== */
.about-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow); padding: 48px; display: flex; gap: 40px; align-items: center;
}
.about-avatar {
  width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 46px; font-weight: 800;
  box-shadow: var(--shadow);
}
.about-text h3 { font-size: 22px; margin-bottom: 14px; }
.about-text p { color: var(--text-secondary); margin-bottom: 14px; }
.about-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  font-size: 13px; padding: 5px 16px; border-radius: 999px;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-secondary);
}

/* ===== 联系我 ===== */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.contact-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 28px; display: flex; align-items: center; gap: 18px;
  box-shadow: var(--shadow); transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.contact-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.contact-icon { font-size: 36px; }
.contact-info h4 { font-size: 16px; margin-bottom: 4px; }
.contact-info p { font-size: 14px; color: var(--text-secondary); word-break: break-all; }

/* ===== 页脚 ===== */
.footer { padding: 48px 0; text-align: center; border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer-quote { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: var(--primary); }
.footer-copy { font-size: 14px; color: var(--text-secondary); }

/* ===== 返回顶部 ===== */
.back-to-top {
  position: fixed; right: 28px; bottom: 28px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 20px; cursor: pointer;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transform: translateY(16px); transition: 0.3s ease;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); }

/* ===== 入场动画 ===== */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--navbar-bg); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height 0.35s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-link { display: block; padding: 14px 24px; }
  .menu-btn { display: flex; }
  .menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-btn.open span:nth-child(2) { opacity: 0; }
  .menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .about-card { flex-direction: column; text-align: center; padding: 36px 28px; }
  .about-tags { justify-content: center; }
  .hero-stats { gap: 32px; }
  .section { padding: 72px 0; }
}