/* ==========================================================================
   FLYIOI · 主题皮肤样式
   深夜（默认，见 styles.css）/ 晴日 / 森林探险 / 星际小探险家 / 游乐园狂欢
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. 通用：场景层、侧边入口、气泡、主题弹窗
   -------------------------------------------------------------------------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
}

.theme-stage {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

html[data-theme="forest"] .bg-grid,
html[data-theme="space"] .bg-grid,
html[data-theme="carnival"] .bg-grid,
html[data-theme="forest"] .bg-glow,
html[data-theme="space"] .bg-glow,
html[data-theme="carnival"] .bg-glow { display: none; }

/* 切换主题时的浮动提示 */
.theme-hint {
  position: fixed;
  left: 50%;
  top: 92px;
  transform: translate(-50%, -12px);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: 0.26s ease;
  backdrop-filter: blur(8px);
}
.theme-hint.show { opacity: 1; transform: translate(-50%, 0); }
.theme-hint b { font-size: 13px; letter-spacing: 0.04em; }
.theme-hint span { color: rgba(248, 250, 252, 0.72); font-size: 11.5px; }

/* 侧边主题入口 */
.theme-dock {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 46;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px;
}
.theme-dock[hidden] { display: none; }

.dock-item {
  position: relative;
  width: 78px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-family: inherit;
}
.dock-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dock-avatar svg { width: 46px; height: 46px; display: block; }
.dock-label {
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.dock-item:focus-visible { outline: none; }
.dock-item:focus-visible .dock-avatar { box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.55); }

/* 悬停 / 点击反馈 */
.dock-item:hover .dock-avatar { transform: translateY(-4px) scale(1.07); }
.dock-item.hopping .dock-avatar { animation: dock-hop 0.7s ease; }
.dock-item.wiggle .dock-avatar { animation: dock-wiggle 0.5s ease; }

/* 未登录时入口灰化，右上角挂一把小锁 */
.dock-item.is-locked .dock-avatar { opacity: 0.72; filter: saturate(0.72); }
.dock-item.is-locked .dock-label { opacity: 0.78; }
.dock-item.is-locked:hover .dock-avatar { opacity: 0.92; filter: saturate(0.9); transform: translateY(-2px) scale(1.03); }
.dock-lock {
  position: absolute;
  top: 2px;
  right: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(28, 34, 48, 0.72);
  box-shadow: 0 1px 3px rgba(10, 14, 24, 0.35);
}
.dock-lock::before {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 3px;
  width: 6px;
  height: 5px;
  border: 1.6px solid #ffd9a0;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
}
.dock-lock::after {
  content: "";
  position: absolute;
  left: 3.6px;
  top: 7px;
  width: 7.8px;
  height: 5.6px;
  border-radius: 1.6px;
  background: #ffd9a0;
}

@keyframes dock-hop {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-16px) scale(1.05, 0.97) rotate(-5deg); }
  50% { transform: translateY(0) scale(0.94, 1.06); }
  72% { transform: translateY(-7px) scale(1.02, 0.99); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes dock-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-7deg) scale(1.05); }
  60% { transform: rotate(6deg) scale(1.03); }
  85% { transform: rotate(-2deg); }
}

/* 气泡 / 任务卡 */
.dock-popover {
  position: fixed;
  left: 0;
  top: 0;
  width: 236px;
  padding: 12px 14px;
  border-radius: 14px;
  z-index: 3;
  animation: pop-in 0.22s ease both;
  text-align: left;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateX(-8px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.dock-popover strong { display: block; font-size: 13px; margin-bottom: 4px; }
.dock-popover p { margin: 0; font-size: 11.5px; line-height: 1.6; }

/* 主题弹窗 */
.theme-dialog .dialog-body { line-height: 1.7; }
.theme-note { margin: 0 0 12px; font-size: 12.5px; }
.theme-note-body { margin: 0 0 12px; font-size: 13px; line-height: 1.75; }
.theme-note-body code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.08);
}

/* 星际装备库 */
.suit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 4px; }
.suit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 14px 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(120, 140, 210, 0.3);
  background: #f7f9ff;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: 0.18s ease;
}
.suit-card:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(109, 140, 255, 0.7); }
.suit-card.equipped { border-color: rgba(109, 140, 255, 0.9); box-shadow: 0 0 0 3px rgba(109, 140, 255, 0.16); }
.suit-card.locked { opacity: 0.55; cursor: not-allowed; }
.suit-preview { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--suit) 22%, #eef2fd); }
.suit-preview svg { width: 46px; height: 46px; }
.suit-card strong { font-size: 12.5px; }
.suit-note { font-size: 11px; color: var(--muted); text-align: center; }
.suit-state { font-size: 10.5px; color: var(--cyan); font-family: var(--mono); }

