@font-face {
  font-family: "Festival Calligraphy";
  src: url("/fonts/MaShanZheng-FestivalSubset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0020,
    U+00B7,
    U+4E8B,
    U+53EF,
    U+5409,
    U+56CD,
    U+5713,
    U+5718,
    U+597D,
    U+5982,
    U+5B89,
    U+5BB6,
    U+5E74,
    U+5EB7,
    U+5FEB,
    U+610F,
    U+65B0,
    U+6625,
    U+6708,
    U+6A02,
    U+706B,
    U+71C8,
    U+7965,
    U+798F,
    U+82B1,
    U+842C,
    U+89AA,
    U+95D4;
}

@font-face {
  font-family: "Ma Shan Zheng Full";
  src:
    url("/fonts/MaShanZheng-Regular.woff2") format("woff2"),
    url("/fonts/MaShanZheng-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --card-glass-start: rgba(255, 255, 255, 0.76);
  --card-glass-end: rgba(255, 255, 255, 0.56);
  --card-border: rgba(255, 255, 255, 0.46);
  --text: #1f2937;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #6366f1;
  --site-cover-image: none;
  --banner-height: 316px;
  --cover-clear-offset: 56px;
  --cover-clear-height: calc(var(--banner-height) + var(--cover-clear-offset));
  --text-gradient: linear-gradient(112deg, #0ea5e9 0%, #2563eb 36%, #7c3aed 68%, #db2777 100%);
  --festival-font: "Festival Calligraphy", "STKaiti", "KaiTi", "FangSong", serif;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(30, 41, 59, 0.08);
}

:root.dark {
  --bg: #0f1117;
  --card: #171a23;
  --card-glass-start: rgba(23, 26, 35, 0.8);
  --card-glass-end: rgba(23, 26, 35, 0.64);
  --card-border: rgba(148, 163, 184, 0.22);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: #2b3342;
  --primary: #a5b4fc;
  --text-gradient: linear-gradient(112deg, #67e8f9 0%, #60a5fa 32%, #a78bfa 66%, #f472b6 100%);
  --shadow: 0 12px 28px rgba(2, 6, 23, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "SF Pro Display", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.site-bg {
  position: fixed;
  inset: 0;
  background-image: var(--site-cover-image, none);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}

.site-bg-clear {
  clip-path: inset(0 0 calc(100% - var(--cover-clear-height)) 0);
  opacity: 0.99;
}

.site-bg-blur {
  background-image:
    linear-gradient(180deg, rgba(15, 23, 42, 0.03), rgba(15, 23, 42, 0.1)),
    var(--site-cover-image, none);
  clip-path: inset(var(--cover-clear-height) 0 0 0);
  filter: blur(7px) saturate(1.01);
  transform: scale(1.015);
  transform-origin: center center;
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 36px, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 36px, #000 100%);
}

.banner {
  position: relative;
  height: var(--banner-height);
  overflow: hidden;
  background: transparent;
  z-index: 1;
}

.festival-scene {
  position: relative;
  height: 100%;
  max-width: 1680px;
  margin: 0 auto;
  pointer-events: none;
  --festival-glow: rgba(251, 146, 60, 0.42);
  --lantern-rim: #f59e0b;
  --lantern-highlight: rgba(254, 240, 138, 0.22);
  --lantern-stripe: rgba(251, 191, 36, 0.65);
  --lantern-core-start: #f87171;
  --lantern-core-mid: #ef4444;
  --lantern-core-end: #dc2626;
  --lantern-cap-start: #fcd34d;
  --lantern-cap-end: #f59e0b;
  --lantern-char-color: #fcd34d;
  --blessing-bg: linear-gradient(95deg, rgba(127, 29, 29, 0.96), rgba(185, 28, 28, 0.94));
  --blessing-border: #fbbf24;
  --blessing-color: #fde68a;
}

.festival-scene--spring {
  --lantern-char-color: #fcd34d;
}

.festival-scene--none .festival-lantern,
.festival-scene--none .festival-blessing,
.festival-scene--none .festival-moon {
  display: none;
}

.festival-scene--lantern {
  --festival-glow: rgba(245, 158, 11, 0.45);
  --lantern-rim: #f59e0b;
  --lantern-highlight: rgba(253, 230, 138, 0.25);
  --lantern-stripe: rgba(252, 211, 77, 0.62);
  --lantern-core-start: #fb7185;
  --lantern-core-mid: #f43f5e;
  --lantern-core-end: #e11d48;
  --lantern-cap-start: #fde68a;
  --lantern-cap-end: #f59e0b;
  --lantern-char-color: #fef08a;
  --blessing-bg: linear-gradient(95deg, rgba(190, 24, 93, 0.95), rgba(234, 88, 12, 0.94));
  --blessing-border: #fcd34d;
  --blessing-color: #fef9c3;
}

.festival-scene--midAutumn {
  --festival-glow: rgba(168, 85, 247, 0.34);
  --lantern-rim: #fbbf24;
  --lantern-highlight: rgba(254, 249, 195, 0.34);
  --lantern-stripe: rgba(250, 204, 21, 0.5);
  --lantern-core-start: #a78bfa;
  --lantern-core-mid: #8b5cf6;
  --lantern-core-end: #7c3aed;
  --lantern-cap-start: #fde68a;
  --lantern-cap-end: #f59e0b;
  --lantern-char-color: #fef3c7;
  --blessing-bg: linear-gradient(95deg, rgba(76, 29, 149, 0.94), rgba(147, 51, 234, 0.9));
  --blessing-border: #fde68a;
  --blessing-color: #fef9c3;
}

.festival-lantern {
  position: fixed;
  top: max(8px, env(safe-area-inset-top, 0px));
  width: 150px;
  height: 100px;
  line-height: 0;
  transform-origin: 50% -100px;
  animation: lantern-sway 5s infinite ease-in-out;
  z-index: 6;
  pointer-events: none;
}

.festival-lantern-top-rope {
  width: 4px;
  height: 40px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--lantern-cap-start), var(--lantern-cap-end));
}

.festival-lantern-top,
.festival-lantern-bottom {
  width: 40%;
  height: 8px;
  margin-inline: auto;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, var(--lantern-cap-start), var(--lantern-cap-end));
  border: 1px solid var(--lantern-cap-end);
}

.festival-lantern-top {
  margin-bottom: -2px;
  border-radius: 5px 5px 0 0;
}

.festival-lantern-bottom {
  margin-top: -2px;
  border-radius: 0 0 5px 5px;
}

.festival-lantern-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 120px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.2), transparent 44%),
    linear-gradient(140deg, var(--lantern-core-start), var(--lantern-core-mid) 50%, var(--lantern-core-end));
  box-shadow: 0 0 80px -10px var(--festival-glow);
}

