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

:root {
  --deep-purple: #1e0a3c;
  --purple-dark: #2d1b69;
  --purple: #6d28d9;
  --purple-light: #a78bfa;
  --purple-subtle: #ede9fe;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --amber-dark: #d97706;
  --bg: #f8f6fc;
  --card-bg: #ffffff;
  --text: #1e0a3c;
  --text-light: #6b5b8a;
  --text-muted: #a89bc0;
  --border: #e5ddf5;
  --shadow: 0 1px 3px rgba(30, 10, 60, 0.06), 0 1px 2px rgba(30, 10, 60, 0.04);
  --shadow-hover: 0 10px 30px rgba(30, 10, 60, 0.1);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --max-w: 1060px;
  --content-w: 720px;
  --header-h: 68px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--purple); color: #fff; }

a { color: var(--purple); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--amber); }

/* ===== Header ===== */
.site-header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo a {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--deep-purple);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo .logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--purple), var(--amber));
  border-radius: 8px;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-light);
  transition: var(--transition);
}
.main-nav a:hover {
  color: var(--purple);
  background: var(--purple-subtle);
}
.main-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  font-weight: 600;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

/* ===== Main ===== */
.main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 44px 28px 56px;
  min-height: calc(100vh - var(--header-h) - 170px);
}

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 20px 0 48px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.hero-text h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--deep-purple);
  margin-bottom: 14px;
}
.hero-text h1 .highlight {
  background: linear-gradient(135deg, var(--purple), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-text p {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.75;
  margin-bottom: 20px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amber-light);
  color: var(--amber-dark);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  background: linear-gradient(135deg, var(--purple-subtle), var(--amber-light));
  border-radius: 16px;
  min-height: 260px;
}

/* ===== Post Grid ===== */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--deep-purple);
  margin-bottom: 24px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--amber));
  opacity: 0;
  transition: var(--transition);
}
.post-card:hover {
  border-color: var(--purple-light);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.post-card:hover::before {
  opacity: 1;
}

.post-card-icon {
  padding: 22px 22px 0;
  font-size: 2rem;
}

.post-card-body {
  padding: 14px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.post-meta .tag {
  background: var(--purple-subtle);
  color: var(--purple);
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.post-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text);
}
.post-title a { color: inherit; }
.post-title a:hover { color: var(--purple); }

.post-excerpt {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 14px;
}

.post-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.post-link:hover { color: var(--amber); gap: 8px; }

/* ===== Article Page ===== */
.article-wrap {
  max-width: var(--content-w);
  margin: 0 auto;
}

.article-head {
  margin-bottom: 36px;
}
.article-head .art-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.article-head .art-meta .tag {
  background: var(--purple-subtle);
  color: var(--purple);
  padding: 2px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.article-head h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--deep-purple);
  line-height: 1.3;
}

.article-body {
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--text);
}
.article-body p { margin-bottom: 1.5em; }
.article-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--deep-purple);
  margin: 2em 0 0.7em;
}
.article-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--purple-dark);
  margin: 1.5em 0 0.5em;
}
.article-body ul, .article-body ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}
.article-body li { margin-bottom: 0.4em; }
.article-body blockquote {
  border-left: 4px solid var(--purple-light);
  background: var(--purple-subtle);
  padding: 18px 22px;
  margin: 1.5em 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-light);
  font-size: 0.98rem;
}
.article-body strong { color: var(--deep-purple); }
.article-body hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, var(--purple-subtle), var(--amber-light));
  margin: 2.5em 0;
}

.article-nav {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.article-nav a {
  font-size: 0.9rem;
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-nav a:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--purple-subtle);
}

/* ===== About ===== */
.about-wrap {
  max-width: var(--content-w);
  margin: 0 auto;
}

.about-head {
  text-align: center;
  padding: 16px 0 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.about-avatar {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--purple), var(--amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fff;
  margin: 0 auto 18px;
  font-weight: 700;
}
.about-head h1 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--deep-purple);
  margin-bottom: 4px;
}
.about-head .sub {
  color: var(--text-light);
  font-size: 1rem;
}

.about-block {
  margin-bottom: 30px;
}
.about-block h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple-dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.about-block p {
  color: var(--text-light);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 0.6em;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--deep-purple);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 36px 28px 32px;
  font-size: 0.85rem;
  line-height: 1.8;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.site-footer .flinks {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.site-footer .flinks a {
  color: var(--purple-light);
  font-size: 0.85rem;
}
.site-footer .flinks a:hover { color: var(--amber); }
.footer-star {
  color: var(--amber);
  font-size: 1rem;
  margin-bottom: 10px;
  opacity: 0.6;
}
.site-footer .icp {
  color: rgba(255,255,255,0.35);
  font-size: 0.78rem;
}
.site-footer .icp a {
  color: rgba(255,255,255,0.35);
}
.site-footer .icp a:hover { color: var(--amber); }

/* ===== Back to Top ===== */
.back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  background: var(--card-bg);
  color: var(--purple);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 99;
}
.back-top.visible { opacity: 1; visibility: visible; }
.back-top:hover {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
  transform: translateY(-3px);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--deep-purple);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  z-index: 200;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ===== RWD ===== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .hero-text h1 { font-size: 1.9rem; }
  .hero-visual { min-height: 180px; font-size: 4.5rem; }
  .posts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 12px 20px;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }
  .main-nav.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .main-nav a { width: 100%; padding: 12px 16px; border-radius: var(--radius-sm); }

  .article-head h1 { font-size: 1.5rem; }
  .article-body { font-size: 0.95rem; }

  .main { padding: 28px 18px 40px; }
  .header-inner { padding: 0 18px; height: 60px; }
  :root { --header-h: 60px; }
}
