/* ============================================================
   芭蕾糖果舞台 · 整体 UI（轻松 / 活泼 / 可爱）
   设计令牌说明：
   - 品牌色唯一真源见 PROJECT-INFO §7：主色 #FF1493、强调 #FF69B4、
     背景渐变 #FFF0F5→#FFE4E1→#FFF5EE，本文件只做延展不改定义
   - 辅助马卡龙色（薰衣草/薄荷/奶油）仅作点缀，主色主导视觉
   - 装饰 emoji 由系统 emoji 字体渲染，不占自托管字体子集
   ============================================================ */

/* 品牌字体自托管（原 @import Google Fonts 在境内不可达，导致字体必然回退 + 闪烁）
   子集化 woff2 仅含界面用到的字形；font-display: swap 保证文字先以回退字体显示 */
@font-face {
  font-family: 'ZCOOL KuaiLe';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/zcool-kuaile-subset.woff2') format('woff2');
}

@font-face {
  font-family: 'Ma Shan Zheng';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/mashan-zheng-subset.woff2') format('woff2');
}

/* 中文字体回退栈：字体子集缺字或加载失败时仍保证中文可读 */
:root {
  --font-ui: 'ZCOOL KuaiLe', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Hiragino Sans GB', sans-serif;
  --font-display: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', 'PingFang SC', 'Microsoft YaHei', serif;

  /* 品牌色（唯一真源 PROJECT-INFO §7） */
  --pink-deep: #FF1493;
  --pink-hot: #FF69B4;
  /* 延展色阶 */
  --pink-mid: #FF8FBF;
  --pink-soft: #FFB9D6;
  --pink-candy: #FFD9E8;
  --pink-blush: #FFE9F3;
  --pink-paper: #FFF5FA;
  /* 马卡龙点缀色（仅少量点缀，不喧宾夺主） */
  --lavender: #D9CBFF;
  --mint: #BDEFDD;
  --lemon: #FFEBB3;

  --ink: #8A5A72;          /* 正文暖棕粉：比纯灰更软更甜 */
  --ink-light: #B98CA3;

  --radius-card: 22px;
  --radius-pill: 999px;

  /* 糖果立体感：底部「果冻」托边 + 柔粉投影 */
  --shadow-candy: 0 3px 0 var(--pink-candy), 0 8px 18px rgba(255, 105, 180, 0.16);
  --shadow-card: 0 10px 30px rgba(255, 105, 180, 0.14), 0 2px 8px rgba(255, 20, 147, 0.06);

  /* 果冻弹性曲线：一切微交互统一用它，活泼感的来源 */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  /* 品牌背景渐变（唯一真源）打底 */
  background: linear-gradient(135deg, #FFF0F5 0%, #FFE4E1 50%, #FFF5EE 100%);
  background-attachment: fixed;
  font-family: var(--font-ui);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

/* 极光柔光斑：统一粉色族（奶油芭蕾厅单主导色原则），只留两团呼吸感 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42vw 34vw at 10% 8%, rgba(255, 105, 180, 0.10), transparent 70%),
    radial-gradient(44vw 36vw at 92% 92%, rgba(255, 143, 191, 0.12), transparent 70%);
}

/* 单层极淡波点：糖霜感但不与画布抢戏 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 105, 180, 0.08) 2.5px, transparent 3px);
  background-size: 56px 56px;
}

/* ---------- 漂浮装饰层（少量、锚定四角、粉系 emoji） ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.decor {
  position: absolute;
  opacity: 0.5;
  filter: drop-shadow(0 3px 6px rgba(255, 105, 180, 0.22));
  animation: decor-float 8s ease-in-out infinite;
}
.decor-1 { top: 10%; left: 6%;   font-size: 28px; animation-duration: 7.5s; }
.decor-2 { top: 12%; right: 7%;  font-size: 24px; animation-duration: 8.5s; animation-delay: -2s; }
.decor-3 { bottom: 8%; left: 4%; font-size: 24px; animation-duration: 9s;   animation-delay: -3.5s; }
.decor-4 { bottom: 10%; right: 5%; font-size: 26px; animation-duration: 8s; animation-delay: -1.2s; }

@keyframes decor-float {
  0%, 100% { transform: translateY(0) rotate(-6deg) scale(1); }
  50%      { transform: translateY(-16px) rotate(8deg) scale(1.08); }
}

/* ---------- 标题区 ---------- */
.game-header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px 4px;
  animation: rise-in 0.5s var(--spring) both;
}

.game-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 33px;
  letter-spacing: 5px;
  /* 渐变字 + 白色「贴纸描边」：糖果招牌感 */
  background: linear-gradient(135deg, var(--pink-deep) 10%, var(--pink-hot) 55%, var(--pink-mid) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #fff) drop-shadow(0 6px 14px rgba(255, 105, 180, 0.35));
  animation: title-sway 5s ease-in-out infinite;
}

@keyframes title-sway {
  0%, 100% { transform: rotate(-1.2deg); }
  50%      { transform: rotate(1.2deg); }
}

.game-subtitle {
  margin-top: 4px;
  padding: 3px 16px;
  font-size: 14px;
  color: var(--pink-hot);
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid var(--pink-candy);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-candy);
  letter-spacing: 2px;
}

