@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

/* ===== 变量 ===== */
:root {
  --red: #ff0000;
  --purple: #8b00ff;
  --dark: #261717;
  --dark2: #1a0f0f;
  --dark3: #321f1f;
  --glass-bg: rgba(255,255,255,0.10);
  --glass-bg-strong: rgba(255,255,255,0.16);
  --glass-border: rgba(255,255,255,0.18);
  --glass-blur: 15px;
  --text: #f0e8e8;
  --text-muted: rgba(240,232,232,0.60);
  --text-dim: rgba(240,232,232,0.40);
  --radius: 10px;
  --bnav-h: 58px;
  --aside-w: 220px;
  --font: 'IBM Plex Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --gutter: 20px;
  --max-content: 820px;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--dark2);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 背景光晕 ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(139,0,255,0.22) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(255,0,0,0.18) 0%, transparent 70%),
    linear-gradient(160deg, var(--dark2) 0%, var(--dark) 50%, #1c0e0e 100%);
  z-index: -1;
  pointer-events: none;
}

/* ===== 玻璃面板基类 ===== */
.glass-panel {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.glass-card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
}
.glass-card:hover {
  background: var(--glass-bg-strong);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(139,0,255,0.25);
}

/* ===== 页面包装 ===== */
.page-wrap {
  display: flex;
  min-height: 100vh;
  padding-bottom: calc(var(--bnav-h) + 20px);
}

/* ===== 侧边 aside（内容左侧）===== */
.site-aside {
  width: var(--aside-w);
  flex-shrink: 0;
  padding: 24px 12px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* aside 内的 nav */
.site-aside nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  transition: background 0.2s, color 0.2s;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,0,0,0.15);
  color: #fff;
}