/* 游乐园贴纸 */
.sticker-tray { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.sticker-chip {
  width: 62px;
  padding: 7px 4px 5px;
  border-radius: 14px;
  border: 1px dashed rgba(199, 120, 160, 0.45);
  background: #fff8fb;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: inherit;
  color: #5a3c52;
  transition: 0.18s ease;
}
.sticker-chip span { font-size: 22px; line-height: 1.1; }
.sticker-chip small { font-size: 10px; }
.sticker-chip:hover:not(:disabled) { transform: translateY(-2px) scale(1.04); border-color: #ff8a4c; }
.sticker-chip.locked { opacity: 0.45; cursor: not-allowed; }
.sticker-chip.placed { background: #fff0f6; border-style: solid; border-color: #ff8a4c; }

.sticker-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff6f9, #ffe9f1);
  border: 2px dashed rgba(224, 86, 140, 0.3);
}
.wall-slot {
  height: 74px;
  border-radius: 14px;
  border: 1px dashed rgba(199, 120, 160, 0.35);
  background: rgba(255, 255, 255, 0.6);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: inherit;
}
.wall-slot span { font-size: 30px; }
.wall-slot .slot-plus { font-size: 20px; color: rgba(199, 120, 160, 0.55); }
.wall-slot.filled { border-style: solid; border-color: rgba(224, 86, 140, 0.45); background: #fff; }
.sticker-hint { margin: 12px 0 10px; font-size: 12px; color: var(--muted); }
.sticker-actions { display: flex; gap: 8px; }

.ride-stage { position: relative; margin-top: 10px; min-height: 0; }
.ride-stage.riding {
  min-height: 92px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 120%, #2b1c4a, #120c26);
  overflow: hidden;
}
.firework {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.7);
  animation: firework-pop 1.2s ease-out infinite;
}
.firework.f1 { left: 24%; top: 40%; animation-delay: 0s; }
.firework.f2 { left: 52%; top: 22%; animation-delay: 0.3s; background: #ff8ac1; }
.firework.f3 { left: 76%; top: 44%; animation-delay: 0.6s; background: #8fe3ff; }
@keyframes firework-pop {
  0% { transform: scale(0.4); opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  70% { opacity: 1; box-shadow: 0 0 0 26px rgba(255, 209, 102, 0); }
  100% { transform: scale(0.6); opacity: 0; box-shadow: 0 0 0 34px rgba(255, 209, 102, 0); }
}
.ride-text { position: relative; margin: 0; padding: 62px 16px 14px; color: #ffe9f1; font-size: 12.5px; text-align: center; }

/* 棉花糖休息站 */
.relax-stage { display: grid; place-items: center; height: 132px; margin-bottom: 6px; }
.relax-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #ffd3e2, #ff9fc0 70%);
  color: #7a2b48;
  font-size: 12px;
  animation: relax-breathe 6s ease-in-out infinite;
  box-shadow: 0 0 0 10px rgba(255, 179, 205, 0.18);
}
@keyframes relax-breathe {
  0%, 100% { transform: scale(0.86); box-shadow: 0 0 0 6px rgba(255, 179, 205, 0.18); }
  40% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(255, 179, 205, 0.1); }
  60% { transform: scale(1.06); }
}

/* 滚动到题库时的高亮 */
.grid-pulse .card { animation: card-glow 1.2s ease; }
@keyframes card-glow {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.35); }
}

/* ==========================================================================
   1. 森林探险
   ========================================================================== */
html[data-theme="forest"] {
  color-scheme: light;
  --bg: #cfe6bd;
  --bg-soft: #e6f2d8;
  --panel: #fffdf4;
  --panel-solid: #fffdf4;
  --panel-hover: #fbf3e2;
  --line: rgba(94, 70, 40, 0.18);
  --line-strong: rgba(63, 125, 79, 0.45);
  --text: #31402e;
  --text-dim: #56624f;
  --muted: #7f8b73;
  --cyan: #3f7d4f;
  --sky: #4f8a4b;
  --violet: #8a6a3f;
  --ok: #2f8f5b;
  --warn: #b9801c;
  --danger: #bf4a2f;
  --forest-wood: #8a6239;
  --forest-wood-dark: #5d4126;
  --forest-cream: #fffdf4;
}

html[data-theme="forest"] body {
  background: #cfe6bd;
  padding-left: 0;
}

/* 场景 */
html[data-theme="forest"] .forest-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f2fbe6 0%, #e2f3cf 26%, #c8e7b0 54%, #a7d493 78%, #8cc47c 100%);
}
html[data-theme="forest"] .forest-sun {
  position: absolute;
  right: -60px;
  bottom: 12%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 40%, rgba(255, 246, 190, 0.95), rgba(249, 230, 162, 0.35) 46%, rgba(249, 230, 162, 0) 68%);
  opacity: 0.7;
}
html[data-theme="forest"] .forest-rays {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background:
    linear-gradient(116deg, transparent 26%, rgba(255, 255, 255, 0.55) 38%, transparent 46%),
    linear-gradient(102deg, transparent 58%, rgba(255, 255, 255, 0.32) 68%, transparent 76%);
}
html[data-theme="forest"] .forest-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
html[data-theme="forest"] .forest-motes i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 10px rgba(255, 246, 190, 0.95);
  animation: mote-float 9s ease-in-out infinite;
}
@keyframes mote-float {
  0%, 100% { transform: translate(0, 0); opacity: 0.2; }
  40% { transform: translate(14px, -22px); opacity: 0.9; }
  70% { transform: translate(-8px, -40px); opacity: 0.5; }
}