/* ---------- 主布局 ---------- */
.game-container {
  position: relative;
  z-index: 1;
  width: 100%;
  /* 宽屏放开到 1560：1240 的限宽会在 1440+ 屏幕上制造两条大边带，画布被高度锁死
     （宽高比 1.2，显示尺寸 = min(面板宽, 容器高×1.2)），放宽限宽 + 压低标题区高度
     可让画布在宽屏充分展开；超宽屏仍居中保留呼吸边距 */
  max-width: 1560px;
  display: flex;
  flex-direction: row;
  gap: 16px;
  padding: 6px 20px 16px;
  height: calc(100vh - 100px);
  min-height: 520px;
  animation: rise-in 0.55s var(--spring) 0.08s both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Left panel: canvas display */
.display-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.canvas-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  height: 100%;
}

/* 白卡纸画框：画布 padding 区留白卡边（不影响绘制坐标），
   一道细粉线 + 大柔影即可——让房间内容做主角，不再叠加图案 */
#gameCanvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 14px;
  border: 1px solid var(--pink-candy);
  border-radius: 26px;
  box-shadow:
    0 20px 48px rgba(255, 105, 180, 0.22),
    0 4px 14px rgba(255, 20, 147, 0.08);
}

/* Right panel: controls */
.control-panel {
  width: 344px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* overflow:hidden 会把卡片投影裁掉：用 padding + 负 margin 抵消布局位移，
     同时给投影留出显示空间（ clipping 边界在 padding box） */
  overflow: hidden;
  padding: 8px;
  margin: -8px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 方案存档卡 ---------- */
.save-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
  padding: 8px 12px 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--pink-candy);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}
.save-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.save-bar-title { font-size: 13px; color: var(--pink-deep); font-weight: bold; letter-spacing: 1px; }
.save-bar-title::before { content: '💖 '; }
/* 自动保存状态：小圆点呼吸灯 + 文案 */
.save-status { font-size: 11px; color: #3EBB7A; display: inline-flex; align-items: center; gap: 4px; }
.save-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3EBB7A;
  animation: status-breathe 1.8s ease-in-out infinite;
}
@keyframes status-breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50%      { opacity: 1;    transform: scale(1.15); }
}
.save-slot-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 12px;
  transition: background 0.2s;
}
/* 高亮当前编辑槽位：让自动保存/保存的目标可预期 */
.save-slot-row.active { background: var(--pink-blush); }
.save-slot-row.active .save-slot-label { color: var(--pink-deep); font-weight: bold; }
.save-slot-label { font-size: 12px; color: var(--ink-light); margin-right: 2px; }

