@font-face {
  font-family: 'Fusion Pixel';
  src: url('fonts/fusion-pixel.woff2') format('woff2');
  font-display: swap;
  font-weight: 400;
}

:root {
  --bg: #fbfbfd;
  --fg: #17191f;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #ffffff;
  --accent: #1f6feb;
  --accent-soft: #dbe6ff;
  --code-bg: #f3f4f6;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  color-scheme: light;
}

html[data-theme='dark'] {
  --bg: #0e1117;
  --fg: #e6e9ef;
  --muted: #9aa3b2;
  --border: #232936;
  --card: #141922;
  --accent: #7aa2ff;
  --accent-soft: #1b2a4a;
  --code-bg: #10151f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Fusion Pixel', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1 0 auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--layout-width, 860px);
  margin: 0 auto;
  padding: 18px 24px 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}

.site-header::after {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, #7aa2ff, #c084fc, #f472b6, #fbbf24, #34d399, #7aa2ff);
  opacity: 0.55;
}

.brand {
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }

.site-nav { display: flex; align-items: center; gap: 4px; }

.nav-link {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
}
.nav-link:hover { background: var(--card); color: var(--fg); text-decoration: none; }
.nav-link[aria-current='page'] { color: var(--fg); background: var(--card); }

.theme-toggle {
  appearance: none;
  margin-left: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--accent); }

