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

:root {
  --bg: #0a0a14;
  --card-bg: rgba(255,255,255,0.035);
  --card-border: rgba(255,255,255,0.07);
  --card-hover-bg: rgba(255,255,255,0.055);
  --card-hover-border: rgba(255,255,255,0.14);
  --card-shadow: rgba(0,0,0,0.25);
  --text: #e4e4ec;
  --text-secondary: #9494a8;
  --text-tertiary: #6b6b80;
  --link-color: #8fa8ff;
  --link-hover: #b8c8ff;
  --radius: 18px;
  --code-bg: rgba(0,0,0,0.3);
  --code-border: rgba(255,255,255,0.08);
  --step-num-bg: rgba(140,155,220,0.18);
  --step-num-color: #a0b0e0;
  --toc-active-bg: rgba(140,155,220,0.12);
  --btn-link-bg: rgba(140,155,220,0.12);
  --btn-link-border: rgba(140,155,220,0.22);
  --btn-link-hover-bg: rgba(140,155,220,0.2);
  --pros-bg: rgba(140,155,220,0.14);
  --pros-label: #a0b0e0;
  --cons-label: #b89040;
  --scroll-thumb: rgba(130,155,220,0.35);
  --scroll-thumb-hover: rgba(130,155,220,0.55);
}

[data-theme="light"] {
  --bg: #f3eff3;
  --card-bg: rgba(255,255,255,0.62);
  --card-border: rgba(0,0,0,0.06);
  --card-hover-bg: rgba(255,255,255,0.82);
  --card-hover-border: rgba(251,114,153,0.22);
  --card-shadow: rgba(0,0,0,0.06);
  --text: #18181e;
  --text-secondary: #6b6b80;
  --text-tertiary: #999;
  --link-color: #d44070;
  --link-hover: #fb7299;
  --code-bg: rgba(0,0,0,0.04);
  --code-border: rgba(0,0,0,0.08);
  --step-num-bg: rgba(251,114,153,0.18);
  --step-num-color: #b05060;
  --toc-active-bg: rgba(251,114,153,0.12);
  --btn-link-bg: rgba(251,114,153,0.12);
  --btn-link-border: rgba(251,114,153,0.22);
  --btn-link-hover-bg: rgba(251,114,153,0.2);
  --pros-bg: rgba(251,114,153,0.14);
  --pros-label: #a04058;
  --cons-label: #8a6830;
  --scroll-thumb: rgba(200,130,160,0.3);
  --scroll-thumb-hover: rgba(200,130,160,0.5);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23b8c8ff'/%3E%3Cstop offset='100%25' stop-color='%238c96ff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16 27 C16 27 4 19 4 11 C4 5 8 3 12 7.5 C14 10 15 12 16 14 C17 12 18 10 20 7.5 C24 3 28 5 28 11 C28 19 16 27 16 27 Z' fill='url(%23g)' stroke='%23fff' stroke-width='2' stroke-linejoin='round' transform='rotate(145 16 16)'/%3E%3C/svg%3E") 10 7, auto;
}
input, textarea, [contenteditable] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='30' viewBox='0 0 14 30'%3E%3Crect x='4' y='4' width='6' height='22' rx='3' fill='%238c96ff' stroke='%23fff' stroke-width='1.3'/%3E%3Crect x='1' y='1' width='12' height='5' rx='2.5' fill='%238c96ff' stroke='%23fff' stroke-width='1'/%3E%3Crect x='1' y='24' width='12' height='5' rx='2.5' fill='%238c96ff' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E") 7 15, text;
}
a, button, [role="button"], .toc-item, .step-img {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='32' viewBox='0 0 40 32'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23b8c8ff'/%3E%3Cstop offset='100%25' stop-color='%238c96ff'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='1.5' y='4' width='4' height='9' rx='2' fill='url(%23g)' stroke='%23fff' stroke-width='1'/%3E%3Crect x='7' y='1.5' width='4.5' height='12.5' rx='2.25' fill='url(%23g)' stroke='%23fff' stroke-width='1'/%3E%3Crect x='13' y='0.5' width='5' height='15' rx='2.5' fill='url(%23g)' stroke='%23fff' stroke-width='1'/%3E%3Crect x='19.5' y='2.5' width='5' height='12' rx='2.5' fill='url(%23g)' stroke='%23fff' stroke-width='1'/%3E%3Crect x='1.5' y='13' width='25' height='15' rx='6' fill='url(%23g)' stroke='%23fff' stroke-width='1.5'/%3E%3Crect x='0.5' y='18' width='5.5' height='8' rx='2.75' fill='url(%23g)' stroke='%23fff' stroke-width='1.2'/%3E%3C/svg%3E") 16 1, pointer;
}