.festival-lantern-line {
  position: relative;
  height: 100%;
  text-align: center;
}

.festival-lantern-line::before,
.festival-lantern-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  border: 2px solid var(--lantern-rim);
  border-radius: 50%;
  transform: translate(-50%, 0);
}

.festival-lantern-line::before {
  width: 75%;
  height: 100%;
}

.festival-lantern-line::after {
  width: 35%;
  height: 100%;
}

.festival-lantern-text-wrap {
  display: inline-block;
  height: 100%;
  vertical-align: top;
}

.festival-lantern .lantern-char {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--festival-font);
  writing-mode: vertical-lr;
  text-orientation: upright;
  color: var(--lantern-char-color);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-shadow: 0 2px 7px rgba(120, 53, 15, 0.48);
}

.festival-lantern-bottom-rope {
  width: 4px;
  height: 20px;
  margin: 0 auto;
  position: relative;
  background: linear-gradient(180deg, var(--lantern-cap-start), var(--lantern-cap-end));
  animation: lantern-sway 3s infinite ease-in-out;
  transform-origin: 50% -45px;
}

.festival-lantern-bottom-rope::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -4px;
  width: 12px;
  height: 50px;
  background:
    linear-gradient(
      180deg,
      var(--lantern-core-start),
      var(--lantern-core-mid) 3px,
      var(--lantern-cap-start) 5px,
      var(--lantern-cap-end) 8px,
      var(--lantern-core-mid) 12px,
      var(--lantern-core-start) 16px,
      rgba(220, 38, 38, 0.85) 26px,
      rgba(220, 38, 38, 0.65)
    );
  border-radius: 5px 5px 0 0;
}

.lantern-left-1 {
  left: 14px;
}

.lantern-left-2 {
  left: 176px;
  animation-delay: 0.22s;
}

.lantern-right-1 {
  right: 176px;
  animation-delay: 0.36s;
}

.lantern-right-2 {
  right: 14px;
  animation-delay: 0.54s;
}

