/* Heartopia Web Tool 全局现代暗色主题样式 */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131c2e;
  --bg-tertiary: #1e293b;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 顶部状态栏 */
.header {
  height: 56px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  cursor: pointer;
  transition: all 0.16s ease;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  margin-right: 4px;
}

.mobile-nav-toggle:active {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--accent-color);
}

.desktop-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-user-trigger-wrap {
  display: none;
  position: relative;
}

.mobile-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: #fff;
  cursor: pointer;
  transition: all 0.16s;
}

.mobile-user-btn:active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-color);
}

.mobile-user-name {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.mobile-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  z-index: 10002;
  overflow: hidden;
  animation: modalFadeIn 0.15s ease;
}

.mobile-user-dropdown-header {
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name-bold {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}

.mobile-user-dropdown-menu {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 16px;
  font-size: 0.88rem;
  color: var(--text-main);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.mobile-menu-link:hover,
.mobile-menu-link:active {
  background: rgba(255, 255, 255, 0.08);
}

.mobile-menu-link.danger-link {
  color: #f87171;
}

.mobile-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.mobile-dropdown-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.4);
}

.sidebar-mobile-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
  z-index: 9998;
}

.saved-account-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-tertiary);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  gap: 10px;
}

.saved-account-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}
.app-version-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.28);
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.02em;
  user-select: none;
}


.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
  border-color: rgba(239, 68, 68, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

/* 主内容布局 */
.main-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* 左侧功能菜单面板 */
.sidebar {
  width: 210px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
}

.sidebar-header {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: none; /* Firefox: 隐藏滚动条 */
  -ms-overflow-style: none; /* IE / Edge: 隐藏滚动条 */
}

.sidebar-menu::-webkit-scrollbar {
  display: none; /* Chrome / Safari / Edge: 隐藏滚动条 */
  width: 0;
  height: 0;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.sidebar-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-menu-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0.05) 100%);
  color: #60a5fa;
  font-weight: 600;
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: inset 3px 0 0 var(--accent-color);
}

.sidebar-menu-item .menu-icon {
  font-size: 1.15rem;
  line-height: 1;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-menu-item .menu-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-running-light {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 7px rgba(74, 222, 128, 0.9);
  animation: menu-running-pulse 1.5s ease-in-out infinite;
}

@keyframes menu-running-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* 左侧二级分组样式 */
.sidebar-group {
  display: flex;
  flex-direction: column;
  margin: 1px 0;
}

.sidebar-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
  transition: all 0.16s ease;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.sidebar-group-header:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-group.has-active-child .sidebar-group-header {
  color: #93c5fd;
}

.sidebar-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.sidebar-group-title .menu-icon {
  font-size: 1.15rem;
  line-height: 1;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-group-title .group-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-group-arrow {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  padding: 0 4px;
}

.sidebar-group-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 14px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  margin-top: 2px;
  margin-bottom: 4px;
}

.sidebar-sub-item {
  padding: 7px 10px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

.sidebar-sub-item .menu-icon {
  font-size: 1rem;
  width: 20px;
}

.sidebar-empty-hint {
  padding: 16px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: center;
}

/* 右侧内容主面板 */
.content-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-primary);
  min-width: 0;
}

/* 顶部任务标签页栏 (VS Code / 现代浏览器完全连续无缝 Tab 方案) */
.task-tabs-bar {
  display: flex;
  align-items: flex-end;
  background: #090e1a; /* 沉稳深色底色，作为标签页轨道 */
  height: 38px;
  min-height: 38px;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  flex-shrink: 0;
  box-sizing: border-box;
  gap: 0; /* 绝对无间隙 */
}

.task-tabs-bar::-webkit-scrollbar {
  height: 3px;
}

.task-tabs-bar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* 起始左侧垫片（带底线） */
.task-tab-edge-spacer {
  width: 0;
  display: none;
}

/* 单个任务标签：紧密相连无缝排列 */
.task-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  user-select: none;
  max-width: 240px;
  min-width: 120px;
  flex-shrink: 0;
  box-sizing: border-box;
  margin: 0; /* 消除所有外边距间隙 */
  position: relative;
}

/* 未激活 Tab：底线完整闭合，右边框作为自然分界线 */
.task-tab-item:not(.active) {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.task-tab-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
}

/* 首个未激活 Tab 补齐左边框 */
.task-tab-item:first-child:not(.active) {
  border-left: 1px solid var(--border-color);
}

/* 选中的激活 Tab：彻底融入下方内容区（无底线、完全贴合无左右间隙） */
.task-tab-item.active {
  background: var(--bg-secondary); /* #131c2e，与下方 task-banner 颜色完全融为一体 */
  color: #ffffff;
  font-weight: 600;
  border: none;
  border-top: 2px solid var(--accent-color); /* 顶部精致科技蓝强调条 */
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: none !important; /* 彻底去除底部分割线 */
  height: 38px; /* 与容器等高，直接咬合下方内容 */
  margin-left: -1px; /* 紧扣前一个 Tab，消除双边框与间隙 */
  margin-right: 0;
  z-index: 2; /* 浮于相邻普通边框之上 */
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25);
}

.task-tab-item:first-child.active {
  margin-left: 0;
  border-left: none; /* 贴合最左侧边界 */
}

/* 状态小圆点 */
.task-tab-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #64748b;
  display: inline-block;
}

.task-tab-status-dot.dot-online {
  background: var(--success-color);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.9);
}

.task-tab-status-dot.dot-logged {
  background: var(--accent-color);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.9);
}

.task-tab-status-dot.dot-taptap {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.9);
}

.task-tab-status-dot.dot-offline {
  background: #64748b;
}

.task-tab-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.task-tab-busy-icon {
  font-size: 0.72rem;
  animation: spin 1.5s linear infinite;
}

/* 关闭按钮 */
.task-tab-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  opacity: 0.6;
  margin-left: 4px;
}

.task-tab-item:hover .task-tab-close,
.task-tab-item.active .task-tab-close {
  opacity: 1;
}

.task-tab-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: var(--danger-color);
}

/* '+' 添加按钮区域（紧跟在最后一个 Tab 后面，带底线） */
.task-tab-add-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 10px;
  margin: 0;
  flex-shrink: 0;
  box-sizing: border-box;
}

.task-tab-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.task-tab-add-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-color);
  color: #60a5fa;
  transform: scale(1.05);
}

/* 延伸到底部的连接横线，填满剩余所有宽度 */
.task-tab-rail-line {
  flex: 1;
  height: 38px;
  min-width: 20px;
  border-bottom: 1px solid var(--border-color);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 任务状态条：直接与激活 Tab 无缝连成一体 */
.task-banner {
  padding: 10px 18px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-message {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 兼容旧 Tab 导航栏类 (如存在内嵌子项使用) */
.tab-nav {
  display: flex;
  padding: 0 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  gap: 2px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.tab-btn {
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

/* 空任务占位容器 */
.empty-task-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  text-align: center;
  color: var(--text-muted);
  padding: 60px 24px;
}

/* 标签页视图区域 */
.tab-content {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 当背包、拼画板、2D/3D/竖向蓝图、房间家具、采集、移动或派对 Tab 激活时，关闭外部容器纵向滚动条，彻底消除外部滚动条与双滚动条 */
.tab-content.tab-content-replace-active,
.tab-content.tab-content-bag-active,
.tab-content.tab-content-easel-active,
.tab-content.tab-content-drawing-animation-active,
.tab-content.tab-content-drawing-gallery-active,
.tab-content.tab-content-bp2d-active,
.tab-content.tab-content-bp3d-active,
.tab-content.tab-content-bpvert-active,
.tab-content.tab-content-room-active,
.tab-content.tab-content-gather-active,
.tab-content.tab-content-cook-active,
.tab-content.tab-content-move-active,
.tab-content.tab-content-party-active {
  overflow-y: hidden;
  height: 100%;
}

.tab-content.tab-content-replace-active,
.tab-content.tab-content-cook-active,
.tab-content.tab-content-move-active,
.tab-content.tab-content-party-active {
  padding: 10px 14px;
}

/* 角色移动合并一体化卡片与地图视口样式 */
.move-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.move-unified-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 12px 16px;
  gap: 10px;
}

.move-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.move-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  flex-shrink: 0;
}

.move-coords-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  flex-shrink: 0;
}

.move-progress-bar-wrap {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  flex-shrink: 0;
}

.move-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.move-map-viewport {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: #07131e;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  user-select: none;
}

/* 通用按钮与卡片 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-tertiary);
  color: #fff;
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn-primary {
  background: var(--accent-color);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-success {
  background: var(--success-color);
}

.btn-success:hover {
  filter: brightness(1.1);
}

.btn-danger {
  background: var(--danger-color);
}

.btn-warning {
  background: #f59e0b;
  color: #0f172a;
  border-color: #d97706;
}

.btn-warning:hover {
  background: #d97706;
  color: #fff;
}

/* 按钮禁用统一样式：彻底置灰并半透明，禁用一切指针交互与高亮 */
button:disabled,
.btn:disabled,
.btn[disabled],
.subtab-btn:disabled,
select:disabled,
input:disabled {
  opacity: 0.32 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(90%) !important;
  box-shadow: none !important;
  transform: none !important;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 栅格布局 */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

/* 拖拽上传框 */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(30, 41, 59, 0.4);
}

.upload-dropzone:hover {
  border-color: var(--accent-color);
  background: rgba(59, 130, 246, 0.05);
}

/* 3D 渲染视图容器 */
.three-canvas-container {
  width: 100%;
  height: 520px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

/* ==================== 表单与输入框通用统一规范 ==================== */
.input-control,
.form-control,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="search"],
select,
textarea {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary) !important;
  color: var(--text-main, #f8fafc) !important;
  border: 1px solid var(--border-color);
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  outline: none;
}

.form-control {
  display: block;
  width: 100%;
}

.input-control:hover,
.form-control:hover,
input[type="text"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="email"]:hover,
input[type="search"]:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.input-control:focus,
.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: var(--accent-color) !important;
  background-color: var(--bg-tertiary) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

/* 紧凑型下拉框与输入框规范 (彻底解决小尺寸 select/input 文字被上下挤压裁切截断问题) */
.table-select,
select.table-select {
  height: 28px !important;
  line-height: 26px !important;
  padding: 0 20px 0 8px !important;
  font-size: 0.82rem !important;
  border-radius: var(--radius-sm) !important;
  background-color: var(--bg-tertiary) !important;
  color: var(--text-main, #f8fafc) !important;
  border: 1px solid var(--border-color) !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  cursor: pointer;
  outline: none !important;
}

.table-select:focus,
select.table-select:focus {
  border-color: var(--accent-color) !important;
}

.input-control-sm {
  height: 28px !important;
  line-height: 26px !important;
  padding: 0 8px !important;
  font-size: 0.82rem !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

/* 统一输入框占位符颜色 */
.input-control::placeholder,
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-muted, #94a3b8) !important;
  opacity: 0.65;
}

/* 修复 Chrome / Edge 等浏览器密码与账号自动填充 (autofill) 导致输入框背景变白/黄的问题 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-tertiary) inset !important;
  -webkit-text-fill-color: var(--text-main, #f8fafc) !important;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: var(--text-main, #f8fafc);
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm);
}

input:-webkit-autofill:focus {
  border-color: var(--accent-color) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-tertiary) inset, 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

/* 数据表格通用样式 */
.data-table-container {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  color: var(--text-main);
}

.data-table tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning-color); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger-color); }
.badge-info { background: rgba(59, 130, 246, 0.2); color: var(--accent-color); }