/* 糖果按钮通用造型：白→粉渐变 + 果冻托边，按下会「陷进去」 */
.save-slot-btn,
.save-tool-btn,
.retry-btn,
.mobile-collapse-btn {
  border: 2px solid var(--pink-candy);
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #FFFFFF, #FFF0F6);
  box-shadow: var(--shadow-candy);
  cursor: pointer;
  color: var(--pink-hot);
  font-family: var(--font-ui);
  white-space: nowrap;
  transition: transform 0.16s var(--spring), box-shadow 0.16s var(--spring), border-color 0.16s, color 0.16s;
}
.save-slot-btn:hover,
.save-tool-btn:hover,
.retry-btn:hover,
.mobile-collapse-btn:hover {
  border-color: var(--pink-hot);
  color: var(--pink-deep);
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--pink-candy), 0 12px 22px rgba(255, 105, 180, 0.22);
}
.save-slot-btn:active,
.save-tool-btn:active,
.retry-btn:active,
.mobile-collapse-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--pink-candy), 0 3px 8px rgba(255, 105, 180, 0.18);
}

.save-slot-btn { padding: 3px 11px; font-size: 12px; }
.save-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.save-tool-btn {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--pink-deep);
  border-color: var(--pink-soft);
}
/* 工具按钮图标（顺序与 ui.js buildSaveBar 一致） */
.save-tools .save-tool-btn:nth-child(1)::before { content: '🎲 '; }
.save-tools .save-tool-btn:nth-child(2)::before { content: '🔄 '; }
.save-tools .save-tool-btn:nth-child(3)::before { content: '↩️ '; }

/* ---------- 分类页签（糖果胶囊） ---------- */
.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  backdrop-filter: blur(10px);
  border: 2px solid var(--pink-candy);
  border-bottom: none;
  box-shadow: var(--shadow-card);
  /* 两行页签实测 97px（padding 20 + 胶囊 36×2 + gap 5），留 11px 余量，避免第二行被裁 */
  max-height: 108px;
  overflow-y: auto;
}

.category-bar::-webkit-scrollbar { width: 5px; }
.category-bar::-webkit-scrollbar-thumb { background: var(--pink-candy); border-radius: 3px; }

.category-tab {
  padding: 7px 8px;
  border: 2px solid var(--pink-candy);
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #FFFFFF, var(--pink-blush));
  cursor: pointer;
  font-size: 15px;
  font-family: var(--font-ui);
  color: var(--ink-light);
  white-space: nowrap;
  transition: transform 0.18s var(--spring), box-shadow 0.18s var(--spring), background 0.18s, color 0.18s, border-color 0.18s;
}
/* 分类图标：emoji 走系统字体，不碰自托管子集 */
.category-tab::before { margin-right: 3px; }
.category-tab[data-cat="hair"]::before { content: '🎀'; }
.category-tab[data-cat="face"]::before { content: '😊'; }
.category-tab[data-cat="clothes"]::before { content: '👗'; }
.category-tab[data-cat="shoes"]::before { content: '👟'; }
.category-tab[data-cat="accessory"]::before { content: '👑'; }
.category-tab[data-cat="makeup"]::before { content: '💄'; }
.category-tab[data-cat="costume"]::before { content: '🐱'; }

.category-tab:hover {
  transform: translateY(-2px) rotate(-1deg);
  border-color: var(--pink-hot);
  color: var(--pink-hot);
  box-shadow: 0 6px 14px rgba(255, 105, 180, 0.20);
}

.category-tab.active {
  border-color: var(--pink-deep);
  background: linear-gradient(135deg, var(--pink-hot), var(--pink-deep));
  color: #fff;
  font-weight: bold;
  box-shadow: 0 6px 16px rgba(255, 20, 147, 0.32);
  /* 每次切换重渲染都会重放果冻弹跳（活泼） */
  animation: jelly-pop 0.45s var(--spring);
}