main {
  max-width: var(--layout-width, 860px);
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.hero { padding: 18px 0 26px; }

.hero-avatar {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  object-fit: cover;
  image-rendering: pixelated;
}

.hero-title {
  margin: 16px 0 6px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-tagline { margin: 0; color: var(--muted); font-size: 15px; }

.hero-bio {
  margin: 14px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 14.5px;
}

.hero-links { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--card);
}
.chip:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 30px 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title::before {
  content: '';
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(var(--accent), #ff7bb0);
}

.post-list { display: flex; flex-direction: column; gap: 10px; }

.post-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--fg);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.post-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.10);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.post-card-title {
  margin: 6px 0 6px;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.post-card-summary { margin: 0; color: var(--muted); font-size: 14px; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  line-height: 1.7;
}

.article { max-width: 700px; }

.article-title {
  margin: 6px 0 10px;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.article-body { margin-top: 24px; font-size: 16px; }

.article-body h2 {
  margin: 34px 0 10px;
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.article-body h3 { margin: 26px 0 8px; font-size: 17.5px; }

.article-body p { margin: 12px 0; }

.article-body ul, .article-body ol { margin: 12px 0; padding-left: 24px; }
.article-body li { margin: 6px 0; }

.article-body code {
  padding: 1.5px 5px;
  border-radius: 5px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  font-size: 13.5px;
}

.article-body pre {
  margin: 16px 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--code-bg);
}
.article-body pre code { padding: 0; border: 0; background: none; font-size: 13.5px; }

.article-body blockquote {
  margin: 18px 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.article-body hr { margin: 28px 0; border: 0; border-top: 1px solid var(--border); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.about-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.site-footer {
  max-width: var(--layout-width, 860px);
  margin: 0 auto;
  padding: 24px 24px 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.empty { color: var(--muted); }

@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .site-header {
    padding: 12px 14px 10px;
    gap: 8px;
  }
  .site-header::after { left: 14px; right: 14px; }
  .brand { font-size: 16px; }
  .site-nav { gap: 2px; }
  .nav-link { padding: 8px 10px; font-size: 13.5px; }
  .theme-toggle { width: 36px; height: 36px; }
  main { padding: 20px 14px 44px; }
  .hero { padding: 10px 0 20px; }
  .hero-avatar { width: 64px; height: 64px; border-radius: 16px; }
  .hero-title { font-size: 25px; }
  .hero-bio { font-size: 14px; }
  .article-title { font-size: 23px; }
  .post-card { padding: 15px 16px; border-radius: 12px; }
  .post-card-title { font-size: 17px; }
  .article-body { font-size: 15.5px; }
  .article-body h2 { font-size: 19px; }
  .article-body pre { padding: 12px; border-radius: 8px; }
  .site-footer { padding: 18px 14px 36px; font-size: 12px; }
  html.has-bg-image main { margin-bottom: 14px; }
  html.has-bg-image .site-header { border-radius: 0; }
  html.has-bg-image main { border-radius: 0 0 14px 14px; }
}

@media (max-width: 420px) {
  .hero-title { font-size: 22px; }
  .hero-avatar { width: 56px; height: 56px; }
  .article-title { font-size: 21px; }
  .post-card-title { font-size: 16px; }
  .post-meta { font-size: 12px; }
  .nav-link { padding: 8px 7px; font-size: 12.5px; }
  .theme-toggle { width: 32px; height: 32px; font-size: 14px; }
  .site-nav { gap: 0; }
}

/* 背景图：body 伪元素承载（支持模糊与压暗），内容整体抬到上层 */
html.has-bg-image { background-image: none; }

html.has-bg-image body { background: transparent; }

html.has-bg-image body::before {
  content: '';
  position: fixed;
  inset: -24px;
  z-index: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(var(--bg-blur, 0px));
  pointer-events: none;
}

html.has-bg-image main,
html.has-bg-image .site-footer {
  position: relative;
  z-index: 1;
}

/* 背景图较透时，给顶栏和 Hero 文字加一点描边阴影，保证可读 */
html.has-bg-image .brand,
html.has-bg-image .nav-link,
html.has-bg-image .hero-title,
html.has-bg-image .hero-tagline,
html.has-bg-image .hero-bio {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.55);
}

html[data-theme='dark'].has-bg-image .brand,
html[data-theme='dark'].has-bg-image .nav-link,
html[data-theme='dark'].has-bg-image .hero-title,
html[data-theme='dark'].has-bg-image .hero-tagline,
html[data-theme='dark'].has-bg-image .hero-bio {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.bg-scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--card-bg, rgba(255, 255, 255, 0.72));
  pointer-events: none;
}

html.has-bg-image main,
html.has-bg-image .site-header,
html.has-bg-image .site-footer {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* 窗口内圈的彩虹流光描边 */
@property --rb-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

html.rainbow-frame body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  border-radius: 0;
  padding: var(--rb-width, 2px);
  background: conic-gradient(
    from var(--rb-angle),
    #ff6b6b,
    #ffd93d,
    #6bcb77,
    #4d96ff,
    #b06bff,
    #ff6bd6,
    #ff6b6b
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  animation: rb-spin var(--rb-speed, 9s) linear infinite;
  opacity: var(--rb-alpha, 0.85);
}

@media (max-width: 720px) {
  html.rainbow-frame body::after { inset: 0; border-radius: 0; }
}

/* 在线音乐播放器 */
.music-player {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg, var(--card));
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  color: var(--fg);
}

.music-player[data-playing='true'] { border-color: var(--accent); }

.music-player[data-blocked='true'] .mp-play {
  border-color: var(--accent);
  color: var(--accent);
  animation: mp-pulse 1.6s ease-in-out infinite;
}

@keyframes mp-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.mp-btn {
  appearance: none;
  flex: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.mp-btn:hover { border-color: var(--accent); color: var(--accent); }

.mp-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mp-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; line-height: 1.3; }
.mp-time { font-size: 11px; line-height: 1.3; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-progress { width: 84px; flex: none; accent-color: var(--accent); }
.mp-volume { width: 64px; flex: none; accent-color: var(--accent); }
.mp-mute { font-size: 14px; }

.mp-meter {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  pointer-events: none;
}
.mp-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.2s linear;
}

@media (max-width: 720px) {
  .music-player {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-width: none;
    padding: 8px 10px 11px;
    gap: 6px;
  }
  .mp-progress { display: none; }
  .mp-volume { display: none; }
  .mp-btn { width: 38px; height: 38px; font-size: 14px; }
  .mp-info { flex: 1; min-width: 0; }
  .mp-title { max-width: none; font-size: 13px; }
  .mp-time { font-size: 10.5px; }
  body { padding-bottom: 86px; }
}

/* 装饰层：流星 / 季节粒子 / 进度 / 回顶 / 日历 / 节日横幅 */
.decor-canvas {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.4s ease;
}
html.decor-particles-off .decor-canvas { opacity: 0; }

.decor-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 65;
  background: linear-gradient(90deg, var(--accent), #c084fc, #f472b6);
  box-shadow: 0 0 8px var(--accent);
}

.decor-top {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 65;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.decor-top[data-show='1'] { opacity: 0.92; transform: none; pointer-events: auto; }
.decor-top:hover { border-color: var(--accent); color: var(--accent); }

.decor-calendar-btn, .decor-toggle { font-size: 14px; }
.decor-toggle[aria-pressed='false'] { opacity: 0.5; }

.decor-calendar {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 80;
  width: 272px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  font-size: 13px;
}
.decor-calendar header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.decor-cal-title { flex: 1; text-align: center; font-weight: 600; font-size: 13px; }
.decor-calendar header button {
  appearance: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  line-height: 1;
}
.decor-cal-week, .decor-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.decor-cal-week span { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }
.decor-cal-day {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg);
  height: 30px;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
button.decor-cal-day { cursor: pointer; }
.decor-cal-day.has-post { color: var(--accent); font-weight: 600; }
.decor-cal-day.has-post::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.decor-cal-day.is-today { background: var(--accent-soft); }
.decor-cal-day:hover { background: var(--bg); }

.decor-festival {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 66;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.decor-festival.is-out { opacity: 0; transform: translateX(-50%) translateY(-8px); pointer-events: none; }

@media (max-width: 720px) {
  .decor-top { left: 10px; bottom: 72px; width: 34px; height: 34px; }
  .decor-calendar { right: 8px; left: 8px; width: auto; top: 60px; }
  .decor-festival { top: 8px; font-size: 12px; }
  .decor-canvas { opacity: 0.8; }
}

/* 开场动画：红黑立绘 + 深红标题 + 切片错位 + 黄色语录 */
html.intro-active body { overflow: hidden; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 999;
  overflow: hidden;
  background: #050507;
  transition: opacity 0.9s ease;
}
.intro.is-out { opacity: 0; pointer-events: none; }

.intro-bg {
  position: absolute;
  inset: 0;
  background: url('intro-bg.webp') center 32% / cover no-repeat;
  filter: saturate(1.08) contrast(1.06);
  transform: scale(1.06);
  animation: intro-zoom 9s ease-out forwards;
}
@keyframes intro-zoom {
  from { transform: scale(1.1); }
  to { transform: scale(1.0); }
}

/* VR 数字故障：周期性 RGB 撕裂，一下就好 */
.intro-glitch {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: url('intro-bg.webp') center 32% / cover no-repeat;
  opacity: 0;
  mix-blend-mode: screen;
  animation: intro-glitch-flash 2.6s steps(1, end) infinite;
}
.intro-glitch::before,
.intro-glitch::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-position: inherit;
  background-size: inherit;
  opacity: 0;
}
.intro-glitch::before {
  filter: hue-rotate(165deg) saturate(3.4) brightness(1.15) contrast(1.1);
  animation: intro-glitch-a 2.6s steps(1, end) infinite;
}
.intro-glitch::after {
  filter: hue-rotate(-35deg) saturate(3.4) brightness(1.08) contrast(1.1);
  animation: intro-glitch-b 2.6s steps(1, end) infinite;
}

@keyframes intro-glitch-flash {
  0%, 6% { opacity: 0.42; }
  7% { opacity: 0.2; }
  8%, 100% { opacity: 0; }
}
@keyframes intro-glitch-a {
  0% { opacity: 0.95; transform: translate(-16px, 0); clip-path: inset(10% 0 68% 0); }
  1.5% { opacity: 0.75; transform: translate(18px, -2px); clip-path: inset(22% 0 56% 0); }
  3% { opacity: 0.9; transform: translate(-10px, 2px); clip-path: inset(4% 0 80% 0); }
  4.5% { opacity: 0.6; transform: translate(12px, -1px); clip-path: inset(32% 0 48% 0); }
  6% { opacity: 0.4; transform: translate(0, 0); clip-path: inset(14% 0 70% 0); }
  7%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 100% 0); }
}
@keyframes intro-glitch-b {
  0% { opacity: 0.9; transform: translate(14px, 1px); clip-path: inset(66% 0 12% 0); }
  1.5% { opacity: 0.7; transform: translate(-20px, 3px); clip-path: inset(58% 0 24% 0); }
  3% { opacity: 0.85; transform: translate(9px, -2px); clip-path: inset(74% 0 8% 0); }
  4.5% { opacity: 0.55; transform: translate(-12px, 0); clip-path: inset(50% 0 32% 0); }
  6% { opacity: 0.35; transform: translate(0, 0); clip-path: inset(62% 0 18% 0); }
  7%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 100% 0); }
}

