/* ===== 全局重置与变量 ===== */
:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --accent: #a78bfa;
  --accent-2: #60a5fa;
  --accent-glow: rgba(167, 139, 250, 0.15);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #555;
  --border: rgba(255,255,255,0.07);
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(13,13,13,0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width var(--transition);
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(167,139,250,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(96,165,250,0.08) 0%, transparent 60%),
    var(--bg-primary);
  z-index: 0;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
}

.hero-sub {
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.hero-title {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s forwards;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s forwards;
}

.btn-primary {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all var(--transition);
  box-shadow: 0 0 20px rgba(167,139,250,0.3);
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(167,139,250,0.5);
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  animation: bounce 2s infinite;
  z-index: 1;
}

/* ===== 通用 Section ===== */
.section { padding: 6rem 1.5rem; }
.section-alt { background: var(--bg-secondary); }

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  color: var(--text-primary);
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

/* ===== 关于我 ===== */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
}

.avatar-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 3px;
  box-shadow: 0 0 40px rgba(167,139,250,0.3);
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.about-text h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  font-family: 'Noto Serif SC', serif;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.tag {
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

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

/* ===== 文章列表 ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.post-card:hover {
  border-color: rgba(167,139,250,0.3);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.post-card:hover::before { transform: scaleX(1); }

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.post-cat {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(167,139,250,0.2);
}

.post-date { font-size: 0.8rem; color: var(--text-muted); }

.post-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.5;
  font-family: 'Noto Serif SC', serif;
}

.post-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-link {
  font-size: 0.85rem;
  color: var(--accent);
  transition: color var(--transition);
}

.post-link:hover { color: var(--accent-2); }

/* ===== 项目展示 ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--transition);
}

.project-card:hover {
  border-color: rgba(96,165,250,0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 40px rgba(96,165,250,0.05);
}

.project-icon { font-size: 2.2rem; margin-bottom: 1rem; }

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  font-family: 'Noto Serif SC', serif;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.project-tech span {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: rgba(96,165,250,0.1);
  color: var(--accent-2);
  border-radius: 4px;
  border: 1px solid rgba(96,165,250,0.2);
}

.project-links { display: flex; gap: 1rem; }

.project-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

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

/* ===== 时间线 ===== */
.timeline {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2), transparent);
}

.tl-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.tl-dot {
  position: absolute;
  left: -2.45rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(167,139,250,0.6);
}

.tl-year {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.3rem;
}

.tl-content h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  font-family: 'Noto Serif SC', serif;
}

.tl-content p { font-size: 0.9rem; color: var(--text-secondary); }

/* ===== 联系 ===== */
.contact-box {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.contact-box p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-item {
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.contact-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
}

/* ===== Footer ===== */
.footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== 动画 ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: rgba(13,13,13,0.97);
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
  }
  .menu-btn { display: block; }
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-avatar { display: flex; justify-content: center; }
  .tags { justify-content: center; }
}