/* 顶部：挂在树枝上的木牌 */
html[data-theme="forest"] .topbar {
  background-color: transparent;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, rgba(0, 0, 0, 0.02) 2px 5px, transparent 5px 26px),
    linear-gradient(180deg, #b98a55, #966a3c 55%, #805832);
  background-size: 100% 100%, 100% calc(100% - 44px);
  background-position: 0 44px, 0 44px;
  background-repeat: no-repeat;
  border-bottom: 3px solid #5d4126;
  border-radius: 8px 8px 24px 24px;
  padding-top: 58px;
  box-shadow: 0 14px 28px rgba(45, 68, 36, 0.26), inset 0 2px 0 rgba(255, 232, 190, 0.28);
  backdrop-filter: none;
}
html[data-theme="forest"] .topbar::before {
  content: "";
  position: absolute;
  left: -1%;
  right: -1%;
  top: 0;
  height: 14px;
  border-radius: 0 0 10px 10px;
  background:
    radial-gradient(ellipse 12px 5px at 14% 45%, rgba(58, 38, 18, 0.6), transparent 72%),
    radial-gradient(ellipse 9px 4px at 58% 60%, rgba(58, 38, 18, 0.5), transparent 72%),
    radial-gradient(ellipse 7px 3px at 86% 40%, rgba(58, 38, 18, 0.45), transparent 72%),
    linear-gradient(180deg, #7d5731, #4a3117);
  box-shadow: 0 4px 6px rgba(40, 28, 14, 0.22);
}
html[data-theme="forest"] .topbar-deco span {
  position: absolute;
  top: 7px;
  width: 6px;
  height: 42px;
  border-radius: 3px;
  background: linear-gradient(180deg, #f0e0bd, #c2a476);
  box-shadow: 0 0 0 1px rgba(90, 66, 38, 0.22), 0 2px 4px rgba(60, 40, 20, 0.2);
}
html[data-theme="forest"] .topbar-deco span::after {
  content: "";
  position: absolute;
  left: -2px;
  top: -3px;
  width: 10px;
  height: 7px;
  border-radius: 50%;
  background: #d8c39b;
  box-shadow: inset 0 -1px 0 rgba(120, 90, 50, 0.35);
}
html[data-theme="forest"] .topbar-deco span:nth-child(1) { left: 2.2%; }
html[data-theme="forest"] .topbar-deco span:nth-child(2) { right: 2.2%; }
html[data-theme="forest"] .topbar-deco span:nth-child(3) { display: none; }

html[data-theme="forest"] .brand-mark {
  background: linear-gradient(150deg, #fff8e6, #e8d3ac);
  border-color: #7a5530;
  color: #5d4126;
  box-shadow: 0 3px 0 rgba(93, 65, 38, 0.4);
}
html[data-theme="forest"] .brand-text h1 {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #fffaf0;
  text-shadow: 0 2px 0 rgba(93, 65, 38, 0.45);
}
html[data-theme="forest"] .brand-text p { color: rgba(255, 246, 223, 0.78); }
html[data-theme="forest"] .stat-value { color: #fffaf0; }
html[data-theme="forest"] .stat-value.ok { color: #c8f0a6; }
html[data-theme="forest"] .stat-label { color: rgba(255, 246, 223, 0.72); }
html[data-theme="forest"] .divider { background: rgba(255, 246, 223, 0.22); }

/* 木牌按钮：悬停轻轻晃动 */
html[data-theme="forest"] .topbar .btn {
  background: linear-gradient(180deg, #fff8e6, #f2e2c4);
  border: 2px solid #8a6239;
  color: #5a4024;
  border-radius: 8px 8px 10px 10px;
  box-shadow: 0 3px 0 rgba(93, 65, 38, 0.5), inset 0 1px 0 #fffdf5;
  font-weight: 600;
}
html[data-theme="forest"] .topbar .btn:hover {
  animation: sign-sway 1.5s ease-in-out infinite;
  transform-origin: 50% -8px;
  border-color: #6b4a2a;
  color: #3f2c17;
  box-shadow: 0 3px 0 rgba(93, 65, 38, 0.55), 0 10px 20px rgba(60, 40, 20, 0.22);
}
html[data-theme="forest"] .topbar .btn.primary {
  background: linear-gradient(180deg, #7fbb72, #4f8a4b);
  border-color: #3c6b3a;
  color: #f7ffee;
}
html[data-theme="forest"] .topbar .btn.ghost { background: rgba(255, 247, 228, 0.85); }
html[data-theme="forest"] .topbar .icon-btn { color: #fff6df; }
html[data-theme="forest"] .topbar .icon-btn:hover { background: rgba(255, 246, 223, 0.18); color: #fff; }
html[data-theme="forest"] .user-chip { background: rgba(255, 248, 232, 0.9); border-color: #8a6239; color: #5a4024; }
@keyframes sign-sway {
  0%, 100% { transform: rotate(-1.6deg); }
  50% { transform: rotate(1.6deg); }
}

/* 工具栏 / 输入 */
html[data-theme="forest"] .toolbar {
  position: relative;
  margin-top: 16px;
  padding: 18px 22px 14px;
  border-radius: 20px;
  border: 1px solid rgba(94, 70, 40, 0.16);
  background: rgba(255, 253, 244, 0.9);
  box-shadow: 0 14px 30px rgba(47, 74, 40, 0.14), inset 0 1px 0 #fff;
}
html[data-theme="forest"] .toolbar::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 6px;
  height: 3px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, rgba(122, 168, 96, 0.55) 0 8px, transparent 8px 18px);
}
html[data-theme="forest"] .search-wrap,
html[data-theme="forest"] .segmented,
html[data-theme="forest"] .select,
html[data-theme="forest"] .field input,
html[data-theme="forest"] .field select,
html[data-theme="forest"] .field textarea,
html[data-theme="forest"] .inline-field select,
html[data-theme="forest"] .text-input {
  background: #fffdf4;
  border-color: rgba(138, 98, 57, 0.28);
  color: var(--text);
}
html[data-theme="forest"] .search-wrap { box-shadow: inset 0 1px 0 #fff; }
html[data-theme="forest"] .seg.active {
  background: linear-gradient(135deg, #dff0cf, #c3e4ab);
  color: #2f5d33;
  box-shadow: inset 0 0 0 1px rgba(63, 125, 79, 0.35);
}
html[data-theme="forest"] .chip { background: #fffdf4; border-color: rgba(138, 98, 57, 0.22); color: #4b5a43; }
html[data-theme="forest"] .chip.active {
  background: linear-gradient(135deg, #e2f3d2, #c8e8b2);
  border-color: rgba(63, 125, 79, 0.5);
  color: #2f5d33;
}
html[data-theme="forest"] .chip .chip-count { color: #7f8b73; }
html[data-theme="forest"] .chip.active .chip-count { color: #3f7d4f; }
html[data-theme="forest"] .tag-bar-label { color: #5d6b54; }
html[data-theme="forest"] .count {
  color: #2f5d33;
  background: #e2f3d2;
  border-color: rgba(63, 125, 79, 0.3);
}
html[data-theme="forest"] .list-head h2 { color: #3f5238; }

/* 卡片：树桩 / 蘑菇屋 */
html[data-theme="forest"] .card {
  background: #fffdf4;
  border: 2px solid #ddc7a4;
  border-bottom: 5px solid #c2a87f;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(47, 74, 40, 0.13);
}
html[data-theme="forest"] .card::before {
  height: 4px;
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(122, 168, 96, 0.55), transparent);
}
html[data-theme="forest"] .card::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 7px;
  width: 22px;
  height: 22px;
  opacity: 0.22;
  pointer-events: none;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='13' y='16' width='6' height='11' rx='3' fill='%238a6239'/%3E%3Cpath d='M3 17c0-7 6-12 13-12s13 5 13 12z' fill='%23bf4a2f'/%3E%3C/svg%3E");
}
html[data-theme="forest"] .card:hover {
  background: #fffef8;
  border-color: #c9a877;
  border-bottom-color: #b0925f;
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(47, 74, 40, 0.18);
}
html[data-theme="forest"] .card.card-doing {
  border-color: #e3b9a5;
  border-bottom-color: #d09a80;
  background: linear-gradient(180deg, #fdf1ea, #fffdf4 62%);
}
html[data-theme="forest"] .card.card-ac {
  border-color: #b6d6a6;
  border-bottom-color: #96c083;
  background: linear-gradient(180deg, #f1f9e9, #fffdf4 62%);
}
html[data-theme="forest"] .card.card-reviewed {
  border-color: #b9cfd8;
  border-bottom-color: #96b6c4;
  background: linear-gradient(180deg, #eff7fa, #fffdf4 62%);
}
html[data-theme="forest"] .card.card-doing:hover { background: linear-gradient(180deg, #fbe6dc, #fffdf4 65%); }
html[data-theme="forest"] .card.card-ac:hover { background: linear-gradient(180deg, #e7f6d8, #fffdf4 65%); }
html[data-theme="forest"] .card.card-reviewed:hover { background: linear-gradient(180deg, #e6f3f8, #fffdf4 65%); }
html[data-theme="forest"] .title-cn { color: #31402e; }
html[data-theme="forest"] .title-en { color: #7f8b73; }
html[data-theme="forest"] .pid { color: #6b7a5f; }
html[data-theme="forest"] .card-foot { border-top-color: rgba(138, 98, 57, 0.18); color: #7f8b73; }
html[data-theme="forest"] .tag-pill {
  color: #2f6b3a;
  background: #eaf4dc;
  border-color: rgba(63, 125, 79, 0.24);
}
html[data-theme="forest"] .card-actions button:hover {
  color: #2f6b3a;
  background: #eef8e2;
  border-color: rgba(63, 125, 79, 0.3);
}

/* 弹窗 / 表格 / 分页 */
html[data-theme="forest"] dialog.dialog {
  background: linear-gradient(180deg, #fffdf5, #fbf4e4);
  border: 2px solid #cdb894;
  box-shadow: 0 30px 80px rgba(40, 55, 30, 0.4);
}
html[data-theme="forest"] .dialog-head { background: #f7eeda; border-bottom-color: rgba(138, 98, 57, 0.22); }
html[data-theme="forest"] .dialog-foot { background: #f9f2e3; border-top-color: rgba(138, 98, 57, 0.22); }
html[data-theme="forest"] .page-btn { background: #fffdf4; border-color: rgba(138, 98, 57, 0.25); }
html[data-theme="forest"] .page-btn.active {
  background: linear-gradient(135deg, #dff0cf, #c3e4ab);
  border-color: rgba(63, 125, 79, 0.45);
  color: #2f5d33;
}
html[data-theme="forest"] .empty { background: rgba(255, 253, 244, 0.75); border-color: rgba(138, 98, 57, 0.25); }
html[data-theme="forest"] .toast { background: #fffdf4; color: #31402e; border-color: #cdb894; }
html[data-theme="forest"] .data-table th { color: #56624f; }

/* 侧边入口：小松鼠、小兔子的树桩底座 */
html[data-theme="forest"] .dock-avatar {
  background: radial-gradient(circle at 50% 35%, #fffdf4, #f0e3c8);
  border: 2px solid #c9ac82;
  box-shadow: 0 4px 0 rgba(138, 98, 57, 0.35), 0 8px 16px rgba(47, 74, 40, 0.18);
}
html[data-theme="forest"] .dock-label { background: rgba(255, 250, 236, 0.92); color: #4b5a43; border: 1px solid rgba(138, 98, 57, 0.22); }
html[data-theme="forest"] .dock-item:hover .dock-label { background: #fff8e6; color: #2f5d33; }
html[data-theme="forest"] .dock-popover.speech-bubble {
  background: #fffdf4;
  border: 2px solid #cdb894;
  color: #33412f;
  box-shadow: 0 10px 24px rgba(47, 74, 40, 0.18);
}
html[data-theme="forest"] .speech-bubble::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 22px;
  width: 14px;
  height: 14px;
  background: #fffdf4;
  border-left: 2px solid #cdb894;
  border-bottom: 2px solid #cdb894;
  transform: rotate(45deg);
}
html[data-theme="forest"] .speech-bubble strong { color: #2f5d33; }
html[data-theme="forest"] .speech-bubble p { color: #5a6a50; }

/* 森林彩蛋角落 */
html[data-theme="forest"] .forest-eggs {
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px 9px;
  border-radius: 18px;
  border: 1px solid rgba(138, 98, 57, 0.28);
  background: rgba(255, 251, 240, 0.92);
  box-shadow: 0 10px 24px rgba(47, 74, 40, 0.16);
  pointer-events: auto;
}
html[data-theme="forest"] .egg-head {
  position: absolute;
  top: -20px;
  left: 12px;
  font-size: 10.5px;
  color: #5d6b54;
  background: rgba(255, 251, 240, 0.95);
  border: 1px solid rgba(138, 98, 57, 0.2);
  border-radius: 999px;
  padding: 1px 9px;
  white-space: nowrap;
}
html[data-theme="forest"] .egg-head b { color: #2f6b3a; font-family: var(--mono); }
html[data-theme="forest"] .egg {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  border-radius: 12px;
  transition: 0.18s ease;
}
html[data-theme="forest"] .egg svg { width: 34px; height: 34px; }
html[data-theme="forest"] .egg span { font-size: 9.5px; color: #7f8b73; }
html[data-theme="forest"] .egg:hover { background: #f2f8e8; transform: translateY(-2px); }
html[data-theme="forest"] .egg.unlocked { opacity: 0.85; }
html[data-theme="forest"] .egg.unlocked::after {
  content: "✓";
  position: absolute;
  margin-left: 26px;
  margin-top: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4f8a4b;
  color: #fff;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
}
html[data-theme="forest"] .egg.just-found { animation: dock-hop 0.7s ease; }

/* ==========================================================================
   2. 星际小探险家
   ========================================================================== */
html[data-theme="space"] {
  color-scheme: light;
  --bg: #0a0f2b;
  --bg-soft: #131a44;
  --panel: #eef1fb;
  --panel-solid: #f4f6ff;
  --panel-hover: #e6ebfb;
  --line: rgba(108, 122, 190, 0.28);
  --line-strong: rgba(109, 140, 255, 0.5);
  --text: #232a4a;
  --text-dim: #4b5478;
  --muted: #7b84a9;
  --cyan: #5b74e8;
  --sky: #6d8cff;
  --violet: #8b7bff;
  --ok: #3fb98a;
  --warn: #d9843f;
  --danger: #d95468;
}

html[data-theme="space"] body {
  background: #0a0f2b;
  padding-bottom: 92px;
}

/* 星空 */
html[data-theme="space"] .space-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1100px 700px at 22% 14%, #241a5c 0%, rgba(36, 26, 92, 0) 62%),
    radial-gradient(900px 600px at 82% 68%, #1a2a6a 0%, rgba(26, 42, 106, 0) 58%),
    linear-gradient(170deg, #0b1030 0%, #101538 46%, #191247 78%, #0c0f2c 100%);
}
html[data-theme="space"] .space-nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.55;
}
html[data-theme="space"] .nebula-a {
  width: 520px;
  height: 380px;
  left: -120px;
  top: 8%;
  background: radial-gradient(circle, rgba(139, 123, 255, 0.5), rgba(139, 123, 255, 0) 70%);
}
html[data-theme="space"] .nebula-b {
  width: 620px;
  height: 420px;
  right: -160px;
  bottom: 4%;
  background: radial-gradient(circle, rgba(94, 160, 255, 0.42), rgba(94, 160, 255, 0) 70%);
}
html[data-theme="space"] .starfield i {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(200, 220, 255, 0.9);
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
html[data-theme="space"] .meteor {
  position: absolute;
  width: 140px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 60%, rgba(190, 220, 255, 0.9));
  filter: drop-shadow(0 0 6px rgba(180, 210, 255, 0.9));
  opacity: 0;
  transform: rotate(28deg);
  animation: meteor-fly 9s linear infinite;
}
html[data-theme="space"] .meteor-a { top: 12%; left: -10%; animation-delay: 1.5s; }
html[data-theme="space"] .meteor-b { top: 32%; left: 20%; animation-delay: 5.4s; animation-duration: 11s; }
html[data-theme="space"] .meteor-c { top: 6%; left: 55%; animation-delay: 8s; animation-duration: 13s; width: 100px; }
@keyframes meteor-fly {
  0% { opacity: 0; transform: translate(0, 0) rotate(28deg); }
  6% { opacity: 1; }
  18% { opacity: 1; }
  28% { opacity: 0; transform: translate(420px, 220px) rotate(28deg); }
  100% { opacity: 0; transform: translate(420px, 220px) rotate(28deg); }
}
html[data-theme="space"] .far-planet {
  position: absolute;
  border-radius: 50%;
  opacity: 0.75;
}
html[data-theme="space"] .far-planet-a {
  width: 120px;
  height: 120px;
  right: 12%;
  top: 16%;
  background: radial-gradient(circle at 34% 32%, #ffb27a, #d9653c 58%, #7d2f22);
  box-shadow: 0 0 50px rgba(232, 121, 74, 0.35);
}
html[data-theme="space"] .far-planet-b {
  width: 64px;
  height: 64px;
  left: 16%;
  bottom: 18%;
  background: radial-gradient(circle at 36% 34%, #cbb6ff, #7b5cd6 60%, #3f2a80);
  box-shadow: 0 0 34px rgba(139, 123, 255, 0.4);
}

/* 顶部：悬浮飞船 */
html[data-theme="space"] .topbar {
  max-width: 1520px;
  margin: 14px auto 0;
  width: calc(100% - 22px);
  gap: 16px;
  padding: 12px 20px;
  border: 1px solid rgba(160, 185, 255, 0.55);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(248, 250, 255, 0.98), rgba(216, 224, 248, 0.95));
  box-shadow:
    0 0 0 4px rgba(109, 140, 255, 0.1),
    0 18px 44px rgba(6, 12, 40, 0.55),
    0 0 70px rgba(110, 140, 255, 0.22),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  animation: ship-float 6s ease-in-out infinite;
  backdrop-filter: blur(6px);
}
html[data-theme="space"] .topbar::before {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: -9px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(190, 215, 255, 0.95), rgba(140, 170, 255, 0.25));
  filter: blur(0.4px);
  opacity: 0.8;
}
html[data-theme="space"] .topbar::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -7px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(120, 170, 255, 0.85), rgba(120, 170, 255, 0) 72%);
  filter: blur(2px);
}
html[data-theme="space"] .topbar-deco span {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 10px;
  margin-top: -5px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, #ffd08a, rgba(255, 140, 60, 0.2) 65%, transparent 75%);
  filter: blur(1px);
}
html[data-theme="space"] .topbar-deco span:nth-child(1) { left: -12px; }
html[data-theme="space"] .topbar-deco span:nth-child(2) { right: -12px; }
html[data-theme="space"] .topbar-deco span:nth-child(3) { display: none; }
@keyframes ship-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

html[data-theme="space"] .brand-mark {
  background: linear-gradient(150deg, #dfe8ff, #a9befb);
  border-color: rgba(255, 255, 255, 0.8);
  color: #3c4fa8;
  box-shadow: 0 0 22px rgba(109, 140, 255, 0.35), inset 0 1px 0 #fff;
}
html[data-theme="space"] .brand-text h1 {
  background: linear-gradient(92deg, #2b3468, #5b74e8 72%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="space"] .brand-text p { color: #6b76a3; }
html[data-theme="space"] .stat-value { color: #2a3260; }
html[data-theme="space"] .stat-label { color: #7b84a9; }
html[data-theme="space"] .divider { background: rgba(108, 122, 190, 0.25); }

html[data-theme="space"] .topbar .btn {
  background: linear-gradient(180deg, #6d84ea, #4b5fd0);
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #f4f7ff;
  box-shadow: 0 4px 14px rgba(70, 90, 220, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
html[data-theme="space"] .topbar .btn:hover {
  border-color: #fff;
  color: #fff;
  box-shadow: 0 6px 20px rgba(70, 90, 220, 0.5), 0 0 0 3px rgba(109, 140, 255, 0.2);
}
html[data-theme="space"] .topbar .btn.ghost {
  background: rgba(255, 255, 255, 0.62);
  color: #3f4c86;
  box-shadow: none;
}
html[data-theme="space"] .topbar .btn.primary {
  background: linear-gradient(135deg, #8b7bff, #5b74e8);
  color: #fff;
}
html[data-theme="space"] .topbar .icon-btn { color: #4b5aa0; }
html[data-theme="space"] .topbar .icon-btn:hover { background: rgba(91, 116, 232, 0.12); color: #2b3468; }
html[data-theme="space"] .user-chip { background: rgba(255, 255, 255, 0.8); border-color: rgba(109, 140, 255, 0.4); color: #2b3468; }

/* 工具栏：驾驶舱面板 */
html[data-theme="space"] .toolbar {
  position: relative;
  margin-top: 18px;
  padding: 18px 22px 14px;
  border-radius: 22px;
  border: 1px solid rgba(150, 175, 255, 0.45);
  background: rgba(236, 241, 253, 0.92);
  box-shadow: 0 18px 44px rgba(6, 12, 40, 0.5), inset 0 1px 0 #fff;
}
html[data-theme="space"] .toolbar::before,
html[data-theme="space"] .toolbar::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(109, 140, 255, 0.55);
}
html[data-theme="space"] .toolbar::before { left: 8px; top: 8px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
html[data-theme="space"] .toolbar::after { right: 8px; bottom: 8px; border-left: none; border-top: none; border-radius: 0 0 8px 0; }
html[data-theme="space"] .search-wrap,
html[data-theme="space"] .segmented,
html[data-theme="space"] .select,
html[data-theme="space"] .field input,
html[data-theme="space"] .field select,
html[data-theme="space"] .field textarea,
html[data-theme="space"] .inline-field select,
html[data-theme="space"] .text-input {
  background: #fbfcff;
  border-color: rgba(108, 122, 190, 0.26);
  color: var(--text);
}
html[data-theme="space"] .seg.active {
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.24), rgba(109, 140, 255, 0.18));
  color: #2b3468;
  box-shadow: inset 0 0 0 1px rgba(109, 140, 255, 0.45);
}
html[data-theme="space"] .chip { background: #fbfcff; border-color: rgba(108, 122, 190, 0.22); color: #444d78; }
html[data-theme="space"] .chip.active {
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.2), rgba(109, 140, 255, 0.16));
  border-color: rgba(109, 140, 255, 0.55);
  color: #2b3468;
}
html[data-theme="space"] .tag-bar-label { color: #5c6690; }
html[data-theme="space"] .count { color: #e8eeff; background: rgba(109, 140, 255, 0.3); border-color: rgba(150, 175, 255, 0.55); }
html[data-theme="space"] .list-head h2 { color: #dfe7ff; }
html[data-theme="space"] .list-head .muted { color: #a8b3dd; }
html[data-theme="space"] .page-info { color: #b9c4e8; }
html[data-theme="space"] .list-head .muted.small { color: #a8b3dd; }
html[data-theme="space"] .topbar .btn { padding: 7px 12px; }

/* 卡片：银色太空舱 */
html[data-theme="space"] .card {
  background: linear-gradient(180deg, #fafbff, #e9eefb);
  border: 1px solid rgba(120, 140, 210, 0.35);
  border-top: 3px solid rgba(109, 140, 255, 0.75);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(6, 12, 40, 0.4), inset 0 1px 0 #fff;
}
html[data-theme="space"] .card:nth-child(4n+1) { border-top-color: #6d8cff; }
html[data-theme="space"] .card:nth-child(4n+2) { border-top-color: #a78bfa; }
html[data-theme="space"] .card:nth-child(4n+3) { border-top-color: #e8794a; }
html[data-theme="space"] .card:nth-child(4n+4) { border-top-color: #4ab8c9; }
html[data-theme="space"] .card::before {
  height: 1px;
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
}
html[data-theme="space"] .card:hover {
  background: linear-gradient(180deg, #ffffff, #eef2ff);
  border-color: rgba(109, 140, 255, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(6, 12, 40, 0.5), 0 0 0 3px rgba(109, 140, 255, 0.14);
}
html[data-theme="space"] .card.card-doing { background: linear-gradient(180deg, #fff3f2, #eef1fb 70%); border-top-color: #ef8a7a; }
html[data-theme="space"] .card.card-ac { background: linear-gradient(180deg, #edfaf3, #eef1fb 70%); border-top-color: #3fb98a; }
html[data-theme="space"] .card.card-reviewed { background: linear-gradient(180deg, #eef5ff, #eef1fb 70%); border-top-color: #6d8cff; }
html[data-theme="space"] .title-cn { color: #232a4a; }
html[data-theme="space"] .pid { color: #59638f; }
html[data-theme="space"] .card-foot { border-top-color: rgba(120, 140, 210, 0.22); color: #7b84a9; }
html[data-theme="space"] .tag-pill { color: #3c50a8; background: rgba(109, 140, 255, 0.12); border-color: rgba(109, 140, 255, 0.28); }
html[data-theme="space"] .card-actions button:hover { color: #3c50a8; background: rgba(109, 140, 255, 0.1); border-color: rgba(109, 140, 255, 0.3); }

/* 弹窗 / 表格 */
html[data-theme="space"] dialog.dialog {
  background: linear-gradient(180deg, #f8faff, #e8eefb);
  border: 1px solid rgba(150, 175, 255, 0.65);
  box-shadow: 0 30px 80px rgba(4, 8, 28, 0.7), 0 0 60px rgba(109, 140, 255, 0.2);
}
html[data-theme="space"] .dialog-head { background: rgba(255, 255, 255, 0.72); border-bottom-color: rgba(120, 140, 210, 0.25); }
html[data-theme="space"] .dialog-foot { background: rgba(255, 255, 255, 0.6); border-top-color: rgba(120, 140, 210, 0.25); }
html[data-theme="space"] .page-btn { background: #f8faff; border-color: rgba(120, 140, 210, 0.3); }
html[data-theme="space"] .page-btn.active {
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.26), rgba(109, 140, 255, 0.2));
  border-color: rgba(109, 140, 255, 0.5);
  color: #2b3468;
}
html[data-theme="space"] .empty { background: rgba(248, 250, 255, 0.65); border-color: rgba(150, 175, 255, 0.35); }
html[data-theme="space"] .toast { background: #1b2150; color: #e8eeff; border-color: rgba(139, 123, 255, 0.5); }

/* 侧边入口：不同颜色的星球 */
html[data-theme="space"] .dock-avatar {
  background: radial-gradient(circle at 42% 34%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.2) 42%, rgba(24, 32, 78, 0.6));
  border: 1px solid rgba(180, 200, 255, 0.45);
  box-shadow: 0 0 22px rgba(109, 140, 255, 0.35), inset 0 0 14px rgba(10, 16, 45, 0.35);
}
html[data-theme="space"] .dock-item:hover .dock-avatar { box-shadow: 0 0 30px rgba(139, 123, 255, 0.6); }
html[data-theme="space"] .dock-label { background: rgba(20, 27, 64, 0.82); color: #d7e0ff; border: 1px solid rgba(139, 160, 255, 0.35); }
html[data-theme="space"] .dock-popover.mission-card {
  background: linear-gradient(180deg, rgba(19, 26, 62, 0.97), rgba(12, 17, 45, 0.98));
  border: 1px solid rgba(139, 160, 255, 0.45);
  color: #e6ecff;
  box-shadow: 0 18px 40px rgba(3, 6, 24, 0.6), 0 0 40px rgba(109, 140, 255, 0.18);
}
html[data-theme="space"] .mission-tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--planet) 60%, transparent);
  background: color-mix(in srgb, var(--planet) 22%, transparent);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.08em;
}
html[data-theme="space"] .mission-card h4 { margin: 0 0 4px; font-size: 14px; color: #fff; }
html[data-theme="space"] .mission-card p { color: rgba(224, 232, 255, 0.78); }
html[data-theme="space"] .mission-actions { display: flex; gap: 6px; margin-top: 10px; }
html[data-theme="space"] .mission-card .btn.ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(180, 200, 255, 0.3);
  color: #cfd9ff;
}
html[data-theme="space"] .mission-card .btn.ghost:hover { color: #fff; border-color: rgba(200, 215, 255, 0.6); }

/* 底部银河轨道 + 小火箭 */
html[data-theme="space"] .space-orbit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 74px;
  pointer-events: none;
}
html[data-theme="space"] .orbit-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  height: 3px;
  background: repeating-linear-gradient(90deg, rgba(160, 185, 255, 0.55) 0 14px, rgba(160, 185, 255, 0.05) 14px 26px);
  box-shadow: 0 0 16px rgba(109, 140, 255, 0.5);
}
html[data-theme="space"] .orbit-moon {
  position: absolute;
  right: 6%;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #f4f7ff, #b9c4e8 62%, #7c88b8);
  box-shadow: 0 0 24px rgba(200, 215, 255, 0.4);
}
html[data-theme="space"] .orbit-rocket {
  position: absolute;
  left: 5%;
  bottom: 24px;
  width: 58px;
  height: 34px;
  transition: left 0.25s ease-out;
  filter: drop-shadow(0 0 10px rgba(109, 140, 255, 0.6));
}
html[data-theme="space"] .orbit-rocket svg { width: 100%; height: 100%; }
html[data-theme="space"] .rocket-flame {
  position: absolute;
  right: -16px;
  top: 50%;
  width: 26px;
  height: 8px;
  margin-top: -4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 214, 130, 0.95), rgba(255, 140, 60, 0.4) 60%, transparent);
  animation: flame-flicker 0.28s ease-in-out infinite alternate;
}
@keyframes flame-flicker {
  from { transform: scaleX(0.8); opacity: 0.7; }
  to { transform: scaleX(1.15); opacity: 1; }
}

/* ==========================================================================
   3. 游乐园狂欢
   ========================================================================== */
html[data-theme="carnival"] {
  color-scheme: light;
  --bg: #bfe8fb;
  --bg-soft: #d9f1ff;
  --panel: #fff5f9;
  --panel-solid: #fffafd;
  --panel-hover: #ffeef5;
  --line: rgba(190, 110, 155, 0.22);
  --line-strong: rgba(224, 86, 140, 0.45);
  --text: #3b2b3f;
  --text-dim: #5d4a63;
  --muted: #8f7a96;
  --cyan: #d94b83;
  --sky: #3d9ee0;
  --violet: #9a6bff;
  --ok: #2fa86a;
  --warn: #e0812b;
  --danger: #d93a55;
}

html[data-theme="carnival"] body { background: #bfe8fb; }

html[data-theme="carnival"] .carnival-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #a6e0ff 0%, #c8ecff 32%, #e4f6ff 62%, #fdf3e6 100%);
}
html[data-theme="carnival"] .carnival-sun {
  position: absolute;
  right: 18%;
  top: 6%;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff6c2, #ffd76e 62%, rgba(255, 215, 110, 0) 74%);
}
html[data-theme="carnival"] .carnival-cloud {
  position: absolute;
  height: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  filter: blur(0.4px);
  box-shadow: 0 14px 30px rgba(120, 170, 210, 0.18);
}
html[data-theme="carnival"] .carnival-cloud::before,
html[data-theme="carnival"] .carnival-cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}
html[data-theme="carnival"] .carnival-cloud::before { width: 58px; height: 58px; left: 22px; top: -22px; }
html[data-theme="carnival"] .carnival-cloud::after { width: 42px; height: 42px; right: 26px; top: -14px; }
html[data-theme="carnival"] .cloud-a { width: 150px; left: 6%; top: 14%; }
html[data-theme="carnival"] .cloud-b { width: 190px; right: 8%; top: 26%; transform: scale(0.9); opacity: 0.85; }
html[data-theme="carnival"] .cloud-c { width: 120px; left: 30%; top: 6%; transform: scale(0.72); opacity: 0.7; }
html[data-theme="carnival"] .carnival-ground {
  z-index: 0;
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 0;
  height: 20vh;
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  background: linear-gradient(180deg, #b7e6a6, #8fd08a 55%, #79bd7c);
  opacity: 0.8;
}

/* 摩天轮 */
html[data-theme="carnival"] .carnival-wheel {
  z-index: 1;
  position: absolute;
  right: -46px;
  bottom: -14px;
  width: 300px;
  height: 300px;
  opacity: 0.94;
}
html[data-theme="carnival"] .wheel-spin {
  position: absolute;
  inset: 0;
  animation: wheel-turn 48s linear infinite;
}
@keyframes wheel-turn { to { transform: rotate(360deg); } }
html[data-theme="carnival"] .wheel-ring {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  border: 7px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 7px rgba(160, 107, 255, 0.22), inset 0 0 30px rgba(160, 107, 255, 0.16);
}
html[data-theme="carnival"] .wheel-spokes i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 128px;
  margin-left: -1.5px;
  background: rgba(255, 255, 255, 0.88);
  transform-origin: 50% 0;
  transform: rotate(var(--a));
}
html[data-theme="carnival"] .wheel-cabins i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 15px;
  margin: -7.5px;
  border-radius: 5px;
  background: var(--c);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  transform: rotate(var(--a)) translateY(-128px);
}
html[data-theme="carnival"] .wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid #a06bff;
}
html[data-theme="carnival"] .wheel-legs::before,
html[data-theme="carnival"] .wheel-legs::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 150px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
}
html[data-theme="carnival"] .wheel-legs::before { left: 126px; transform: rotate(12deg); transform-origin: bottom; }
html[data-theme="carnival"] .wheel-legs::after { right: 126px; transform: rotate(-12deg); transform-origin: bottom; }

/* 旋转木马 */
html[data-theme="carnival"] .carnival-carousel {
  z-index: 1;
  position: absolute;
  left: 74px;
  bottom: 8px;
  width: 210px;
  height: 165px;
  opacity: 0.95;
  transform: scale(0.88);
  transform-origin: left bottom;
}
html[data-theme="carnival"] .carousel-canopy {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 78px;
  border-radius: 120px 120px 8px 8px;
  background: repeating-linear-gradient(90deg, #ff8aa8 0 26px, #fff6f9 26px 52px);
  box-shadow: 0 6px 0 rgba(201, 161, 90, 0.85), 0 14px 24px rgba(180, 120, 150, 0.18);
}
html[data-theme="carnival"] .carousel-canopy::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -18px;
  width: 4px;
  height: 20px;
  background: #c9a15a;
  transform: translateX(-50%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}
html[data-theme="carnival"] .carousel-poles i {
  position: absolute;
  top: 74px;
  width: 6px;
  height: 62px;
  border-radius: 3px;
  background: linear-gradient(180deg, #f4d79b, #c9a15a);
}
html[data-theme="carnival"] .carousel-poles i:nth-child(1) { left: 48px; }
html[data-theme="carnival"] .carousel-poles i:nth-child(2) { left: 96px; }
html[data-theme="carnival"] .carousel-poles i:nth-child(3) { left: 144px; }
html[data-theme="carnival"] .carousel-poles i:nth-child(4) { left: 190px; }
html[data-theme="carnival"] .carousel-poles i::after {
  content: "";
  position: absolute;
  left: -14px;
  top: 26px;
  width: 34px;
  height: 18px;
  border-radius: 50% 50% 40% 40%;
  background: #fff;
  box-shadow: inset 0 -6px 0 #e7d7ff;
}
html[data-theme="carnival"] .carousel-base {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffd9a8, #e2a86a);
  box-shadow: 0 6px 16px rgba(180, 130, 90, 0.25);
}

/* 顶部：马戏团帐篷 */
html[data-theme="carnival"] .topbar {
  position: relative;
  gap: 18px;
  padding-top: 28px;
  border-bottom: none;
  border-radius: 0 0 34px 34px;
  background: repeating-linear-gradient(90deg, #ff9db4 0 58px, #fff4f7 58px 116px);
  box-shadow: 0 16px 34px rgba(120, 150, 180, 0.28), inset 0 -6px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: none;
}
html[data-theme="carnival"] .topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 14px;
  background: radial-gradient(circle at 16px 0, #ff9db4 11px, transparent 12px) repeat-x;
  background-size: 32px 14px;
  filter: drop-shadow(0 4px 4px rgba(160, 120, 150, 0.16));
}
html[data-theme="carnival"] .topbar-deco span {
  position: absolute;
  top: 3px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 16px solid #ffd166;
  filter: drop-shadow(0 2px 2px rgba(160, 120, 90, 0.2));
}
html[data-theme="carnival"] .topbar-deco span:nth-child(1) { left: 26%; border-top-color: #ffd166; }
html[data-theme="carnival"] .topbar-deco span:nth-child(2) { left: 52%; border-top-color: #9a6bff; }
html[data-theme="carnival"] .topbar-deco span:nth-child(3) { left: 78%; border-top-color: #3d9ee0; display: block; }

html[data-theme="carnival"] .brand-mark {
  background: linear-gradient(150deg, #fff3c4, #ffd166);
  border-color: #f0a93c;
  color: #a4552a;
  box-shadow: 0 4px 0 rgba(224, 150, 60, 0.4);
}
html[data-theme="carnival"] .brand-text h1 {
  background: linear-gradient(92deg, #b8365f, #ff7a4c 72%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="carnival"] .brand-text p { color: #a8637f; }
html[data-theme="carnival"] .stat-value { color: #4a2f45; }
html[data-theme="carnival"] .stat-label { color: #a26e86; }
html[data-theme="carnival"] .divider { background: rgba(200, 120, 160, 0.3); }

html[data-theme="carnival"] .topbar .btn {
  padding: 7px 12px;
  background: #fffdfe;
  border: 2px solid rgba(224, 86, 140, 0.35);
  color: #7a3355;
  border-radius: 12px;
  box-shadow: 0 3px 0 rgba(224, 86, 140, 0.2);
  font-weight: 600;
}
html[data-theme="carnival"] .topbar .btn:hover {
  transform: translateY(-2px) rotate(-1deg);
  border-color: #ff8a4c;
  color: #b8365f;
  box-shadow: 0 5px 0 rgba(255, 138, 76, 0.28), 0 10px 18px rgba(200, 120, 160, 0.2);
}
html[data-theme="carnival"] .topbar .btn.primary {
  background: linear-gradient(135deg, #ff8a4c, #ff5f8f);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 0 rgba(214, 70, 110, 0.32);
}
html[data-theme="carnival"] .topbar .btn.ghost { background: rgba(255, 255, 255, 0.75); }
html[data-theme="carnival"] .topbar .icon-btn { color: #b04a72; }
html[data-theme="carnival"] .topbar .icon-btn:hover { background: rgba(255, 255, 255, 0.6); color: #8a2f52; }
html[data-theme="carnival"] .user-chip { background: #fff; border-color: rgba(224, 86, 140, 0.35); color: #7a3355; }

/* 工具栏：糖果色遮阳棚 */
html[data-theme="carnival"] .toolbar {
  position: relative;
  margin-top: 22px;
  padding: 20px 22px 14px;
  border-radius: 22px;
  border: 1px solid rgba(224, 86, 140, 0.18);
  background: rgba(255, 246, 250, 0.94);
  box-shadow: 0 16px 34px rgba(120, 150, 180, 0.2), inset 0 1px 0 #fff;
}
html[data-theme="carnival"] .toolbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7px;
  border-radius: 22px 22px 0 0;
  background: repeating-linear-gradient(90deg, #ff8a4c 0 28px, #ffd166 28px 56px, #9a6bff 56px 84px, #3d9ee0 84px 112px, #5ac8a8 112px 140px);
  opacity: 0.85;
}
html[data-theme="carnival"] .search-wrap,
html[data-theme="carnival"] .segmented,
html[data-theme="carnival"] .select,
html[data-theme="carnival"] .field input,
html[data-theme="carnival"] .field select,
html[data-theme="carnival"] .field textarea,
html[data-theme="carnival"] .inline-field select,
html[data-theme="carnival"] .text-input {
  background: #fffdfe;
  border-color: rgba(224, 86, 140, 0.2);
  color: var(--text);
}
html[data-theme="carnival"] .seg.active {
  background: linear-gradient(135deg, rgba(255, 138, 76, 0.24), rgba(255, 95, 143, 0.2));
  color: #8a2f52;
  box-shadow: inset 0 0 0 1px rgba(224, 86, 140, 0.4);
}
html[data-theme="carnival"] .chip { background: #fffdfe; border-color: rgba(224, 86, 140, 0.18); color: #6d4a60; }
html[data-theme="carnival"] .chip.active {
  background: linear-gradient(135deg, rgba(255, 138, 76, 0.2), rgba(255, 95, 143, 0.18));
  border-color: rgba(224, 86, 140, 0.45);
  color: #8a2f52;
}
html[data-theme="carnival"] .tag-bar-label { color: #87607a; }
html[data-theme="carnival"] .count { color: #a8365f; background: rgba(255, 95, 143, 0.14); border-color: rgba(224, 86, 140, 0.32); }
html[data-theme="carnival"] .list-head h2 { color: #6b4557; }

/* 卡片：马卡龙糖果盒 */
html[data-theme="carnival"] .card {
  background: #fff5f9;
  border: 2px solid #ffd3e2;
  border-radius: 20px;
  box-shadow: 0 10px 22px rgba(150, 110, 140, 0.14);
}
html[data-theme="carnival"] .card::before {
  height: 5px;
  opacity: 1;
  background: repeating-linear-gradient(90deg, #ff8a4c 0 16px, #ffd166 16px 32px, #9a6bff 32px 48px, #3d9ee0 48px 64px, #5ac8a8 64px 80px);
  border-radius: 3px;
}
html[data-theme="carnival"] .card::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 14px;
  border: 1.5px dashed rgba(224, 86, 140, 0.18);
  pointer-events: none;
}
html[data-theme="carnival"] .card:hover {
  background: #fffafd;
  border-color: #ffb3cd;
  transform: translateY(-3px) rotate(-0.3deg);
  box-shadow: 0 18px 34px rgba(150, 110, 140, 0.22);
}
html[data-theme="carnival"] .card.card-doing { border-color: #ffc9b8; background: linear-gradient(180deg, #fff1ec, #fff5f9 62%); }
html[data-theme="carnival"] .card.card-ac { border-color: #b8e6c8; background: linear-gradient(180deg, #eefaf1, #fff5f9 62%); }
html[data-theme="carnival"] .card.card-reviewed { border-color: #bfd8ff; background: linear-gradient(180deg, #eef4ff, #fff5f9 62%); }
html[data-theme="carnival"] .title-cn { color: #3b2b3f; }
html[data-theme="carnival"] .pid { color: #7a5a70; }
html[data-theme="carnival"] .card-foot { border-top-color: rgba(224, 86, 140, 0.16); color: #8f7a96; }
html[data-theme="carnival"] .tag-pill { color: #a8365f; background: #ffeaf2; border-color: rgba(224, 86, 140, 0.22); }
html[data-theme="carnival"] .card-actions button:hover { color: #a8365f; background: #ffeef5; border-color: rgba(224, 86, 140, 0.28); }

/* 弹窗 / 表格 */
html[data-theme="carnival"] dialog.dialog {
  background: linear-gradient(180deg, #fffafd, #fff0f7);
  border: 2px solid #ffd3e2;
  box-shadow: 0 30px 80px rgba(120, 90, 120, 0.4);
}
html[data-theme="carnival"] .dialog-head { background: #fff4f9; border-bottom-color: rgba(224, 86, 140, 0.16); }
html[data-theme="carnival"] .dialog-foot { background: #fff6fa; border-top-color: rgba(224, 86, 140, 0.16); }
html[data-theme="carnival"] .page-btn { background: #fffdfe; border-color: rgba(224, 86, 140, 0.22); }
html[data-theme="carnival"] .page-btn.active {
  background: linear-gradient(135deg, rgba(255, 138, 76, 0.22), rgba(255, 95, 143, 0.2));
  border-color: rgba(224, 86, 140, 0.5);
  color: #8a2f52;
}
html[data-theme="carnival"] .empty { background: rgba(255, 250, 253, 0.7); border-color: rgba(224, 86, 140, 0.22); }
html[data-theme="carnival"] .toast { background: #fff6fa; color: #6b3f56; border-color: #ffd3e2; }

/* 侧边入口：游乐设施 */
html[data-theme="carnival"] .dock-avatar {
  background: radial-gradient(circle at 50% 32%, #ffffff, #ffe9f2);
  border: 2px solid #ffd3e2;
  box-shadow: 0 4px 0 rgba(224, 86, 140, 0.16), 0 8px 16px rgba(150, 110, 140, 0.16);
}
html[data-theme="carnival"] .dock-item:hover .dock-avatar {
  background: radial-gradient(circle at 50% 32%, #fff, #ffe0ee);
  box-shadow: 0 6px 0 rgba(255, 138, 76, 0.28), 0 10px 20px rgba(150, 110, 140, 0.2);
}
html[data-theme="carnival"] .dock-label { background: #fff; color: #8a4a68; border: 1px solid rgba(224, 86, 140, 0.22); }
html[data-theme="carnival"] .dock-item:hover .dock-label { background: #fff0f6; border-color: #ff8a4c; color: #a8365f; }

/* ==========================================================================
   4. 窄屏适配
   ========================================================================== */
@media (max-width: 1180px) {
  .theme-dock { display: none; }
  html[data-theme="forest"] .toolbar,
  html[data-theme="forest"] .content { padding-left: 22px; }
  html[data-theme="space"] .topbar { width: calc(100% - 16px); padding: 10px 16px; border-radius: 22px; }
  html[data-theme="carnival"] .carnival-wheel { right: -150px; opacity: 0.55; }
  html[data-theme="carnival"] .carnival-carousel { left: -120px; opacity: 0.5; }
}

@media (min-width: 1181px) {
  html[data-theme="forest"] .toolbar,
  html[data-theme="space"] .toolbar,
  html[data-theme="carnival"] .toolbar,
  html[data-theme="forest"] .content,
  html[data-theme="space"] .content,
  html[data-theme="carnival"] .content { padding-left: 104px; }
}

@media (max-height: 760px) {
  .theme-dock { gap: 6px; }
  .dock-avatar { width: 48px; height: 48px; }
  .dock-avatar svg { width: 38px; height: 38px; }
  .dock-label { font-size: 10px; }
  .dock-item { width: 70px; }
}

@media (max-width: 720px) {
  html[data-theme="forest"] .forest-eggs { transform: scale(0.82); transform-origin: left bottom; }
  html[data-theme="forest"] .topbar { padding-top: 34px; }
  html[data-theme="space"] .orbit-rocket { transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="space"] .topbar,
  html[data-theme="carnival"] .wheel-spin,
  html[data-theme="space"] .meteor,
  html[data-theme="forest"] .forest-motes i,
  html[data-theme="space"] .orbit-rocket { animation: none; }
}