/* Light theme cursors */
[data-theme="light"] body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23ffb3c6'/%3E%3Cstop offset='100%25' stop-color='%23fb7299'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16 27 C16 27 4 19 4 11 C4 5 8 3 12 7.5 C14 10 15 12 16 14 C17 12 18 10 20 7.5 C24 3 28 5 28 11 C28 19 16 27 16 27 Z' fill='url(%23g)' stroke='%23fff' stroke-width='2' stroke-linejoin='round' transform='rotate(145 16 16)'/%3E%3C/svg%3E") 10 7, auto;
}
[data-theme="light"] input, [data-theme="light"] textarea, [data-theme="light"] [contenteditable] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='30' viewBox='0 0 14 30'%3E%3Crect x='4' y='4' width='6' height='22' rx='3' fill='%23fb7299' stroke='%23fff' stroke-width='1.3'/%3E%3Crect x='1' y='1' width='12' height='5' rx='2.5' fill='%23fb7299' stroke='%23fff' stroke-width='1'/%3E%3Crect x='1' y='24' width='12' height='5' rx='2.5' fill='%23fb7299' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E") 7 15, text;
}
[data-theme="light"] a, [data-theme="light"] button, [data-theme="light"] [role="button"], [data-theme="light"] .toc-item, [data-theme="light"] .step-img {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='32' viewBox='0 0 40 32'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0%25' stop-color='%23ffb3c6'/%3E%3Cstop offset='100%25' stop-color='%23fb7299'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='1.5' y='4' width='4' height='9' rx='2' fill='url(%23g)' stroke='%23fff' stroke-width='1'/%3E%3Crect x='7' y='1.5' width='4.5' height='12.5' rx='2.25' fill='url(%23g)' stroke='%23fff' stroke-width='1'/%3E%3Crect x='13' y='0.5' width='5' height='15' rx='2.5' fill='url(%23g)' stroke='%23fff' stroke-width='1'/%3E%3Crect x='19.5' y='2.5' width='5' height='12' rx='2.5' fill='url(%23g)' stroke='%23fff' stroke-width='1'/%3E%3Crect x='1.5' y='13' width='25' height='15' rx='6' fill='url(%23g)' stroke='%23fff' stroke-width='1.5'/%3E%3Crect x='0.5' y='18' width='5.5' height='8' rx='2.75' fill='url(%23g)' stroke='%23fff' stroke-width='1.2'/%3E%3C/svg%3E") 16 1, pointer;
}

[data-fireworks="off"] body { cursor: auto; }
[data-fireworks="off"] input, [data-fireworks="off"] textarea, [data-fireworks="off"] [contenteditable] { cursor: text; }
[data-fireworks="off"] a, [data-fireworks="off"] button, [data-fireworks="off"] [role="button"], [data-fireworks="off"] .toc-item, [data-fireworks="off"] .step-img { cursor: pointer; }

/* ---- Background decorations ---- */
.bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.12;
}
.blob-1 { width: 400px; height: 400px; background: rgba(140,120,220,0.5); top: -80px; left: -80px; }
.blob-2 { width: 350px; height: 350px; background: rgba(200,130,160,0.4); bottom: 100px; right: -100px; }
.blob-3 { width: 300px; height: 300px; background: rgba(120,160,220,0.35); top: 40%; left: 50%; }

/* ---- Layout (universal) ---- */
.app { max-width: 1100px; margin: 0 auto; padding: 40px 24px 60px; position: relative; z-index: 1; }

/* ---- Shared content ---- */
.back-link { display: inline-block; color: var(--text-secondary); text-decoration: none; font-size: 0.82rem; margin-bottom: 28px; }
.back-link:hover { color: var(--link-hover); }

.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.page-header p  { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; }

.page-footer { text-align: center; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--card-border); }
.page-footer a { font-size: 0.78rem; color: var(--link-color); text-decoration: none; }
.page-footer a:hover { color: var(--link-hover); }

/* ---- Image Lightbox ---- */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 92vh; object-fit: contain;
  border-radius: 12px;
  animation: lbZoom 0.2s ease-out;
}
@keyframes lbZoom { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 560px) {
  .app { padding: 24px 14px 40px; }
  .page-header h1 { font-size: 1.1rem; }
}

/* ---- Firework particles ---- */
.firework-particle {
  position: fixed; z-index: 200; pointer-events: none;
  width: 4px; height: 4px; border-radius: 50%;
  animation: fwBurst 0.9s ease-out forwards;
}
.firework-particle.star {
  width: 2px; height: 6px; border-radius: 0;
  animation: fwBurst 0.9s ease-out forwards, fwStar 0.9s ease-out forwards;
}
@keyframes fwBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
}
@keyframes fwStar {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(var(--tx), var(--ty)) rotate(360deg); }
}