@keyframes jelly-pop {
  0%   { transform: scale(0.72); }
  55%  { transform: scale(1.12); }
  80%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

/* 当前已选提示：让「再次点击即卸下」可发现 */
.current-line {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--pink-hot);
  background: rgba(255, 245, 250, 0.95);
  border-left: 2px solid var(--pink-candy);
  border-right: 2px solid var(--pink-candy);
}
.current-line::before { content: '🎀 '; font-size: 12px; }

/* ---------- 部件面板 ---------- */
/* 3 列自适应网格：flex-wrap 在 344px 面板里会卡在「第 3 格差 2px」的临界点，
   右侧留下一条够不着一个格子的空白，看起来像排版错位。
   最小列宽取 78px（低于格子的 92px 设计值），滚动条占走 6px 后仍能排满 3 列 */
.item-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 10px;
  padding: 12px 12px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  overflow-y: auto;
  scrollbar-gutter: stable;
  flex: 1;
  align-content: start;
  border: 2px solid var(--pink-candy);
  border-top: none;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}

.item-panel::-webkit-scrollbar { width: 6px; }
.item-panel::-webkit-scrollbar-track { background: transparent; }
.item-panel::-webkit-scrollbar-thumb { background: var(--pink-candy); border-radius: 3px; }

/* 部件格：使用 <button>，需重置浏览器默认按钮样式 */
.item-slot {
  width: 100%;
  min-width: 0;
  height: 96px;
  border: 2px solid var(--pink-blush);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--spring), box-shadow 0.2s var(--spring), border-color 0.18s, background 0.18s;
  position: relative;
  padding: 5px;
  font-family: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 2px 6px rgba(255, 105, 180, 0.08);
  /* 入场交错弹跳：切换分类时整批格子像爆米花一样蹦出来。
     用 backwards 而非 both：结束后交还样式主权，否则 hover 变换会被 fill 帧压住 */
  animation: slot-pop 0.38s var(--spring) backwards;
}
.item-slot:nth-child(2) { animation-delay: 0.03s; }
.item-slot:nth-child(3) { animation-delay: 0.06s; }
.item-slot:nth-child(4) { animation-delay: 0.09s; }
.item-slot:nth-child(5) { animation-delay: 0.12s; }
.item-slot:nth-child(6) { animation-delay: 0.15s; }
.item-slot:nth-child(7) { animation-delay: 0.18s; }
.item-slot:nth-child(8) { animation-delay: 0.21s; }
.item-slot:nth-child(9) { animation-delay: 0.24s; }
.item-slot:nth-child(n+10) { animation-delay: 0.27s; }

@keyframes slot-pop {
  0%   { opacity: 0; transform: scale(0.6) translateY(10px); }
  70%  { opacity: 1; transform: scale(1.06) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.item-slot:hover {
  border-color: var(--pink-hot);
  transform: translateY(-4px) rotate(-1.6deg);
  box-shadow: 0 10px 20px rgba(255, 105, 180, 0.24);
}

.item-slot:active { transform: translateY(0) scale(0.94); }

.item-slot.selected {
  border-color: var(--pink-deep);
  background: linear-gradient(160deg, var(--pink-blush), var(--pink-candy));
  box-shadow: 0 0 0 3px rgba(255, 20, 147, 0.14), 0 10px 22px rgba(255, 20, 147, 0.22);
  transform: translateY(-2px);
}

/* 选中徽章：粉色圆形 ✓，像盖了一颗糖果印章 */
.item-slot.selected::after {
  content: '\2713';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-hot), var(--pink-deep));
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(255, 20, 147, 0.4);
  animation: jelly-pop 0.4s var(--spring);
}

.item-slot img {
  width: 58px;
  height: 58px;
  pointer-events: none;
  object-fit: contain;
}

.item-slot .color-swatch {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #999;
  /* 糖果色块的白边 + 内高光，像一颗硬糖 */
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--pink-candy), inset 0 -6px 10px rgba(0, 0, 0, 0.06);
}