/* 房间聊天发言人信息：标签作为辅助信息，真实昵称单独突出显示。 */
.room-chat-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.room-chat-meta-group {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
}
.room-chat-meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 0.69rem;
  line-height: 1.15;
  font-weight: 650;
  white-space: nowrap;
}
.room-chat-meta-stranger { background: rgba(245, 158, 11, 0.14); color: #fbbf24; border-color: rgba(245, 158, 11, 0.42); }
.room-chat-meta-friend { background: rgba(16, 185, 129, 0.14); color: #34d399; border-color: rgba(16, 185, 129, 0.42); }
.room-chat-meta-self { background: rgba(56, 189, 248, 0.14); color: #67e8f9; border-color: rgba(56, 189, 248, 0.4); }
.room-chat-meta-level { background: rgba(168, 85, 247, 0.16); color: #d8b4fe; border-color: rgba(168, 85, 247, 0.42); }
.room-chat-meta-house { background: rgba(59, 130, 246, 0.14); color: #93c5fd; border-color: rgba(59, 130, 246, 0.4); }
.room-chat-meta-title { background: rgba(234, 179, 8, 0.13); color: #fde68a; border-color: rgba(234, 179, 8, 0.36); }
.room-chat-sender-name {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  margin-right: 2px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fbbf24;
  font-size: 1rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}
.room-chat-friend-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #facc15;
  font-size: 0.9rem;
  line-height: 1;
}
.room-chat-self-icon { color: #67e8f9; }
.room-chat-stranger-icon { color: #64748b; font-size: 1.2rem; }
.room-chat-level-text,
.room-chat-title-text,
.room-chat-house-text {
  color: #cbd5e1;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
}
.room-chat-level-text { color: #d8b4fe; font-weight: 700; }
.room-chat-title-text { color: #94a3b8; }
.room-chat-house-text { color: #93c5fd; }
.room-chat-sender-id {
  color: #94a3b8;
  font-size: 0.7rem;
  line-height: 1.2;
  white-space: nowrap;
}
.room-chat-message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: #64748b;
  font-size: 0.72rem;
}
@media (max-width: 720px) {
  .room-chat-message-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .room-chat-message-actions { width: 100%; justify-content: flex-end; }
}

/* ==========================================================================
   背包与物品管理 Tab 专属自适应布局（消除外部滚动条与双滚动条）
   ========================================================================== */
.bag-tab-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.bag-tab-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  margin-bottom: 0 !important;
  padding: 14px 18px;
  gap: 10px;
  overflow: hidden;
}

.bag-tab-header,
.bag-tab-toolbar,
.bag-tab-summary,
.bag-tab-pagination {
  flex-shrink: 0;
}

.bag-table-wrapper {
  flex: 1;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  position: relative;
}

.bag-table-wrapper .data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.bag-table-wrapper thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

/* 物品类型专属彩色标签 */
.badge-type-furniture { background: rgba(168, 85, 247, 0.16); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.badge-type-costume   { background: rgba(236, 72, 153, 0.16); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.35); }
.badge-type-cooking   { background: rgba(249, 115, 22, 0.16); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.35); }
.badge-type-food      { background: rgba(234, 179, 8, 0.16); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.35); }
.badge-type-fish      { background: rgba(6, 182, 212, 0.16); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.35); }
.badge-type-insect    { background: rgba(34, 197, 94, 0.16); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.badge-type-bird      { background: rgba(99, 102, 241, 0.16); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.35); }
.badge-type-plant     { background: rgba(16, 185, 129, 0.16); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-type-material  { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.35); }
.badge-type-prop      { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-type-easel     { background: rgba(217, 70, 239, 0.16); color: #e879f9; border: 1px solid rgba(217, 70, 239, 0.35); }
.badge-type-collect   { background: rgba(20, 184, 166, 0.16); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.35); }
.badge-type-vehicle   { background: rgba(59, 130, 246, 0.16); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.badge-type-blueprint { background: rgba(56, 189, 248, 0.16); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.badge-type-pet       { background: rgba(244, 114, 182, 0.16); color: #f472b6; border: 1px solid rgba(244, 114, 182, 0.35); }
.badge-type-other     { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.25); }

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ==========================================================================
   CropEditor & 图片替换 1:1 复刻专属样式
   ========================================================================== */
.replace-tab-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  gap: 10px;
}

.replace-header-card {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.replace-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-replace-start {
  font-weight: 600;
  padding: 8px 20px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-replace-start:hover:not(:disabled) {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.replace-status-bar {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-message {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quota-error-alert {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 500;
}

.quota-error-alert.quota-ok {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* 主编辑器布局 */
.crop-editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 0 !important;
  padding: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

.crop-editor-layout {
  flex: 1;
  display: flex;
  gap: 12px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

/* 左侧工作主列：图片编辑框在上方，已选图片列表与实时输出预览在下方 */
.crop-main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow: hidden;
}

/* 画布交互视口 */
.canvas-viewport {
  flex: 1;
  min-width: 0;
  min-height: 350px;
  height: 100%;
  background: #202020;
  border: 1px solid #475569;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
}

#cropCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-floating-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  z-index: 10;
}

.canvas-layer-badge {
  font-size: 0.75rem;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

.zoom-text {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  min-width: 36px;
  text-align: center;
}

.canvas-empty-tip {
  position: absolute;
  text-align: center;
  color: #cbd5e1;
  pointer-events: none;
}

/* 右侧控制面板 (独占一列，自顶向下，禁止横向滚动条) */
.crop-controls-sidebar {
  width: 390px;
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden; /* 彻底杜绝横向滚动条 */
  padding-right: 6px;
  box-sizing: border-box;
}

.crop-controls-sidebar::-webkit-scrollbar {
  width: 6px;
}

.crop-controls-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.crop-controls-sidebar::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.crop-controls-sidebar::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.control-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--bg-tertiary);
  margin: 0;
  min-width: 0; /* 修复原生 fieldset 默认 min-width: min-content 撑宽容器的 bug */
  box-sizing: border-box;
  width: 100%;
}

.control-box legend {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 0 6px;
}

/* 选项列按钮专属立体与交互样式 - 极强可辨识度 */
.crop-controls-sidebar .btn,
.crop-controls-sidebar .btn-sm,
.crop-controls-sidebar .btn-xs {
  background: linear-gradient(180deg, #2a374a 0%, #1c2635 100%);
  border: 1px solid #4a5c78;
  color: #f1f5f9;
  font-weight: 500;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.15s ease;
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
}

.crop-controls-sidebar .btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.crop-controls-sidebar .btn-xs {
  padding: 3px 8px;
  font-size: 0.75rem;
  line-height: 1.4;
}

.crop-controls-sidebar .btn:hover:not(:disabled),
.crop-controls-sidebar .btn-sm:hover:not(:disabled),
.crop-controls-sidebar .btn-xs:hover:not(:disabled) {
  background: linear-gradient(180deg, #384961 0%, #243144 100%);
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 6px rgba(96, 165, 250, 0.35);
}

.crop-controls-sidebar .btn:active:not(:disabled),
.crop-controls-sidebar .btn-sm:active:not(:disabled),
.crop-controls-sidebar .btn-xs:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  background: #17212e;
  border-color: #3b82f6;
}

.crop-controls-sidebar .btn:disabled,
.crop-controls-sidebar .btn-sm:disabled,
.crop-controls-sidebar .btn-xs:disabled {
  opacity: 0.35 !important;
  background: #18202c !important;
  border-color: #2e3a4e !important;
  color: #64748b !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.crop-controls-sidebar .radio-label,
.crop-controls-sidebar .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.crop-controls-sidebar .radio-label input,
.crop-controls-sidebar .checkbox-label input {
  accent-color: var(--accent-color);
  cursor: pointer;
}

.ratio-options-row {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  flex-wrap: wrap;
  width: 100%;
}

.control-btn-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.options-inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  flex-wrap: wrap;
  width: 100%;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  width: 100%;
  min-width: 0;
}

.slider-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 28px;
  flex-shrink: 0;
}

.slider-val {
  font-size: 0.8rem;
  color: #f1f5f9;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}


/* 拖动条步进微调按钮 (+ / -) */
.btn-slider-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  border-radius: 4px;
  background: #1e293b;
  border: 1px solid #475569;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

.btn-slider-step:hover:not(:disabled) {
  background: #334155;
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.35);
}

.btn-slider-step:active:not(:disabled) {
  transform: scale(0.92);
  background: #0284c7;
  color: #ffffff;
}

.btn-slider-step:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #334155;
}

.range-slider {
  flex: 1;
  min-width: 60px;
  accent-color: var(--accent-color);
  height: 4px;
  border-radius: 2px;
  background: #334155;
  cursor: pointer;
}

.crosshair-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  flex-wrap: wrap;
  width: 100%;
}

.crosshair-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.cross-img-label {
  color: #D8D8D8;
}

.cross-crop-label {
  color: #28d7ff;
}

.hint-muted {
  font-size: 0.75rem;
  color: #64748b;
}

.fit-target-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
  flex-wrap: wrap;
  width: 100%;
}

.color-picker-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #4a5c78;
  cursor: pointer;
  flex-shrink: 0;
}

.color-swatch-input {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 40px;
  height: 40px;
  border: none;
  cursor: pointer;
}

.btn-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
}

.btn-xs:hover {
  background: #334155;
}

/* 底部区域：缩略图列表与实时输出预览 (在左侧主列下方) */
.crop-bottom-layout {
  display: flex;
  gap: 10px;
  margin-top: 0;
  min-height: 142px;
  height: auto;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

.thumb-strip-box {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.strip-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.thumb-strip-scroll {
  flex: 1;
  min-height: 76px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: center;
  padding: 2px 4px 6px 4px;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  user-select: none;
  -webkit-user-select: none;
}

.strip-empty-placeholder {
  color: #64748b;
  font-size: 0.85rem;
  margin: auto;
}

/* 分组行：水平排布各个分组，无卡片外边框，释放垂直空间 */
.thumb-groups-row {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 100%;
  min-width: max-content;
}

/* 分组结构：左侧竖向标题栏 + 右侧横排缩略图，无外部边框 */
.thumb-group-section {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 2px 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* 组与组之间保留轻柔的分隔虚线 */
.thumb-group-section.not-first-group {
  border-left: 1px dashed rgba(255, 255, 255, 0.14);
  padding-left: 10px;
}

/* 拖拽悬停至该组时的高亮微光背景 */
.thumb-group-section.drag-over-group {
  background: rgba(56, 189, 248, 0.08);
}

/* 竖向标题栏：完全不占用上下高度，与 1:1 缩略图等高 */
.thumb-group-vertical-bar {
  width: 25px;
  height: 70px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  box-sizing: border-box;
  flex-shrink: 0;
  user-select: none;
  cursor: default;
  transition: all 0.15s ease;
}

.thumb-group-vertical-bar:hover {
  filter: brightness(1.15);
}

/* 各类型专属配色 */
.thumb-group-vertical-bar.bar-avatar {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.thumb-group-vertical-bar.bar-home {
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c084fc;
}

.thumb-group-vertical-bar.bar-custom_16_9 {
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: #60a5fa;
}

.vbar-icon {
  font-size: 0.72rem;
  line-height: 1;
}

.vbar-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  line-height: 1;
}

.vbar-badge {
  min-width: 17px;
  height: 17px;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 17px;
  padding: 0 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.bar-avatar .vbar-badge.has-items {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.bar-home .vbar-badge.has-items {
  background: #8b5cf6 !important;
  color: #ffffff !important;
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.bar-custom_16_9 .vbar-badge.has-items {
  background: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.thumb-group-items-row {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 100%;
}

/* 该分组无图片时的空插槽：固定 1:1，与卡片同为 70x70 */
.thumb-group-empty-slot {
  width: 70px;
  height: 70px;
  aspect-ratio: 1 / 1;
  border: 1.5px dashed #475569;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.68rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.15s;
  user-select: none;
  box-sizing: border-box;
  flex-shrink: 0;
}

.thumb-group-empty-slot:hover,
.thumb-group-empty-slot.drop-active {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.empty-slot-plus {
  font-size: 1.2rem;
  line-height: 1;
  margin-bottom: 2px;
}

.empty-slot-text {
  font-size: 0.65rem;
}

/* 缩略图卡片：固定 1:1 正方形框展示，尺寸由 58px 增大至 70px */
.thumb-item-card {
  width: 70px;
  height: 70px;
  min-width: 70px;
  max-width: 70px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 6px;
  border: 2px solid #334155;
  background: #141416;
  position: relative;
  cursor: grab;
  overflow: hidden;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s, opacity 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-sizing: border-box;
}

.thumb-item-card:hover {
  border-color: #64748b;
  transform: translateY(-1px);
}

.thumb-item-card:active {
  cursor: grabbing;
}

.thumb-item-card.active {
  border-color: #ffcc33;
  box-shadow: 0 0 10px rgba(255, 204, 51, 0.45);
}

.thumb-item-card.is-dragging {
  opacity: 0.35;
  transform: scale(0.95);
  border-style: dashed;
}

/* 拖拽插入提示线 */
.thumb-item-card.drag-over-before {
  box-shadow: -4px 0 0 0 #ffcc33, 0 0 8px rgba(255, 204, 51, 0.4);
}

.thumb-item-card.drag-over-after {
  box-shadow: 4px 0 0 0 #ffcc33, 0 0 8px rgba(255, 204, 51, 0.4);
}

/* 核心：1:1 容器内图片完整展示，不截断任何像素 */
.thumb-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.thumb-index-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.75);
  color: #f1f5f9;
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1.3;
  pointer-events: none;
}



/* 顶部裁剪比例快捷更改按钮组 */
.btn-group-profile {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.btn-profile-quick {
  font-size: 0.73rem !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  transition: all 0.15s ease !important;
  cursor: pointer;
  white-space: nowrap;
}

.btn-profile-avatar {
  background: rgba(16, 185, 129, 0.15) !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  color: #34d399 !important;
}

.btn-profile-avatar:hover:not(:disabled) {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45) !important;
}

.btn-profile-home {
  background: rgba(139, 92, 246, 0.15) !important;
  border: 1px solid rgba(139, 92, 246, 0.45) !important;
  color: #c084fc !important;
}

.btn-profile-home:hover:not(:disabled) {
  background: #8b5cf6 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.45) !important;
}

.btn-profile-169 {
  background: rgba(59, 130, 246, 0.15) !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  color: #60a5fa !important;
}

.btn-profile-169:hover:not(:disabled) {
  background: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.45) !important;
}

/* 批量多选状态指示胶囊 */
.multi-select-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.multi-select-pill b {
  color: #ffffff;
  font-weight: 700;
}

.btn-clear-sel {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.btn-clear-sel:hover {
  color: #f87171;
}

/* 缩略图左上角多选复选框 */
.thumb-check-box {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0.4;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, transform 0.1s;
}

.thumb-item-card:hover .thumb-check-box,
.thumb-check-box.checked {
  opacity: 1;
}

.thumb-check-box:hover {
  transform: scale(1.15);
  border-color: #38bdf8;
}

.thumb-check-box.checked {
  background: #0284c7;
  border-color: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.thumb-check-box .check-icon {
  font-size: 0.62rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

/* 选中高亮状态 */
.thumb-item-card.is-selected {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5) !important;
}

/* 拖拽跟随浮层批量徽标 */
.ghost-multi-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  border: 2px solid #ffffff;
  z-index: 10001;
}

/* 移动端触摸拖拽跟随浮层 */
.thumb-touch-ghost {
  position: fixed;
  width: 70px;
  height: 70px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 2px solid #ffcc33;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65), 0 0 12px rgba(255, 204, 51, 0.5);
  background: #141416;
  pointer-events: none;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  transform: scale(1.08);
  transition: transform 0.05s ease;
}

.thumb-touch-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}


.thumb-filename {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.75);
  color: #f1f5f9;
  padding: 1px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-tag {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 0.65rem;
  font-weight: 500;
  background: rgba(37, 99, 235, 0.85);
  color: #fff;
  padding: 0 4px;
  border-radius: 3px;
  line-height: 1.4;
  letter-spacing: 0.2px;
}

.thumb-tag-avatar {
  background: rgba(16, 185, 129, 0.88) !important;
}

.thumb-tag-home {
  background: rgba(139, 92, 246, 0.88) !important;
}

.thumb-tag-custom_16_9 {
  background: rgba(37, 99, 235, 0.88) !important;
}

.strip-info-row {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.strip-info-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* 实时输出预览框 (140x140) */
.output-preview-box {
  width: 130px;
  height: auto;
  align-self: stretch;
  min-height: 142px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
}

.preview-title {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 2px;
}

.preview-canvas-wrap {
  width: 80px;
  height: 80px;
  background: #202020;
  border: 1px solid #334155;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.preview-empty {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: #64748b;
  pointer-events: none;
  z-index: 2;
  user-select: none;
}

.preview-meta-text {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 2px;
  text-align: center;
  line-height: 1.1;
}

/* 相框弹窗 */
.frame-picker-dialog {
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.frame-upload-banner {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
}

.frame-card {
  padding: 8px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.frame-card:hover {
  border-color: #64748b;
}

.frame-card.selected {
  border-color: var(--accent-color);
  background: rgba(59, 130, 246, 0.15);
}

.frame-preview-box {
  width: 80px;
  height: 80px;
  margin: 0 auto 6px;
  background: #202020;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.frame-thumb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.frame-name {
  font-size: 0.75rem;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 弹窗通用基础 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
}

.modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-close:hover {
  color: #fff;
}

/* ---------------- 认证与关键数据面板定制样式 ---------------- */
.subtab-bar {
  display: flex;
  gap: 6px;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.subtab-btn {
  flex: 1;
  text-align: center;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.subtab-btn:hover {
  color: #fff;
}

.subtab-btn.active {
  background: var(--accent-color);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   TapTap 登录页面与应用内登录内嵌适配优化
   ========================================================================== */

.auth-tab-grid {
  display: grid;
  grid-template-columns: minmax(470px, 1fr) 1fr;
  gap: 18px;
}

@media (max-width: 1080px) {
  /* PC模式窄屏下：若视口不足以并排容纳左侧 >=470px 登录卡片与右侧游戏卡片，则自动转为单列，确保登录卡片获得充足宽度 */
  .auth-tab-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

@media (min-width: 861px) {
  /* PC模式窄屏下：强力锁定内嵌 TapTap 官方登录页的宽度不能小于 470px，即使在极窄视口下也通过横向滑动保持 470px，杜绝二维码错乱 */
  .auth-tab-left-card {
    min-width: 470px;
  }
  .inapp-login-iframe-wrapper {
    overflow-x: auto !important;
  }
  .inapp-login-iframe {
    min-width: 470px !important;
  }
}

.inapp-box {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.inapp-live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.data-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 12px;
}

.data-cell {
  display: flex;
  align-items: baseline;
  font-size: 0.84rem;
  line-height: 1.4;
  background: rgba(15, 23, 42, 0.4);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(51, 65, 85, 0.4);
}

.data-key {
  width: 76px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.82rem;
}

.data-val {
  flex: 1;
  color: var(--text-main);
  word-break: break-all;
}

/* 全局 Toast 通知样式 */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 280px;
  max-width: 460px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  animation: toastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

.toast-item.toast-success {
  background: rgba(16, 185, 129, 0.95);
  border-color: rgba(5, 150, 105, 0.8);
}

.toast-item.toast-error {
  background: rgba(239, 68, 68, 0.95);
  border-color: rgba(220, 38, 38, 0.8);
}

.toast-item.toast-warning {
  background: rgba(245, 158, 11, 0.95);
  border-color: rgba(217, 119, 6, 0.8);
  color: #1e1e1e;
}

.toast-item.toast-info {
  background: rgba(59, 130, 246, 0.95);
  border-color: rgba(37, 99, 235, 0.8);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast-fade-enter-active,
.toast-fade-leave-active {
  transition: all 0.25s ease;
}
.toast-fade-enter-from,
.toast-fade-leave-to {
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
}

/* 全局自定义弹窗（确认与输入，替代系统 confirm/prompt） */

/* 全局置顶自定义确认与输入弹窗（层级最高，永不被其他任何业务弹窗覆盖） */
.global-dialog-backdrop {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.78);
  backdrop-filter: blur(5px);
  z-index: 200000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.18s ease;
}

.secondary-dialog-backdrop {
  z-index: 15000 !important;
  background: rgba(8, 12, 20, 0.78);
}

.custom-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.72);
  backdrop-filter: blur(4px);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.18s ease;
}

.custom-modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 440px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   3. 主页 / 头像 / 收藏 Tab 1:1 专属复刻样式
   ========================================================================== */
.media-tab-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

/* 上半部分：左右等宽并排 */
.media-top-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 1080px) {
  .media-top-split {
    grid-template-columns: 1fr;
  }
}

.media-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.media-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.media-toolbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-toolbar-title-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.badge-subtle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.media-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.media-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ---------------- 头像管理专属游戏卡片 (1:1 原版奶油暖色) ---------------- */
/* ---------------- 头像管理专属游戏卡片 (1:1 像素级复刻) ---------------- */
.avatar-card {
  min-height: 480px;
}

.game-avatar-stage {
  padding-top: 18px; /* 给悬浮胶囊预留空间 */
  display: flex;
  flex: 1;
}

.game-avatar-dialog {
  background: #ffffff; /* 截图纯白大圆角卡片 */
  border: 1.5px solid #ede5d8;
  border-radius: 36px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 34px 24px 26px 24px;
}

/* 顶部居中半悬浮装饰胶囊 ★ 编辑头像 ★ */
.dialog-capsule-title {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: #faeedb; /* 温暖浅杏黄色 */
  border: 4px solid #ffffff; /* 粗实心纯白边框 */
  border-radius: 999px;
  padding: 5px 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(160, 130, 100, 0.18);
  z-index: 10;
}

.dialog-capsule-title .star-deco {
  color: #ffffff;
  font-size: 1.15rem;
}

.dialog-capsule-title .capsule-text {
  color: #9a785d; /* 截图原版暖棕大字 */
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 3px;
}

/* 右上角半悬浮关闭按钮 ✕ */
.dialog-close-round {
  position: absolute;
  top: -16px;
  right: -10px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #faeedb;
  border: 4px solid #ffffff; /* 粗实心纯白边框 */
  color: #9a785d;
  font-size: 1.35rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(160, 130, 100, 0.22);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.dialog-close-round:hover {
  transform: scale(1.12);
  background: #faeedb;
}

/* 主体左右布局 */
.dialog-body-split {
  display: flex;
  gap: 22px;
  flex: 1;
  align-items: center;
}

@media (max-width: 640px) {
  .dialog-body-split {
    flex-direction: column;
  }
}

/* 左侧：暖米黄色圆角大底板（固定尺寸与比例） */
.dialog-grid-plate {
  flex: 1.25;
  background: #faeedb; /* 暖米黄色圆角大底板 */
  border-radius: 28px;
  padding: 24px 18px;
  box-shadow: inset 0 2px 8px rgba(180, 150, 120, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.dialog-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 20px 14px;
  width: 100%;
  justify-items: center;
  align-items: center;
}

.grid-cell {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-cell:hover {
  transform: scale(1.06);
}

.grid-cell.selected {
  transform: scale(1.06);
}

.circle-avatar-thumb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3.5px solid #ffffff; /* 截图中厚实纯白边框 */
  position: relative;
  background: #f2ede4;
  box-shadow: 0 4px 10px rgba(140, 110, 90, 0.18);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 选中项：纯白内圈 + 亮金黄色粗光环（1:1 复刻真机效果） */
.grid-cell.selected .circle-avatar-thumb {
  border: 3px solid #ffffff !important;
  box-shadow: 0 0 0 4.5px #f6c443, 0 6px 14px rgba(246, 196, 67, 0.35) !important;
}

.avatar-img-round {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 空槽位占位圆圈 */
.circle-empty-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.14);
}

/* 槽位 0 的加号按钮 */
.circle-btn-add {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3.5px solid #ffffff;
  background: #c3ab96; /* 灰驼色内底 */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(140, 110, 90, 0.18);
  transition: all 0.2s;
}

.cell-add:hover .circle-btn-add {
  background: #b59b84;
  transform: scale(1.05);
}

.circle-btn-add .plus-sign {
  font-size: 2.2rem;
  color: #ffffff;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 2px;
}

/* 右侧大图预览区域 */
.dialog-preview-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.preview-avatar-circle-wrap {
  position: relative;
  width: 184px;
  height: 184px;
}

.preview-avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid #ffffff; /* 截图中粗白外环 */
  box-shadow: 0 12px 32px rgba(160, 130, 100, 0.24);
  overflow: hidden;
  position: relative;
  background: #f5efe4;
}

.preview-avatar-circle.circle-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #baa999;
  font-size: 1.15rem;
  font-weight: bold;
}

.preview-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 大头像右下角悬浮下载圆钮（独立完整正圆，浮在头像上层，绝不被父级圆弧裁剪） */
.btn-download-round {
  position: absolute;
  right: -4px;
  bottom: 8px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fde0c1; /* 截图原版米桃色 */
  color: #8c715b; /* 棕色 */
  border: 3.5px solid #ffffff;
  box-shadow: 0 4px 14px rgba(160, 130, 100, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-download-round:hover {
  transform: scale(1.12);
  background: #ffffff;
}

/* 操作区域：正在使用 / 胶囊按钮 */
.preview-status-area {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.status-in-use {
  font-size: 1.3rem;
  font-weight: 800;
  color: #867a70; /* 截图原版正在使用字样 */
  letter-spacing: 1.5px;
}

.status-not-selected {
  font-size: 1.15rem;
  font-weight: bold;
  color: #baa999;
}

.action-capsule-group {
  display: flex;
  gap: 14px;
}

.btn-game-capsule {
  padding: 8px 28px;
  border-radius: 999px;
  font-weight: bold;
  font-size: 1rem;
  letter-spacing: 4px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: all 0.2s;
  padding-left: 30px;
}

.btn-game-capsule.btn-change {
  background: #36cfc9;
  color: #ffffff;
}

.btn-game-capsule.btn-change:hover {
  background: #2cb5b0;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(54, 207, 201, 0.45);
}

.btn-game-capsule.btn-delete {
  background: #ff6d75;
  color: #ffffff;
}

.btn-game-capsule.btn-delete:hover {
  background: #f0525b;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 109, 117, 0.45);
}

/* ---------------- 主页照片 / 名片专属样式 ---------------- */
.background-card {
  min-height: 480px;
}

.profile-card-viewport {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: #faf7f3; /* 温暖米白淡奶油色底板 */
  border: 1px solid #ede5d8;
  border-radius: 28px;
  padding: 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.profile-card-image-wrapper {
  width: 100%;
  max-width: 580px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 0;
}

.profile-card-img {
  width: 100%;
  height: auto;
  cursor: pointer;
  transition: transform 0.2s;
  filter: drop-shadow(0 10px 24px rgba(130, 110, 150, 0.25));
}

.profile-card-img:hover {
  transform: scale(1.015);
}

.profile-card-adjust-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  background: #ffffff;
  border: 1px solid #ede5d8;
  padding: 8px 14px;
  border-radius: 14px;
  margin-top: 12px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 2px 8px rgba(180, 160, 140, 0.1);
}

.adjust-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.adjust-label {
  font-size: 0.85rem;
  color: #8c82a0;
  font-weight: 500;
}

.adjust-input {
  width: 72px;
  padding: 4px 6px;
  font-size: 0.85rem;
  text-align: center;
  background: #f8f6f2 !important;
  color: #4b3e34 !important;
  border: 1px solid #dfd7cc !important;
}

/* ---------------- 收藏画廊相册专属样式 ---------------- */
.favourites-card {
  min-height: 380px;
}

.favourite-gallery-container {
  min-height: 240px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gallery-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  padding: 32px 0;
  color: var(--text-muted);
}

.gallery-empty-state .empty-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
  opacity: 0.6;
}

.gallery-empty-state .empty-text {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.gallery-empty-state .empty-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.favourite-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1100px) {
  .favourite-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 780px) {
  .favourite-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fav-photo-card {
  background: var(--bg-tertiary);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.fav-photo-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.fav-photo-card.selected {
  border-color: #f6c443;
  background: rgba(246, 196, 67, 0.12);
  box-shadow: 0 4px 14px rgba(246, 196, 67, 0.2);
}

.fav-img-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.fav-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fav-check-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #f6c443;
  color: #141b2b;
  font-size: 0.75rem;
  font-weight: bold;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.fav-zoom-btn {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.fav-photo-card:hover .fav-zoom-btn {
  opacity: 1;
}

.fav-photo-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 0 2px;
}

.fav-index-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.fav-photo-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* 翻页控制条 */
.favourite-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 4px;
}

.fav-total-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fav-selected-text {
  font-size: 0.85rem;
  color: #f6c443;
  font-weight: 500;
}

.pagination-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  min-width: 48px;
  text-align: center;
}

/* 模态框扩展 */
.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 90vw;
}

.pick-fav-modal {
  width: 720px;
  max-height: 80vh;
}

.image-preview-modal {
  width: 900px;
}

.custom-modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.custom-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}

.custom-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pick-fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.pick-fav-item {
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  padding: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.pick-fav-item:hover {
  border-color: var(--accent-color);
}

.pick-fav-item.active {
  border-color: #f6c443;
  background: rgba(246, 196, 67, 0.15);
}

.pick-fav-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.pick-fav-id {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
  text-align: center;
}

/* ==================== 顶部 Banner 用户操作栏与 RBAC 权限控制 ==================== */
.header-user-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.86rem;
  transition: all 0.2s;
}

.header-user-profile:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.user-avatar-icon {
  font-size: 1rem;
  line-height: 1;
}

.user-name-text {
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.2px;
}

.user-role-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-weight: 500;
}

.user-role-tag.role-admin {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.user-role-tag.role-operator {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}

.user-role-tag.role-user {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-btn {
  font-size: 0.82rem;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.login-backdrop {
  backdrop-filter: blur(8px);
  background: rgba(15, 23, 42, 0.75);
}

.system-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tab-perm-card {
  transition: all 0.15s ease;
}

.tab-perm-card:hover {
  transform: translateY(-1px);
}

/* ==========================================================================
   拼画板 (Easel Grid) 1:1 复刻专属样式
   ========================================================================== */
.easel-tab-container {
  display: flex;
  height: 100%;
  min-height: 0;
  gap: 16px;
  overflow: hidden;
}

.easel-left-card {
  width: 410px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.easel-left-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.easel-left-footer {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.easel-right-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.easel-target-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  border: 1px solid var(--border-color);
}

.easel-target-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 0.83rem;
  font-weight: 500;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.easel-target-btn.active {
  background: var(--accent-color);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.easel-inventory-box {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.easel-inventory-box.box-danger {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.easel-inventory-box.box-success {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
}

.easel-preset-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.easel-preset-btn {
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.easel-preset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
}

.easel-preset-btn.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: var(--accent-color);
  color: #60a5fa;
}

.easel-stat-card {
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.83rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.easel-right-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.easel-tab-nav {
  display: flex;
  gap: 6px;
}

.easel-nav-btn {
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.easel-nav-btn.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--accent-color);
  color: #60a5fa;
  font-weight: 600;
}

.easel-canvas-container {
  flex: 1;
  position: relative;
  background: #090d16;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.easel-canvas-tip {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
  z-index: 10;
  background: rgba(15, 23, 42, 0.7);
  padding: 3px 8px;
  border-radius: 4px;
}

/* ==========================================================================
   画画服务 (Drawing) 1:1 复刻专属样式
   ========================================================================== */
.drawing-library-category {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
}

.drawing-library-category.active {
  background: var(--accent-color);
  color: #fff;
}

.drawing-tab-container {
  display: flex;
  height: 100%;
  min-height: 0;
  gap: 16px;
  overflow: hidden;
}

.drawing-library {
  flex: 1;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  overflow: hidden;
}

.drawing-library-header,
.drawing-library-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.drawing-library-header h3 { margin: 0 0 5px; font-size: 1rem; }
.drawing-library-header p,
.drawing-artwork-dialog .modal-header p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drawing-library-header .spinner { width: 12px; height: 12px; }
.drawing-library-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.drawing-library-category { display: flex; align-items: center; gap: 8px; }
.drawing-library-count { padding: 1px 6px; border-radius: 10px; background: rgba(127, 127, 127, 0.15); font-size: 0.75rem; }
.drawing-library-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
/* 画布动画 */
.drawing-animation { --drawing-animation-controls-width: 340px; display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-secondary); overflow: hidden; }
.drawing-animation-header { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border-color); }
.drawing-animation-header h3 { margin: 0 0 6px; font-size: 1rem; }
.drawing-animation-header p { margin: 0; color: var(--text-muted); font-size: .82rem; }
.drawing-animation-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 12px; padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.drawing-animation-board label, .drawing-animation-settings label { display: flex; min-width: 0; flex-direction: column; gap: 6px; font-size: .8rem; }
.drawing-animation-board > label:first-child, .drawing-animation-board-select { grid-column: 1 / -1; }
.drawing-animation-board-select { min-width: 0 !important; }
.drawing-animation-board .input-control { width: 100%; margin: 0; }
.drawing-animation-distance { min-width: 0; }
.drawing-animation-board > .btn { justify-content: center; }
.drawing-animation-board-hint { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: .78rem; line-height: 1.6; }
.drawing-animation-error { margin: 0 0 16px; padding: 12px; border-radius: 6px; background: rgba(239, 68, 68, .1); color: #ef7373; font-size: .83rem; overflow-wrap: anywhere; }
.drawing-animation-layout { display: grid; grid-template-columns: minmax(290px, var(--drawing-animation-controls-width)) minmax(0, 1fr); flex: 1; min-height: 0; overflow: hidden; }
.drawing-animation-controls { min-width: 0; min-height: 0; padding: 16px; border-right: 1px solid var(--border-color); overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.drawing-animation-picker, .drawing-animation-playlist { min-width: 0; }
.drawing-animation-picker { display: flex; flex-direction: column; min-height: 0; padding: 16px; overflow: hidden; }
.drawing-animation-playlist { border-top: 1px solid var(--border-color); padding-top: 16px; margin-top: 16px; }
.drawing-animation-panel-heading { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.drawing-animation-panel-heading h4 { margin: 0; font-size: .92rem; }
.drawing-animation-panel-heading h4 small { color: var(--text-muted); font-size: .75rem; margin-left: 6px; font-weight: normal; }
.drawing-animation-panel-heading > span { font-size: .75rem; color: var(--text-muted); }
.drawing-animation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); grid-auto-rows: max-content; align-content: start; flex: 1; min-height: 0; gap: 12px; overflow-y: auto; padding: 2px; scrollbar-gutter: stable; overscroll-behavior: contain; }
.drawing-animation-pick { min-width: 0; padding: 0 0 10px; background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.drawing-animation-pick:hover, .drawing-animation-pick:focus-visible { border-color: var(--accent-color); }
.drawing-animation-pick.selected { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color); }
.drawing-animation-pick:disabled { cursor: default; }
.drawing-animation-pick-image { position: relative; width: 100%; aspect-ratio: 1; padding: 10px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(rgba(127,127,127,.10) 0% 25%, rgba(127,127,127,.04) 0% 50%) 50% / 16px 16px; }
.drawing-animation-pick-image img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; }
.drawing-animation-pick-badge { position: absolute; top: 7px; right: 7px; min-width: 24px; height: 24px; box-sizing: border-box; padding: 0 4px; display: grid; place-items: center; border-radius: 6px; background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border-color); font-size: .75rem; }
.drawing-animation-pick.selected .drawing-animation-pick-badge { color: white; background: var(--accent-color); border-color: var(--accent-color); }
.drawing-animation-pick > strong { display: block; padding: 9px 10px 4px; font-size: .8rem; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.drawing-animation-pick > span { display: block; padding: 0 10px; color: var(--text-muted); font-size: .72rem; }
.drawing-animation-pagination { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: .75rem; color: var(--text-muted); }
.drawing-animation-pagination > div { display: flex; align-items: center; gap: 10px; }
.drawing-animation-queue { list-style: none; padding: 0; margin: 0; }
.drawing-animation-queue li { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border: 1px solid transparent; border-bottom-color: var(--border-color); border-radius: 5px; min-width: 0; }
.drawing-animation-queue li.current { border-color: var(--accent-color); background: rgba(59, 130, 246, .08); }
.drawing-animation-frame-number { min-width: 16px; color: var(--text-muted); font-size: .75rem; text-align: center; }
.drawing-animation-queue li > img, .drawing-animation-frame-placeholder { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; background: var(--bg-primary); border-radius: 4px; image-rendering: pixelated; }
.drawing-animation-frame-placeholder { display: grid; place-items: center; }
.drawing-animation-queue li > strong { flex: 1; min-width: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-size: .78rem; }
.drawing-animation-queue-actions { display: flex; gap: 3px; }
.drawing-animation-queue-actions button { width: 25px; height: 28px; color: var(--text-primary); border: 1px solid var(--border-color); background: var(--bg-primary); border-radius: 4px; cursor: pointer; }
.drawing-animation-queue-actions button:disabled { opacity: .35; cursor: default; }
.drawing-animation-queue-empty { padding: 20px 14px; margin: 0 0 18px; border: 1px dashed var(--border-color); border-radius: 7px; color: var(--text-muted); font-size: .8rem; line-height: 1.8; }
.drawing-animation-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.drawing-animation-settings .input-control { width: 100%; box-sizing: border-box; margin: 0; }
.drawing-animation-cycles { grid-column: 1 / -1; }
.drawing-animation-cycles small { color: var(--text-muted); font-size: .72rem; }
.drawing-animation-speed-hint, .drawing-animation-background-hint, .drawing-animation-start-hint { font-size: .75rem; line-height: 1.7; color: var(--text-muted); margin: 12px 0 0; }
.drawing-animation-footer { display: grid; grid-template-columns: minmax(290px, var(--drawing-animation-controls-width)) minmax(0, 1fr); flex-shrink: 0; border-top: 1px solid var(--border-color); background: var(--bg-secondary); }
.drawing-animation-footer-controls { padding: 12px 16px; border-right: 1px solid var(--border-color); }
.drawing-animation-footer .drawing-animation-start-hint { margin-top: 8px; }
.drawing-animation-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.drawing-animation-actions > .btn { flex: 1; justify-content: center; min-width: 110px; }
.drawing-animation-status { padding: 12px 16px; background: rgba(59, 130, 246, .05); font-size: .82rem; line-height: 1.7; overflow-wrap: anywhere; }
.drawing-animation-status-error { background: rgba(239, 68, 68, .08); }
.drawing-animation-status-error > strong { color: #ef7373; }
.drawing-animation-metrics { display: flex; flex-wrap: wrap; gap: 5px 18px; color: var(--text-muted); font-size: .75rem; margin-top: 4px; }
@media (max-width: 1000px) {
  .drawing-animation { --drawing-animation-controls-width: 300px; }
}
@media (max-width: 760px) {
  .drawing-animation-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, .9fr) minmax(0, 1fr); }
  .drawing-animation-controls { border-right: none; border-bottom: 1px solid var(--border-color); }
  .drawing-animation-footer { grid-template-columns: minmax(0, 1fr); }
  .drawing-animation-status { order: -1; max-height: 88px; overflow-y: auto; font-size: .76rem; }
  .drawing-animation-footer-controls { border-right: none; }
}
@media (max-width: 600px) {
  .drawing-animation-header { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .drawing-animation-controls, .drawing-animation-picker { padding: 12px; }
  .drawing-animation-footer-controls, .drawing-animation-status { padding: 10px 12px; }
  .drawing-animation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .drawing-animation-pagination { justify-content: center; }
  .drawing-animation-queue-actions button { width: 30px; height: 34px; }
}

.drawing-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.drawing-library-grid-multipart { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.drawing-artwork-card { min-width: 0; border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-primary); }
.drawing-artwork-parts { display: grid; gap: 8px; padding: 10px; }
.drawing-artwork-parts-multiple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.drawing-artwork-part { min-width: 0; overflow: hidden; border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.drawing-artwork-part-label { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 7px; font-size: 0.78rem; color: var(--text-main); }
.drawing-artwork-part-label small { color: var(--text-muted); font-size: 0.7rem; white-space: nowrap; }
.drawing-artwork-image,
.drawing-artwork-full-image {
  background-color: var(--bg-tertiary);
  background-image: linear-gradient(45deg, rgba(128,128,128,.16) 25%, transparent 25%), linear-gradient(-45deg, rgba(128,128,128,.16) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(128,128,128,.16) 75%), linear-gradient(-45deg, transparent 75%, rgba(128,128,128,.16) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.drawing-artwork-image { display: flex; width: 100%; aspect-ratio: 4 / 3; padding: 12px; border: 0; cursor: zoom-in; align-items: center; justify-content: center; color: var(--text-muted); }
.drawing-artwork-image:disabled { cursor: default; }
.drawing-artwork-image img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.drawing-artwork-placeholder { display: flex; align-items: center; flex-direction: column; gap: 8px; font-size: 0.76rem; }
.drawing-artwork-placeholder > span { font-size: 1.8rem; }
.drawing-artwork-info { display: flex; flex-direction: column; gap: 7px; padding: 12px; font-size: 0.75rem; color: var(--text-muted); }
.drawing-artwork-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); font-size: 0.88rem; }
.drawing-artwork-in-use { color: var(--accent-color); }
.drawing-artwork-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.drawing-manager-header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.drawing-manager-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; flex-shrink: 0; }
.drawing-manager-filters input { flex: 1; min-width: 140px; }
.drawing-manager-filters select { max-width: 180px; }
.drawing-manager-selected { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color); }
.drawing-manager-select { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 0.8rem; cursor: pointer; }
.drawing-manager-select input, .drawing-manager-check input { width: auto; flex: 0 0 auto; }
.drawing-manager-description { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.drawing-manager-progress { display: flex; flex-direction: column; gap: 4px; padding: 10px 20px; border-top: 1px solid var(--border-color); font-size: 0.8rem; flex-shrink: 0; overflow-wrap: anywhere; }
.drawing-manager-dialog { width: min(540px, 94vw); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.drawing-manager-dialog .modal-header, .drawing-manager-dialog .modal-footer { flex-shrink: 0; }
.drawing-manager-dialog-body { min-height: 0; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.drawing-manager-dialog-body > label { display: flex; flex-direction: column; gap: 7px; font-size: 0.85rem; }
.drawing-manager-dialog-body > p { margin: 0; font-size: 0.85rem; line-height: 1.6; }
.drawing-manager-dialog-body > .drawing-manager-check { flex-direction: row; align-items: center; }
.drawing-manager-import-entry { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; overflow-wrap: anywhere; }
.drawing-manager-order { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.drawing-manager-order > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.drawing-library-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 240px; color: var(--text-muted); text-align: center; }
.drawing-library-empty-icon { font-size: 2.2rem; }
.drawing-library-empty p { margin: 0; font-size: 0.85rem; line-height: 1.6; }
.drawing-library-error { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; margin-bottom: 16px; border: 1px solid rgba(239,68,68,.35); border-radius: var(--radius-sm); background: rgba(239,68,68,.08); color: #ef7777; font-size: 0.85rem; }
.drawing-library-footer { border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.8rem; }
.drawing-library-pagination { display: flex; align-items: center; gap: 12px; }
.drawing-artwork-dialog { width: min(900px, 94vw); max-height: 90vh; }
.drawing-artwork-dialog .modal-header p { margin-top: 4px; }
.drawing-artwork-full-image { display: flex; align-items: center; justify-content: center; min-height: 200px; padding: 20px; overflow: auto; }
.drawing-artwork-full-image img { display: block; max-width: 100%; max-height: 70vh; width: 100%; object-fit: contain; image-rendering: pixelated; }
.drawing-artwork-delete-dialog { width: min(440px, 94vw); }
.drawing-artwork-delete-body { padding: 20px; color: var(--text-main); font-size: 0.88rem; line-height: 1.6; overflow-wrap: anywhere; }
.drawing-artwork-delete-body p { margin: 0 0 10px; }
.drawing-artwork-delete-body p:last-child { margin-bottom: 0; }
.drawing-artwork-delete-error { color: #ef7777; }

@media (max-width: 600px) {
  .drawing-library-header, .drawing-library-footer { padding: 12px; }
  .drawing-library-categories { padding: 0 12px 12px; }
  .drawing-manager-filters { padding: 0 12px 12px; }
  .drawing-library-body { padding: 12px; }
  .drawing-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .drawing-library-grid-multipart { grid-template-columns: minmax(0, 1fr); }
  .drawing-library-category { padding: 8px 10px; }
  .drawing-artwork-info { padding: 10px; }
  .drawing-library-footer { justify-content: center; }
}

.drawing-left-card {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.drawing-left-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawing-left-footer {
  flex-shrink: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-color);
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-tertiary));
  box-shadow: 0 -8px 22px rgba(2, 6, 23, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawing-action-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.drawing-action-step {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.drawing-action-step-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.drawing-action-step-title > span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.13);
  font-size: 0.7rem;
  font-weight: 700;
}

.drawing-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.drawing-action-buttons > .btn {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  margin: 0;
  padding: 7px 6px;
  font-size: 0.8rem;
  line-height: 1.15;
  white-space: nowrap;
}

.drawing-action-file-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.drawing-action-file-btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.drawing-right-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.drawing-category-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  border: 1px solid var(--border-color);
}

.drawing-category-btn {
  flex: 1 1 auto;
  padding: 7px 10px;
  font-size: 0.83rem;
  font-weight: 500;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}

.drawing-category-btn.active {
  background: var(--accent-color);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.drawing-size-toggle {
  display: flex;
  background: rgba(15, 23, 42, 0.4);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  border: 1px dashed var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.drawing-size-btn {
  flex: 1;
  min-width: 0;
  padding: 4px 2px;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawing-size-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.drawing-size-btn.active {
  background: rgba(59, 130, 246, 0.22);
  color: #60a5fa;
  font-weight: 600;
  border-color: rgba(59, 130, 246, 0.45);
}

.drawing-part-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawing-part-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.drawing-part-row.ready {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
}

.drawing-preview-viewport {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090d16;
  position: relative;
  overflow: hidden;
  padding: 12px;
  box-sizing: border-box;
}

.drawing-pixel-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  background-color: #293241;
  background-image: conic-gradient(#3b4658 25%, transparent 0 50%, #3b4658 0 75%, transparent 0);
  background-size: 16px 16px;
}

.drawing-thumb-strip {
  display: flex;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
  overflow-x: auto;
  align-items: center;
  scrollbar-width: thin;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.drawing-thumb-item {
  position: relative;
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background-color: #293241;
  background-image: conic-gradient(#3b4658 25%, transparent 0 50%, #3b4658 0 75%, transparent 0);
  background-size: 8px 8px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
}

.drawing-thumb-item:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.drawing-thumb-item.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

.drawing-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.drawing-thumb-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1;
  pointer-events: none;
}

.drawing-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  font-size: 11px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.drawing-thumb-item:hover .drawing-thumb-del {
  display: flex;
}

/* ================= 蓝图 2D 平面拼画 (tt_blueprint_ui 1:1) ================= */
.blueprint-2d-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bp-workspace-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.bp-left-card {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.bp-left-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.bp-left-scroll::-webkit-scrollbar {
  width: 5px;
}

.bp-left-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.bp-left-footer {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-field {
  display: flex;
  flex-direction: column;
}

.bp-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bp-info-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

.bp-unified-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bp-unified-sec {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bp-unified-title {
  font-weight: 600;
  font-size: 0.83rem;
  color: var(--text-color);
}

.bp-unified-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.bp-unified-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.bp-unified-result {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.bp-unified-result.bp-valid {
  border-left: 4px solid var(--success-color);
}

.bp-unified-result.bp-invalid {
  border-left: 4px solid var(--danger-color);
}

.bp-specs-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.6);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.bp-result-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.bp-result-box.bp-valid {
  border-left: 4px solid var(--success-color);
}

.bp-result-box.bp-invalid {
  border-left: 4px solid var(--danger-color);
}



.bp-right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
}

.bp-canvas-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.bp-canvas-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  border: 1px solid #93a3b7;
}

.swatch-usable {
  background-color: #e5f4ec;
}

.swatch-partial {
  background-color: #f3eadb;
}

.swatch-locked {
  background-color: #e2e6ed;
}

.bp-canvas-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  background-color: #f3f6fb;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#blueprint-2d-canvas,
#blueprint-vert-pixel-canvas,
#blueprint-vert-land-canvas,
#blueprint-3d-land-canvas,
#three-container,
#three-container canvas,
.easel-canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.bp-canvas-hint {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.bp-progress-floating-card {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 40px));
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  z-index: 50;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.bp-progress-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
}

.bp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.25s ease;
}

/* 3D 建造、竖向拼画、蓝图家具与采集 Tab 容器满高约束 */
.blueprint-3d-container,
.blueprint-vertical-container,
.room-furniture-container,
.gather-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* 3D WebGL 视口容器 */
.three-viewport-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.three-canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* 房间家园与蓝图家具两栏工作台 */
.rf-workspace-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.rf-left-col {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* 房间家园列表表格与专属微章 */
.rf-home-table-container {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.rf-home-table {
  width: 100%;
}

.rf-home-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-tertiary);
  font-size: 0.78rem;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
}

.rf-home-table tbody tr {
  transition: background 0.15s ease;
}

.rf-home-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.rf-home-table tbody tr.active-row {
  background: rgba(59, 130, 246, 0.16) !important;
  border-left: 3px solid var(--accent-color, #3b82f6);
}

.rf-badge-own {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0 3px;
  border-radius: 4px;
  font-size: 0.76rem;
  line-height: 1.3;
}

.rf-badge-title {
  display: inline-flex;
  align-items: center;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0 5px;
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1.4;
}

.rf-badge-house {
  display: inline-flex;
  align-items: center;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 0 5px;
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1.4;
}

.rf-left-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.rf-left-footer {
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rf-right-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  position: relative;
}

/* 采集工作台布局 */
.gather-workspace-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  gap: 10px;
  position: relative;
}

.gather-table-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.gather-table-viewport thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-tertiary);
  box-shadow: 0 1px 0 var(--border-color);
}

/* ==========================================================================
   通用加载指示器与预览生成遮罩 (Loading Spinner & Preview Overlay)
   ========================================================================== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent-color, #3b82f6);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

.preview-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 80;
  gap: 14px;
  color: #fff;
  border-radius: 6px;
  pointer-events: all;
  animation: modalFadeIn 0.2s ease-out;
  padding: 24px;
  text-align: center;
}

.preview-loading-spinner {
  width: 42px;
  height: 42px;
  border: 3.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: #60a5fa;
  border-right-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.preview-loading-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: 0.5px;
}

.preview-loading-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  max-width: 360px;
  line-height: 1.5;
  white-space: pre-line;
}

/* 蓝图建造/家园家具专属表格与固定表头 */
.rf-table-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  position: relative;
}

.rf-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.81rem;
  text-align: left;
}

.rf-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 8px 6px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  user-select: none;
}

.rf-table th,
.rf-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 6px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.rf-table tr.group-row {
  background: rgba(30, 41, 59, 0.55);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.rf-table tr.group-row:hover {
  background: rgba(59, 130, 246, 0.12);
}

.rf-table tr.child-row {
  background: rgba(15, 23, 42, 0.4);
  font-size: 0.79rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.rf-table tr.child-row:hover {
  background: rgba(59, 130, 246, 0.08);
}

.rf-table tr.child-row td {
  border-bottom: 1px dashed rgba(51, 65, 85, 0.35);
  padding: 5px 10px;
}

.group-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.group-toggle-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.12);
}

/* 现代专业建造看板：分类标签导航 */
.rf-cat-nav {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2px 3px;
  gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.rf-cat-nav::-webkit-scrollbar {
  display: none;
}

.rf-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  flex-shrink: 0;
}

.rf-cat-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.rf-cat-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.rf-cat-badge {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-weight: 600;
}

.rf-cat-btn.active .rf-cat-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* 现代状态徽章与发光指示圆点 */
.rf-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.rf-status-pill.status-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.rf-status-pill.status-missing,
.rf-status-pill.status-missing_and_warn {
  background: rgba(244, 63, 94, 0.14);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.rf-status-pill.status-warn,
.rf-status-pill.status-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.rf-status-pill.status-sub,
.rf-status-pill.status-substituted,
.rf-status-pill.status-substituted_and_warn {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.rf-status-pill.status-pending {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.rf-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rf-dot.dot-ok {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.rf-dot.dot-missing,
.rf-dot.dot-missing_and_warn {
  background: #f43f5e;
  box-shadow: 0 0 6px #f43f5e;
}

.rf-dot.dot-warn,
.rf-dot.dot-warning {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}

.rf-dot.dot-sub,
.rf-dot.dot-substituted,
.rf-dot.dot-substituted_and_warn {
  background: #a855f7;
  box-shadow: 0 0 6px #a855f7;
}

.rf-dot.dot-pending {
  background: #94a3b8;
  box-shadow: 0 0 6px #94a3b8;
}

/* 构件备料与规格分布看板 (BOM Dashboard) */
.rf-bom-dashboard {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 8px 12px 12px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.rf-bom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.rf-bom-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.rf-bom-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rf-bom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.rf-bom-chip {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.rf-bom-chip:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-1px);
}

.rf-bom-chip-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rf-bom-chip-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: #60a5fa;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.rf-bom-chip-pct {
  font-size: 0.72rem;
  font-weight: normal;
  color: var(--text-muted);
}

.rf-bom-bar-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.rf-bom-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* 数量气泡胶囊 */
.rf-count-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 8px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  font-weight: 700;
  font-size: 0.8rem;
}

.rf-count-sub-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.74rem;
}

/* ==========================================================================
   12. 自动做饭与灶台QTE监控 (Cook) 模块专属样式
   ========================================================================== */

.cook-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.cook-workspace-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.cook-unified-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  flex: 1 1 0;
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.cook-home-select {
  width: 280px;
  max-width: 100%;
}

.cook-search-input {
  width: 195px;
}

.cook-unified-card .cook-table-viewport {
  flex: 1 1 0;
  min-height: 140px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.cook-table-viewport {
  flex: 1 1 0;
  min-height: 140px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.cook-log-wrapper {
  height: 180px;
  min-height: 140px;
  max-height: 220px;
  flex: none;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  overflow: hidden;
}

.cook-table-viewport table {
  width: 100%;
  border-collapse: collapse;
}

.cook-table-viewport thead th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  z-index: 2;
  box-shadow: 0 1px 0 var(--border-color);
}

/* 灶台各状态专属 Badge */
.badge-cook-idle {
  background: rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.badge-cook-prep {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-cook-cooking {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-cook-danger {
  background: rgba(220, 38, 38, 0.25);
  color: #f87171;
  border: 1px solid #ef4444;
  font-weight: 700;
  animation: pulse-danger 1.2s infinite ease-in-out;
}

@keyframes pulse-danger {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  }
}

.badge-cook-relief {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.badge-cook-succeed {
  background: rgba(16, 185, 129, 0.28);
  color: #34d399;
  border: 1px solid #10b981;
  font-weight: 700;
}

.badge-cook-failed {
  background: rgba(153, 27, 27, 0.28);
  color: #fca5a5;
  border: 1px solid rgba(153, 27, 27, 0.6);
}

/* 实时监控与操作日志控制台 */
.cook-log-wrapper {
  height: 190px;
  min-height: 150px;
  max-height: 240px;
  flex: none;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cook-log-header {
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.rf-build-log-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  gap: 8px;
}

.rf-build-log-summary,
.rf-build-log-toolbar,
.rf-build-log-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.rf-build-log-summary,
.rf-build-log-toolbar {
  flex-shrink: 0;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  font-size: 0.8rem;
}

.rf-build-log-summary > strong {
  color: var(--text-main);
}

.rf-build-log-toolbar {
  justify-content: space-between;
}

.rf-build-log-tools {
  min-width: 0;
  gap: 8px;
}

.rf-build-log-search {
  width: 240px;
  max-width: 100%;
  min-width: 0;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.rf-build-log-autoscroll,
.rf-build-log-running {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.rf-build-log-running {
  color: var(--accent-color);
  margin-left: auto;
}

.rf-build-log-running .spinner {
  width: 12px;
  height: 12px;
}

.rf-build-log-count,
.rf-build-log-time {
  color: var(--text-muted);
}

.rf-build-log-console {
  flex: 1;
  min-height: 160px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: Consolas, "SFMono-Regular", "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.7;
  scrollbar-gutter: stable;
}

.rf-build-log-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: inherit;
}

.rf-build-log-line span {
  font-family: inherit;
}

.rf-build-log-time,
.rf-build-log-level {
  flex-shrink: 0;
  white-space: nowrap;
}

.rf-build-log-level {
  width: 9ch;
}

.rf-build-log-message {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rf-build-log-success {
  color: var(--success-color);
}

.rf-build-log-warning {
  color: var(--warning-color);
}

.rf-build-log-error,
.rf-build-log-load-error {
  color: var(--danger-color);
}

.rf-build-log-line.rf-build-log-error {
  background: rgba(239, 68, 68, 0.06);
}

.rf-build-log-load-error {
  flex-shrink: 0;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.rf-build-log-empty {
  padding: 24px 12px;
  color: var(--text-muted);
  text-align: center;
}

.rf-build-log-empty p + p {
  margin-top: 6px;
}

.cook-log-console {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  background: #0a0e17;
  color: #cbd5e1;
}

.cook-log-line {
  margin-bottom: 3px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.cook-log-time {
  color: #64748b;
  flex-shrink: 0;
  user-select: none;
}

.cook-log-msg-qte {
  color: #f87171;
  font-weight: 600;
}

.cook-log-msg-collect {
  color: #34d399;
  font-weight: 600;
}

.cook-log-msg-info {
  color: #60a5fa;
}

.cook-log-msg-warn {
  color: #fbbf24;
}

.cook-log-msg-success {
  color: #4ade80;
  font-weight: 600;
}

.cook-log-msg-error {
  color: #f87171;
  font-weight: 600;
}

.cook-log-msg-prank {
  color: #c084fc;
  font-weight: 600;
}

.cook-log-msg-danger {
  color: #ef4444;
  font-weight: 600;
}

/* ==========================================================================
   全量移动端响应式与触屏手势适配系统 (Mobile & Touch Responsive Adaptation)
   ========================================================================== */

@media (max-width: 860px) {
  /* 1. 基础视口与页面防抖动锁定 */
  html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  #app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* 2. 顶部导航栏 Header */
  .header {
    height: 52px;
    padding: 0 12px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    flex-shrink: 0;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .logo-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
  }

  .status-pill {
    padding: 3px 7px;
    font-size: 0.72rem;
  }

  .status-pill-text {
    display: none;
  }

  .desktop-actions-group {
    display: none !important;
  }

  .header-user-profile {
    display: none !important;
  }

  .mobile-user-trigger-wrap {
    display: block !important;
  }

  /* 3. 左侧抽屉菜单 Sidebar (Off-Canvas Drawer) */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 270px !important;
    max-width: 82vw !important;
    height: 100% !important;
    height: 100dvh !important;
    z-index: 9999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1) !important;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.8) !important;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar.sidebar-mobile-open {
    transform: translateX(0) !important;
  }

  .sidebar-mobile-close-btn {
    display: inline-flex !important;
  }

  .sidebar-backdrop {
    display: block !important;
  }

  .sidebar-header {
    padding: 12px 14px;
  }

  .sidebar-menu-item {
    padding: 11px 14px;
    font-size: 0.92rem;
    min-height: 44px;
  }

  .sidebar-group-header {
    padding: 10px 14px;
    min-height: 42px;
  }

  .sidebar-sub-item {
    padding: 9px 12px;
    font-size: 0.88rem;
    min-height: 40px;
  }

  /* 4. 主容器弹性视口布局 Main Layout & Content Panel */
  .main-layout {
    height: calc(100vh - 52px) !important;
    height: calc(100dvh - 52px) !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .content-panel {
    width: 100% !important;
    height: 100% !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* 5. 任务标签栏 Task Tabs Bar */
  .task-tabs-bar {
    height: 38px;
    min-height: 38px;
    flex-shrink: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 4px;
    scrollbar-width: none;
  }

  .task-tabs-bar::-webkit-scrollbar {
    display: none;
  }

  .task-tab-item {
    height: 38px;
    padding: 0 10px;
    min-width: 90px;
    max-width: 150px;
    font-size: 0.8rem;
    gap: 5px;
  }

  .task-tab-item.active {
    height: 38px;
  }

  .task-tab-close {
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
    opacity: 0.85;
  }

  .task-tab-add-wrap {
    padding: 0 6px;
  }

  .task-tab-add-btn {
    width: 26px;
    height: 26px;
    font-size: 1.1rem;
  }

  /* 6. 任务状态横幅 Task Banner */
  .task-banner {
    flex-shrink: 0 !important;
    padding: 8px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .task-banner > div:first-child {
    justify-content: space-between;
  }

  .task-banner > div:last-child {
    flex-wrap: wrap;
    gap: 6px;
  }

  .status-message {
    font-size: 0.82rem;
  }

  /* 7. 全量核心标签页视图容器：解除截断，允许平滑纵向滚动，保留充足底部呼吸空间 */
  .tab-content,
  .tab-content.tab-content-replace-active,
  .tab-content.tab-content-bag-active,
  .tab-content.tab-content-easel-active,
  .tab-content.tab-content-bp2d-active,
  .tab-content.tab-content-bp3d-active,
  .tab-content.tab-content-bpvert-active,
  .tab-content.tab-content-room-active,
  .tab-content.tab-content-gather-active,
  .tab-content.tab-content-cook-active,
  .tab-content.tab-content-move-active {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain;
    padding: 8px 8px 24px 8px !important;
  }

  /* 移动端页面底部轻量弹性安全占位：适度留白（32px），把高度最大限度留给预览视口与表格 */
  .tab-content::after {
    content: "" !important;
    display: block !important;
    width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    flex-shrink: 0 !important;
    pointer-events: none !important;
  }

  .tab-content.tab-content-drawing-animation-active,
  .tab-content.tab-content-drawing-gallery-active {
    overflow-y: hidden !important;
    padding: 8px !important;
    touch-action: auto !important;
  }

  .tab-content.tab-content-drawing-animation-active::after,
  .tab-content.tab-content-drawing-gallery-active::after {
    display: none !important;
  }

  /* 8. 通用栅格、卡片与触控输入框优化 */
  .auth-tab-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .auth-tab-left-card {
    min-width: 0 !important;
    width: 100% !important;
  }

  .inapp-login-iframe-wrapper {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .inapp-login-iframe {
    min-width: 0 !important;
    width: 100% !important;
  }

  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .card {
    padding: 12px 10px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
  }

  .card-title {
    font-size: 0.95rem;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"],
  select,
  textarea,
  .form-control,
  .input-control {
    font-size: 16px !important; /* 防止 iOS Safari 自动缩放页面 */
    min-height: 38px;
  }

  .btn {
    min-height: 36px;
    padding: 6px 12px;
  }

  .btn-sm {
    min-height: 32px;
    padding: 5px 10px;
  }

  .btn-xs {
    min-height: 28px;
    padding: 3px 8px;
  }

  /* 9. 图片替换 Tab (Replace) */
  .replace-tab-container {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .crop-editor-panel {
    padding: 10px !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 20px !important;
  }

  .replace-top-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
  }

  .toolbar-left {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .toolbar-left .btn {
    flex: 1 1 calc(50% - 6px) !important;
    text-align: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 8px 6px;
  }

  .toolbar-left .checkbox-label {
    width: 100% !important;
    padding: 4px 0;
  }

  .toolbar-right {
    width: 100% !important;
  }

  .toolbar-right .btn-replace-start {
    width: 100% !important;
    padding: 11px !important;
    font-size: 0.98rem !important;
  }

  .crop-editor-layout {
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    flex: none !important;
    display: flex !important;
    gap: 12px !important;
  }

  .crop-main-column {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .canvas-viewport {
    height: 280px !important;
    min-height: 200px !important;
    max-height: 320px !important;
    touch-action: pan-y !important;
    flex: none !important;
  }

  .canvas-floating-toolbar {
    top: 6px;
    right: 6px;
    padding: 3px 6px;
    gap: 4px;
  }

  .canvas-floating-toolbar .btn-group button {
    padding: 2px 6px;
    font-size: 0.72rem;
  }

  .crop-bottom-layout {
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    flex: none !important;
    gap: 8px !important;
  }

  .thumb-strip-box {
    width: 100% !important;
    height: auto !important;
    min-height: 90px !important;
    overflow: visible !important;
    flex: none !important;
  }

  .strip-header {
    flex-wrap: wrap;
    gap: 6px;
  }

  .strip-tools {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
  }

  .thumb-strip-scroll {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    user-select: none !important;
    padding: 6px 4px 10px 4px !important;
    min-height: 72px !important;
  }

  .thumb-item-card {
    touch-action: pan-x !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    flex-shrink: 0 !important;
  }

  .thumb-img {
    pointer-events: none !important;
    -webkit-user-drag: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
  }

  .output-preview-box {
    width: 100% !important;
    height: auto !important;
    min-height: 160px !important;
    flex: none !important;
  }

  .crop-controls-sidebar {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    flex: none !important;
    padding-right: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  /* 10. 头像与媒体相册 Tab (Media) */
  .media-top-split {
    grid-template-columns: 1fr !important;
  }

  .avatar-card {
    min-height: auto !important;
  }

  .game-avatar-stage {
    padding-top: 14px;
  }

  .game-avatar-dialog {
    border-radius: 20px !important;
    padding: 26px 12px 18px 12px !important;
  }

  .dialog-capsule-title {
    top: -14px !important;
    padding: 3px 18px !important;
    gap: 8px !important;
    max-width: 82% !important;
  }

  .dialog-capsule-title .capsule-text {
    font-size: 0.95rem !important;
    letter-spacing: 1px !important;
  }

  .dialog-close-round {
    top: -12px !important;
    right: 4px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 1.1rem !important;
  }

  .dialog-body-split {
    flex-direction: column !important;
    gap: 14px !important;
  }

  .dialog-grid-plate {
    width: 100% !important;
    min-height: auto !important;
    padding: 16px 10px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  .dialog-avatar-grid {
    gap: 12px 8px !important;
  }

  .grid-cell {
    width: clamp(52px, 17vw, 76px) !important;
    height: clamp(52px, 17vw, 76px) !important;
  }

  .dialog-preview-side {
    width: 100% !important;
  }

  .favourite-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)) !important;
    gap: 8px !important;
  }

  /* 11. 背包管理 Tab (Bag) 专属适配：充足表格视口高度，不局促 */
  .bag-tab-container {
    height: auto !important;
    overflow: visible !important;
  }

  .bag-tab-card {
    padding: 12px 10px 16px 10px !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    margin-bottom: 16px !important;
  }

  .bag-tab-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .bag-tab-toolbar > div {
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  .bag-tab-toolbar input[type="text"],
  .bag-tab-toolbar select {
    width: 100% !important;
  }

  .bag-table-wrapper {
    flex: none !important;
    height: 460px !important;
    min-height: 360px !important;
    max-height: 580px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 10px !important;
  }

  .bag-table-wrapper .data-table {
    min-width: 620px !important;
  }

  .bag-tab-pagination {
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: space-between !important;
    padding-top: 8px !important;
  }

  /* 12. 拼画板 (Easel) & 图纸画画 (Drawing) 模块适配 */
  .easel-tab-container,
  .drawing-tab-container {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
    gap: 12px !important;
  }

  .easel-left-card,
  .drawing-left-card {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    flex: none !important;
  }

  .easel-left-scroll,
  .drawing-left-scroll {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
    padding: 12px 10px !important;
  }

  .easel-right-card,
  .drawing-right-card {
    width: 100% !important;
    min-height: 520px !important;
    height: auto !important;
    flex: none !important;
    overflow: visible !important;
  }

  .easel-right-header {
    flex-wrap: wrap !important;
    gap: 8px !important;
    height: auto !important;
    padding: 8px !important;
  }

  .easel-tab-nav {
    width: 100% !important;
    display: flex !important;
  }

  .easel-tab-nav .easel-nav-btn {
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 6px 4px !important;
    font-size: 0.8rem !important;
  }

  .easel-right-header > div:last-child {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  .easel-canvas-container {
    height: 480px !important;
    min-height: 440px !important;
    width: 100% !important;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
  }

  .easel-palette-grid,
  .drawing-palette-grid {
    gap: 4px !important;
  }

  /* 13. 2D / 3D / 竖向蓝图拼画 (Blueprint 2D / 3D / Vert) 专属适配：大视口高画幅渲染，消除底边裁切 */
  .blueprint-2d-container,
  .blueprint-3d-container,
  .blueprint-vertical-container {
    height: auto !important;
    overflow: visible !important;
  }

  .bp-workspace-layout {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
    gap: 12px !important;
  }

  .bp-left-card {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    flex: none !important;
  }

  .bp-left-scroll {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
    padding: 12px 10px !important;
  }

  .bp-left-footer {
    padding: 10px !important;
  }

  .bp-right-card,
  .bp-right-panel {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    flex: none !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 12px 12px 18px 12px !important;
    margin-bottom: 20px !important;
  }

  .bp-canvas-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .bp-canvas-toolbar > div:first-child {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .bp-canvas-toolbar > div:first-child > button:nth-child(1),
  .bp-canvas-toolbar > div:first-child > button:nth-child(2) {
    flex: 1 1 calc(50% - 6px) !important;
    text-align: center !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    padding: 6px 4px !important;
  }

  .bp-canvas-viewport {
    flex: none !important;
    width: 100% !important;
    height: 480px !important;
    min-height: 400px !important;
    position: relative !important;
    touch-action: none !important;
    border-radius: var(--radius-sm);
    overflow: hidden !important;
    margin-bottom: 6px !important;
  }

  .three-viewport-wrapper {
    flex: none !important;
    width: 100% !important;
    height: 480px !important;
    min-height: 400px !important;
    position: relative !important;
    touch-action: none !important;
    border-radius: var(--radius-sm);
    overflow: hidden !important;
    margin-bottom: 6px !important;
  }

  /* 14. 房间家具与建筑建造 Tab (Room Furniture) 完整适配 */
  .room-furniture-container {
    height: auto !important;
    overflow: visible !important;
  }

  .rf-workspace-layout {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
    gap: 12px !important;
  }

  .rf-left-col {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    flex: none !important;
  }

  .rf-left-scroll {
    overflow: visible !important;
    height: auto !important;
    flex: none !important;
    padding: 10px !important;
  }

  .rf-home-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 200px !important;
  }

  .rf-home-table {
    min-width: 320px;
  }

  .rf-right-col {
    width: 100% !important;
    min-height: 480px !important;
    height: auto !important;
    flex: none !important;
    overflow: visible !important;
    padding: 10px !important;
  }

  .rf-cat-nav {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
  }

  .rf-table-container {
    flex: none !important;
    height: 420px !important;
    min-height: 300px !important;
    max-height: 520px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .rf-table {
    min-width: 780px !important;
  }

  /* 15. 自动采集 Tab (Gather) 专属适配 */
  .gather-container {
    height: auto !important;
    overflow: visible !important;
  }

  .gather-workspace-layout {
    height: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .gather-workspace-layout select {
    min-width: 80px;
    width: auto !important;
  }

  .gather-table-viewport {
    flex: none !important;
    height: 380px !important;
    min-height: 280px !important;
    max-height: 480px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .gather-table-viewport table {
    min-width: 650px !important;
  }

  /* 16. 自动烹饪与灶台QTE监控 Tab (Cook) 专属适配：充裕高度，灶台与日志均清晰完整 */
  .cook-container {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .cook-workspace-layout {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .cook-unified-card {
    padding: 10px 8px 14px 8px !important;
    height: auto !important;
    min-height: auto !important;
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    margin-bottom: 12px !important;
  }

  .cook-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .cook-header-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .cook-header-actions .btn {
    flex: 1 1 calc(50% - 6px) !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .cook-settings-bar {
    gap: 8px 12px !important;
  }

  .cook-target-home-label {
    width: 100% !important;
  }

  .cook-home-select {
    width: 100% !important;
    max-width: 100% !important;
  }

  .cook-workspace-layout select {
    max-width: 100% !important;
  }

  .cook-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .cook-category-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .cook-search-box {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .cook-search-box .input-control {
    flex: 1 !important;
    width: auto !important;
  }

  .cook-table-viewport {
    flex: none !important;
    height: 380px !important;
    min-height: 280px !important;
    max-height: 500px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 6px !important;
  }

  .cook-table-viewport table {
    min-width: 680px !important;
  }

  .cook-unified-card .pagination-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding-top: 6px !important;
  }

  .cook-unified-card .pagination-bar > div {
    display: flex !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .cook-log-wrapper {
    flex: none !important;
    min-height: 200px !important;
    height: 240px !important;
    overflow: hidden !important;
    margin-bottom: 16px !important;
  }

  .cook-log-console {
    height: calc(100% - 36px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* 17. 角色移动与全图导航 Tab (Move) 专属适配：大画幅交互地图，选点浮条不抢占视野 */
  .move-container {
    height: auto !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .move-unified-card {
    padding: 10px 8px 16px 8px !important;
    height: auto !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    margin-bottom: 16px !important;
  }

  .move-header-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .move-header-bar > div:last-child {
    flex-wrap: wrap !important;
    justify-content: flex-end;
  }

  .move-status-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  .move-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }

  .move-filter-bar > div:last-child {
    width: 100% !important;
  }

  .move-map-viewport {
    min-height: 420px !important;
    height: 500px !important;
    touch-action: none !important;
    position: relative !important;
    border-radius: var(--radius-sm);
    overflow: hidden !important;
    margin-bottom: 8px !important;
  }

  /* 移动端地图底部操作栏：全屏绝对置底吸附，确保按钮100%可见，永不被裁切 */
  .map-target-dock {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 12px)) 16px !important;
    box-shadow: 0 -8px 36px rgba(0, 0, 0, 0.92) !important;
    z-index: 10005 !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(245, 158, 11, 0.8) !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    touch-action: auto !important;
    pointer-events: auto !important;
    animation: slideUpDock 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes slideUpDock {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .map-dock-info {
    width: 100% !important;
    min-width: 0 !important;
  }

  .map-dock-actions {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    align-items: center !important;
  }

  .map-dock-actions .dock-desc-tag {
    display: none !important;
  }

  .map-dock-actions .btn-dock-teleport {
    flex: 1.25 !important;
    min-height: 42px !important;
    padding: 8px 10px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    justify-content: center !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45) !important;
  }

  .map-dock-actions .btn-dock-run {
    flex: 1 !important;
    min-height: 42px !important;
    padding: 8px 10px !important;
    font-size: 0.88rem !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .map-dock-actions .btn-dock-close {
    flex: 0 0 38px !important;
    height: 38px !important;
    width: 38px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.15rem !important;
  }

  /* 18. 邮箱邮件 Tab (Mail) */
  .mail-container {
    height: auto !important;
    gap: 10px !important;
  }

  .mail-container .card {
    padding: 10px 10px !important;
  }

  .mail-container .data-table {
    min-width: 650px;
  }

  /* 19. 弹窗与对话框 (Modals & Dialogs) */
  .modal-overlay,
  .custom-modal-backdrop {
    padding: 10px !important;
    align-items: flex-start !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-content,
  .custom-modal-dialog,
  .custom-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    margin: 10px auto !important;
    border-radius: var(--radius-md) !important;
  }

  .custom-modal-body,
  .modal-body {
    max-height: calc(100dvh - 160px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 14px 10px !important;
  }

  .custom-modal-footer,
  .modal-footer {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .custom-modal-footer .btn,
  .modal-footer .btn {
    min-height: 38px;
  }

  /* 已保存账号列表卡片移动端响应式 */
  .saved-account-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .saved-account-actions {
    width: 100% !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  .saved-account-actions .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  .saved-account-actions .btn-danger {
    flex: 0 0 42px;
  }

  /* 权限配置卡片矩阵 */
  .tab-permission-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 6px !important;
  }
}

/* 针对更小屏幕 (如 320px - 480px 紧凑手机) 专属精细微调 */
@media (max-width: 480px) {
  .logo-title {
    font-size: 0.92rem;
    max-width: 105px;
  }

  .mobile-user-name {
    max-width: 60px;
  }

  .task-tab-item {
    min-width: 75px;
    max-width: 120px;
    padding: 0 8px;
    font-size: 0.76rem;
  }

  .grid-cell {
    width: clamp(48px, 19vw, 68px) !important;
    height: clamp(48px, 19vw, 68px) !important;
  }

  .favourite-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .dialog-capsule-title {
    padding: 2px 12px !important;
  }

  .dialog-capsule-title .capsule-text {
    font-size: 0.88rem !important;
  }

  /* 480px 紧凑手机下同样保证高画幅大视口（绝不压缩成小方块） */
  .easel-canvas-container {
    height: 420px !important;
    min-height: 380px !important;
  }

  .bp-right-card,
  .bp-right-panel {
    height: auto !important;
  }

  .bp-canvas-viewport,
  .three-viewport-wrapper {
    height: 440px !important;
    min-height: 380px !important;
  }

  .gather-table-viewport {
    height: 380px !important;
  }

  .cook-table-viewport {
    height: 280px !important;
  }

  .cook-log-wrapper {
    height: 240px !important;
  }

  .move-map-viewport {
    height: 460px !important;
  }

  .rf-table-container {
    height: 400px !important;
  }

  .bag-table-wrapper {
    height: 420px !important;
  }
}

/* ==========================================================================
   蓝图管理工坊 (Blueprint Library) 专属样式
   ========================================================================== */
.bp-lib-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.bp-lib-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.bp-lib-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}

.bp-lib-cat-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bp-lib-cat-pill {
  padding: 4px 12px;
  font-size: 0.82rem;
  border-radius: 9999px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bp-lib-cat-pill:hover {
  color: var(--text-color);
  border-color: var(--accent-color);
}

.bp-lib-cat-pill.active {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  font-weight: 600;
}

.bp-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.bp-lib-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bp-lib-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.bp-lib-cover-box {
  width: 100%;
  height: 180px;
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-lib-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.bp-lib-cover-box:hover .bp-lib-cover-img {
  transform: scale(1.04);
}

.bp-lib-empty-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.bp-lib-empty-cover span.icon {
  font-size: 2.5rem;
  opacity: 0.7;
}

.bp-lib-badge-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.bp-lib-badge-vis {
  position: absolute;
  top: 10px;
  right: 10px;
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
}
.bp-lib-badge-vis.pub {
  background: rgba(16, 185, 129, 0.85);
}
.bp-lib-badge-vis.priv {
  background: rgba(245, 158, 11, 0.88);
}

.bp-lib-badge-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.bp-lib-filter-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.82rem;
  outline: none;
}

.bp-lib-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.bp-lib-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bp-lib-card-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-lib-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.bp-lib-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bp-lib-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bp-lib-card-footer {
  padding: 10px 16px 14px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-lib-main-actions {
  display: flex;
  gap: 8px;
}

.bp-lib-secondary-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* 多效果图管理展示区 */
.bp-lib-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.bp-lib-gallery-item {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.bp-lib-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.bp-lib-gallery-item .cover-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.68rem;
  padding: 1px 5px;
  background: var(--accent-color);
  color: #fff;
  border-radius: 3px;
  font-weight: 600;
}

.bp-lib-gallery-item .item-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: space-around;
  padding: 4px 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bp-lib-gallery-item:hover .item-actions {
  opacity: 1;
}

.bp-lib-gallery-item .item-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
}

.bp-lib-gallery-item .item-btn:hover {
  color: var(--accent-color);
}

.bp-lib-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bp-lib-dropzone:hover {
  border-color: var(--accent-color);
  background: rgba(59, 130, 246, 0.05);
  color: var(--text-color);
}

.bp-lib-import-modal {
  max-width: 800px;
  width: min(800px, 95vw);
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}

.bp-lib-import-modal .modal-header,
.bp-lib-import-modal .modal-footer {
  flex-shrink: 0;
}

.bp-lib-import-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bp-lib-import-hint {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.bp-lib-import-warnings {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.bp-lib-import-warnings ul {
  max-height: 100px;
  margin: 6px 0 0;
  padding-left: 18px;
  overflow-y: auto;
}

.bp-lib-import-section-title {
  font-weight: 600;
}

.bp-lib-import-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.bp-lib-import-summary > span {
  color: var(--text-muted);
}

.bp-lib-import-table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.bp-lib-import-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.bp-lib-import-table th,
.bp-lib-import-table td {
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color);
  overflow-wrap: anywhere;
}

.bp-lib-import-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-tertiary);
}

.bp-lib-import-table th:last-child {
  width: 36%;
}

.bp-lib-import-table tr:last-child td {
  border-bottom: none;
}

.bp-lib-import-image-names {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bp-lib-import-image-names li + li {
  margin-top: 4px;
}

.bp-lib-import-cover-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.7rem;
}

.bp-lib-import-result.is-success {
  color: var(--success-color);
}

.bp-lib-import-result.is-error,
.bp-lib-import-result.is-blocked,
.bp-lib-import-result.is-skipped {
  color: var(--danger-color);
}

.bp-lib-import-result.is-uploading {
  color: var(--accent-color);
}

.bp-lib-import-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.bp-lib-import-progress progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent-color);
}

/* ========================================================
   系统设置 Modal (左侧小菜单 + 右侧连续 Card 样式)
   ======================================================== */
.settings-modal-dialog {
  max-width: 880px;
  width: 95%;
  height: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.settings-modal-body-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
}

.settings-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: rgba(11, 15, 25, 0.55);
  border-right: 1px solid var(--border-color);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}

.settings-sidebar-header {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 4px 10px 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all 0.18s ease;
  user-select: none;
  border-left: 3px solid transparent;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.settings-nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-weight: 600;
  border-left-color: #3b82f6;
}

.settings-nav-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.settings-nav-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-content-area {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

.settings-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
}

.settings-card.active-target {
  border-color: rgba(59, 130, 246, 0.5);
}

.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-card-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
}

.settings-row-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .settings-modal-dialog {
    width: 98% !important;
    height: 90vh !important;
    max-height: 90vh !important;
  }
  .settings-modal-body-layout {
    flex-direction: column !important;
  }
  .settings-sidebar {
    width: 100% !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    padding: 8px 10px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
  }
  .settings-sidebar-header {
    display: none !important;
  }
  .settings-nav-item {
    width: auto !important;
    padding: 6px 10px !important;
    font-size: 0.82rem !important;
  }
  .settings-content-area {
    padding: 14px 12px !important;
  }
}

/* ==========================================================================
   派对节 (Party Festival) 专属视觉体系
   ========================================================================== */
.party-festival-container {
  display: flex;
  flex-direction: column;
  gap: 10px !important;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.party-festival-container > .card {
  margin-bottom: 0 !important;
}

.party-festival-sticky-header {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
  padding: 6px 12px 12px 12px !important;
  margin-bottom: 20px !important;
}

.party-festival-cards-card {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px 10px 2px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.party-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.party-card-item {
  background: var(--bg-secondary, #131c2e);
  border: 1px solid var(--border-color, #334155);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  position: relative;
}

.party-card-item:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(59, 130, 246, 0.5);
}

.party-card-cover {
  width: 100%;
  height: 165px;
  position: relative;
  overflow: hidden;
  background: #0f172a;
}

.party-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.party-card-item:hover .party-card-cover img {
  transform: scale(1.03);
}

.party-card-placeholder {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
}

.party-card-body {
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
}

.party-card-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: #f8fafc;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.party-card-host-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.party-card-host-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.party-card-host-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #3b82f6;
  flex-shrink: 0;
}

.party-card-host-avatar-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.party-card-host-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.party-card-host-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.party-card-host-id {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: monospace;
}

.party-card-member-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.party-card-actions {
  padding: 8px 16px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 768px) {
  .party-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
.drawing-processing-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-width: 0;
  font-size: 0.83rem;
}
.drawing-processing-controls legend { font-weight: 600; padding: 0 4px; }
.drawing-processing-controls > label { display: flex; justify-content: space-between; gap: 6px; }
.drawing-processing-controls input[type="range"] { width: 100%; accent-color: var(--accent-color); }
.drawing-processing-controls .input-control { width: 100%; }
.drawing-processing-hint { margin: 0 0 4px; color: var(--text-muted); font-size: 0.78rem; line-height: 1.5; }
.drawing-cut-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
}
.drawing-cut-body {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}
.drawing-cut-controls {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.83rem;
}
.drawing-cut-controls > label:not(.drawing-cut-file-btn) {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
}
.drawing-cut-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent-color);
}
.drawing-cut-file-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}
.drawing-cut-source-name {
  padding: 7px 9px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawing-cut-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.drawing-cut-counts label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 600;
}
.drawing-cut-preview {
  position: relative;
  min-height: 440px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  background-image:
    linear-gradient(45deg, rgba(127, 127, 127, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(127, 127, 127, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(127, 127, 127, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(127, 127, 127, 0.08) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.drawing-cut-preview img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 280px);
  object-fit: contain;
}
.drawing-cut-source-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  border-radius: 4px;
  line-height: 0;
  touch-action: none;
  user-select: none;
}
.drawing-cut-source-stage.is-loading {
  pointer-events: none;
}
.drawing-cut-source-stage > img {
  width: auto;
  height: auto;
}
.drawing-cut-crop-box {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  border: 2px solid #ff5f87;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(12, 14, 20, 0.56);
  cursor: move;
  touch-action: none;
}
.drawing-cut-crop-box.is-free {
  cursor: default;
}
.drawing-cut-grid-line {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 1px rgba(30, 30, 30, 0.38);
}
.drawing-cut-grid-line.is-vertical {
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
}
.drawing-cut-grid-line.is-horizontal {
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
}
.drawing-cut-crop-size {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 20px);
  padding: 3px 6px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(15, 17, 24, 0.78);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.drawing-cut-resize-handle {
  position: absolute;
  z-index: 3;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 2px;
  background: #ff5f87;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.drawing-cut-resize-handle.is-nw {
  top: 2px;
  left: 2px;
  cursor: nwse-resize;
}
.drawing-cut-resize-handle.is-ne {
  top: 2px;
  right: 2px;
  cursor: nesw-resize;
}
.drawing-cut-resize-handle.is-sw {
  bottom: 2px;
  left: 2px;
  cursor: nesw-resize;
}
.drawing-cut-resize-handle.is-se {
  right: 2px;
  bottom: 2px;
  cursor: nwse-resize;
}
.drawing-cut-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-secondary) 86%, transparent);
  z-index: 2;
}
.drawing-cut-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  text-align: center;
}
.drawing-cut-result-meta {
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
  color: var(--text-muted);
  font-size: 0.78rem;
}
@media (max-width: 760px) {
  .drawing-cut-body {
    grid-template-columns: 1fr;
  }
  .drawing-cut-preview {
    min-height: 240px;
    max-height: 40vh;
  }
  .drawing-cut-preview img {
    max-height: 36vh;
  }
}
