/* ===== 思远笔记 - 惊艳视觉风格 ===== */

/* --- CSS 变量 --- */
:root {
  --bg: #f8f9fc;
  --card-bg: rgba(255,255,255,0.72);
  --card-bg-hover: rgba(255,255,255,0.92);
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 70%, #4338ca 100%);
  --glass-border: 1px solid rgba(255,255,255,0.25);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 760px;
  --nav-height: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- 页面淡入动画 --- */
body { animation: pageIn 0.6s var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- 导航栏（玻璃态） --- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.navbar.scrolled {
  background: rgba(255,255,255,0.92);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  position: relative;
}
.nav-logo::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.35s var(--ease);
}
.nav-logo:hover::after { width: 100%; }

.nav-links { display: flex; gap: 32px; }
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color 0.25s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
  transition: width 0.35s var(--ease);
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

/* --- Hero 区域（深色渐变 + 动态光晕） --- */
.hero {
  position: relative;
  padding: calc(var(--nav-height) + 80px) 32px 96px;
  text-align: center;
  overflow: hidden;
  background: var(--hero-gradient);
}
/* 动态光晕背景 */
.hero::before {
  content: '';
  position: absolute;
  top: -40%; left: -20%;
  width: 140%; height: 140%;
  background: radial-gradient(ellipse at 30% 20%, rgba(99,102,241,0.25) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(139,92,246,0.18) 0%, transparent 55%);
  animation: heroGlow 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes heroGlow {
  from { transform: translate(0, 0) scale(1); opacity: 0.7; }
  to   { transform: translate(3%, -3%) scale(1.08); opacity: 1; }
}
/* 网格装饰线 */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 80%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 28px;
  animation: fadeUp 0.7s var(--ease) 0.15s both;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 900;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fadeUp 0.7s var(--ease) 0.25s both;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, #c4b5fd, #a78bfa, #818cf8, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(16px, 2.5vw, 19px);
  color: rgba(255,255,255,0.6);
  line-height: 1.75;
  max-width: 520px;
  margin: 0 auto;
  animation: fadeUp 0.7s var(--ease) 0.4s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  animation: fadeUp 0.7s var(--ease) 0.55s both;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.hero-stat-label {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

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

/* --- 文章列表区域 --- */
.post-list-section {
  max-width: 960px;
  margin: -48px auto 0;
  padding: 0 32px 100px;
  position: relative;
  z-index: 2;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  animation: fadeUp 0.6s var(--ease) 0.6s both;
}
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.post-count {
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(99,102,241,0.08);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 500;
}

/* --- 文章卡片（玻璃态 + 悬停动画） --- */
.post-list { display: flex; flex-direction: column; gap: 20px; }

.post-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 32px 36px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  transition: transform 0.4s var(--ease),
              box-shadow 0.4s var(--ease),
              background 0.4s var(--ease),
              border-color 0.4s var(--ease);
  animation: cardIn 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 0.08s + 0.7s);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.post-card:hover {
  transform: translateY(-4px) scale(1.008);
  background: var(--card-bg-hover);
  box-shadow: 0 16px 48px rgba(99,102,241,0.1), 0 4px 12px rgba(0,0,0,0.06);
  border-color: rgba(99,102,241,0.18);
}
.post-card:hover::before { transform: scaleX(1); }

.post-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-date::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-gradient);
  flex-shrink: 0;
}

.post-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 10px;
  transition: color 0.25s;
}
.post-card:hover h2 { color: var(--accent); }

.post-excerpt {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-tags {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.post-tag {
  background: rgba(99,102,241,0.08);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background 0.25s, color 0.25s;
}
.post-card:hover .post-tag {
  background: var(--accent-gradient);
  color: #fff;
}

/* --- 文章详情页 --- */
.article-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px 100px;
}

/* 返回链接 */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-top: calc(var(--nav-height) + 32px);
  margin-bottom: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.03);
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.back-link:hover {
  background: rgba(99,102,241,0.1);
  color: var(--accent);
  transform: translateX(-4px);
}

/* 文章头部 */
.article-header {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  animation: fadeUp 0.6s var(--ease) both;
}
.article-date {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.article-date::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-gradient);
}

