/* ===================================================================
   DRAWQUARIUM · 网页重制版
   UI 参照原游戏（byKaleb）：深色半透明圆角面板 + 细亮边 + 圆形图标按钮
   =================================================================== */

:root {
  --panel: rgba(44, 56, 55, 0.82);
  --panel-solid: rgba(38, 49, 48, 0.96);
  --panel-line: rgba(186, 219, 212, 0.26);
  --panel-line-soft: rgba(186, 219, 212, 0.14);
  --cream: #f4f1e6;
  --muted: #a8b7b5;
  --accent: #eda44c;
  --accent-2: #f6c583;
  --accent-line: rgba(255, 214, 160, 0.75);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #08131d;
  color: var(--cream);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  letter-spacing: 0.2px;
}
body { height: 100dvh; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

#tank {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  background: #061b24;
}

/* ---------------- 通用小组件 ---------------- */
.version-tag {
  position: fixed;
  top: calc(var(--safe-t) + 8px);
  left: calc(var(--safe-l) + 14px);
  font-size: 10.5px;
  letter-spacing: 1.1px;
  color: rgba(236, 245, 240, 0.5);
  font-weight: 500;
  z-index: 25;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rail-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(244, 249, 245, 0.92);
  background: rgba(46, 60, 59, 0.68);
  border: 1px solid rgba(214, 235, 229, 0.24);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.13s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s;
  flex: none;
}
.rail-btn .ic { width: 20px; height: 20px; }
.rail-btn:active { transform: scale(0.9); background: rgba(84, 104, 100, 0.8); }
.rail-btn.on {
  background: rgba(237, 164, 76, 0.9);
  border-color: rgba(255, 219, 170, 0.85);
  color: #2b1c0c;
}
.rail-btn.accent {
  background: rgba(63, 80, 78, 0.85);
  border-color: rgba(224, 240, 234, 0.42);
}
.rail-btn.accent .ic { width: 25px; height: 25px; stroke-width: 2.1; }

/* ---------------- 鱼缸 HUD ---------------- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud > * { pointer-events: auto; }

.rail-left {
  position: absolute;
  left: calc(var(--safe-l) + 11px);
  top: calc(var(--safe-t) + 44px);
}
.rail-right {
  position: absolute;
  right: calc(var(--safe-r) + 11px);
  bottom: calc(var(--safe-b) + 20px);
}

.side-right {
  position: absolute;
  top: calc(var(--safe-t) + 16px);
  right: calc(var(--safe-r) + 12px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  max-width: 62vw;
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background: rgba(20, 32, 36, 0.55);
  border: 1px solid rgba(210, 234, 228, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #f6f4ea;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.counter .ic { width: 22px; height: 22px; color: var(--accent); stroke-width: 1.7; }

.quests {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  padding: 8px 10px 8px 16px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(8, 20, 26, 0) 0%, rgba(8, 20, 26, 0.34) 45%);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  min-width: 150px;
}
.quest {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.65;
  color: rgba(240, 246, 240, 0.9);
  white-space: nowrap;
}
.quest .q-arrow { color: var(--accent-2); font-size: 10px; }
.quest .q-progress { color: rgba(240, 246, 240, 0.55); font-size: 11px; margin-left: 2px; }
.quest.done { color: rgba(240, 246, 240, 0.42); text-decoration: line-through; }
.quest.done .q-arrow { color: rgba(163, 226, 199, 0.7); }

.feed-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 34px);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #20180c;
  background: rgba(246, 197, 131, 0.94);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  animation: floatY 2.4s ease-in-out infinite;
  pointer-events: none;
  white-space: nowrap;
  z-index: 12;
}
@keyframes floatY {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -4px); }
}

.toasts {
  position: absolute;
  top: calc(var(--safe-t) + 92px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  z-index: 14;
}
.toast {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #f7f5ec;
  background: rgba(24, 37, 38, 0.82);
  border: 1px solid rgba(198, 226, 218, 0.3);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 84vw;
  text-align: center;
  line-height: 1.35;
}
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px) scale(0.97); } }

/* 造景面板 */
.decor-panel {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 14px);
  width: min(calc(100vw - 22px), 460px);
  padding: 12px 14px 14px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  box-shadow: var(--shadow);
  z-index: 15;
  animation: sheetUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 9px;
}
.mini-x {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}
.decor-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.decor-list::-webkit-scrollbar { display: none; }
.decor-item {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 12.5px;
  color: #e8efea;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.decor-item.on {
  background: rgba(237, 164, 76, 0.22);
  border-color: rgba(246, 197, 131, 0.65);
  color: #ffe6c2;
}
.decor-item .em { font-size: 15px; }
.panel-tip { margin-top: 8px; font-size: 11px; color: var(--muted); text-align: center; }