.festival-blessing {
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  min-width: min(90vw, 980px);
  max-width: min(92vw, 1040px);
  text-align: center;
  padding: 24px 46px;
  border-radius: 24px;
  border: 3px solid var(--blessing-border);
  background: var(--blessing-bg);
  color: var(--blessing-color);
  font-family: var(--festival-font);
  font-size: clamp(1.65rem, 3.1vw, 2.85rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  box-shadow: 0 22px 42px rgba(127, 29, 29, 0.38);
  text-shadow: 0 2px 9px rgba(120, 53, 15, 0.56);
  animation: blessing-pulse 2.8s ease-in-out infinite;
}

.festival-moon {
  position: fixed;
  top: 74px;
  left: 50%;
  width: 154px;
  height: 154px;
  border-radius: 999px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.96) 0%, rgba(254, 249, 195, 0.9) 36%, rgba(253, 230, 138, 0.74) 68%, rgba(250, 204, 21, 0.2) 100%),
    radial-gradient(circle at 68% 68%, rgba(253, 186, 116, 0.45), transparent 58%);
  box-shadow:
    0 0 0 1px rgba(252, 211, 77, 0.5),
    0 16px 26px rgba(113, 63, 18, 0.25),
    0 0 46px rgba(253, 224, 71, 0.34);
  opacity: 0;
  z-index: 2;
}

.festival-scene--midAutumn .festival-moon {
  opacity: 1;
}

.festival-knot-rail {
  position: fixed;
  top: 224px;
  bottom: 20px;
  width: 122px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  pointer-events: none;
  z-index: 4;
  --knot-thread-main: #e11d2e;
  --knot-thread-dark: #991b1b;
  --knot-loop-thread: #b91c1c;
  --knot-highlight: rgba(254, 242, 242, 0.38);
  --knot-gold: #f59e0b;
  --knot-gold-soft: #fcd34d;
  --knot-fringe-main: #dc2626;
  --knot-fringe-dark: #991b1b;
  --knot-shadow: rgba(127, 29, 29, 0.36);
}

.festival-knot-rail--lantern {
  --knot-thread-main: #e11d48;
  --knot-thread-dark: #9d174d;
  --knot-loop-thread: #be123c;
  --knot-highlight: rgba(255, 241, 242, 0.42);
  --knot-gold: #f59e0b;
  --knot-gold-soft: #fde68a;
  --knot-fringe-main: #f43f5e;
  --knot-fringe-dark: #9f1239;
  --knot-shadow: rgba(157, 23, 77, 0.34);
}

.festival-knot-rail--midAutumn {
  --knot-thread-main: #9333ea;
  --knot-thread-dark: #5b21b6;
  --knot-loop-thread: #6d28d9;
  --knot-highlight: rgba(250, 245, 255, 0.35);
  --knot-gold: #f59e0b;
  --knot-gold-soft: #fde68a;
  --knot-fringe-main: #a855f7;
  --knot-fringe-dark: #6b21a8;
  --knot-shadow: rgba(76, 29, 149, 0.34);
}

.rail-left {
  left: 0;
}

.rail-right {
  right: 0;
}

.festival-knot {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 14px;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(255, 255, 255, 0.08) 10px 13px),
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(255, 255, 255, 0.08) 10px 13px),
    radial-gradient(circle at 30% 24%, var(--knot-highlight), transparent 50%),
    linear-gradient(140deg, var(--knot-thread-main) 0%, var(--knot-thread-dark) 100%);
  border: 3px solid var(--knot-loop-thread);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 12px 20px var(--knot-shadow);
  transform: rotate(45deg);
  animation: knot-sway 3.4s ease-in-out infinite;
  animation-delay: var(--knot-delay);
}

.festival-knot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 112px;
  height: 80px;
  transform: translate(-50%, -50%) rotate(-45deg);
  background:
    radial-gradient(circle at 11% 50%, transparent 17px, var(--knot-loop-thread) 17px 20px, transparent 20px),
    radial-gradient(circle at 89% 50%, transparent 17px, var(--knot-loop-thread) 17px 20px, transparent 20px),
    radial-gradient(circle at 24% 50%, transparent 21px, var(--knot-thread-main) 21px 24px, transparent 24px),
    radial-gradient(circle at 76% 50%, transparent 21px, var(--knot-thread-main) 21px 24px, transparent 24px),
    radial-gradient(circle at 50% 8%, var(--knot-thread-main) 0 6px, transparent 6px),
    radial-gradient(circle at 50% 92%, var(--knot-thread-main) 0 6px, transparent 6px);
  z-index: -1;
}

