/* ========== 基础重置与变量 ========== */
:root {
  --primary: #3b82f6;
  --primary-light: #93c5fd;
  --primary-dark: #1d4ed8;
  --accent: #818cf8;
  --text: #0f172a;
  --text-light: #475569;
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 8px 32px rgba(59, 130, 246, 0.12);
  --radius: 16px;
  --transition: 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 25%, #e0f2fe 50%, #dbeafe 75%, #ede9fe 100%);
  background-attachment: fixed;
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 浮动背景光球 */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}
body::before {
  width: 600px;
  height: 600px;
  background: rgba(147, 197, 253, 0.35);
  top: -100px;
  right: -100px;
  animation: floatOrb1 20s ease-in-out infinite;
}
body::after {
  width: 500px;
  height: 500px;
  background: rgba(165, 180, 252, 0.3);
  bottom: -80px;
  left: -80px;
  animation: floatOrb2 25s ease-in-out infinite;
}
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
}
.orb-1 {
  width: 400px; height: 400px;
  background: rgba(96, 165, 250, 0.25);
  top: 40%; left: 60%;
  animation: floatOrb3 18s ease-in-out infinite;
}
.orb-2 {
  width: 300px; height: 300px;
  background: rgba(196, 181, 253, 0.25);
  top: 70%; left: 10%;
  animation: floatOrb1 22s ease-in-out infinite reverse;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 30px) scale(1.1); }
}
@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.05); }
}
@keyframes floatOrb3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 50px) scale(1.08); }
}

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

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 48px;
  text-align: center;
  color: var(--text);
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  margin: 12px auto 0;
}

/* ========== 玻璃卡片通用样式 ========== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 10px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.45);
}

/* ========== 导航栏 ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  transition: var(--transition);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-weight: 500;
  color: var(--text-light);
  position: relative;
  transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 1px;
  transition: var(--transition);
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
  border-radius: 1px;
}

/* ========== 英雄区 ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 64px;
  position: relative;
}
.hero-content {
  padding: 60px 40px;
  max-width: 700px;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 40px;
}

/* ========== 文章列表 ========== */
.articles { padding: 100px 0; }
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}
.article-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
  cursor: pointer;
}
.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(59, 130, 246, 0.2);
  border-color: rgba(255,255,255,0.9);
}
.article-cover {
  height: 200px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(255,255,255,0.5);
}
.article-body { padding: 24px; }
.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.article-category {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.article-body h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--text);
}
.article-body p {
  color: var(--text-light);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 关于 ========== */
.about { padding: 100px 0; }
.about-content {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  max-width: 800px;
  margin: 0 auto;
  padding: 48px;
}
.about-avatar { flex-shrink: 0; }
.avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}
.about-text p { margin-bottom: 16px; color: var(--text-light); }
.about-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.tag {
  background: rgba(255,255,255,0.5);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-light);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
}

/* ========== 联系 ========== */
.contact { padding: 100px 0; }
.contact-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 48px;
}
.contact-content p { color: var(--text-light); margin-bottom: 32px; }
.contact-links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.6);
  transition: var(--transition);
  color: var(--text);
}
.contact-item:hover {
  background: rgba(255,255,255,0.7);
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}
.contact-icon { font-size: 1.2rem; }

/* ========== 页脚 ========== */
.footer {
  padding: 32px 0;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.5);
}

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(59, 130, 246, 0.2);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.8);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
  z-index: 1;
}
.modal-close:hover { background: rgba(255,255,255,0.9); color: var(--primary); }
.modal-body { padding: 40px; }
.modal-body h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.modal-body .modal-meta {
  display: flex;
  gap: 16px;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.modal-body .modal-content {
  color: var(--text);
  line-height: 1.9;
}
.modal-body .modal-content p { margin-bottom: 16px; }
.modal-body .modal-content h3 { margin: 24px 0 12px; font-size: 1.3rem; color: var(--primary-dark); }
.modal-body .modal-content code {
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--primary-dark);
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.modal-body .modal-content pre {
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  padding: 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.modal-body .modal-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  border: none;
}
.modal-body .modal-content ul,
.modal-body .modal-content ol {
  margin: 12px 0;
  padding-left: 24px;
}
.modal-body .modal-content li { margin-bottom: 6px; }

/* ========== 加载状态 ========== */
.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-light);
}
.loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 8px 32px rgba(59,130,246,0.1);
  }
  .nav-links.open { display: flex; }
  .menu-toggle { display: flex; }
  .about-content { flex-direction: column; align-items: center; text-align: center; padding: 32px; }
  .about-tags { justify-content: center; }
  .articles-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 24px; }
  .modal-body h2 { font-size: 1.4rem; }
  .contact-content { padding: 32px; }
  .hero-content { padding: 40px 24px; }
}