/* ---------------- 屏幕 ---------------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
}
.screen.show { display: flex; }

/* ---------------- 首页 / 主菜单 ---------------- */
.menu {
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(105% 70% at 62% 34%, rgba(40, 92, 132, 0.55), rgba(9, 22, 36, 0) 62%),
    radial-gradient(80% 60% at 18% 78%, rgba(18, 52, 76, 0.5), rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, #0d2136 0%, #0a1a2b 45%, #071320 100%);
}
.menu-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.3px 1.3px at 12% 18%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 28% 42%, rgba(220, 240, 255, 0.7), transparent),
    radial-gradient(1.6px 1.6px at 46% 12%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 63% 30%, rgba(210, 235, 255, 0.6), transparent),
    radial-gradient(1.2px 1.2px at 78% 16%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 86% 48%, rgba(220, 240, 255, 0.55), transparent),
    radial-gradient(1.4px 1.4px at 34% 66%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 70% 72%, rgba(220, 240, 255, 0.45), transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
  opacity: 0.85;
}
@keyframes twinkle { from { opacity: 0.55; } to { opacity: 0.95; } }

.menu-snow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34vh;
  min-height: 190px;
}
.menu-snow svg { width: 100%; height: 100%; display: block; }

.menu-inner {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 26px;
  margin-bottom: 12vh;
}
.wordmark {
  width: min(80vw, 350px);
  height: auto;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.42));
  animation: logoFloat 6s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.byline {
  margin-top: 2px;
  font-size: 12.5px;
  letter-spacing: 1.6px;
  color: rgba(226, 238, 233, 0.8);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.menu-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}
.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 28px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 1.2px;
  color: #f7f5ec;
  background: rgba(58, 74, 73, 0.72);
  border: 1px solid rgba(222, 240, 234, 0.34);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.14s ease, background 0.2s;
}
.btn-new .ic { width: 26px; height: 26px; stroke-width: 2.1; }
.btn-new:active { transform: scale(0.97); background: rgba(78, 96, 93, 0.85); }
.menu-hint {
  margin: 26px 0 0;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: rgba(207, 224, 219, 0.62);
}
.link-btn {
  margin-top: 16px;
  padding: 6px 12px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: rgba(207, 224, 219, 0.55);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rail-btn.off { opacity: 0.45; }
.menu-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-b) + 12px);
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: rgba(190, 210, 205, 0.42);
  z-index: 3;
}

/* ---------------- 画画 ---------------- */
.paint {
  background: transparent;
  padding-top: calc(var(--safe-t) + 2px);
  z-index: 30;
}
.paint-scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 15, 22, 0.55);
  -webkit-backdrop-filter: blur(26px) saturate(0.85) brightness(0.62);
  backdrop-filter: blur(26px) saturate(0.85) brightness(0.62);
  z-index: 0;
}
.paint > *:not(.paint-scrim) { position: relative; z-index: 1; }

.paint-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 12px 6px;
}
.top-actions { display: flex; gap: 8px; }

.kind-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(30, 42, 42, 0.72);
  border: 1px solid var(--panel-line-soft);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.kind-tabs button {
  padding: 6px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(224, 236, 231, 0.65);
  transition: background 0.18s, color 0.18s;
}
.kind-tabs button.on {
  background: rgba(244, 241, 230, 0.92);
  color: #25302f;
}