.festival-knot::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -70px;
  width: 50px;
  height: 78px;
  background:
    linear-gradient(180deg, var(--knot-thread-main) 0 12px, transparent 12px) center top / 3px 16px no-repeat,
    linear-gradient(180deg, var(--knot-gold-soft) 0 7px, var(--knot-gold) 7px 14px, transparent 14px) left 6px top 16px / 16px 14px no-repeat,
    linear-gradient(180deg, var(--knot-gold-soft) 0 7px, var(--knot-gold) 7px 14px, transparent 14px) right 6px top 16px / 16px 14px no-repeat,
    repeating-linear-gradient(90deg, var(--knot-fringe-dark) 0 2px, var(--knot-fringe-main) 2px 4px) left 5px top 28px / 18px 45px no-repeat,
    repeating-linear-gradient(90deg, var(--knot-fringe-dark) 0 2px, var(--knot-fringe-main) 2px 4px) right 5px top 28px / 18px 45px no-repeat;
  border-radius: 0 0 10px 10px;
  transform: translateX(-50%) rotate(-45deg);
}

@keyframes lantern-sway {
  0% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
  100% { transform: rotate(-10deg); }
}

@keyframes knot-sway {
  0% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(47.8deg) translateY(-1px); }
  100% { transform: rotate(45deg) translateY(0); }
}

@keyframes blessing-pulse {
  0% { box-shadow: 0 20px 38px rgba(127, 29, 29, 0.36); }
  50% { box-shadow: 0 24px 46px rgba(127, 29, 29, 0.52); }
  100% { box-shadow: 0 20px 38px rgba(127, 29, 29, 0.36); }
}