.intro-tint {  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 32% 38%, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.72) 72%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.18) 42%, rgba(0, 0, 0, 0.88) 100%);
}

.intro::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 40, 40, 0.05) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}

.intro-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vh, 40px);
  padding: 0 6vw;
  text-align: center;
}

.intro-title {
  position: relative;
  font-family: 'Fusion Pixel', system-ui, sans-serif;
  font-size: clamp(22px, 5.4vw, 64px);
  letter-spacing: 0.14em;
  color: #9c0d0d;
  text-shadow: 0 0 26px rgba(190, 0, 0, 0.6), 0 0 4px rgba(255, 60, 60, 0.45);
  opacity: 0;
  animation: intro-title-in 1.2s ease forwards 0.15s;
  will-change: transform;
}
.intro-title::before,
.intro-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  color: #ff2f2f;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 12px rgba(255, 40, 40, 0.7);
}
.intro-title::before {
  clip-path: inset(0 0 56% 0);
  animation: intro-glitch-top 3.6s steps(1, end) infinite;
}
.intro-title::after {
  clip-path: inset(58% 0 0 0);
  animation: intro-glitch-bottom 3.6s steps(1, end) infinite;
}

@keyframes intro-title-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* 切片错位：正常 → 左右错开 → 复位 → 再错开 */
@keyframes intro-glitch-top {
  0%, 78% { transform: translateX(0); opacity: 0; }
  79% { transform: translateX(-10px); opacity: 0.9; }
  82% { transform: translateX(9px); opacity: 0.9; }
  85% { transform: translateX(-6px); opacity: 0.9; }
  88% { transform: translateX(4px); opacity: 0.9; }
  91%, 100% { transform: translateX(0); opacity: 0; }
}
@keyframes intro-glitch-bottom {
  0%, 80% { transform: translateX(0); opacity: 0; }
  81% { transform: translateX(11px); opacity: 0.9; }
  84% { transform: translateX(-8px); opacity: 0.9; }
  87% { transform: translateX(6px); opacity: 0.9; }
  90% { transform: translateX(-3px); opacity: 0.9; }
  93%, 100% { transform: translateX(0); opacity: 0; }
}