.paint-main {
  flex: 1;
  display: flex;
  gap: 9px;
  padding: 0 12px;
  min-height: 0;
}
.paint-tools { justify-content: flex-start; }
.canvas-frame {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  border: 1px solid rgba(222, 240, 234, 0.22);
  background: rgba(10, 22, 26, 0.28);
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.25);
}
.canvas-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.paper-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  letter-spacing: 1px;
  color: rgba(232, 242, 237, 0.35);
  pointer-events: none;
  transition: opacity 0.3s;
}
.paper-empty.hide { opacity: 0; }
.paint-tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: rgba(232, 242, 237, 0.42);
  pointer-events: none;
}

.paint-panel {
  display: flex;
  gap: 12px;
  margin: 9px 12px 0;
  padding: 10px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  box-shadow: var(--shadow);
  flex: none;
}
.wheel-box {
  width: 104px;
  height: 104px;
  flex: none;
  align-self: center;
}
.wheel-box canvas { width: 104px; height: 104px; display: block; touch-action: none; }

.panel-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; justify-content: center; }

.swatches {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 0 2px;
  scrollbar-width: none;
}
.swatches::-webkit-scrollbar { display: none; }
.swatch {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.22);
  transition: transform 0.14s, border-color 0.14s;
}
.swatch.on { transform: scale(1.16); border-color: #fff; box-shadow: 0 0 0 2px rgba(244, 241, 230, 0.35); }

.brush-row { display: flex; align-items: center; gap: 6px; }
.brush-dot {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.brush-dot i { display: block; border-radius: 50%; background: var(--cream); }
.brush-dot.on { background: rgba(237, 164, 76, 0.85); border-color: rgba(255, 219, 170, 0.8); }
.brush-dot.on i { background: #2b1c0c; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.slider-row span { flex: none; width: 44px; }
.slider-row b { flex: none; width: 26px; text-align: right; font-weight: 600; color: var(--cream); font-size: 11px; }
.slider-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 18px;
  background: transparent;
}
.slider-row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.paint-actions { padding: 10px 12px calc(var(--safe-b) + 10px); }
.btn-accent {
  width: 100%;
  height: 52px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #fff8ec;
  background: linear-gradient(180deg, #eda451, #d98c33);
  border: 1px solid var(--accent-line);
  box-shadow: 0 12px 26px rgba(202, 124, 37, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.13s ease, filter 0.2s;
}
.btn-accent:active { transform: scale(0.985); filter: brightness(0.95); }
.btn-accent[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------------- 弹层 / 面板 ---------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 10, 16, 0.58);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(180deg, rgba(48, 60, 59, 0.97), rgba(30, 40, 40, 0.99));
  border-top: 1px solid var(--panel-line);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.5);
  padding-bottom: var(--safe-b);
  animation: sheetUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sheetUp { from { transform: translateY(26px); opacity: 0.5; } }
.sheet::before {
  content: "";
  width: 38px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  margin: 9px auto 0;
  flex: none;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 6px;
  flex: none;
}
.sheet-head h2 { margin: 0; font-size: 17px; letter-spacing: 1px; font-weight: 700; color: var(--cream); }
.sheet-x {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
}
.sheet-body {
  padding: 6px 20px 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.fish-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.fish-thumb {
  flex: none;
  width: 112px;
  height: 84px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.09);
  overflow: hidden;
}
.fish-thumb img { max-width: 92%; max-height: 92%; object-fit: contain; display: block; }
.fish-title { min-width: 0; flex: 1; }
.fish-title h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.fish-title p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(237, 164, 76, 0.16);
  color: var(--accent-2);
  border: 1px solid rgba(237, 164, 76, 0.26);
  white-space: nowrap;
}

.stat { margin-bottom: 12px; }
.stat-top { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.stat-bar { height: 7px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.stat-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #8fd8b9, #c9f0dd); transition: width 0.5s ease; }
.stat-fill.hungry { background: linear-gradient(90deg, #eda44c, #f6c583); }
.stat-fill.low { background: linear-gradient(90deg, #6f9ad6, #a8c4ee); }

.row-btns { display: flex; gap: 9px; margin-top: 16px; }
.row-btns .btn { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.3px;
  color: #f7f5ec;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.13s ease, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(180deg, #eda451, #d98c33); border-color: var(--accent-line); color: #fff8ec; }
.btn.ghost { background: rgba(255, 255, 255, 0.06); }
.btn.small { min-height: 36px; font-size: 12.5px; padding: 0 14px; border-radius: 10px; }
.btn.danger { background: rgba(214, 88, 78, 0.16); border-color: rgba(240, 120, 110, 0.32); color: #ffb9b2; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; }
.list-card {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  transition: background 0.18s, transform 0.12s;
}
.list-card:active { transform: scale(0.97); background: rgba(237, 164, 76, 0.12); }
.list-card .lt { height: 68px; display: grid; place-items: center; margin-bottom: 6px; }
.list-card .lt img { max-width: 96%; max-height: 100%; object-fit: contain; }
.list-card .ln { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.list-card .lm { font-size: 10.5px; color: var(--muted); margin-top: 3px; display: flex; justify-content: space-between; }
.empty-note { text-align: center; color: #93a5a2; font-size: 13px; line-height: 1.8; padding: 26px 10px; }

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.setting:last-child { border-bottom: 0; }
.setting .st { font-size: 14px; font-weight: 650; }
.setting .sd { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.setting .sv { flex: none; display: flex; align-items: center; gap: 8px; }
.switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  transition: background 0.22s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cream);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.switch.on { background: rgba(237, 164, 76, 0.75); }
.switch.on::after { transform: translateX(20px); }

.setting-col { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.setting-col .st { font-size: 14px; font-weight: 650; }
.setting-col .sd { font-size: 11px; color: var(--muted); margin: 4px 0 10px; line-height: 1.6; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; }
.range::-webkit-slider-runnable-track { height: 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.2); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed rgba(237, 164, 76, 0.4);
  margin-top: 8px;
}
.code-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  letter-spacing: 3px;
  color: var(--accent-2);
  flex: 1;
}
.code-box .cbtn { font-size: 11.5px; color: var(--accent-2); padding: 6px 10px; border-radius: 8px; background: rgba(237, 164, 76, 0.14); }

.dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 10, 16, 0.62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.18s ease;
}
.dialog-card {
  width: min(100%, 370px);
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(52, 64, 62, 0.99), rgba(33, 43, 42, 0.99));
  border: 1px solid var(--panel-line);
  box-shadow: var(--shadow);
  animation: popIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes popIn { from { transform: scale(0.94); opacity: 0; } }
.dialog-card h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: 0.5px; }
.dialog-card p { margin: 0 0 15px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.dialog-card input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.26);
  color: var(--cream);
  font-size: 16px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.dialog-card input:focus { border-color: rgba(237, 164, 76, 0.6); }
.dialog-actions { display: flex; gap: 9px; margin-top: 15px; }
.dialog-actions .btn { flex: 1; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #08131d;
  transition: opacity 0.5s ease;
}
.boot.gone { opacity: 0; pointer-events: none; }
.boot-fish { font-size: 44px; animation: bootBob 1.6s ease-in-out infinite; }
@keyframes bootBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-9px) rotate(4deg); } }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; background: #08131d; z-index: 200; }

@media (max-height: 700px) {
  .wheel-box, .wheel-box canvas { width: 88px; height: 88px; }
  .paint-panel { padding: 8px; }
  .menu-actions { margin-top: 24px; }
  .btn-new { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* 隐藏界面模式（藏在设置右侧的眼睛图标里） */
.rail, .side-right, .feed-hint, .decor-panel, .hud .version-tag { transition: opacity 0.28s ease; }
.hud.ui-hidden .rail,
.hud.ui-hidden .side-right,
.hud.ui-hidden .feed-hint,
.hud.ui-hidden .decor-panel,
.hud.ui-hidden .version-tag { opacity: 0; pointer-events: none; }
.hud.ui-hidden .toasts { opacity: 1; }

/* 原版风格修正 */
.paint .version-tag { display: none; }
.quests { background: none; }
.slider-row span { width: 56px; white-space: nowrap; font-size: 10.5px; }
.rail-btn[disabled] { opacity: 0.32; pointer-events: none; }