.card {
  border-radius: var(--radius);
  background:
    linear-gradient(148deg, var(--card-glass-start), var(--card-glass-end));
  border: 1px solid var(--card-border);
  box-shadow:
    0 16px 36px rgba(30, 41, 59, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
}

.top-nav {
  position: sticky;
  top: max(8px, env(safe-area-inset-top, 0px));
  z-index: 20;
  max-width: 1080px;
  margin: -56px auto 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  width: 38px;
  height: 34px;
  cursor: pointer;
}

.logo {
  font-weight: 800;
  color: #0f172a;
}

.top-nav nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.top-nav nav a {
  color: #334155;
  font-weight: 500;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto 28px;
  padding: 0 16px;
  display: grid;
  gap: 18px;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}

.left-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(84px + env(safe-area-inset-top, 0px));
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.main-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.page-head {
  padding: 20px 22px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  color: #0b1324;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.profile-card {
  padding: 16px;
  text-align: center;
}

.avatar-wrap {
  width: 110px;
  height: 110px;
  margin: 4px auto 10px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  display: block;
}

.profile-name {
  margin: 8px 0 4px;
  font-size: 1.15rem;
}

.profile-bio {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.profile-links a {
  background: #eef2ff;
  color: #3730a3;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
}

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

.post-card {
  padding: 18px 20px;
}

.post-cover {
  height: 160px;
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background:
    radial-gradient(circle at 80% 14%, rgba(255, 255, 255, 0.44), transparent 48%),
    linear-gradient(132deg, rgba(59, 130, 246, 0.5), rgba(168, 85, 247, 0.42), rgba(244, 114, 182, 0.36));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.post-title {
  color: #0f172a;
  font-weight: 800;
  font-size: 1.18rem;
}

.post-desc {
  margin: 10px 0 12px;
  color: var(--muted);
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #475569;
  font-size: 0.86rem;
}

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.post-tags span {
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.post-tags a {
  background: linear-gradient(120deg, #0ea5e9, #6366f1);
  border: none;
  border-radius: 999px;
  padding: 3px 10px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.2);
}

.widget-card {
  padding: 14px;
}

.widget-card h3 {
  margin: 0 0 10px;
}

.tag-cloud-widget {
  overflow: hidden;
}

.tag-cloud-shell {
  position: relative;
  height: 220px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 22% 18%, rgba(14, 165, 233, 0.12), transparent 58%),
    radial-gradient(circle at 78% 14%, rgba(217, 70, 239, 0.12), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(248, 250, 252, 0.72));
}

.tag-cloud {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transform-style: preserve-3d;
}

.tag-cloud-item {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: none;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.26);
  transition: transform 0.2s ease, filter 0.2s ease;
  will-change: transform, opacity;
}

.tag-cloud-item small {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  font-weight: 700;
}

.tag-cloud-item:hover {
  filter: brightness(1.08) saturate(1.08);
}

.tag-cloud-item:nth-child(6n + 1) { background: linear-gradient(120deg, #0ea5e9, #3b82f6); }
.tag-cloud-item:nth-child(6n + 2) { background: linear-gradient(120deg, #22c55e, #16a34a); }
.tag-cloud-item:nth-child(6n + 3) { background: linear-gradient(120deg, #f59e0b, #f97316); }
.tag-cloud-item:nth-child(6n + 4) { background: linear-gradient(120deg, #ec4899, #db2777); }
.tag-cloud-item:nth-child(6n + 5) { background: linear-gradient(120deg, #8b5cf6, #6366f1); }
.tag-cloud-item:nth-child(6n + 6) { background: linear-gradient(120deg, #14b8a6, #0ea5e9); }

.widget-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.widget-tags a {
  flex: 0 0 auto;
  border-radius: 999px;
  border: none;
  color: #ffffff;
  padding: 5px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  background: linear-gradient(120deg, #0ea5e9, #6366f1);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}

.widget-tags small {
  color: rgba(255, 255, 255, 0.9);
}

.widget-tags a:nth-child(6n + 1),
.post-tags a:nth-child(6n + 1) {
  background: linear-gradient(120deg, #0ea5e9, #3b82f6);
}

.widget-tags a:nth-child(6n + 2),
.post-tags a:nth-child(6n + 2) {
  background: linear-gradient(120deg, #22c55e, #16a34a);
}

.widget-tags a:nth-child(6n + 3),
.post-tags a:nth-child(6n + 3) {
  background: linear-gradient(120deg, #f59e0b, #f97316);
}

.widget-tags a:nth-child(6n + 4),
.post-tags a:nth-child(6n + 4) {
  background: linear-gradient(120deg, #ec4899, #db2777);
}

.widget-tags a:nth-child(6n + 5),
.post-tags a:nth-child(6n + 5) {
  background: linear-gradient(120deg, #8b5cf6, #6366f1);
}

.widget-tags a:nth-child(6n + 6),
.post-tags a:nth-child(6n + 6) {
  background: linear-gradient(120deg, #14b8a6, #0ea5e9);
}

.widget-tags::-webkit-scrollbar {
  height: 6px;
}

.widget-tags::-webkit-scrollbar-track {
  background: transparent;
}

.widget-tags::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.archive-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.archive-list span {
  color: var(--muted);
  font-size: 0.84rem;
}

.archive-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.archive-group {
  padding: 16px 18px;
}

.archive-group h2 {
  margin: 0 0 8px;
}

.archive-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-group li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.archive-group span {
  color: var(--muted);
  font-size: 0.85rem;
}

.comments-card {
  padding: 18px;
}

.comments-card h3 {
  margin: 0 0 12px;
}

.reply-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.reply-box[hidden] {
  display: none;
}

.reply-box button {
  border: 1px solid #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #0f172a;
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
}

.comment-form button {
  border: 1px solid #4338ca;
  background: #4f46e5;
  color: #ffffff;
  border-radius: 10px;
  padding: 9px 12px;
  width: fit-content;
  cursor: pointer;
}

.comment-message {
  min-height: 20px;
  color: var(--muted);
  margin: 0 0 8px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-pagination {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-pagination button {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.84rem;
  cursor: pointer;
}

.comment-pagination button[hidden] {
  display: none;
}

.comment-pagination button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.comment-item {
  --reply-indent: 0px;
  --comment-avatar-size: 40px;
  --comment-avatar-space: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  background: #ffffff;
}

.comment-body {
  padding-left: var(--reply-indent);
}

.comment-text {
  margin: 6px 0 0;
  padding-left: var(--comment-avatar-space);
  text-indent: 2em;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.comment-item p {
  margin: 6px 0 0;
}

.comment-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-left: var(--comment-avatar-space);
}

.reply-btn {
  border: 1px solid transparent;
  background: var(--primary);
  color: #ffffff;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}

.toggle-replies-btn {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.comment-children[hidden] {
  display: none;
}

.comment-head {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.85rem;
}

.comment-author {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.comment-meta {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.comment-nickname {
  font-size: 0.95rem;
  line-height: 1.2;
}

.comment-avatar {
  width: var(--comment-avatar-size);
  height: var(--comment-avatar-size);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  object-fit: cover;
  flex: 0 0 auto;
}

.comment-time {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.hp-input {
  display: none;
}

.muted-empty {
  color: var(--muted);
  margin: 4px 0;
}

.comment-highlight {
  outline: 2px solid #818cf8;
  outline-offset: 1px;
}

.tags-page {
  padding: 18px;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.tag-tile {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #1e293b;
}

.tag-tile small {
  color: var(--muted);
}

code {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  padding: 2px 6px;
}

@media (max-width: 960px) {
  :root {
    --banner-height: 246px;
    --cover-clear-offset: 40px;
  }

  .banner {
    height: 246px;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

  .left-col {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }

  .festival-lantern {
    top: max(6px, env(safe-area-inset-top, 0px));
    width: 97px;
    height: 65px;
    transform-origin: 50% -50px;
  }

  .festival-lantern-top-rope {
    width: 3px;
    height: 20px;
  }

  .festival-lantern-top,
  .festival-lantern-bottom {
    width: 35%;
    height: 6px;
  }

  .festival-lantern-top {
    margin-bottom: -1px;
  }

  .festival-lantern-bottom {
    margin-top: -1px;
  }

  .festival-lantern-body {
    height: 100%;
    box-shadow: 0 0 40px -10px var(--festival-glow);
  }

  .festival-lantern-bottom-rope {
    width: 2px;
    height: 14px;
    margin-top: 0;
  }

  .festival-lantern-bottom-rope::after {
    left: -2px;
    width: 6px;
    height: 25px;
  }

  .festival-lantern .lantern-char {
    font-size: 1.36rem;
    letter-spacing: 1px;
  }

  .lantern-left-1 {
    left: 4px;
  }

  .lantern-left-2 {
    left: 99px;
  }

  .lantern-right-1 {
    right: 99px;
  }

  .lantern-right-2 {
    right: 4px;
  }

  .festival-blessing {
    top: 20px;
    min-width: 86vw;
    padding: 14px 22px;
    letter-spacing: 0.06em;
    font-size: 1.28rem;
  }

  .festival-moon {
    top: 60px;
    width: 108px;
    height: 108px;
  }

  .top-nav {
    margin-top: -40px;
  }

  .tag-cloud-shell {
    height: 198px;
  }

  .tag-cloud-item {
    font-size: 0.76rem;
    padding: 4px 10px;
  }

  .post-cover {
    height: 140px;
  }

body.is-post-detail .left-col {
  display: none;
}

body.is-post-detail .page-shell {
  grid-template-columns: minmax(0, 1fr);
}
}

@media (max-width: 1200px) {
  .festival-knot-rail {
    display: none;
  }
}

:root.dark .top-nav nav a,
:root.dark .post-title,
:root.dark .tag-tile,
:root.dark .profile-links a {
  color: var(--text);
}

:root.dark .tag-tile,
:root.dark .comment-item,
:root.dark .reply-box,
:root.dark .comment-form input,
:root.dark .comment-form textarea,
:root.dark .profile-links a {
  background: #1f2633;
}

:root.dark .tag-cloud-shell {
  border-color: #334155;
  background:
    radial-gradient(circle at 24% 18%, rgba(56, 189, 248, 0.16), transparent 58%),
    radial-gradient(circle at 78% 14%, rgba(244, 114, 182, 0.14), transparent 56%),
    linear-gradient(180deg, rgba(30, 41, 59, 0.72), rgba(30, 41, 59, 0.88));
}

:root.dark .widget-tags a,
:root.dark .post-tags a {
  color: #ffffff;
}

:root.dark .reply-box {
  border-color: #334155;
  color: #cbd5e1;
}

:root.dark .reply-box button {
  background: #3f1d1d;
  border-color: #7f1d1d;
  color: #fecaca;
}

:root.dark .festival-blessing {
  filter: saturate(0.92) brightness(0.96);
}

:root.dark .festival-knot {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.05),
    0 10px 18px rgba(15, 23, 42, 0.55);
}

:root.dark .festival-moon {
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.38),
    0 16px 24px rgba(15, 23, 42, 0.48),
    0 0 44px rgba(250, 204, 21, 0.2);
}

:root.dark .reply-btn {
  color: #0f172a;
}

:root.dark .toggle-replies-btn {
  background: #1f2633;
  color: var(--text);
  border-color: #334155;
}

:root.dark .comment-pagination button {
  background: #1f2633;
  color: var(--text);
  border-color: #334155;
}

:root.dark .comment-form input,
:root.dark .comment-form textarea {
  color: var(--text);
}

.color-text {
  background-image: var(--text-gradient);
  background-size: 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}

.color-text:hover {
  filter: saturate(1.15) brightness(1.05);
}
