/*
Theme Name: 明月轻博客
Theme URI: https://read.imoons.cn
Description: 高端大气，轻盈现代的个人博客主题
Version: 2.0.0
Author: 鹏飞
*/

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --accent: #8b5cf6;
  --accent-light: rgba(139, 92, 246, 0.1);
  --teal: #14b8a6;
  --bg: #030712;
  --bg-alt: #0f172a;
  --surface: #0f172a;
  --surface-light: #1e293b;
  --surface-glass: rgba(15, 23, 42, 0.8);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(148, 163, 184, 0.1);
  --border-light: rgba(148, 163, 184, 0.05);
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #14b8a6 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(139,92,246,0.15) 50%, rgba(20,184,166,0.15) 100%);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(99,102,241,0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --container: 1200px;
  --font: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-light: #f1f5f9;
  --surface-glass: rgba(255,255,255,0.85);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: rgba(15,23,42,0.08);
  --border-light: rgba(15,23,42,0.04);
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #14b8a6 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.08) 50%, rgba(20,184,166,0.08) 100%);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 40px rgba(99,102,241,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; transition: all .4s cubic-bezier(0.4,0,0.2,1); min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; transition: all .25s; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-light); border-radius: 3px; }

/* Container */
.container { max-width: var(--container); margin: 0 auto; padding: 0 40px; }

/* === HEADER === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all .3s;
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.site-logo a {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
  transition: width .3s;
}
.main-nav a:hover { color: var(--text); }
.main-nav a:hover::after { width: 100%; }

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all .3s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--primary);
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(99,102,241,0.3);
}

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 40px 100px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ' ';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(139,92,246,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(20,184,166,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.hero::after {
  content: ' ';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}
/* Floating orbs */
.orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: float 20s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: rgba(99,102,241,0.15); top: -100px; right: -100px; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: rgba(139,92,246,0.12); bottom: -50px; left: -50px; animation-delay: -7s; }
.orb-3 { width: 200px; height: 200px; background: rgba(20,184,166,0.1); top: 40%; left: 60%; animation-delay: -14s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content { position: relative; z-index: 1; max-width: 720px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--gradient-subtle);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  animation: fadeDown .6s ease-out;
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--gradient);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--text);
  animation: fadeUp .7s ease-out;
}
.hero-title .gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 40px;
  animation: fadeUp .7s ease-out .15s both;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp .7s ease-out .3s both;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all .3s;
}
.hero-btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}
.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,0.5);
}
.hero-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.hero-btn-secondary:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  animation: fadeUp .7s ease-out .5s both;
}
.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--primary), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

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

/* === CONTENT === */
.content-area {
  max-width: var(--container);
  margin: 0 auto;
  padding: 80px 40px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: ' ';
  width: 4px;
  height: 22px;
  background: var(--gradient);
  border-radius: 4px;
}
.section-more {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color .2s;
}
.section-more:hover { color: var(--primary); }

/* Post grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.post-card, a.post-card {
  display: block;
  color: inherit;
  text-decoration: none;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .4s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.post-card::before {
  content: ' ';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: var(--gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.post-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow);
  border-color: transparent;
}
.post-card:hover::before { opacity: 1; }

.post-card-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform .5s;
}
.post-card:hover .post-card-thumb { transform: scale(1.04); }
.post-card-thumb-wrap {
  overflow: hidden;
  position: relative;
}
.post-card-cat-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  z-index: 1;
}

.post-card-body { padding: 22px 24px 24px; }
.post-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .25s;
}
.post-card:hover .post-card-title { color: var(--primary); }
.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}
.post-card-date { font-size: 0.78rem; color: var(--text-muted); }
.post-card-views { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.post-card-placeholder {
  width: 100%;
  height: 200px;
  background: var(--gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.post-card-placeholder::after {
  content: ' ';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.03) 50%, transparent 60%);
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.post-card-placeholder::before { content: '📝'; font-size: 2.5rem; opacity: 0.3; z-index: 1; position: relative; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 64px; }
.pagination a, .pagination span {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all .25s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.pagination .current { background: var(--gradient); color: #fff; border-color: transparent; font-weight: 600; }

/* === FOOTER === */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 80px 0 0;
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: ' ';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 1px;
  background: var(--gradient);
  opacity: 0.5;
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 48px;
  align-items: start;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-light);
}
.footer-brand { max-width: 280px; }
.footer-brand-logo {
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}
.footer-brand-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; }
.footer-wechat-img { width: 100px; height: 100px; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.footer-col-title { font-size: 0.8rem; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { font-size: 0.875rem; color: var(--text-muted); transition: color .2s; }
.footer-nav a:hover { color: var(--primary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--primary); }

/* === SINGLE POST === */
.single-post { max-width: 760px; margin: 0 auto; padding: 100px 40px 80px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 32px; transition: color .2s; padding: 8px 16px; border: 1px solid var(--border); border-radius: 50px; }
.back-link:hover { color: var(--primary); border-color: var(--primary); }
.single-post-header { margin-bottom: 40px; }
.single-post-cat { display: inline-block; padding: 5px 14px; background: var(--gradient); color: #fff; border-radius: 50px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; }
.single-post-title { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 16px; color: var(--text); }
.single-post-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-muted); }
.single-post-cover { width: 100%; border-radius: var(--radius-lg); margin-bottom: 40px; max-height: 440px; object-fit: cover; border: 1px solid var(--border); }

.article-content { font-size: 1.05rem; line-height: 1.9; color: var(--text-secondary); }
.article-content h2 { font-size: 1.4rem; font-weight: 800; color: var(--text); margin: 2.5em 0 1em; letter-spacing: -0.02em; }
.article-content h3 { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 2em 0 0.8em; }
.article-content p { margin-bottom: 1.4em; }
.article-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article-content a:hover { text-shadow: 0 0 20px rgba(99,102,241,0.3); }
.article-content img { border-radius: var(--radius); margin: 1.8em 0; max-width: 100%; border: 1px solid var(--border); }
.article-content code { background: var(--surface-light); padding: 2px 8px; border-radius: 5px; font-size: 0.875em; color: var(--primary); border: 1px solid var(--border); }
.article-content pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; overflow-x: auto; margin: 1.8em 0; }
.article-content pre code { background: none; padding: 0; border: none; color: var(--text-secondary); }
.article-content blockquote { border-left: 3px solid var(--primary); padding: 16px 20px; margin: 2em 0; background: var(--gradient-subtle); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); font-style: italic; }
.article-content ul, .article-content ol { margin: 1em 0 1.4em 1.5em; }
.article-content li { margin-bottom: 0.6em; }

  .hero-actions { flex-direction: column; align-items: center; }
  .hero-btn { width: 100%; justify-content: center; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }

/* ============================================
   RESPONSIVE LAYOUT
   ============================================ */

/* 手机端 (< 768px) */
@media screen and (max-width: 767px) {
  .posts-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* 平板端 (768px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }
}

/* 桌面端 (> 1024px) */
@media screen and (min-width: 1025px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 28px !important;
  }
}