.intro-quote {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  opacity: 0;
  animation: intro-quote-in 2.4s ease forwards 2.1s;
}
.intro-quote p {
  margin: 0;
  color: #ffcf40;
  font-family: 'Fusion Pixel', system-ui, sans-serif;
  font-size: clamp(15px, 2.7vw, 28px);
  letter-spacing: 0.2em;
  text-shadow: 0 0 18px rgba(255, 190, 20, 0.5), 0 0 3px rgba(255, 220, 120, 0.6);
}
.intro-quote .q2 {
  font-size: clamp(12px, 2.1vw, 21px);
  opacity: 0;
  animation: intro-quote-in 1.8s ease forwards 3.4s;
}

.intro-emblem {
  width: clamp(46px, 6.4vw, 64px);
  height: auto;
  margin-top: 14px;
  opacity: 0;
  filter: drop-shadow(0 0 14px rgba(220, 30, 30, 0.55));
  animation: intro-quote-in 2s ease forwards 4.8s;
}
@keyframes intro-quote-in {
  from { opacity: 0; filter: blur(6px); transform: translateY(6px); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* 党徽下方的标语：从下往上慢慢升起 */
.intro-quote .intro-slogan {
  margin: 20px 0 0;
  width: 100%;
  max-width: 100%;
  font-family: 'Fusion Pixel', system-ui, sans-serif;
  font-size: clamp(14px, 4.6vw, 44px);
  line-height: 1.3;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
  color: #e81010;
  text-shadow: 0 0 22px rgba(220, 0, 0, 0.55), 0 0 5px rgba(255, 80, 80, 0.45);
  opacity: 0;
  will-change: transform, opacity;
  animation: intro-slogan-in 2.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards 5s;
}
@keyframes intro-slogan-in {
  0% { opacity: 0; transform: translateY(28px); filter: blur(4px); }
  55% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .intro-quote .intro-slogan { animation: none; opacity: 1; transform: none; filter: none; }
}

.intro-hint {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(255, 190, 190, 0.35);
  opacity: 0;
  animation: intro-quote-in 1.6s ease forwards 4.6s;
}

html.intro-done .site-header,
html.intro-done main,
html.intro-done .site-footer {
  animation: site-in 0.9s ease both;
}

@keyframes site-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 留言板 / 收信箱 */
.board { max-width: 720px; }
.board-hint { margin: 6px 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.board-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.board-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.board-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  outline: none;
  resize: vertical;
}
.board-input:focus { border-color: var(--accent); }
.board-form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.board-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.board-status { font-size: 12.5px; color: var(--muted); }
.board-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.board-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.board-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.board-btn-primary:hover { color: #fff; filter: brightness(1.05); }
.board-list { display: flex; flex-direction: column; gap: 12px; }
.board-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.board-item.is-unread { border-color: var(--accent); }
.board-item header { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.board-author { font-weight: 600; color: var(--fg); }
.board-time { margin-left: auto; font-variant-numeric: tabular-nums; }
.board-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.board-tag { padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.board-tag-pending { background: #fff3cd; color: #8a6d3b; }
.board-item-actions { display: flex; gap: 8px; margin-top: 10px; }
.board-btn-sm { padding: 4px 10px; font-size: 12px; }

.terms h2 { margin: 24px 0 8px; font-size: 17px; }
.terms h2:first-of-type { margin-top: 18px; }
.terms p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; line-height: 1.8; }
.footer-link { color: inherit; text-decoration: none; }
.footer-link:hover { color: var(--accent); }

.brand { display: inline-flex; align-items: center; gap: 8px; }

/* 游戏服务器状态卡 */
.server-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 10px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  font-size: 13.5px;
  color: var(--muted);
}
.server-card[hidden] { display: none; }
.server-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa3b2; flex: none; }
.server-dot.live { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.server-label { color: var(--muted); }
.server-count { color: var(--fg); font-weight: 700; }
.server-time { margin-left: auto; font-size: 12px; color: var(--muted); }

/* 我的世界卡片 */
.world-card {
  margin: 18px 0 10px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--card), var(--bg));
  box-shadow: var(--shadow);
}
.world-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.world-tag { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.world-title { margin: 8px 0 2px; font-size: 22px; font-weight: 700; color: var(--fg); }
.world-sub { font-size: 13px; color: var(--pink, #ff7bb0); }
.world-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px 18px; margin-top: 14px; }
.world-stats span { display: flex; flex-direction: column; gap: 2px; }
.world-stats i { font-style: normal; font-size: 11px; color: var(--muted); }
.world-stats b { font-size: 20px; color: var(--fg); font-variant-numeric: tabular-nums; }
@media (max-width: 420px) {
  .world-stats { grid-template-columns: repeat(2, 1fr); }
  .world-title { font-size: 19px; }
}
.world-foot { margin-top: 12px; font-size: 11px; color: var(--muted); opacity: .85; }

}.brand-mark {
  width: 26px;
  height: 26px;
  display: block;
  border-radius: 7px;
  image-rendering: pixelated;
}
.board-title { margin: 8px 0 6px; font-size: 16px; font-weight: 650; line-height: 1.4; }
.board-body { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }

@keyframes rb-spin {
  to { --rb-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  html.rainbow-frame body::after { animation: none; }
}


/* ===== 版式装饰：框、角、分隔线 ===== */
.hero {
  position: relative;
  margin-top: 6px;
  padding: 24px 20px 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  pointer-events: none;
}
.hero::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.hero::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  margin-left: 4px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.post-card {
  position: relative;
  padding-left: 22px;
  overflow: hidden;
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), #ff7bb0);
  opacity: .55;
  transition: opacity .2s ease;
}
.post-card:hover::before { opacity: 1; }
.post-card::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 0;
  width: 1px;
  height: 14px;
  background: var(--border);
}

.world-card,
.server-card {
  position: relative;
}
.world-card::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 10px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  opacity: .5;
}

.site-footer {
  border-top: 1px solid var(--border);
  box-shadow: inset 0 4px 0 -3px var(--accent);
}

@media (max-width: 420px) {
  .hero { padding: 18px 14px 16px; }
  .hero::before, .hero::after { width: 12px; height: 12px; }
  .post-card { padding-left: 18px; }
}

/* 元旦 / 除夕 倒计时 */
.countdown {
  margin: 18px 0 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.cd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}
.cd-row + .cd-row { border-top: 1px solid var(--border); }
.cd-label { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.cd-label b { color: var(--fg); font-weight: 600; }
.cd-nums {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.cd-nums b {
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
  min-width: 1.6ch;
  text-align: right;
  font-weight: 700;
}
.cd-nums i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  margin: 0 4px 0 1px;
}
.cd-row.is-today .cd-nums b { color: #ff7bb0; }
.cd-row[data-cd="eve"] .cd-nums b { color: #ff5233; }
.cd-row[data-cd="eve"] .cd-label b { color: #ff5233; }

@media (max-width: 420px) {
  .cd-row { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 14px; }
  .cd-nums b { font-size: 18px; }
}