.article-header h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1.25;
}

.article-tags {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.article-tag {
  background: rgba(99,102,241,0.08);
  color: var(--accent);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* --- 文章正文内容 --- */
.article-content {
  font-size: 16.5px;
  line-height: 1.9;
  color: #374151;
  animation: fadeUp 0.6s var(--ease) 0.15s both;
}
.article-content > *:first-child { margin-top: 0; }

.article-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 48px 0 16px;
  letter-spacing: -0.3px;
  position: relative;
  padding-left: 20px;
}
.article-content h2::before {
  content: '';
  position: absolute;
  left: 0; top: 6px;
  width: 4px; height: calc(100% - 12px);
  background: var(--accent-gradient);
  border-radius: 4px;
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 36px 0 12px;
}

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

.article-content ul, .article-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}
.article-content li {
  margin-bottom: 8px;
  color: #4b5563;
}
.article-content li::marker { color: var(--accent); }

.article-content code {
  background: rgba(99,102,241,0.08);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.9em;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", Menlo, monospace;
}

.article-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 24px 28px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.7;
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
}
.article-content pre::before {
  content: '';
  position: absolute;
  top: 14px; left: 18px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 18px 0 0 #eab308, 36px 0 0 #22c55e;
}
.article-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  display: block;
  margin-top: 8px;
}

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 24px;
  margin-bottom: 24px;
  background: rgba(99,102,241,0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #6b7280;
  font-style: italic;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}
.article-content th {
  background: rgba(99,102,241,0.06);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.article-content td {
  padding: 11px 16px;
  border-top: 1px solid rgba(0,0,0,0.04);
  color: #4b5563;
}
.article-content tr:hover td { background: rgba(99,102,241,0.03); }

/* --- 关于页 --- */
.about-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 32px 100px;
}
.about-hero {
  text-align: center;
  padding: calc(var(--nav-height) + 72px) 0 48px;
  animation: fadeUp 0.6s var(--ease) both;
}
.about-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(99,102,241,0.3);
}
.about-hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.about-hero p {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.about-section {
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 36px 40px;
  margin-bottom: 24px;
  box-shadow: var(--glass-shadow);
  animation: fadeUp 0.6s var(--ease) both;
  animation-delay: 0.2s;
}
.about-section h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.about-section h2 .icon { font-size: 22px; }
.about-section p {
  font-size: 16px;
  color: #4b5563;
  line-height: 1.85;
  margin-bottom: 14px;
}
.about-section p:last-child { margin-bottom: 0; }

.about-tech-list {
  list-style: none;
  padding: 0;
}
.about-tech-list li {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: rgba(99,102,241,0.04);
  font-size: 15px;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.about-tech-list li:hover {
  background: rgba(99,102,241,0.1);
  transform: translateX(4px);
}
.about-tech-list li .tech-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* --- 页脚 --- */
.footer {
  text-align: center;
  padding: 40px 32px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.01);
}
.footer a {
  color: var(--accent);
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* --- 空状态 --- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  animation: fadeUp 0.6s var(--ease) both;
}
.empty-state .icon { font-size: 56px; margin-bottom: 20px; }
.empty-state p { font-size: 16px; }

/* --- 响应式 --- */
@media (max-width: 768px) {
  .nav-inner { padding: 0 20px; }
  .nav-links { gap: 20px; }
  .hero { padding: calc(var(--nav-height) + 48px) 20px 64px; }
  .hero-stats { gap: 24px; }
  .hero-stat-num { font-size: 22px; }
  .post-list-section { padding: -32px 20px 64px; }
  .post-card { padding: 24px 24px; }
  .post-card h2 { font-size: 18px; }
  .article-wrapper { padding: 0 20px 64px; }
  .back-link { margin-top: calc(var(--nav-height) + 20px); }
  .article-header h1 { font-size: 26px; }
  .about-wrapper { padding: 0 20px 64px; }
  .about-section { padding: 28px 24px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 30px; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .post-card { padding: 20px 18px; }
  .article-content h2 { font-size: 20px; padding-left: 16px; }
}