/* aside 卡片 */
.aside-related, .aside-tags {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aside-related h3, .aside-tags h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: none;
}
.aside-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aside-links a {
  display: block;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.aside-links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.aside-parent-link {
  display: block;
  padding: 8px;
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border-radius: 6px;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.aside-parent-link:hover { color: #ff4444; }

/* ===== 内容区 ===== */
.content-wrap {
  flex: 1;
  min-width: 0;
  padding: 24px var(--gutter) 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: calc(var(--max-content) + 40px);
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--red); }

/* ===== 页头面板 ===== */
.page-header {
  padding: 24px 28px;
}
.page-header h1 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fff 30%, #ffaaaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-top: 8px;
}

/* ===== Hero（首页）===== */
.hero-section {
  margin-bottom: 8px;
}
.hero-inner {
  padding: 32px 28px;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.hero-inner::after {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,0,0,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-icon {
  font-size: 48px;
  line-height: 1;
}
.hero-title {
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.25;
  background: linear-gradient(135deg, #ffffff 0%, #ff8888 50%, #cc88ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 480px;
  line-height: 1.6;
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--red), var(--purple));
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(255,0,0,0.35);
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* ===== main > section > article ===== */
main { width: 100%; }
section { width: 100%; }

.content-section {
  padding: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}
.content-section h2,
.content-section h3 {
  margin: 24px 0 10px;
  font-weight: 700;
}
.content-section p { margin-bottom: 14px; }
.content-section a {
  color: #ff8888;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.content-section a:hover { color: #ffbbbb; }
.content-section ul, .content-section ol {
  padding-left: 20px;
  margin-bottom: 14px;
}
.content-section li { margin-bottom: 6px; }

article + article { margin-top: 36px; }

/* ===== h2 + hr 装饰 ===== */
h2 {
  font-size: clamp(17px, 2.5vw, 22px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0;
}
h2 + hr,
h3 + hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, var(--red), var(--purple), transparent);
  margin: 8px 0 18px;
  opacity: 0.6;
}
hr {
  border: none;
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 12px 0;
}

/* ===== 分类卡片网格 ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text);
}
.cat-card strong {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.cat-card span {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== 条目卡片网格 ===== */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.entry-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.entry-card a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
}
.entry-card a:hover { color: #ffaaaa; }
.entry-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.card-date {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ===== 子页列表（children-grid）===== */
.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.child-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text);
}
.child-card strong {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.child-card .card-meta {
  font-size: 11px;
  color: var(--text-dim);
}
.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== 兄弟页卡片 ===== */
.siblings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.sibling-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
}
.sibling-card strong {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.sibling-card span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 标签云 ===== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  background: rgba(139,0,255,0.20);
  border: 1px solid rgba(139,0,255,0.35);
  border-radius: 15px;
  font-size: 13px;
  color: #ddaaff;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.tag-pill:hover {
  background: rgba(139,0,255,0.40);
  color: #fff;
}
.tag-cloud.small .tag-pill {
  height: 26px;
  font-size: 12px;
  padding: 0 10px;
}

/* ===== 条目页专用 ===== */
.entry-header {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.entry-header h1 {
  font-size: clamp(20px, 3.5vw, 30px);
  font-weight: 700;
  line-height: 1.3;
  background: linear-gradient(135deg, #fff 30%, #ffaaaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.entry-date {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.entry-hero {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}
.entry-hero-img {
  width: 100%;
  height: auto;
  display: block;
}
.entry-content {
  font-size: 16px;
  line-height: 1.75;
}

/* ===== 页脚（仅 p + small）===== */
.site-footer {
  padding: 20px var(--gutter) calc(var(--bnav-h) + 20px);
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.site-footer p {
  font-size: 13px;
  color: var(--text-dim);
}
.site-footer small {
  font-size: 12px;
  color: var(--text-dim);
}
.site-footer a {
  color: #ff8888;
  text-decoration: underline;
}

/* ===== 底部固定导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bnav-h);
  z-index: 100;
  background: rgba(26,15,15,0.85);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255,255,255,0.10);
}
.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 12px;
  max-width: 900px;
  margin: 0 auto;
  gap: 8px;
}
.bottom-nav-left,
.bottom-nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.bottom-nav-right {
  justify-content: flex-end;
}
.bnav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
}
.bnav-link:hover { color: #fff; }
.bnav-brand {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  text-align: center;
  padding: 0 10px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--red), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.bnav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--red), var(--purple));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 7px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.bnav-cta:hover { opacity: 0.85; }

/* ===== 动效 stagger ===== */
@media (prefers-reduced-motion: no-preference) {
  .stagger-item {
    opacity: 0;
    transform: translateY(18px);
    animation: fadeUp 0.45s ease forwards;
    animation-delay: calc(var(--i, 0) * 0.08s);
  }
  @keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .stagger-item {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  :root {
    --aside-w: 0px;
    --gutter: 14px;
  }
  .site-aside {
    display: none;
  }
  .page-wrap {
    flex-direction: column;
  }
  .content-wrap {
    padding: 16px var(--gutter);
    max-width: 100%;
  }
  .hero-inner {
    min-height: 42vh;
    padding: 28px 18px;
  }
  .hero-icon { font-size: 36px; }
  .cat-grid,
  .entry-grid,
  .children-grid,
  .siblings-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .page-header,
  .entry-header {
    padding: 18px 18px;
  }
  .bottom-nav-inner { padding: 0 8px; }
  .bnav-link { font-size: 11px; padding: 0 5px; }
  .bnav-brand { font-size: 14px; padding: 0 6px; }
  .bnav-cta { padding: 0 10px; font-size: 12px; }
}

@media (max-width: 420px) {
  .cat-grid,
  .entry-grid,
  .children-grid {
    grid-template-columns: 1fr;
  }
  .siblings-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 隐私/关于页 ===== */
.privacy-content,
.about-content {
  max-width: var(--max-content);
}
.about-cats {
  margin-top: 0;
}

/* ===== aside hr ===== */
.aside-related hr,
.aside-tags hr {
  margin: 4px 0 8px;
  opacity: 0.5;
}