.item-slot .item-name {
  font-size: 12px;
  color: var(--ink);
  margin-top: 3px;
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-slot.selected .item-name { color: var(--pink-deep); font-weight: bold; }

/* 键盘可达性：统一的可见焦点样式 */
.item-slot:focus-visible,
.category-tab:focus-visible,
.save-slot-btn:focus-visible,
.save-tool-btn:focus-visible,
.mobile-collapse-btn:focus-visible,
.retry-btn:focus-visible {
  outline: 3px solid var(--pink-deep);
  outline-offset: 2px;
}

/* ---------- 加载遮罩 ---------- */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255, 240, 245, 0.97), rgba(255, 228, 225, 0.97));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--pink-hot);
  font-family: var(--font-ui);
  z-index: 1000;
  gap: 18px;
  letter-spacing: 3px;
}

/* 双环糖果 spinner：外圈热粉、内圈深粉反旋 */
.loading-overlay .loading-spinner {
  width: 56px;
  height: 56px;
  border: 5px solid var(--pink-candy);
  border-top-color: var(--pink-hot);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: relative;
}
.loading-overlay .loading-spinner::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 4px solid transparent;
  border-bottom-color: var(--pink-deep);
  border-radius: 50%;
  animation: spin 0.55s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 加载失败态：可点击重试 */
.loading-error-msg { font-size: 18px; color: var(--pink-hot); }
.retry-btn { padding: 8px 26px; font-size: 16px; }

/* ---------- Toast：显式操作的可见反馈 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 14px) scale(0.9);
  max-width: 90vw;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--pink-hot), var(--pink-deep));
  color: #fff;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 1px;
  box-shadow: 0 10px 26px rgba(255, 20, 147, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.28s var(--spring);
  z-index: 1200;
}
.toast::before { content: '💖 '; }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- 折叠按钮（compact 布局） ---------- */
.mobile-collapse-btn {
  display: none;
  padding: 5px 14px;
  font-size: 13px;
}

/* compact 布局（窄屏或横屏矮视口）：由 JS 按断点/方向切换 body class，
   不再仅依赖启动时的一次 matchMedia 判断 */
body.compact-layout .mobile-collapse-btn { display: inline-block; }
body.compact-layout .control-panel.collapsed .save-bar,
body.compact-layout .control-panel.collapsed .category-bar,
body.compact-layout .control-panel.collapsed .current-line,
body.compact-layout .control-panel.collapsed .item-panel { display: none; }

/* Mobile responsive: stack vertically */
@media (max-width: 600px) {
  .game-container {
    flex-direction: column;
    height: auto;
    min-height: auto;
    gap: 10px;
    padding: 4px 10px 12px;
  }
  .game-title { font-size: 30px; letter-spacing: 4px; }
  .game-subtitle { font-size: 12px; }
  .display-panel {
    height: 50vh;
    min-height: 350px;
  }
  .control-panel {
    width: 100%;
  }
  .item-panel {
    max-height: 220px;
  }
  /* 小屏减弱漂浮装饰，避免视觉拥挤 */
  .decor-3, .decor-4 { display: none; }
}

/* 横屏手机（宽 >600px 但视口矮）：压缩标题与面板，避免角色区与控制面板互相挤压 */
body.landscape-layout .game-header { padding: 3px 12px 2px; }
body.landscape-layout .game-title {
  font-size: 20px;
  letter-spacing: 2px;
}
body.landscape-layout .game-subtitle { display: none; }
body.landscape-layout .game-container {
  height: calc(100vh - 32px);
  min-height: auto;
  padding: 2px 8px 6px;
  gap: 10px;
}
body.landscape-layout .control-panel {
  width: 300px;
  overflow-y: auto;
}
body.landscape-layout .category-bar { max-height: none; }
body.landscape-layout .item-panel { max-height: 150px; }

/* 减少动态偏好：关闭全部装饰性动画，保留状态变化本身 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
