:root {
  --bg: #faf9f5;
  --card: #ffffff;
  --text: #262657;
  --heading: #10102e;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: #ccfbf1;
  --accent-rgb: 13 148 136;
  --accent-hover-rgb: 15 118 110;
  --accent-light-rgb: 20 184 166;
}
html[data-accent="blue"] {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-rgb: 37 99 235;
  --accent-hover-rgb: 29 78 216;
  --accent-light-rgb: 59 130 246;
}
html[data-accent="violet"] {
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #ede9fe;
  --accent-rgb: 124 58 237;
  --accent-hover-rgb: 109 40 217;
  --accent-light-rgb: 139 92 246;
}
html[data-accent="orange"] {
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-soft: #ffedd5;
  --accent-rgb: 234 88 12;
  --accent-hover-rgb: 194 65 12;
  --accent-light-rgb: 249 115 22;
}
html[data-accent="rose"] {
  --accent: #e11d48;
  --accent-hover: #be123c;
  --accent-soft: #ffe4e6;
  --accent-rgb: 225 29 72;
  --accent-hover-rgb: 190 18 60;
  --accent-light-rgb: 244 63 94;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.boot { max-width: 720px; margin: 0 auto; padding: 80px 24px; text-align: center; }
.boot h1 { color: var(--heading); }
.muted { color: #888; }

/* line-clamp fallback (Tailwind CDN usually provides these) */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* markdown article typography */
.prose { color: #334; font-size: 1.05rem; line-height: 1.85; word-break: break-word; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--heading); font-weight: 800; line-height: 1.3; margin: 1.8em 0 0.6em;
}
.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.5rem; padding-bottom: 0.3em; border-bottom: 1px solid #eef; }
.prose h3 { font-size: 1.2rem; }
.prose p { margin: 0.9em 0; }
.prose ul, .prose ol { margin: 0.9em 0; padding-left: 1.5em; }
.prose li { margin: 0.35em 0; line-height: 1.7; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent-hover); }
.prose strong { color: var(--heading); font-weight: 700; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.7em 1.1em;
  margin: 1.1em 0;
  color: #334;
  border-radius: 0 10px 10px 0;
}
.prose blockquote p { margin: 0; }
.prose code {
  background: #f1f5f9;
  color: #be185d;
  padding: 0.15em 0.45em;
  border-radius: 5px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.prose pre {
  background: #f6f8fa;
  color: #1f2937;
  border: 1px solid #e2e8f0;
  padding: 1em 1.2em;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.1em 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.prose img { max-width: 100%; border-radius: 12px; margin: 1em 0; }
.prose .video-embed {
  display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9;
  margin: 1em 0; border: 0; border-radius: 12px; background: #000;
}
.prose video.video-embed { height: auto; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose th, .prose td { border: 1px solid #e5e7eb; padding: 0.5em 0.8em; }
.prose th { background: #f8fafc; }

/* dark theme: shared by the public site and admin */
html.dark {
  color-scheme: dark;
  --bg: #0f172a;
  --card: #1e293b;
  --text: #cbd5e1;
  --heading: #f8fafc;
  --accent-soft: rgba(20, 184, 166, 0.16);
}
html.dark[data-accent="blue"] { --accent-soft: rgba(59, 130, 246, 0.18); }
html.dark[data-accent="violet"] { --accent-soft: rgba(139, 92, 246, 0.18); }
html.dark[data-accent="orange"] { --accent-soft: rgba(249, 115, 22, 0.18); }
html.dark[data-accent="rose"] { --accent-soft: rgba(244, 63, 94, 0.18); }
html.dark body,
html.dark .bg-cream { background-color: var(--bg); color: var(--text); }
html.dark .bg-white { background-color: var(--card); }
html.dark .bg-white\/85 { background-color: rgba(30, 41, 59, 0.88); }
html.dark .bg-gray-50 { background-color: #162238; }
html.dark .bg-gray-100 { background-color: #293548; }
html.dark .text-ink { color: var(--heading); }
html.dark .text-body { color: var(--text); }
html.dark .text-body\/80 { color: rgba(203, 213, 225, 0.8); }
html.dark .text-gray-500,
html.dark .text-gray-400 { color: #94a3b8; }
html.dark .text-teal-hover { color: #5eead4; }
html.dark .border-gray-100,
html.dark .border-gray-200 { border-color: #334155; }
html.dark .divide-gray-50 > :not([hidden]) ~ :not([hidden]) { border-color: #293548; }
html.dark .hover\:bg-gray-50:hover { background-color: #162238; }
html.dark .hover\:bg-gray-100:hover { background-color: #293548; }
html.dark .hover\:bg-gray-200:hover { background-color: #334155; }
html.dark .bg-teal-soft { background-color: var(--accent-soft); }
html.dark .bg-red-50 { background-color: rgba(239, 68, 68, 0.12); }
html.dark .text-red-600 { color: #f87171; }
html.dark input,
html.dark textarea,
html.dark select { color: #e2e8f0; }
html.dark input::placeholder,
html.dark textarea::placeholder { color: #64748b; }
html.dark .prose { color: var(--text); }
html.dark .prose h2 { border-bottom-color: #334155; }
html.dark .prose blockquote { color: var(--text); }
html.dark .prose code { background: #293548; color: #f9a8d4; }
html.dark .prose pre { background: #1e293b; color: #e2e8f0; border-color: #334155; }
html.dark .prose pre code { background: transparent; }
html.dark .prose th,
html.dark .prose td { border-color: #334155; }
html.dark .prose th { background: #162238; }
.theme-icon-sun { display: none; }
html.dark .theme-icon-sun { display: block; }
html.dark .theme-icon-moon { display: none; }

/* navigation submenus */
.nav-details > summary { list-style: none; }
.nav-details > summary::-webkit-details-marker { display: none; }
.nav-details[open] .nav-chevron { transform: rotate(180deg); }

/* article code copy button */
.code-block-wrap { position: relative; }
.code-block-wrap > pre { margin: 0; }
.code-copy-btn {
  position: absolute; top: .5rem; right: .5rem; z-index: 2;
  padding: .3rem .65rem; border-radius: .4rem;
  background: rgba(255, 255, 255, .94); color: #334155;
  font-size: .75rem; font-weight: 600; line-height: 1.2;
  border: 1px solid rgba(148, 163, 184, .45);
  cursor: pointer; opacity: .7;
  transition: opacity .15s ease, background-color .15s ease, color .15s ease;
}
.code-block-wrap:hover .code-copy-btn,
.code-copy-btn:focus { opacity: 1; }
.code-copy-btn:hover { background: #0d9488; color: #fff; border-color: #0d9488; }
.code-copy-btn.is-copied { opacity: 1; background: #0d9488; color: #fff; border-color: #0d9488; }
@media (hover: none) { .code-copy-btn { opacity: 1; } }
html.dark .code-copy-btn { background: rgba(30, 41, 59, .95); color: #e2e8f0; border-color: rgba(100, 116, 139, .6); }
html.dark .code-copy-btn:hover,
html.dark .code-copy-btn.is-copied { background: #0d9488; color: #fff; border-color: #0d9488; }

/* accent color swatches */
.accent-swatch {
  width: 1.5rem; height: 1.5rem; border-radius: 9999px;
  background: var(--swatch); border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, border-color .15s ease;
}
.accent-swatch:hover { transform: scale(1.1); }
.accent-swatch[aria-pressed="true"] { border-color: var(--heading); }
html.dark .accent-swatch[aria-pressed="true"] { border-color: #f8fafc; }

/* top announcement bar */
.announce-bar {
  background: linear-gradient(90deg, rgb(var(--accent-hover-rgb)) 0%, rgb(var(--accent-light-rgb)) 100%);
  color: #fff;
}
.announce-bar .announce-text {
  font-weight: 600;
  letter-spacing: .01em;
}
.announce-cta {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .7rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .65);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.announce-cta:hover { background: rgba(255, 255, 255, .32); }

/* floating ad slots on both sides (wide screens only) */
.side-ad {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  z-index: 30;
  display: none;
}
/* 每条广告独立成卡片，间距处露出页面背景，调间距时能明显看到变化 */
.side-ad-list > a,
.side-ad-list > img {
  display: block;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .16);
}
.side-ad img { display: block; width: 100%; height: auto; }
.side-ad-list { display: flex; flex-direction: column; gap: 14px; }
.side-ad-pos-center { top: 50%; transform: translateY(-50%); }
.side-ad-pos-top { top: 100px; transform: none; }
.side-ad-pos-bottom { top: auto; bottom: 60px; transform: none; }
.side-ad a { display: block; }
.side-ad-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, .55);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.side-ad-close:hover { background: rgba(15, 23, 42, .85); }
.side-ad-left { left: 16px; }
.side-ad-right { right: 16px; }
@media (min-width: 1900px) { .side-ad { display: block; } }
html.dark .side-ad-list > a,
html.dark .side-ad-list > img { background: #1e293b; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

/* hero 纹路（跟随主题强调色） */
.hero-pattern { pointer-events: none; opacity: .4; }
.hero-pattern-none { display: none; }
.hero-pattern-dots {
  background-image: radial-gradient(circle, rgb(var(--accent-light-rgb) / .9) 1px, transparent 1.6px);
  background-size: 22px 22px;
}
.hero-pattern-grid {
  background-image:
    linear-gradient(rgb(var(--accent-light-rgb) / .35) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--accent-light-rgb) / .35) 1px, transparent 1px);
  background-size: 42px 42px;
}
.hero-pattern-diagonal {
  background-image: repeating-linear-gradient(45deg, rgb(var(--accent-light-rgb) / .28) 0 2px, transparent 2px 16px);
}
.hero-pattern-rings {
  background-image: repeating-radial-gradient(circle at 50% 45%, rgb(var(--accent-light-rgb) / .3) 0 2px, transparent 2px 30px);
}
