
/* ========== 工具箱模块 ========== */

/* 侧边栏激活时主内容区向右偏移，与其他侧边导航保持一致 */
body.with-toolbox-side-nav .main {
  max-width: none;
  margin-left: 220px;
  width: auto;
}


/* 入口卡片网格 */
.toolbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.toolbox-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border, #444);
  background: var(--bg-alt, #1a1a2e);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
}

.toolbox-card:hover {
  border-color: var(--accent, #6c63ff);
  box-shadow: 0 4px 16px rgba(108, 99, 255, 0.18);
  transform: translateY(-2px);
}

.toolbox-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--accent, #6c63ff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.toolbox-card-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.toolbox-card-body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ========== 图片去背景工具 ========== */

#view-removebg .rti-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

/* 进度条 */
.rbg-progress-bar-wrap {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border, #333);
  margin-top: 1rem;
  overflow: hidden;
}

.rbg-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--accent, #6c63ff);
  transition: width 0.25s ease;
}

/* 结果工具栏 */
.rbg-result-toolbar {
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* 结果图片项 —— 复用 rti-image-item，但不强制 9/16 比例 */
.rbg-image-item {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border, #444);
  background: var(--bg-alt, #1a1a2e);
  transition: transform 0.2s, box-shadow 0.2s;
}

.rbg-image-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 透明图预览用棋盘格背景 */
.rbg-image-preview {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background-image: linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
  background-color: #fff;
}

.rbg-image-actions {
  padding: 0.5rem;
  text-align: center;
}

.rbg-image-name {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 0.5rem 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rbg-error-item {
  border-radius: 6px;
  border: 1px solid #7f1d1d;
  background: rgba(127, 29, 29, 0.15);
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
  color: #f87171;
  word-break: break-all;
}

@media (max-width: 1024px) {
  #view-removebg .rti-layout {
    grid-template-columns: 1fr;
  }
}
