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

:root {
  --bg: #f5f6fa;
  --surface: #fff;
  --surface-2: #fafafa;
  --surface-3: #f5f5f5;
  --text: #222;
  --text-2: #555;
  --muted: #888;
  --muted-2: #aaa;
  --border: #e8eaed;
  --border-2: #f0f0f0;
  --brand: #e4393c;
  --brand-hover: #c0392b;
  --blue: #1a73e8;
  --row-hover: #fffaf9;
  --row-selected: #fef7e0;
  --shadow: rgba(0,0,0,0.15);
}

html[data-theme="dark"] {
  --bg: #0f1014;
  --surface: #17181d;
  --surface-2: #1f2027;
  --surface-3: #242630;
  --text: #f2f3f5;
  --text-2: #c9ccd3;
  --muted: #9298a3;
  --muted-2: #717784;
  --border: #30323b;
  --border-2: #282a32;
  --brand: #ff5a5f;
  --brand-hover: #ff7276;
  --blue: #5b9dff;
  --row-hover: #211b1f;
  --row-selected: #2b2518;
  --shadow: rgba(0,0,0,0.45);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
}

/* ===================== 整体布局 ===================== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===================== 左侧 Sidebar ===================== */
.sidebar {
  width: 180px;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #e8eaed;
}
.sidebar-logo {
  padding: 18px 16px 12px;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
  line-height: 1.1;
}
.logo-big {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #1a73e8;
  letter-spacing: 2px;
}
.logo-sub {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #555;
  letter-spacing: 1px;
}
.sidebar-shop {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
}
.sidebar-shop-name {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
  word-break: break-all;
  line-height: 1.3;
}
.sidebar-shop-switch-btn {
  width: 100%;
  padding: 7px 0;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-shop-switch-btn:hover { border-color: #1a73e8; color: #1a73e8; background: #f0f7ff; }
.sidebar-shop-sel { display: none; }
.sidebar-nav { padding: 8px 0; flex: 1; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid #f0f0f0;
}
.sidebar-user {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
  word-break: break-all;
}
.sidebar-logout-btn {
  width: 100%;
  padding: 7px 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  color: #888;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-logout-btn:hover { border-color: #e4393c; color: #e4393c; background: #fff5f5; }
.theme-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  margin-bottom: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.theme-switcher button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  height: 26px;
  white-space: nowrap;
}
.theme-switcher button:hover { color: var(--brand); }
.theme-switcher button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px var(--shadow);
  font-weight: 600;
}
.theme-switcher-large {
  width: 260px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.settings-theme-item { justify-content: space-between; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #555;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: #1a73e8; background: #f0f7ff; }
.nav-item.active { color: #1a73e8; background: #e8f0fe; border-left-color: #1a73e8; font-weight: 600; }
.nav-icon { font-size: 15px; flex-shrink: 0; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================== 右侧主内容 ===================== */
.main-content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ===================== 置顶头部容器 ===================== */
.products-sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #f5f6fa;
  flex-shrink: 0;
}

/* ===================== 状态 Tab ===================== */
.status-tabs {
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  padding: 0 20px;
  flex-shrink: 0;
  overflow-x: auto;
}
.status-tab {
  padding: 0 14px;
  height: 42px;
  line-height: 42px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-tab:hover { color: #e4393c; }
.status-tab.active { color: #fff; background: #ff6b6b; border-radius: 4px; font-weight: 600; }

/* ===================== 批次分类页 ===================== */
.batch-category-bar {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 20px;
  flex-shrink: 0;
}
.batch-cat-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.batch-cat-all {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border: 2px solid #d9d9d9;
  border-radius: 6px;
  background: #fafafa;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.batch-cat-all:hover { border-color: #e4393c; color: #e4393c; }
.batch-cat-all.active {
  border-color: #e4393c; background: #fff5f5; color: #e4393c;
  box-shadow: 0 0 0 2px rgba(228,57,60,0.12);
}
.batch-block-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 100px;
  overflow: hidden;
  flex: 1; min-width: 0;
}
.batch-block-grid.expanded { max-height: none; }
.batch-block {
  width: 42px; height: 42px;
  border-radius: 6px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  transition: all 0.15s;
  position: relative;
  user-select: none;
  border: 2px solid transparent;
}
.batch-block:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.batch-block.active {
  border-color: #222;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.batch-block-dim { font-size: 9px; opacity: 0.8; font-weight: 400; line-height: 1; }
.batch-expand-btn {
  flex-shrink: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  background: #fafafa;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  margin-top: 2px;
}
.batch-expand-btn:hover { border-color: #e4393c; color: #e4393c; }

/* ===================== 搜索栏 ===================== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}
.search-input {
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  outline: none;

  width: 180px;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: #e4393c; }
.search-time-dim { width: 110px; padding: 6px 8px; }
.search-date { width: 130px; padding: 6px 8px; }
.search-datetime { width: 190px; padding: 6px 8px; }
.date-sep { font-size: 13px; color: #aaa; flex-shrink: 0; }
.select-input {
  padding: 6px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  background: #fff;
  cursor: pointer;
}
.select-sm { padding: 4px 8px; font-size: 12px; }
.quick-date-btn {
  padding: 4px 8px;
  font-size: 11px;
  color: #666;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.quick-date-btn:hover { background: #e8e8e8; }
.quick-date-btn.active { background: #e4393c; color: #fff; border-color: #e4393c; }

.search-right { margin-left: auto; display: flex; gap: 8px; }

/* ===================== 批量操作栏 ===================== */
.action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.check-wrap { display: flex; align-items: center; padding-right: 4px; }
.selected-tip { font-size: 12px; color: #e4393c; font-weight: 500; min-width: 80px; }
.action-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
}
.page-btn {
  width: 26px; height: 26px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: #e4393c; color: #e4393c; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#page-info { font-size: 12px; color: #888; }

/* ===================== 按钮 ===================== */
.btn {
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: #e4393c; color: #fff; border-color: #e4393c; }
.btn-primary:hover { background: #c0392b; border-color: #c0392b; }
.btn-default { background: #fff; color: #333; }
.btn-default:hover { border-color: #e4393c; color: #e4393c; }
.btn-purple { background: #722ed1; color: #fff; border-color: #722ed1; }
.btn-purple:hover { background: #9254de; border-color: #9254de; }
.btn-ai { background: #0958d9; color: #fff; border-color: #0958d9; }
.btn-ai:hover { background: #1677ff; border-color: #1677ff; }
.btn-batch { background: #08979c; color: #fff; border-color: #08979c; }
.btn-batch:hover { background: #13c2c2; border-color: #13c2c2; }
.btn-danger-outline { background: #fff; color: #e4393c; border-color: #e4393c; }
.btn-danger-outline:hover { background: #fff1f0; }
.btn-link { background: none; border: none; color: #e4393c; padding: 2px 4px; font-size: 12px; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-link-blue { background: none; border: none; color: #1677ff; padding: 2px 4px; font-size: 12px; cursor: pointer; }
.btn-link-blue:hover { text-decoration: underline; }
.btn-sm { padding: 3px 10px; font-size: 12px; }

/* ===================== 列表表头 ===================== */
.list-header {
  display: grid;
  grid-template-columns: 36px minmax(200px,280px) 150px 160px 160px 40px 200px 290px 190px 100px;
  align-items: center;
  padding: 8px 12px;
  background: #fafafa;
  border-bottom: 1px solid #e8eaed;
  font-size: 12px;
  color: #888;
  font-weight: 500;
  text-align: center;
}

/* ===================== 商品列表 ===================== */
.product-list { background: #f5f6fa; }

.product-row {
  display: grid;
  grid-template-columns: 36px minmax(200px,280px) 150px 160px 160px 40px 200px 290px 190px 100px;
  align-items: start;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 14px 12px;
  transition: background 0.12s;
  gap: 0;
}
.product-row:hover { background: #fffaf9; }
.product-row.selected { background: #fef7e0; }
.product-row.selected:hover { background: #fdf0c8; }

/* 复选框列 */
.col-check { display: flex; align-items: center; }

/* 商品信息列 */
.col-product { padding-right: 12px; }
.product-thumb-wrap { display: flex; gap: 10px; align-items: flex-start; }
.product-meta { flex: 1; min-width: 0; }

/* 标题行（标题 + 颜色图并排） */
.p-title {
  font-size: 13px;
  font-weight: 500;
  color: #222;
  line-height: 1.4;
  word-break: break-all;
  white-space: normal;
  overflow-wrap: break-word;
  margin-bottom: 5px;
}

/* 颜色图（标题右侧） */
.product-color-thumb {
  flex-shrink: 0;
  width: 100%;
  overflow: visible;
  position: relative;
}
.product-color-thumb .drop-target-color {
  position: relative;
  width: 100%;
}
.product-color-thumb .drop-target-color > img {
  width: 100%; height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: zoom-in;
  display: block;
}
.product-color-thumb > img {
  width: 100%; height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: zoom-in;
  display: block;
}
.detail-scroll {
  display: none;
  position: absolute;
  left: 0; top: 100%;
  z-index: 200;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 6px;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  width: 180px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.product-color-thumb:hover .detail-scroll {
  display: flex;
}

/* 元信息字段行 */
.p-meta-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin-bottom: 3px;
  font-size: 11px;
  color: #aaa;
}
.p-meta-item { color: #888; }
.p-meta-item b { color: #555; font-weight: 500; }
.p-meta-sep { color: #ddd; }
.xhs-note-source {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 5px;
  font-size: 11px;
  color: #888;
}
.xhs-author-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #333;
}
.xhs-source-link {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border: 1px solid #f1d8dc;
  border-radius: 999px;
  background: #fff6f7;
  color: #d23b52;
  text-decoration: none;
  line-height: 18px;
}
.xhs-source-link:hover {
  border-color: #e85d75;
  color: #c72c45;
}

.xhs-fold-text {
  position: relative;
  min-width: 0;
}
.xhs-fold-content {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.xhs-fold-text.is-collapsed .xhs-fold-content {
  display: -webkit-box;
  -webkit-line-clamp: var(--xhs-fold-lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 42px;
}
.xhs-fold-toggle {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--blue);
  font-size: 11px;
  cursor: pointer;
}
.xhs-fold-text.is-collapsed .xhs-fold-toggle {
  position: absolute;
  right: 0;
  bottom: 0;
}
.xhs-fold-text:not(.is-collapsed) .xhs-fold-toggle {
  margin-top: 3px;
}
.xhs-fold-toggle:hover {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}
.xhs-row-title {
  font-weight: 600;
  color: var(--text);
  max-width: 360px;
}

.p-id { font-size: 11px; color: #aaa; margin-bottom: 3px; }
.p-id span { color: #888; }
.p-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.p-price { font-size: 13px; color: #e4393c; font-weight: 600; }
.p-dup-tag { font-size: 10px; color: #ff9800; border: 1px solid #ff9800; border-radius: 3px; padding: 0 4px; line-height: 16px; }

/* 图片组列 */
.col-banana, .col-cutimg, .col-mainimgs, .col-colorimg, .col-detailthumbs { padding: 0 6px; }

/* 采集主图宫格 */
.col-mainimgs { min-width: 0; }
.main-img-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 100%;
}
.main-img-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: grab;
  background: #f5f5f5;
}
.main-img-grid img:hover { border-color: #e4393c; transform: scale(1.04); }
.main-img-grid img:active { cursor: grabbing; }

/* 颜色图列 */
.col-colorimg { min-width: 0; }

/* 详情图缩略图列 */
.col-detailthumbs { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.detail-thumb-section {
  width: 100%;
  margin-bottom: 4px;
}
.detail-thumb-label {
  font-size: 10px;
  color: #999;
  margin: 0 0 3px 2px;
  line-height: 1;
}
.detail-thumb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  width: 100%;
}
.detail-thumb-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid #eee;
}
.detail-thumb-grid img:hover { border-color: #1a73e8; transform: scale(1.08); }
.xhs-media-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #e8eaed;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #f8fafc;
}
.xhs-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.xhs-media-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #1677ff;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
}
.xhs-media-badge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 10px;
  text-align: center;
  color: #fff;
  background: rgba(17, 24, 39, 0.72);
  padding: 2px 4px;
  line-height: 1.2;
}
.xhs-media-thumb:hover { border-color: #1a73e8; transform: scale(1.06); }
.xhs-live-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #e8eaed;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #f8fafc;
}
.xhs-live-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.xhs-live-thumb:hover {
  border-color: #1a73e8;
  transform: scale(1.06);
}
.xhs-live-badge {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  background: rgba(242,242,242,0.58);
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: rgba(98,98,98,0.95);
  font-size: 0;
  line-height: 1;
  font-weight: 700;
}
.xhs-live-badge .live-icon {
  display: block;
  width: 13px;
  height: 13px;
  color: rgba(98,98,98,0.95);
  flex: 0 0 auto;
}
.img-preview-live {
  max-width: 90vw;
  max-height: 92vh;
  cursor: default;
}
.xhs-live-preview {
  width: min(560px, 92vw);
  max-height: 92vh;
}
.xhs-live-preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 10px;
  background: #111;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.xhs-live-preview-img,
.xhs-live-preview-video,
.xhs-live-preview .live-img,
.xhs-live-preview .live-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}
.xhs-live-preview-img { z-index: 1; }
.xhs-live-preview-video { z-index: 3; }
.xhs-live-preview-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  letter-spacing: 0;
  background: rgba(17,17,17,0.92);
}
.xhs-live-preview-cover {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 16px;
  box-sizing: border-box;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  background: transparent;
  pointer-events: none;
}
.live-control-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  pointer-events: auto;
}
.live-photo-control {
  display: flex;
  align-items: center;
  pointer-events: auto;
}
.control-content {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  pointer-events: auto;
  cursor: pointer;
}
.control-content .live-icon {
  display: block;
  width: 13px;
  height: 13px;
  color: rgba(255,255,255,0.92);
  flex: 0 0 auto;
}
.live-text { font-weight: 700; letter-spacing: 0; }
.chevron { display: none; }
.xhs-live-preview .fraction {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 4;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(17,24,39,0.34);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.xhs-live-auto {
  position: absolute;
  left: 16px;
  top: 54px;
  z-index: 4;
}
.xhs-live-auto-btn {
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  background: rgba(0,0,0,0.24);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.xhs-live-preview .arrow-controller {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.xhs-live-preview .arrow-controller.hidden {
  display: none;
}
.xhs-live-preview .arrow-controller.forbidden {
  opacity: 0.35;
  pointer-events: none;
}
.xhs-live-preview .arrow-controller.left {
  left: 14px;
}
.xhs-live-preview .arrow-controller.right {
  right: 14px;
  transform: translateY(-50%);
}
.xhs-live-preview .btn-wrapper {
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  transform: translateY(-1px);
}
.xhs-live-preview .slider-pagination-container {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 4;
}
.xhs-live-preview .pagination-list {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.xhs-live-preview .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  cursor: pointer;
}
.xhs-live-preview .dot.active {
  background: #fff;
}
.xhs-live-replay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  margin-top: -27px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  color: rgba(255,255,255,0.95);
  font-size: 28px;
  line-height: 54px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.18);
}
.xhs-live-replay.hidden { display: none; }
.xhs-live-preview-stage:hover .fraction,
.xhs-live-preview-stage:hover .arrow-controller {
  opacity: 1;
}
.xhs-live-preview-stage:hover .arrow-controller.forbidden {
  opacity: 0.35;
}
.detail-thumb-page-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 10px;
  font-size: 11px;
  color: #1a73e8;
  background: #f0f7ff;
  border: 1px solid #d0e2ff;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.detail-thumb-page-btn:hover { background: #d0e2ff; }
.size-thumb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}
.size-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: 100%;
}
.editable-thumb-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  overflow: hidden;
  background: #f8f9fb;
  border: 1px solid #eee;
}
.editable-thumb-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: grab;
}
.editable-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0c4cc;
  font-size: 10px;
  border-style: dashed;
}
.editable-thumb-empty .empty-slot-text {
  pointer-events: none;
}
.img-del-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 12px;
  line-height: 14px;
  cursor: pointer;
  padding: 0;
}
.img-del-btn:hover { background: rgba(228,57,60,0.9); }

/* 比对按钮列 */
.col-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  align-self: center;
}

/* 产品图列 */
.col-prodimg { min-width: 0; }
.col-img-wrap { display: flex; flex-direction: column; gap: 4px; }
.col-thumb {
  width: 100%; height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: zoom-in;
  display: block;
  flex-shrink: 0;
}
.col-thumb-lg {
  width: 100%; height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: zoom-in;
  display: block;
}

/* 生图缩略图（更大） */
.banana-thumb {
  width: 100%; height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: zoom-in;
  display: block;
}

/* 切图合并列（3:4 上，1:1 下） */
.col-cutimg { min-width: 0; }
.banana-cut-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  margin-top: 6px;
}
.banana-cut-footer .banana-compact-card {
  align-items: flex-start;
  text-align: left;
}
.cut-section-label {
  font-size: 10px;
  color: #bbb;
  margin-bottom: 3px;
  font-weight: 500;
}

/* 操作列 */
.col-op {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  padding-top: 2px;
}

/* 详情图横向滚动条 */
.detail-scroll::-webkit-scrollbar { height: 3px; }
.detail-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
.detail-scroll-img {
  width: 36px; height: 36px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #eee;
  cursor: zoom-in;
  flex-shrink: 0;
}
.img-group { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.img-group img {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #eee;
  cursor: zoom-in;
  transition: transform 0.15s;
}
.img-group img:hover { transform: scale(1.05); }

/* 切图列：两排各5张叠加 */
.img-group-cut {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 4px;
}
.img-group-cut img {
  width: 36px; height: 48px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #eee;
  cursor: zoom-in;
  transition: transform 0.15s;
}
.img-group-cut img:hover { transform: scale(1.05); }
.no-img { font-size: 12px; color: #ccc; }
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  white-space: nowrap;
}
.tag-collected  { background: #f5f5f5; color: #888; }
.tag-processing { background: #fff7e6; color: #d46b08; }
.tag-success    { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.tag-fail       { background: #fff1f0; color: #cf1322; }
.tag-banana     { background: #f9f0ff; color: #531dab; }
.tag-source     { background: #eef6ff; color: #1a73e8; border: 1px solid #cfe0ff; }

/* ===================== 空状态 ===================== */
.empty-tip {
  text-align: center;
  color: #bbb;
  padding: 80px 0;
  font-size: 15px;
}

/* ===================== 模板管理 ===================== */
.tpl-page { padding: 16px 20px; }
.tpl-add-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: #fff;
  border-radius: 6px;
  margin-bottom: 16px;
  border: 1px solid #e8eaed;
}
.tpl-layout {
  display: grid;
  grid-template-columns: minmax(760px, 1fr) minmax(320px, 380px);
  gap: 16px;
  align-items: start;
}
.tpl-single-panel,
.tpl-group-panel {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 12px;
}
.tpl-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #222;
  font-size: 13px;
  font-weight: 700;
}
.tpl-subhead small {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 400;
}
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}
.tpl-single-grid {
  min-height: 0;
}
.tpl-grid-sm .tpl-card { width: 90px; }
.tpl-card {
  min-width: 0;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
}
.tpl-card:hover { border-color: #e4393c; box-shadow: 0 2px 8px rgba(228,57,60,0.15); }
.tpl-card.selected { border-color: #e4393c; }
.tpl-card[draggable="true"] { cursor: grab; }
.tpl-card[draggable="true"]:active { cursor: grabbing; }
.tpl-card-img-wrap {
  aspect-ratio: 1;
  background: #f5f5f5;
  overflow: hidden;
}
.tpl-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-grid-sm .tpl-card img { height: 80px; }
.tpl-card-meta { padding: 7px 8px 8px; }
.tpl-card .tpl-name {
  font-size: 12px;
  font-weight: 600;
  color: #444; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.tpl-card-mini .tpl-card-meta { padding: 5px 6px 6px; }
.tpl-card-mini .tpl-name { font-size: 11px; }
.tpl-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 92px;
  border-radius: 8px;
}
.tpl-card .tpl-del {
  font-size: 11px; color: #ff4d4f;
  padding: 2px 6px 4px; cursor: pointer;
}
.tpl-card .tpl-del:hover { text-decoration: underline; }
.tpl-card .tpl-edit {
  font-size: 11px; color: #1677ff;
  padding: 2px 6px 4px; cursor: pointer;
}
.tpl-card .tpl-edit:hover { text-decoration: underline; }
.tpl-actions {
  display: flex; gap: 2px;
  padding: 0 2px 2px;
}

/* ===================== 提示词模板区块 ===================== */
.tpl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.tpl-section-title {
  font-size: 14px; font-weight: 600; color: #333;
}
.tpl-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tpl-series-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tpl-group-block {
  border: 1px solid #e8eaed;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
}
.tpl-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.tpl-group-head strong {
  display: block;
  color: #222;
  font-size: 13px;
}
.tpl-group-head span {
  color: #9ca3af;
  font-size: 11px;
}
.tpl-group-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tpl-group-caret {
  color: #6b7280;
  font-size: 11px;
}
.tpl-empty,
.tpl-more-note {
  color: #9ca3af;
  font-size: 12px;
  padding: 10px;
}
.tpl-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 10px;
  line-height: 1.3;
  margin: 3px 6px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-chip-group {
  background: #eef6ff;
  color: #1677ff;
}
.tpl-drop-over {
  outline: 2px dashed #1677ff !important;
  outline-offset: -4px;
  background: rgba(22,119,255,0.06) !important;
}
.prompt-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.prompt-tpl-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.15s;
  cursor: pointer;
  min-height: 110px;
}
.prompt-tpl-card:hover { border-color: #e4393c; box-shadow: 0 2px 8px rgba(228,57,60,0.1); }
.prompt-tpl-name {
  font-size: 13px; font-weight: 600; color: #333;
  margin-bottom: 6px;
}
.prompt-tpl-text {
  font-size: 12px; color: #555;
  line-height: 1.45;
  word-break: break-word;
  margin-bottom: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.prompt-tpl-alt {
  color: #d46b08;
}

/* ===================== 提示词标签行 ===================== */
.prompt-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 0;
}
.prompt-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid #d9d9d9;
  background: #fafafa;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prompt-tag:hover {
  border-color: #e4393c;
  color: #e4393c;
  background: #fff5f5;
}
.prompt-tag.active {
  border-color: #e4393c;
  background: #e4393c;
  color: #fff;
}
.banana-mode-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.banana-mode-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}
.banana-modal-box {
  width: min(900px, calc(100vw - 72px));
  max-height: min(90vh, 860px);
}
.banana-modal-box .modal-body {
  max-height: calc(min(90vh, 860px) - 116px);
}
.banana-group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.banana-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #d8dde8;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 13px;
  cursor: pointer;
}
.banana-group-btn b {
  color: #1677ff;
  font-size: 14px;
}
.banana-group-btn em {
  color: #8a8f98;
  font-style: normal;
  font-size: 12px;
}
.banana-group-btn.active {
  border-color: #1677ff;
  background: #eef6ff;
  box-shadow: 0 0 0 2px rgba(22,119,255,0.10);
}
.banana-group-preview {
  margin-top: 10px;
}
.banana-group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 8px;
  background: #fafafa;
}
.banana-group-tpl-card {
  min-width: 0;
  padding: 6px;
  border: 1px solid #edf0f5;
  border-radius: 7px;
  background: #fff;
  text-align: center;
}
.banana-group-tpl-card img {
  width: 54px;
  height: 68px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin: 0 auto 5px;
}
.banana-group-tpl-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4b5563;
  font-size: 11px;
}
.banana-group-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: #6b7280;
  font-size: 12px;
}
.banana-group-pager button {
  border: 1px solid #d8dde8;
  border-radius: 5px;
  background: #fff;
  padding: 4px 10px;
  cursor: pointer;
}
.banana-group-pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.prompt-tpl-card .tpl-actions {
  margin-top: 8px;
  padding: 0;
}
.prompt-tpl-card .tpl-edit {
  font-size: 12px; color: #1677ff; cursor: pointer;
}
.prompt-tpl-card .tpl-edit:hover { text-decoration: underline; }
.prompt-tpl-card .tpl-del {
  font-size: 12px; color: #ff4d4f; cursor: pointer;
}
.prompt-tpl-card .tpl-del:hover { text-decoration: underline; }

/* ===================== 弹窗 ===================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
#modal-banana {
  z-index: 1200;
}
#modal-compare-regen {
  z-index: 1100;
}
#modal-category-attr-tree {
  z-index: 1080;
}
#modal-category-attrs {
  z-index: 1120;
}
#modal-taobao-publish-category-browser {
  z-index: 1080;
}
#modal-taobao-publish-schema-detail {
  z-index: 1130;
}
.modal-box {
  background: #fff;
  border-radius: 8px;
  width: 580px;
  max-height: 84vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.modal-lg { width: 860px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px; font-weight: 600;
}
.modal-close {
  background: none; border: none;
  font-size: 18px; cursor: pointer; color: #aaa;
}
.modal-close:hover { color: #333; }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid #f0f0f0;
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: #fff;
}
.tpl-editor-modal {
  width: min(1040px, calc(100vw - 80px));
  height: min(86vh, 820px);
  max-height: min(86vh, 820px);
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 440px;
  border-radius: 10px;
  background: #111;
  color: #f8fafc;
  overflow: hidden;
}
.tpl-editor-preview {
  min-height: 0;
  height: 100%;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tpl-editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.tpl-editor-side {
  background: #fff;
  color: #222;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.tpl-editor-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.tpl-editor-close {
  position: absolute;
  right: 18px;
  top: 14px;
  z-index: 3;
  color: #9ca3af;
}
.tpl-editor-close:hover {
  color: #fff;
}
#modal-edit-template .modal-header {
  padding-right: 46px;
}
#modal-edit-template .modal-footer {
  background: #fff;
  flex-shrink: 0;
}
.tpl-source-row {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid #f1d8dc;
  border-radius: 8px;
  background: #fff6f7;
}
.tpl-source-title {
  margin-bottom: 6px;
  color: #7f1d1d;
  font-size: 12px;
  font-weight: 700;
}
.tpl-source-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tpl-source-author {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
  font-size: 12px;
  font-weight: 600;
}
.tpl-source-empty {
  color: #9f6b72;
  font-size: 12px;
  line-height: 1.5;
}
.form-label { font-size: 12px; color: #666; font-weight: 500; margin-bottom: 6px; display: block; }
.textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid #d9d9d9; border-radius: 4px;
  font-size: 13px; resize: vertical; outline: none;
}
.textarea:focus { border-color: #e4393c; }

/* ===================== 详情弹窗 ===================== */
.detail-section { margin-bottom: 18px; }
.detail-section-title {
  font-size: 12px; font-weight: 600; color: #999;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.detail-item label { font-size: 11px; color: #aaa; display: block; margin-bottom: 2px; }
.detail-item .val { font-size: 13px; color: #333; word-break: break-all; }
.detail-item .val a { color: #1677ff; text-decoration: none; }
.detail-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.detail-imgs img {
  width: 76px; height: 76px; object-fit: cover;
  border-radius: 4px; border: 1px solid #eee; cursor: zoom-in;
}
.xhs-detail-box {
  width: min(1180px, calc(100vw - 72px));
  height: min(88vh, 820px);
  max-height: min(88vh, 820px);
  padding: 0;
  overflow: hidden;
  background: #0b0b0c;
  border-radius: 14px;
}
.xhs-detail-box > .modal-header {
  display: none;
}
.xhs-detail-body {
  padding: 0;
  height: 100%;
  overflow: hidden;
}
.xhs-detail-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(380px, 440px);
  height: 100%;
  min-height: 0;
}
.xhs-detail-media-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #050505;
}
.xhs-detail-media-top {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 14px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.xhs-detail-media-top span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xhs-detail-media-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 18px 86px;
  box-sizing: border-box;
}
.xhs-detail-main-img,
.xhs-detail-video,
.xhs-detail-live-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}
.xhs-detail-video {
  width: 100%;
  height: 100%;
  background: #000;
}
.xhs-detail-live-stage {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.xhs-detail-live-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(0,0,0,0.58);
  color: #fff;
  font-size: 14px;
}
.xhs-detail-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.28);
  color: #fff;
  font-size: 28px;
  line-height: 30px;
  cursor: pointer;
}
.xhs-detail-prev { left: 14px; }
.xhs-detail-next { right: 14px; }
.xhs-detail-nav:hover { background: rgba(0,0,0,0.46); }
.xhs-detail-media-rail {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.xhs-detail-thumb {
  position: relative;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  cursor: pointer;
  padding: 0;
}
.xhs-detail-thumb.active { border-color: #ff2f55; }
.xhs-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.xhs-detail-thumb b {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 0;
  background: rgba(0,0,0,0.58);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
}
.xhs-detail-info-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
  color: #222;
}
.xhs-detail-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.xhs-detail-author {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.xhs-detail-author a {
  color: #222;
  text-decoration: none;
}
.xhs-detail-info-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}
.xhs-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 22px;
}
.xhs-detail-empty {
  color: rgba(255,255,255,0.72);
  font-size: 13px;
}
.product-detail-sku-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.product-detail-sku-label {
  color: #333;
  font-size: 13px;
  font-weight: 700;
}
.product-detail-color-row,
.product-detail-size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.product-detail-color-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 78px;
  max-width: 180px;
  padding: 5px 8px 5px 5px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #222;
  font-size: 13px;
}
.product-detail-color-card.active {
  border-color: #e4393c;
  box-shadow: 0 0 0 1px #e4393c inset;
}
.product-detail-color-card img {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}
.product-detail-color-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-detail-size-chip {
  min-width: 38px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid #d9dce3;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 13px;
  line-height: 28px;
  text-align: center;
}

.xhs-search-bar {
  padding: 8px 0 10px;
}
.xhs-list-header {
  grid-template-columns: 36px minmax(240px,320px) 92px 92px 180px 180px 40px 200px 290px 110px 100px;
}
.xhs-row {
  grid-template-columns: 36px minmax(240px,320px) 92px 92px 180px 180px 40px 200px 290px 110px 100px;
}
.xhs-status-tabs {
  margin: 0 0 8px;
}
.xhs-action-bar {
  margin-bottom: 8px;
}
.xhs-link-import-box {
  width: min(1040px, calc(100vw - 64px));
  max-height: min(88vh, 860px);
}
.xhs-link-import-body {
  background: #f7f8fb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.xhs-link-hero,
.xhs-link-preview,
.xhs-link-section {
  background: #fff;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  padding: 12px;
}
.xhs-link-hero {
  position: relative;
}
.xhs-link-platform-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  margin-bottom: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}
.xhs-link-platform-tabs button {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.xhs-link-platform-tabs button.active {
  background: #ef4444;
  color: #fff;
}
.xhs-link-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 102px;
  gap: 10px;
  align-items: start;
}
.xhs-link-input-row textarea {
  resize: vertical;
  min-height: 54px;
}
.xhs-link-input-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.xhs-link-input-actions .btn {
  width: 100%;
  min-height: 32px;
}
.xhs-link-cookie {
  margin-top: 8px;
  color: #6b7280;
  font-size: 12px;
}
.xhs-link-cookie summary {
  cursor: pointer;
  user-select: none;
}
.xhs-link-cookie textarea {
  margin-top: 6px;
}
.xhs-link-cookie-popover {
  position: absolute;
  right: 12px;
  top: calc(100% - 4px);
  z-index: 20;
  width: min(360px, calc(100% - 24px));
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px var(--shadow);
}
.xhs-link-cookie-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.xhs-link-cookie-head strong {
  color: var(--text);
  font-size: 12px;
}
.xhs-link-cookie-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.xhs-link-status {
  min-height: 0;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.35;
}
.xhs-link-status:empty {
  display: none;
}
.xhs-link-status.is-loading { color: #d48806; }
.xhs-link-status.is-success { color: #16a34a; }
.xhs-link-status.is-error { color: #dc2626; }
.xhs-link-preview-head,
.xhs-link-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.xhs-link-preview-title {
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.xhs-link-preview-meta {
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}
.xhs-link-preview-desc {
  color: #374151;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 92px;
  overflow: auto;
}
.xhs-link-section-head strong {
  color: #111827;
  font-size: 14px;
}
.xhs-link-section-head span {
  color: #6b7280;
  font-size: 12px;
}
.xhs-link-color-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.xhs-link-color-actions button {
  border: 1px solid #d8dde8;
  background: #fff;
  color: #374151;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}
.xhs-link-color-actions button.active,
.xhs-link-color-actions button:hover {
  border-color: #1677ff;
  color: #1677ff;
  background: #f0f7ff;
}
.xhs-link-color-actions span {
  color: #6b7280;
  font-size: 12px;
}
.xhs-link-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}
.xhs-link-color-card {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  cursor: pointer;
  overflow: hidden;
}
.xhs-link-color-card.selected {
  border-color: #fb5a3f;
  box-shadow: 0 0 0 2px rgba(251, 90, 63, 0.14);
}
.xhs-link-color-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 5px;
  display: block;
  background: #f3f4f6;
}
.xhs-link-color-card span {
  display: block;
  margin-top: 5px;
  color: #4b5563;
  font-size: 11px;
  line-height: 1.2;
}
.xhs-link-color-card.selected span {
  color: #fb5a3f;
  font-weight: 700;
}
.xhs-link-template-row,
.xhs-link-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.xhs-link-template-row {
  margin-bottom: 10px;
}
.xhs-link-muted,
.xhs-link-chip-row em {
  color: #9ca3af;
  font-size: 12px;
  font-style: normal;
}
.xhs-link-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.xhs-link-preset-group {
  border: 1px solid #edf0f5;
  border-radius: 8px;
  padding: 10px;
  background: #fbfcff;
}
.xhs-link-preset-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.xhs-link-preset-title span {
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}
.xhs-link-preset-title button {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1677ff;
  border-radius: 5px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 12px;
}
.xhs-link-preset-chip,
.xhs-link-template-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d8dde8;
  background: #fff;
  color: #374151;
  border-radius: 999px;
  padding: 5px 9px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.xhs-link-preset-chip.active,
.xhs-link-template-chip.active {
  border-color: #fb5a3f;
  color: #fb5a3f;
  background: #fff7f5;
}
.xhs-link-preset-chip b,
.xhs-link-template-chip b {
  color: #9ca3af;
  font-weight: 700;
  line-height: 1;
}
.xhs-link-preset-chip b:hover,
.xhs-link-template-chip b:hover {
  color: #dc2626;
}
.xhs-link-code-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  border-top: 1px solid #edf0f5;
  padding-top: 12px;
}
.xhs-link-code-panel label,
.xhs-link-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.xhs-link-code-panel span,
.xhs-link-form-grid span {
  color: #6b7280;
  font-size: 12px;
}
.xhs-link-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.xhs-link-form-grid label:nth-child(4),
.xhs-link-form-grid label:nth-child(5) {
  grid-column: span 1;
}
.xhs-link-import-box {
  width: min(560px, calc(100vw - 40px));
}
.xhs-link-plugin-note,
.xhs-link-plugin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px;
}
.xhs-link-note-layout {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.xhs-link-note-copy {
  min-width: 0;
  padding-right: 10px;
  border-right: 1px solid var(--border-2);
}
.xhs-link-plugin-note.is-empty .xhs-link-note-layout {
  display: block;
}
.xhs-link-plugin-note.is-empty .xhs-link-note-copy,
.xhs-link-plugin-note.is-empty .xhs-link-section-head {
  display: none;
}
.xhs-link-plugin-note.is-empty .xhs-link-color-section {
  width: 100%;
}
.xhs-link-plugin-caption {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}
.xhs-link-plugin-note .xhs-link-preview-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.xhs-link-plugin-note .xhs-link-preview-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xhs-link-plugin-note .xhs-link-preview-desc {
  display: -webkit-box;
  margin-top: 5px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.xhs-link-open-note {
  display: inline-flex;
  margin-top: 5px;
  color: var(--blue);
  font-size: 11px;
}
.xhs-link-color-section {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.xhs-link-plugin-panel .xhs-link-section-head,
.xhs-link-color-section .xhs-link-section-head {
  margin-bottom: 8px;
}
.xhs-link-plugin-panel .xhs-link-section-head strong,
.xhs-link-color-section .xhs-link-section-head strong {
  color: var(--text);
  font-size: 12px;
}
.xhs-link-plugin-panel .xhs-link-section-head span,
.xhs-link-color-section .xhs-link-section-head span {
  color: var(--muted);
  font-size: 11px;
}
.xhs-link-plugin-panel .xhs-link-color-grid,
.xhs-link-color-section .xhs-link-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 76px));
  gap: 8px;
  align-items: start;
}
.xhs-link-plugin-panel .xhs-link-color-card,
.xhs-link-color-section .xhs-link-color-card {
  border-color: var(--border);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 0;
}
.xhs-link-plugin-panel .xhs-link-color-card img,
.xhs-link-color-section .xhs-link-color-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: var(--surface-3);
  border-radius: 6px 6px 0 0;
}
.xhs-link-plugin-panel .xhs-link-color-card span,
.xhs-link-color-section .xhs-link-color-card span {
  margin: 0;
  height: 19px;
  line-height: 19px;
  padding: 0 5px;
  color: var(--text);
  background: var(--surface-2);
  border-radius: 0 0 6px 6px;
  text-align: left;
  font-size: 10px;
}
.xhs-link-plugin-panel .xhs-link-color-card.selected,
.xhs-link-color-section .xhs-link-color-card.selected {
  border-color: #60a5fa;
  box-shadow: 0 0 0 1px rgba(96,165,250,.25);
}
.xhs-link-plugin-panel .xhs-link-color-card.selected span,
.xhs-link-color-section .xhs-link-color-card.selected span {
  color: #fff;
  background: #2563eb;
}
.xhs-link-plugin-panel .xhs-link-color-actions,
.xhs-link-color-section .xhs-link-color-actions {
  border-top: 1px solid var(--border-2);
  margin: 10px 0 0;
  padding-top: 8px;
}
.xhs-link-plugin-panel .xhs-link-color-actions button,
.xhs-link-color-section .xhs-link-color-actions button,
.xhs-link-config-toggle,
.xhs-link-template-add,
.xhs-link-mini-btn,
.xhs-link-preset-title button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}
.xhs-link-plugin-panel .xhs-link-color-actions button.active,
.xhs-link-plugin-panel .xhs-link-color-actions button:hover,
.xhs-link-color-section .xhs-link-color-actions button.active,
.xhs-link-color-section .xhs-link-color-actions button:hover {
  border-color: #ff4d4f;
  background: #ff4d4f;
  color: #fff;
}
.xhs-link-hover-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1600;
  width: 300px;
  max-width: min(300px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(12, 14, 20, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.xhs-link-hover-preview.visible {
  opacity: 1;
  transform: translateY(0);
}
.xhs-link-hover-preview img {
  display: block;
  width: 100%;
  max-height: calc(min(420px, 100vh - 24px) - 16px);
  object-fit: contain;
  border-radius: 7px;
  background: #050507;
}
.xhs-link-config-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-direction: column;
  flex-wrap: nowrap;
  margin-bottom: 10px;
}
.xhs-link-config-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.xhs-link-config-bar strong {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}
.xhs-link-config-toggle {
  color: var(--blue);
  border-color: var(--border);
}
.xhs-link-config-toggle.active {
  color: #fff;
  border-color: #2563eb;
  background: #1d4ed8;
}
.xhs-link-template-add:hover,
.xhs-link-mini-btn:hover,
.xhs-link-preset-title button:hover {
  border-color: #60a5fa;
  color: #bfdbfe;
}
.xhs-link-config-bar .xhs-link-template-row {
  margin: 0;
  min-width: 0;
}
.xhs-link-template-chip {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.xhs-link-template-chip.active {
  border-color: #ff4d4f;
  background: #ff4d4f;
  color: #fff;
}
.xhs-link-summary-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
  color: var(--text);
}
.xhs-link-summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  line-height: 1.7;
}
.xhs-link-summary-line + .xhs-link-summary-line {
  margin-top: 4px;
}
.xhs-link-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.xhs-link-summary-item span {
  color: var(--muted);
  font-size: 11px;
}
.xhs-link-summary-item b {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.xhs-link-preset-editor {
  margin-top: 10px;
  border-top: 1px solid var(--border-2);
  padding-top: 10px;
}
.xhs-link-preset-group {
  border-color: var(--border);
  background: var(--surface-2);
}
.xhs-link-preset-title span {
  color: var(--text);
}
.xhs-link-preset-chip {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
.xhs-link-preset-chip.active {
  border-color: #ff4d4f;
  color: #fff;
  background: rgba(255, 77, 79, .92);
}
.xhs-link-code-panel {
  border-top-color: var(--border-2);
}
.xhs-link-code-panel span {
  color: var(--muted);
}
.xhs-link-code-panel .input,
.xhs-link-code-panel .select-input {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
.xhs-link-collect-btn {
  min-width: 160px;
  background: #1677ff;
  border-color: #1677ff;
  font-weight: 700;
}
.xhs-link-import-box {
  width: min(940px, calc(100vw - 40px));
}
.xhs-link-import-body {
  background: var(--surface-2);
}
.xhs-link-hero {
  background: var(--surface);
  border-color: var(--border);
}
.xhs-link-cookie,
.xhs-link-status {
  color: var(--muted);
}
.xhs-link-workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 206px;
  gap: 12px;
  align-items: start;
}
.xhs-link-right-rail,
.xhs-link-left-rail {
  min-width: 0;
  position: sticky;
  top: 0;
  align-self: start;
}
.xhs-link-main-content,
.xhs-link-right-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.xhs-link-right-rail .xhs-link-plugin-panel {
  padding: 10px;
}
.xhs-link-empty-preview {
  min-height: 190px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.xhs-link-empty-preview div {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
}
.xhs-link-empty-preview span {
  max-width: 360px;
  font-size: 12px;
  line-height: 1.5;
}
.xhs-link-plugin-note.is-empty .xhs-link-preview-title {
  color: var(--text-2);
}
.xhs-link-plugin-note.is-empty .xhs-link-preview-desc {
  color: var(--muted);
}
html[data-theme="dark"] .xhs-link-plugin-note,
html[data-theme="dark"] .xhs-link-plugin-panel {
  background: #15161b;
  border-color: #30323a;
}
html[data-theme="dark"] .xhs-link-import-body {
  background: #101116;
}
html[data-theme="dark"] .xhs-link-color-card,
html[data-theme="dark"] .xhs-link-template-chip,
html[data-theme="dark"] .xhs-link-preset-chip,
html[data-theme="dark"] .xhs-link-empty-preview {
  background: #17181b;
}
html[data-theme="dark"] .xhs-link-color-card img {
  background: #0f1117;
}
.xhs-link-plugin-config .xhs-link-config-bar {
  align-items: stretch;
  flex-direction: column;
  flex-wrap: nowrap;
}
.xhs-link-plugin-config .xhs-link-config-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.xhs-link-plugin-config .xhs-link-config-toggle {
  justify-content: center;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}
.xhs-link-plugin-config .xhs-link-template-add {
  width: 100%;
  justify-content: center;
  text-align: center;
}
.xhs-link-plugin-config .xhs-link-template-row {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.xhs-link-plugin-config .xhs-link-template-chip {
  width: auto;
  max-width: 92px;
  min-height: 24px;
  padding: 5px 7px;
  justify-content: space-between;
  gap: 4px;
}
.xhs-link-plugin-config .xhs-link-template-chip span {
  max-width: 46px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xhs-link-plugin-config .xhs-link-template-chip b {
  font-size: 10px;
}
.xhs-link-plugin-config .xhs-link-summary-line {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 5px;
}
.xhs-link-plugin-config .xhs-link-summary-item {
  justify-content: space-between;
  width: 100%;
}
.xhs-link-plugin-config .xhs-link-preset-grid {
  display: flex;
  flex-direction: column;
}
.xhs-link-plugin-config .xhs-link-code-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.xhs-link-plugin-config .xhs-link-code-panel label,
.xhs-link-plugin-config .xhs-link-code-panel .input,
.xhs-link-plugin-config .xhs-link-code-panel .select-input,
.xhs-link-plugin-config .xhs-link-mini-btn {
  width: 100%;
}
.vvic-link-product-head {
  margin-bottom: 0;
}
.vvic-link-import-box .xhs-link-hero {
  padding: 10px 16px 8px;
}
.vvic-link-import-box .xhs-link-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 10px;
  align-items: start;
}
.vvic-link-import-box .xhs-link-input-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-content: start;
}
.vvic-link-import-box .xhs-link-input-actions .btn {
  min-width: 0;
  height: 40px;
  padding: 0 10px;
}
.vvic-link-import-box #vvic-link-import-status {
  grid-column: 1 / -1;
  min-height: 14px;
  max-width: 126px;
  padding-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vvic-link-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.36);
}
.vvic-link-cookie-modal.hidden {
  display: none;
}
.vvic-link-cookie-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.22);
}
.vvic-link-cookie-dialog .xhs-link-cookie-head {
  margin-bottom: 8px;
}
.vvic-link-cookie-dialog textarea {
  min-height: 96px;
  font-size: 12px;
}
.vvic-link-product-color-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.vvic-link-product-color-card > .xhs-link-plugin-note,
.vvic-link-product-color-card > .xhs-link-plugin-panel {
  padding: 0;
  border: 0;
  background: transparent;
}
.vvic-link-product-color-card > .xhs-link-plugin-note {
  padding-right: 12px;
  border-right: 1px solid var(--border-2);
}
.vvic-link-product-color-card .xhs-link-color-grid {
  grid-template-columns: repeat(auto-fill, minmax(66px, 78px));
}
#vvic-link-size-section .xhs-link-color-grid {
  grid-template-columns: repeat(auto-fill, minmax(46px, 58px));
  gap: 5px;
}
#vvic-link-size-section .xhs-link-color-card img {
  aspect-ratio: 3 / 4;
  object-fit: contain;
}
#vvic-link-size-section .xhs-link-color-card span {
  height: 16px;
  line-height: 16px;
  font-size: 9px;
  padding: 0 4px;
}
.vvic-link-no-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: 6px 6px 0 0;
  font-size: 11px;
}
.vvic-link-code-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.xhs-link-template-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
}
.xhs-link-template-dialog {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.28);
}
.xhs-link-template-head {
  height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eef0f4;
}
.xhs-link-template-head strong {
  font-size: 14px;
  color: #111827;
}
.xhs-link-template-head button {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.xhs-link-template-head button:hover {
  color: #111827;
}
.xhs-link-template-body {
  padding: 12px 14px 14px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.xhs-link-template-body label,
.xhs-link-template-code-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.xhs-link-template-body span,
.xhs-link-template-code-grid span {
  color: #4b5563;
  font-size: 12px;
}
.xhs-link-template-body .input,
.xhs-link-template-body .select-input {
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  color: #111827;
}
.xhs-link-template-code-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.xhs-link-template-foot {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #eef0f4;
  background: #fff;
}
.xhs-link-template-foot > div {
  display: flex;
  gap: 8px;
}
.xhs-link-template-danger {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #dc2626;
  border-radius: 5px;
  padding: 7px 12px;
  cursor: pointer;
}
.xhs-link-template-danger:hover {
  background: #ffe4e6;
}

@media (max-width: 860px) {
  .xhs-link-import-box {
    width: calc(100vw - 24px);
  }
  .xhs-link-workbench-layout {
    grid-template-columns: 1fr;
  }
  .xhs-link-note-layout {
    grid-template-columns: 1fr;
  }
  .xhs-link-note-copy {
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border-2);
  }
  .xhs-link-right-rail,
  .xhs-link-left-rail {
    position: static;
  }
  .xhs-link-input-row,
  .xhs-link-preset-grid,
  .xhs-link-form-grid,
  .xhs-link-code-panel {
    grid-template-columns: 1fr;
  }
}

.shein-sticky-header {
  padding-bottom: 12px;
}
.shein-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 12px;
}
.shein-page-head h2 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}
.shein-page-head p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 13px;
}
.shein-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.shein-opportunity-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
}
.shein-opportunity-tab {
  min-height: 68px;
  padding: 12px 18px;
  border: 0;
  border-right: 1px solid #e5e7eb;
  background: transparent;
  color: #374151;
  text-align: center;
  cursor: pointer;
}
.shein-opportunity-tab:last-child {
  border-right: 0;
}
.shein-opportunity-tab strong {
  display: block;
  color: #111827;
  font-size: 15px;
  line-height: 22px;
}
.shein-opportunity-tab span {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
  line-height: 18px;
}
.shein-opportunity-tab.active {
  background: #fff;
  box-shadow: inset 0 -2px 0 #1a73e8;
}
.shein-opportunity-tab.active strong {
  color: #1a73e8;
}
.shein-status-tabs {
  margin-bottom: 10px;
}
.shein-search-bar {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(240px, 1fr) 120px 14px 120px auto auto;
  gap: 10px;
  align-items: center;
  padding: 0 0 10px;
}
.shein-price-input {
  min-width: 0;
}
.shein-filter-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding-top: 2px;
  border-top: 1px solid #eef0f3;
}
.shein-filter-chip {
  height: 28px;
  padding: 0 12px;
  border: 1px solid #d9e4ff;
  border-radius: 4px;
  background: #fff;
  color: #2563eb;
  font-size: 13px;
  cursor: pointer;
}
.shein-filter-chip.active {
  background: #eaf2ff;
  border-color: #7fb0ff;
  color: #0b63ce;
  font-weight: 600;
}
.shein-total {
  margin-left: auto;
  color: #6b7280;
  font-size: 13px;
  white-space: nowrap;
}
.shein-pager {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4b5563;
  font-size: 13px;
}
.shein-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 14px;
  padding: 14px 0 28px;
  background: #f4f6f8;
}
.shein-product-grid > .empty-tip {
  grid-column: 1 / -1;
  background: #fff;
  border-radius: 6px;
}
.shein-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
}
.shein-card:hover {
  border-color: #b9d3ff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.shein-card.shein-expired {
  border-color: #d1d5db;
  background: #f3f4f6;
  opacity: 0.72;
}
.shein-card.shein-expired:hover {
  border-color: #c4c9d1;
  box-shadow: none;
}
.shein-card.shein-expired .shein-card-media img {
  filter: grayscale(1);
}
.shein-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f3f4f6;
  cursor: zoom-in;
}
.shein-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shein-card-noimg {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #9ca3af;
  font-size: 13px;
}
.shein-sales-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: #ff7a1a;
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shein-source-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
}
.shein-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}
.shein-card-title {
  height: 38px;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  line-height: 19px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.shein-card-cat {
  height: 18px;
  overflow: hidden;
  color: #6b7280;
  font-size: 12px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shein-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 22px;
}
.shein-benefits span {
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: #fff2e8;
  color: #b45309;
  font-size: 12px;
  line-height: 20px;
}
.shein-price-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.shein-price-line span {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shein-price-line em {
  flex-shrink: 0;
  color: #6b7280;
  font-size: 11px;
  font-style: normal;
}
.shein-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}
.shein-card-time {
  min-height: 18px;
  color: #6b7280;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shein-card-time.expired,
.shein-expired-text {
  color: #6b7280 !important;
}
.shein-opportunity,
.shein-status-pill {
  height: 20px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}
.shein-opportunity {
  background: #eef2ff;
  color: #3730a3;
}
.shein-opportunity.scarce {
  background: #fff1f2;
  color: #be123c;
}
.shein-opportunity.trend {
  background: #ecfdf5;
  color: #047857;
}
.shein-opportunity.ranking {
  background: #ccfbf1;
  color: #0f766e;
}
.shein-status-pill {
  background: #f3f4f6;
  color: #4b5563;
}
.shein-status-pill.selected {
  background: #e0f2fe;
  color: #0369a1;
}
.shein-status-pill.pending_1688 {
  background: #fff7ed;
  color: #c2410c;
}
.shein-status-pill.consulted {
  background: #dcfce7;
  color: #15803d;
}
.shein-status-pill.rejected {
  background: #fee2e2;
  color: #b91c1c;
}
.shein-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.shein-card-actions .btn {
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
}
.shein-card-subactions {
  display: flex;
  justify-content: space-between;
  min-height: 18px;
}
.shein-card-subactions button {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
}
.shein-card-subactions button:hover {
  color: #1a73e8;
}

.shein-detail-box {
  width: min(1440px, calc(100vw - 36px));
  height: min(90vh, 860px);
  max-height: min(90vh, 860px);
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
}
.shein-detail-box > .modal-header {
  display: none;
}
.shein-detail-body {
  height: 100%;
  padding: 0;
  overflow: hidden;
}
.shein-detail-shell {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(520px, 600px);
  height: 100%;
  min-height: 0;
  background: #fff;
}
.shein-detail-media-pane {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 16px;
  gap: 12px;
  background: #f7f8fb;
  border-right: 1px solid #e5e7eb;
}
.shein-detail-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}
.shein-detail-thumb {
  width: 62px;
  height: 62px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
}
.shein-detail-thumb.active {
  border-color: #2563eb;
}
.shein-detail-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shein-detail-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  overflow: hidden;
}
.shein-detail-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}
.shein-detail-noimg,
.shein-report-product-noimg {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #9ca3af;
  background: #f3f4f6;
  font-size: 13px;
}
.shein-detail-info-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  color: #111827;
}
.shein-detail-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px 11px;
  border-bottom: 1px solid #eef0f3;
  flex-shrink: 0;
}
.shein-detail-overline {
  margin-bottom: 4px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
}
.shein-detail-title {
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.shein-detail-id {
  margin-top: 5px;
  color: #6b7280;
  font-size: 11px;
}
.shein-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 16px 14px;
}
.shein-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.shein-detail-tags span {
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: #fff4e6;
  color: #b45309;
  font-size: 11px;
  line-height: 20px;
}
.shein-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #fbfcff;
  margin-bottom: 14px;
}
.shein-detail-summary div {
  min-width: 0;
}
.shein-detail-summary label {
  display: block;
  color: #8b95a1;
  font-size: 10px;
  margin-bottom: 2px;
}
.shein-detail-summary b {
  display: block;
  color: #111827;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}
.shein-detail-section {
  margin-top: 10px;
}
.shein-detail-section-title {
  margin-bottom: 6px;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}
.shein-link-list {
  display: grid;
  gap: 8px;
}
.shein-link-list a {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #dbe7ff;
  border-radius: 6px;
  background: #f8fbff;
  color: #1d4ed8;
  text-decoration: none;
}
.shein-link-list span {
  font-size: 12px;
  font-weight: 700;
}
.shein-link-list em {
  min-width: 0;
  color: #4b5563;
  font-size: 11px;
  font-style: normal;
  line-height: 1.45;
  word-break: break-all;
}
.shein-skc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shein-skc-item {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid #dbe7ff;
  border-radius: 6px;
  background: #f8fbff;
  color: #111827;
  font-size: 12px;
  line-height: 1.35;
}
.shein-skc-item em {
  flex: 0 0 auto;
  margin-right: 6px;
  color: #1d4ed8;
  font-style: normal;
  font-weight: 700;
}
.shein-skc-item b {
  min-width: 0;
  font-weight: 600;
  word-break: break-all;
}
.shein-skc-search {
  flex: 0 0 auto;
  margin-left: 8px;
  padding: 3px 7px;
  border: 1px solid #93c5fd;
  border-radius: 5px;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.shein-skc-search:hover {
  background: #eff6ff;
  color: #1e40af;
}
.shein-1688-panel {
  display: grid;
  gap: 8px;
}
.shein-1688-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shein-1688-task {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fbfcff;
  font-size: 11px;
}
.shein-1688-task div {
  min-width: 0;
}
.shein-1688-task label {
  display: block;
  color: #6b7280;
  font-size: 10px;
}
.shein-1688-task b {
  display: block;
  color: #111827;
  word-break: break-all;
}
.shein-1688-task a {
  grid-column: 1 / -1;
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
  word-break: break-all;
}
.shein-1688-match {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  background: #f8fbff;
  font-size: 11px;
}
.shein-1688-match-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.8fr) minmax(56px, 0.4fr) minmax(140px, 1.4fr);
  gap: 6px;
  align-items: start;
}
.shein-1688-match-row em {
  color: #6b7280;
  font-style: normal;
  word-break: break-word;
}
.shein-1688-candidates {
  display: grid;
  gap: 7px;
}
.shein-1688-candidate {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  padding: 7px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
}
.shein-1688-candidate.same {
  border-color: #86efac;
  background: #f7fff9;
}
.shein-1688-candidate.rejected {
  opacity: 0.64;
  background: #fafafa;
}
.shein-1688-candidate img,
.shein-1688-noimg {
  width: 58px;
  height: 58px;
  border-radius: 5px;
  background: #f3f4f6;
  object-fit: cover;
}
.shein-1688-noimg {
  display: grid;
  place-items: center;
  color: #9ca3af;
}
.shein-1688-candidate strong,
.shein-1688-candidate p,
.shein-1688-candidate small {
  display: block;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
  word-break: break-word;
}
.shein-1688-candidate p {
  margin-top: 3px;
  color: #374151;
}
.shein-1688-candidate small {
  margin-top: 2px;
  color: #6b7280;
}
.shein-1688-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.shein-1688-row-actions a,
.shein-1688-row-actions button {
  padding: 3px 7px;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.shein-1688-inquiry {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #dcfce7;
  border-radius: 6px;
  background: #f8fff9;
  font-size: 11px;
}
.shein-1688-inquiry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #4b5563;
  font-size: 11px;
}
.shein-1688-inquiry-actions span {
  min-width: 0;
  word-break: break-all;
}
.shein-1688-inquiry-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 5px;
  background: #1677ff;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.shein-1688-inquiry-open:hover {
  background: #0f62d8;
  color: #fff;
}
.shein-1688-inquiry-batch {
  background: #16a34a;
}
.shein-1688-inquiry-batch:hover {
  background: #15803d;
}
.shein-1688-inquiry-muted {
  color: #9ca3af;
}
.shein-1688-inquiry pre {
  max-height: 180px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.shein-1688-reply-best {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  background: #f8fff9;
  font-size: 11px;
}
.shein-1688-reply-best.pending {
  border-color: #fde68a;
  background: #fffdf2;
}
.shein-1688-reply-best-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.shein-1688-reply-best-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.shein-1688-reply-best-head b {
  color: #111827;
  font-size: 12px;
}
.shein-1688-reply-best-head span {
  color: #6b7280;
  font-size: 10px;
}
.shein-1688-reply-best-head button {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid #93c5fd;
  border-radius: 5px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.shein-1688-reply-source {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}
.shein-1688-reply-source img,
.shein-1688-reply-source .shein-1688-noimg {
  width: 54px;
  height: 54px;
  border-radius: 5px;
  object-fit: cover;
}
.shein-1688-reply-source strong,
.shein-1688-reply-source p,
.shein-1688-reply-source small,
.shein-1688-reply-source a {
  display: block;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
  word-break: break-word;
}
.shein-1688-reply-source strong {
  color: #111827;
  font-size: 11px;
}
.shein-1688-reply-source p {
  margin-top: 3px;
  color: #374151;
}
.shein-1688-reply-source small {
  margin-top: 2px;
  color: #6b7280;
}
.shein-1688-reply-source a {
  margin-top: 4px;
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}
.shein-1688-reply-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.shein-1688-reply-fields div {
  display: grid;
  grid-template-columns: minmax(96px, 0.36fr) minmax(0, 1fr);
  min-width: 0;
  border-right: 1px solid #eef2f7;
  border-bottom: 1px solid #eef2f7;
}
.shein-1688-reply-fields div:nth-child(2n) {
  border-right: 0;
}
.shein-1688-reply-fields label,
.shein-1688-reply-fields b {
  min-width: 0;
  padding: 5px 7px;
  line-height: 1.35;
  word-break: break-word;
}
.shein-1688-reply-fields label {
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
}
.shein-1688-reply-fields b {
  color: #111827;
  font-size: 11px;
  font-weight: 600;
}
.shein-1688-reply-fields .empty b {
  color: #9ca3af;
  font-weight: 500;
}
.shein-1688-reply-hint {
  padding: 6px 8px;
  border-radius: 5px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  line-height: 1.45;
}
.shein-1688-reply-modal {
  z-index: 1320;
}
.shein-1688-reply-modal-box {
  width: min(1080px, calc(100vw - 44px));
  max-height: min(88vh, 820px);
  border-radius: 8px;
}
.shein-1688-reply-modal-body {
  padding: 12px;
  background: #f8fafc;
}
.shein-1688-reply-modal-grid {
  display: grid;
  gap: 10px;
}
.shein-1688-reply-source.modal-source {
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}
.shein-1688-reply-subtitle {
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}
.shein-1688-reply-summary {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
}
.shein-1688-reply-summary-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.38fr) minmax(0, 1fr);
  gap: 0;
  border: 1px solid #eef2f7;
  border-radius: 5px;
  overflow: hidden;
}
.shein-1688-reply-summary-row label,
.shein-1688-reply-summary-row b {
  min-width: 0;
  padding: 6px 8px;
  line-height: 1.45;
  word-break: break-word;
}
.shein-1688-reply-summary-row label {
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}
.shein-1688-reply-summary-row b {
  color: #111827;
  font-size: 11px;
  font-weight: 500;
}
.shein-1688-reply-raw {
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
}
.shein-1688-reply-raw summary {
  color: #374151;
  font-weight: 700;
  cursor: pointer;
}
.shein-1688-reply-raw pre {
  max-height: 220px;
  margin: 8px 0 0;
  padding: 8px;
  overflow: auto;
  border-radius: 5px;
  background: #0f172a;
  color: #e5e7eb;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.shein-require-list {
  margin: 0;
  padding-left: 18px;
  color: #374151;
  font-size: 13px;
  line-height: 1.7;
}
.shein-detail-empty {
  padding: 9px;
  border: 1px dashed #d8dee8;
  border-radius: 6px;
  color: #8b95a1;
  background: #fbfcff;
  font-size: 11px;
}
.shein-mini-open {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #dbe7ff;
  border-radius: 6px;
  background: #f8fbff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.shein-mini-open:hover {
  background: #eff6ff;
}
.shein-nested-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(15, 23, 42, 0.34);
}
.shein-nested-card {
  width: min(760px, calc(100vw - 64px));
  max-height: min(76vh, 680px);
  overflow: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}
.shein-nested-card-wide {
  width: min(1040px, calc(100vw - 64px));
}
.shein-nested-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f3;
  background: #fff;
  font-size: 12px;
}
.shein-nested-head button {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  color: #374151;
  font-size: 11px;
  cursor: pointer;
}
.shein-api-candidate-grid {
  display: grid;
  gap: 0;
  padding: 10px;
  font-size: 11px;
}
.shein-api-candidate-head,
.shein-api-candidate-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.95fr) minmax(220px, 1.35fr);
}
.shein-api-candidate-head span,
.shein-api-candidate-row span,
.shein-api-candidate-row b {
  padding: 6px 8px;
  border-right: 1px solid #eef0f3;
  border-bottom: 1px solid #eef0f3;
  word-break: break-all;
}
.shein-api-candidate-head span {
  background: #f8fafc;
  color: #374151;
  font-weight: 700;
}
.shein-api-candidate-row b {
  border-right: 0;
  color: #111827;
  font-weight: 600;
}
.shein-spec-actions {
  margin-bottom: 6px;
}
.shein-official-spec-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  font-size: 11px;
}
.shein-official-spec-table th,
.shein-official-spec-table td {
  padding: 6px 7px;
  border-right: 1px solid #eef0f3;
  border-bottom: 1px solid #eef0f3;
  color: #374151;
  line-height: 1.35;
  text-align: left;
  vertical-align: middle;
  word-break: break-word;
}
.shein-official-spec-table th {
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
}
.shein-official-spec-table th:last-child,
.shein-official-spec-table td:last-child {
  border-right: 0;
}
.shein-official-spec-table tr:last-child td {
  border-bottom: 0;
}
.shein-required-inline {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #fff1f2;
  font-size: 10px;
  line-height: 1.35;
}
.shein-full-sku-list {
  padding: 10px;
  background: #f8fafc;
  overflow-x: auto;
}
.shein-full-sku-table {
  min-width: max-content;
  width: max-content;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  font-size: 11px;
}
.shein-full-sku-table th,
.shein-full-sku-table td {
  padding: 7px 8px;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
  line-height: 1.35;
  text-align: left;
  vertical-align: middle;
  word-break: break-word;
}
.shein-full-sku-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #374151;
  font-weight: 700;
}
.shein-full-sku-table th:first-child,
.shein-full-sku-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fbfcff;
}
.shein-full-sku-table th:first-child {
  z-index: 3;
  background: #f8fafc;
}
.shein-full-sku-table tr:last-child td {
  border-bottom: 0;
}
.shein-full-sku-table th:last-child,
.shein-full-sku-table td:last-child {
  border-right: 0;
}
.shein-full-sku-skc b,
.shein-full-sku-code {
  font-weight: 700;
  word-break: break-all;
}
.shein-sku-grid {
  display: grid;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  font-size: 11px;
}
.shein-sku-row {
  display: grid;
  grid-template-columns: minmax(76px, 1.05fr) minmax(116px, 1.55fr) minmax(86px, 1.1fr) minmax(46px, 0.62fr) minmax(38px, 0.52fr);
}
.shein-sku-row > div {
  min-width: 0;
  padding: 6px 7px;
  border-right: 1px solid #eef0f3;
  border-bottom: 1px solid #eef0f3;
  color: #374151;
  line-height: 1.35;
  word-break: break-word;
}
.shein-sku-row > div:last-child {
  border-right: 0;
}
.shein-sku-row:last-child > div {
  border-bottom: 0;
}
.shein-sku-head > div {
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
}
.shein-sku-row b {
  display: block;
  color: #111827;
  font-size: 11px;
  font-weight: 600;
  word-break: break-all;
}
.shein-sku-row small {
  display: block;
  margin-top: 2px;
  color: #6b7280;
  font-size: 10px;
  line-height: 1.25;
  word-break: break-all;
}
.shein-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.shein-detail-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  font-size: 13px;
  background: #fff;
}
.shein-table-scroll .shein-detail-table {
  min-width: 980px;
  border: 0;
}
.shein-detail-table th,
.shein-detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f3;
  border-right: 1px solid #eef0f3;
  text-align: left;
  vertical-align: top;
}
.shein-detail-table th:last-child,
.shein-detail-table td:last-child {
  border-right: 0;
}
.shein-detail-table tr:last-child td {
  border-bottom: 0;
}
.shein-detail-table th {
  background: #f8fafc;
  color: #374151;
  font-weight: 700;
}
.shein-required {
  color: #ef4444;
  font-weight: 700;
  white-space: nowrap;
}
.shein-muted {
  color: #8b95a1;
}
.shein-report-product {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dbe7ff;
  border-radius: 7px;
  background: #f8fbff;
}
.shein-report-product img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.shein-report-product strong {
  display: block;
  color: #111827;
  font-size: 13px;
  line-height: 1.45;
  max-height: 38px;
  overflow: hidden;
}
.shein-report-product p {
  margin: 4px 0;
  color: #6b7280;
  font-size: 12px;
}
.shein-report-product span {
  display: inline-flex;
  height: 22px;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
}
.shein-detail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #eef0f3;
  background: #fff;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .shein-page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .shein-opportunity-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .shein-opportunity-tab:nth-child(2n) {
    border-right: 0;
  }
  .shein-search-bar {
    grid-template-columns: 1fr 1fr;
  }
  .shein-search-bar .date-sep {
    display: none;
  }
  .shein-filter-strip {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .shein-total {
    margin-left: 0;
  }
  .shein-detail-box {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
  }
  .shein-detail-shell {
    grid-template-columns: 1fr;
  }
  .shein-detail-media-pane {
    min-height: 320px;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }
  .shein-detail-summary {
    grid-template-columns: 1fr;
  }
}
.xhs-convert-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}
.xhs-convert-mini > div {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 6px;
  align-items: center;
}
.xhs-convert-mini span {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}
.xhs-convert-mini input {
  width: 100%;
  min-width: 0;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
}
.xhs-thumb-wrap {
  position: relative;
}
.xhs-mainimgs-wrap {
  width: 100%;
}
.xhs-mainimgs-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
  min-height: 20px;
}
.xhs-mainimgs-page-btn {
  width: 22px;
  height: 18px;
  border: 1px solid #cfe0ff;
  border-radius: 4px;
  background: #f8fbff;
  color: #1a73e8;
  font-size: 16px;
  line-height: 14px;
  cursor: pointer;
  padding: 0;
}
.xhs-mainimgs-page-btn:hover {
  background: #eaf3ff;
  border-color: #8bbcff;
}
.xhs-mainimgs-page-count {
  font-size: 10px;
  line-height: 1;
  color: #8a8f98;
  min-width: 24px;
  text-align: center;
}
.xhs-row .col-op {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.xhs-row .col-video,
.xhs-row .col-live,
.xhs-row .col-mainimgs {
  min-width: 0;
}
.xhs-row .col-detailthumbs {
  min-width: 0;
}
.xhs-row .col-video .detail-thumb-section,
.xhs-row .col-live .detail-thumb-section {
  margin-bottom: 0;
}
.xhs-row .col-video .detail-thumb-grid,
.xhs-row .col-live .detail-thumb-grid {
  grid-template-columns: 1fr;
}
.xhs-media-grid-single {
  width: 100%;
}
.xhs-thumb-action {
  position: absolute;
  left: 4px;
  bottom: 4px;
  border: 0;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  border-radius: 3px;
  font-size: 10px;
  padding: 2px 4px;
  cursor: pointer;
}
.xhs-thumb-action:hover { background: rgba(17, 24, 39, 0.92); }
.xhs-row .col-banana, .xhs-row .col-cutimg, .xhs-row .col-mainimgs, .xhs-row .col-colorimg, .xhs-row .col-detailthumbs, .xhs-row .col-video, .xhs-row .col-live {
  padding: 0 6px;
}

/* ===================== 识图属性 + 合成列 ===================== */
.col-aiattrs, .col-compose { padding: 0 6px; }

.ai-status-none { font-size: 12px; color: #ccc; }
.ai-status-done {
  font-size: 11px;
  color: #389e0d;
  font-weight: 500;
  margin-bottom: 4px;
}
.ai-status-pending {
  font-size: 11px;
  color: #d48806;
  font-weight: 500;
  margin-bottom: 4px;
}
.ai-status-fail {
  font-size: 11px;
  color: #dc2626;
  font-weight: 500;
  margin-bottom: 4px;
}
.ai-view-btn {
  display: inline-block;
  background: none;
  border: 1px solid #389e0d;
  color: #389e0d;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.ai-view-btn:hover { background: #389e0d; color: #fff; }

.ai-fill-single-btn {
  display: inline-block;
  background: none;
  border: 1px solid #1677ff;
  color: #1677ff;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 4px;
}
.ai-fill-single-btn:hover { background: #1677ff; color: #fff; }
.ai-fill-single-btn:disabled { border-color: #ccc; color: #ccc; cursor: not-allowed; background: none; }

.col-aiattrs {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

/* ===================== 查看成品弹窗 ===================== */
.final-json-wrap {
  padding: 16px 20px;
}
.final-meta-row {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.final-meta-left {
  flex: 1;
  min-width: 0;
}
.final-meta-right {
  flex: 0 0 220px;
  border: 1px solid #e4393c;
  border-radius: 6px;
  padding: 12px 14px;
}
.final-sku-panel {}
.sku-group-label {
  font-size: 12px;
  color: #333;
  font-weight: 500;
  margin-bottom: 6px;
}
.sku-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sku-color-item {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 2px solid #e4393c;
  border-radius: 4px;
  padding: 3px 8px 3px 4px;
  font-size: 12px;
  color: #333;
}
.sku-color-img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 2px;
}
.sku-size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sku-size-item {
  border: 1px solid #e4393c;
  border-radius: 4px;
  padding: 3px 12px;
  font-size: 12px;
  color: #333;
}
.final-img-panel {
  margin-bottom: 10px;
}
.final-img-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 5px;
  margin-top: 4px;
}
.final-img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
.final-thumb-34 {
  height: 72px;
  width: 54px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #f0f0f0;
}
.final-thumb-11 {
  height: 56px;
  width: 56px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #f0f0f0;
}
.final-detail-section {
  margin-top: 8px;
}
.final-thumb-detail {
  height: 60px;
  width: auto;
  max-width: 90px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #f0f0f0;
}

.final-sku-block {
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  padding: 12px 14px;
  background: #fff;
}
.final-sku-label {
  font-size: 12px;
  color: #333;
  font-weight: 600;
  margin: 4px 0 8px;
}
.final-color-row, .final-size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.final-color-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 2px solid #e4393c;
  border-radius: 4px;
  padding: 4px 10px 4px 4px;
  background: #fff;
  font-size: 12px;
  color: #222;
}
.final-color-chip img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 3px;
  cursor: zoom-in;
}
.final-size-chip {
  min-width: 38px;
  text-align: center;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 5px 12px;
  background: #fff;
  font-size: 12px;
  color: #333;
}
.json-summary {
  cursor: pointer;
  color: #1677ff;
  font-size: 12px;
  margin-bottom: 8px;
  user-select: none;
}
.json-collapsible {
  max-height: 360px;
  overflow: auto;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.compose-status-none { font-size: 12px; color: #ccc; }
.compose-btn-group { display: flex; flex-direction: column; gap: 5px; }
.btn-compose-pending {
  background: none;
  border: 1px solid #d9d9d9;
  color: #888;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-compose-pending:hover { border-color: #e4393c; color: #e4393c; }
.btn-compose-done {
  background: #e4393c;
  border: 1px solid #e4393c;
  color: #fff;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn-compose-done:hover { background: #c0392b; border-color: #c0392b; }

/* ===================== 识图JSON查看 ===================== */
.ai-json-tree {
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.7;
  overflow-y: auto;
  max-height: 70vh;
}
.ai-json-title-val {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}
.ai-json-title-label {
  font-size: 11px;
  color: #aaa;
  font-weight: 400;
  margin-right: 6px;
}
.ai-attrs-table {
  width: 100%;
  border-collapse: collapse;
}
.ai-attrs-table th {
  background: #fafafa;
  font-size: 11px;
  color: #888;
  font-weight: 500;
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid #e8eaed;
}
.ai-attrs-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
  color: #333;
  vertical-align: middle;
}
.ai-attrs-table tr:last-child td { border-bottom: none; }
.ai-attrs-table td:first-child { color: #888; font-size: 12px; }

/* 识图记录页表头 */
.ailogs-header {
  grid-template-columns: 60px 90px 60px 1fr 110px 140px 80px 130px !important;
}
.ailogs-row {
  grid-template-columns: 60px 90px 60px 1fr 110px 140px 80px 130px;
}

/* ===================== 结果比对 ===================== */
.modal-compare-box {
  width: 1400px;
  max-width: 98vw;
}
.compare-body {
  padding: 16px 20px;
  overflow-y: auto;
}
.compare-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-nav-info {
  font-size: 13px;
  color: #888;
  min-width: 44px;
  text-align: center;
}
.compare-nav-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: #e4393c;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.compare-nav-btn:hover { background: #c93537; }
.compare-nav-btn:disabled { background: #f0c0c0; cursor: not-allowed; }
.compare-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.compare-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compare-col-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}
.compare-img-wrap {
  background: #f5f6fa;
  border-radius: 6px;
  border: 1px solid #e8eaed;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
.compare-img-wrap-sq {
  min-height: 160px;
}
.compare-img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  cursor: zoom-in;
  display: block;
}
#compare-color-img { max-height: 260px; }
#compare-prod-img { max-height: 900px; }
#compare-banana-img { max-height: 900px; }
.compare-img-wrap-sq .compare-img {
  max-height: 240px;
}
.compare-cut-imgs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.compare-cut-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.compare-cut-label {
  font-size: 11px;
  color: #bbb;
  font-weight: 500;
}
.compare-gen-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ▶ 按钮（生图缩略图旁） */
.btn-compare-jump {
  background: rgba(22,119,255,0.1);
  border: 1px solid rgba(22,119,255,0.3);
  color: #1677ff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.4;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-compare-jump:hover {
  background: #1677ff;
  color: #fff;
}
.btn-compare-inline {
  background: rgba(22,119,255,0.08);
  border: 1px solid rgba(22,119,255,0.25);
  color: #1677ff;
  font-size: 10px;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 4px;
  display: block;
  width: 28px;
  text-align: center;
  line-height: 1.3;
  transition: all 0.15s;
}
.btn-compare-inline:hover { background: #1677ff; color: #fff; border-color: #1677ff; }
.btn-compare-jump-modal {
  background: rgba(22,119,255,0.1);
  border: 1px solid rgba(22,119,255,0.3);
  color: #1677ff;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-compare-jump-modal:hover { background: #1677ff; color: #fff; }

.compare-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px 16px 4px;
  border-top: 1px solid #f0f0f0;
  margin-top: 8px;
}
.btn-warning {
  background: #fff7e6; color: #d46b08; border: 1px solid #ffd591;
  padding: 6px 16px; border-radius: 6px; font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.btn-warning:hover { background: #ffe7ba; }
.btn-danger {
  background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e;
  padding: 6px 16px; border-radius: 6px; font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover { background: #ffccc7; }

/* ===================== 图片预览 ===================== */
.img-preview {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.img-preview.hidden { display: none; }
.img-preview-image-stage {
  position: relative;
  display: inline-block;
  max-width: 90vw;
  max-height: 90vh;
}
.img-preview-image-stage.hidden { display: none; }
.img-preview-image-stage img {
  display: block;
  max-width: 90vw; max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.img-preview video {
  max-width: 90vw;
  max-height: 90vh;
}
.img-preview-live .xhs-live-preview-img,
.img-preview-live .xhs-live-preview-video {
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}
.img-preview-live {
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-preview-fraction {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 6;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(17,24,39,0.34);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.img-preview-nav {
  position: absolute;
  top: 50%;
  z-index: 6;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  border: 0;
}
.img-preview-nav.left { left: 10px; }
.img-preview-nav.right { right: 10px; }
.img-preview-nav.forbidden {
  opacity: 0.35;
  pointer-events: none;
}
.img-preview-image-stage:hover .img-preview-fraction,
.img-preview-image-stage:hover .img-preview-nav {
  opacity: 1;
}
.img-preview-image-stage:hover .img-preview-nav.forbidden {
  opacity: 0.35;
}

/* ===================== Toast ===================== */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  background: rgba(30,30,30,0.88); color: #fff;
  padding: 9px 22px; border-radius: 20px;
  font-size: 13px; z-index: 9998;
  pointer-events: none; white-space: nowrap;
}
.toast.hidden { display: none; }
.hidden { display: none !important; }

/* ===================== 店铺切换 ===================== */
.shop-switcher-wrap {
  display: flex; align-items: center; gap: 6px;
  margin-left: 16px;
}
.shop-label { font-size: 12px; color: #888; white-space: nowrap; }
#shop-switcher { min-width: 120px; }

/* ===================== 设置页 ===================== */
.settings-page { padding: 20px; max-width: 900px; }
.settings-section {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8eaed;
  margin-bottom: 20px;
  overflow: hidden;
}
.settings-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.settings-section-title { font-size: 14px; font-weight: 600; color: #222; }
.settings-list { padding: 0; }
.settings-item {
  display: flex; align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f5f5f5;
  gap: 12px;
}
.settings-item:last-child { border-bottom: none; }
.settings-item-name { font-size: 13px; font-weight: 500; color: #222; flex: 1; }
.settings-item-meta { font-size: 12px; color: #888; flex: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.settings-empty { padding: 24px 20px; color: #bbb; font-size: 13px; text-align: center; }
.subscription-table-wrap { overflow-x: auto; }
.subscription-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
.subscription-table th,
.subscription-table td {
  border: 1px solid #e5e7eb;
  padding: 9px 12px;
  text-align: center;
  color: #333;
  white-space: nowrap;
}
.subscription-table th {
  background: #fafafa;
  font-weight: 600;
}
.subscription-bind-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.subscription-bind-cell select,
.subscription-bind-cell input {
  min-width: 180px;
}
.subscription-bind-input {
  max-width: 240px;
}
.subscription-bind-relations {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 260px;
}
.subscription-binding-line {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto minmax(100px, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  color: #333;
}
.subscription-binding-line b {
  color: #999;
  font-weight: 600;
}
.subscription-pending {
  color: #d97706;
  font-size: 12px;
}
.subscription-bindings-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}
.active-shop-badge {
  display: inline-block; padding: 1px 8px;
  background: #f6ffed; color: #389e0d;
  border: 1px solid #b7eb8f;
  border-radius: 10px; font-size: 11px; margin-left: 8px;
}

/* ===================== 表单辅助 ===================== */
.form-row { margin-bottom: 14px; }
.form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.form-hint { font-size: 11px; color: #aaa; font-weight: 400; margin-left: 6px; }
.form-hint code { background: #f5f5f5; padding: 1px 4px; border-radius: 3px; font-size: 11px; color: #d46b08; }
.image-storage-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.image-storage-summary-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.image-storage-summary-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.image-storage-summary-status {
  flex-shrink: 0;
  font-size: 12px;
  color: #52c41a;
}
.image-storage-modal {
  width: min(820px, calc(100vw - 32px));
}
.image-storage-modal-body {
  display: grid;
  gap: 12px;
}
.image-config-block {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.image-config-block-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.image-config-subtitle {
  margin: 12px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.image-config-provider-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.image-config-provider-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.image-config-provider-option.active {
  border-color: var(--blue);
  background: rgba(26,115,232,0.08);
}
.image-config-provider-option input {
  margin-top: 2px;
}
.image-config-provider-option strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}
.image-config-provider-option em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.4;
}
.image-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.image-config-grid-wide {
  grid-column: 1 / -1;
}
.image-config-grid .input,
.image-config-block .input {
  width: 100%;
}
.image-config-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 12px;
}
@media (max-width: 720px) {
  .image-storage-summary,
  .image-config-provider-row,
  .image-config-grid {
    grid-template-columns: 1fr;
  }
  .image-storage-summary {
    display: grid;
  }
}
.img-url-text {
  display: block;
  font-size: 10px;
  color: #aaa;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.task-id-text {
  font-size: 10px;
  color: #d46b08;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.btn-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* 颜色图：更大，填满黑框 */
.color-img-lg {
  width: 100%; height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: zoom-in;
  display: block;
}

/* 详情图横向滚动条（替换 hover popup） */
.detail-imgs-scroll-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  width: 120px;
}
.detail-scroll-btn {
  flex-shrink: 0;
  width: 16px; height: 50px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: #888;
}
.detail-scroll-btn:hover { background: #e0e0e0; color: #333; }
.detail-imgs-strip {
  flex: 1;
  display: flex;
  gap: 3px;
  overflow-x: hidden;
  scroll-behavior: smooth;
}
.detail-strip-img {
  width: 44px; height: 50px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #eee;
  cursor: zoom-in;
  flex-shrink: 0;
}

/* 生图列：大图填满列宽 */
.banana-thumb-lg {
  width: 100%; height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: zoom-in;
  display: block;
}
.banana-task-info {
  font-size: 10px;
  color: #888;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.banana-compact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.banana-row-btns {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.banana-row-btns-compact {
  margin-top: 0;
}
.btn-row-banana-del {
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid #ffccc7;
  background: #fff1f0;
  color: #cf1322;
  border-radius: 3px;
  cursor: pointer;
}
.btn-row-banana-del:hover { background: #ffccc7; }
.btn-row-banana-regen {
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid #b7eb8f;
  background: #f6ffed;
  color: #389e0d;
  border-radius: 3px;
  cursor: pointer;
}
.btn-row-banana-regen:hover { background: #b7eb8f; }
.btn-row-banana-export {
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid #91caff;
  background: #e6f4ff;
  color: #0958d9;
  border-radius: 3px;
  cursor: pointer;
}
.btn-row-banana-export:hover { background: #bae0ff; }
.log-result-img-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* 单行生图大按钮（未生图时显示） */
.btn-row-banana-gen {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 0;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}
.btn-row-banana-gen:hover { background: #0958d9; }

/* 生图历史入口 */
.banana-history-entry {
  font-size: 10px;
  color: #1677ff;
  margin-top: 6px;
  cursor: pointer;
  text-decoration: underline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.banana-history-entry:hover { color: #0958d9; }
.banana-fail-entry {
  color: #cf1322;
  cursor: default;
  text-decoration: none;
  white-space: normal;
}
.banana-fail-entry:hover { color: #cf1322; }
.banana-history-line {
  line-height: 1.4;
}
.banana-fail-text {
  margin-top: 2px;
}
.banana-history-panel {
  margin-top: 4px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 10px;
  color: #555;
}
.banana-hist-item {
  padding: 2px 0;
  border-bottom: 1px solid #f0f0f0;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
}
.banana-hist-item:last-child { border-bottom: none; }

/* 生图记录单任务查询按钮 */
.btn-hist-query {
  font-size: 11px;
  padding: 1px 7px;
  border: 1px solid #1677ff;
  border-radius: 3px;
  color: #1677ff;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-hist-query:hover { background: #e6f0ff; }
.btn-hist-query:disabled { opacity: 0.5; cursor: not-allowed; }

/* 已生图未切图：大切图按钮 */
.btn-cut-big {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 500;
  background: #fff7e6;
  border: 1px solid #ffa940;
  border-radius: 5px;
  color: #d46b08;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}
.btn-cut-big:hover { background: #ffe7ba; }

/* 表头生图比对按钮 */
.btn-compare-header {
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}
.btn-compare-header:hover { background: #0958d9; }

/* 生图比对按钮 */
.btn-compare-bar {
  background: #d4edda;
  color: #2d7d46;
  border: 1px solid #b7dfc4;
  border-radius: 5px;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-compare-bar:hover { background: #b7dfc4; }

/* ▶比对 按钮加大 */
.btn-compare-inline {
  background: rgba(22,119,255,0.08);
  border: 1px solid rgba(22,119,255,0.25);
  color: #1677ff;
  font-size: 11px;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 4px;
  display: block;
  width: 36px;
  text-align: center;
  line-height: 1.4;
  transition: all 0.15s;
}

/* ===================== 生图记录页 ===================== */
.logs-page { background: #f5f6fa; min-height: calc(100vh - 46px); }
.logs-toolbar {
  display: flex; align-items: center;
  padding: 8px 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.logs-total { font-size: 13px; color: #666; }
.logs-header {
  display: grid;
  grid-template-columns: 60px 90px 150px 110px 1fr 76px 76px 220px 76px 130px 80px;
  padding: 8px 20px;
  background: #fafafa;
  border-bottom: 1px solid #e8eaed;
  font-size: 12px; color: #888; font-weight: 500;
  position: sticky; top: 46px; z-index: 50;
}
.logs-header.ailogs-header,
.log-row.ailogs-row {
  grid-template-columns: 60px 90px 76px 150px 120px minmax(180px, 1fr) 90px 150px;
}
.log-row {
  display: grid;
  grid-template-columns: 60px 90px 150px 110px 1fr 76px 76px 220px 76px 130px 80px;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 20px;
  transition: background 0.12s;
}
.log-row:hover { background: #fffaf9; }
.log-cell { font-size: 12px; color: #444; padding-right: 8px; }
.log-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-id { font-size: 11px; color: #888; font-family: monospace; }
.log-task-id { font-size: 11px; color: #d46b08; font-family: monospace; }
.log-prompt {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #555;
}
.log-thumb { display: flex; align-items: center; }
.placeholder-log-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 72px;
  overflow: auto;
}
.placeholder-log-item {
  display: flex;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
}
.placeholder-log-item span {
  flex: 0 0 76px;
  color: #d46b08;
  font-family: monospace;
}
.placeholder-log-item b {
  flex: 1;
  min-width: 0;
  color: #555;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-img-thumb {
  width: 54px;
  height: 68px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  cursor: pointer;
  background: #f5f5f5;
}
.log-time { font-size: 11px; color: #aaa; }

/* ===================== 占位符提示 ===================== */
.placeholder-tip {
  background: #f0f7ff;
  border: 1px solid #bae0ff;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  color: #444;
  margin-bottom: 14px;
  line-height: 2;
}
.placeholder-tip code {
  background: #e6f4ff;
  color: #0958d9;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  margin-right: 2px;
}

/* ===================== 模板卡片提示词预览 ===================== */
.tpl-prompt-preview {
  font-size: 10px; padding: 2px 6px 3px;
  color: #888; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.3;
}
.tpl-alt-preview { color: #d46b08; }

/* ===================== 模板选择器（列表形式）===================== */
.tpl-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  padding: 6px;
  background: #fafafa;
}
/* 模板选择器 - 俄罗斯方块网格布局 */
.tpl-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid #e8eaed;
  border-radius: 6px;
  padding: 10px;
  background: #fafafa;
}
.tpl-picker-grid-paged {
  max-height: none;
  overflow: visible;
}
.tpl-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  background: #fff;
  transition: all 0.12s;
}
.tpl-grid-item:hover { border-color: #e4393c; background: #fffaf9; }
.tpl-grid-item.selected { border-color: #e4393c; background: #fff1f0; }
.tpl-grid-thumb {
  width: 58px; height: 74px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
}
.tpl-grid-name {
  font-size: 11px; font-weight: 500; color: #222;
  margin-top: 4px;
  text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.tpl-grid-group {
  max-width: 100%;
  margin-top: 2px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1677ff;
  font-size: 10px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-grid-group-single {
  background: #f3f4f6;
  color: #6b7280;
}
.tpl-grid-prompt {
  font-size: 10px; color: #999;
  text-align: center;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}
.tpl-grid-pager {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 2px;
  color: #6b7280;
  font-size: 12px;
}
.tpl-grid-pager button {
  border: 1px solid #d8dde8;
  border-radius: 5px;
  background: #fff;
  padding: 4px 12px;
  cursor: pointer;
}
.tpl-grid-pager button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.tpl-grid-expand {
  display: flex; align-items: center; justify-content: center;
  margin-top: 6px;
}
.tpl-grid-expand button {
  font-size: 12px; padding: 4px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #e4393c;
}
.tpl-grid-expand button:hover { background: #fff1f0; }
.tpl-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  background: #fff;
  transition: all 0.12s;
}
.tpl-list-item:hover { border-color: #e4393c; background: #fffaf9; }
.tpl-list-item.selected { border-color: #e4393c; background: #fff1f0; }
.tpl-list-thumb {
  width: 44px; height: 56px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
  flex-shrink: 0;
}
.tpl-list-info { flex: 1; min-width: 0; }
.tpl-list-name { font-size: 13px; font-weight: 500; color: #222; margin-bottom: 3px; }
.tpl-list-prompt {
  font-size: 11px; color: #888;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}
.tpl-list-alt { color: #d46b08; margin-top: 2px; }

/* ===================== 商品属性维护页 ===================== */
.attrs-page { padding: 16px 20px; }
.attrs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.attrs-toolbar-left { display: flex; align-items: center; gap: 10px; }
.attrs-toolbar-right { display: flex; align-items: center; gap: 8px; }
.attrs-title { font-size: 14px; font-weight: 600; color: var(--text); }
.attrs-hint { font-size: 12px; color: var(--muted); }
.attrs-table-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-size: 12px; color: var(--muted); font-weight: 500;
}
.attrs-category-table-header { display: none; }
.attrs-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  transition: background 0.1s;
}
.attrs-row:last-child { border-radius: 0 0 6px 6px; }
.attrs-row:hover { background: var(--row-hover); }

.mapping-table-header {
  display: grid;
  grid-template-columns: 1fr 32px 1.8fr 104px 70px 120px 60px;
  padding: 8px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-size: 12px; color: var(--muted); font-weight: 500;
}
.mapping-row {
  display: grid;
  grid-template-columns: 1fr 32px 1.8fr 104px 70px 120px 60px;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  transition: background 0.1s;
}
.mapping-row:last-child { border-radius: 0 0 6px 6px; }
.mapping-row:hover { background: var(--row-hover); }
.attrs-col-src, .attrs-col-dst { min-width: 0; }
.attrs-col-arrow { text-align: center; color: var(--muted-2); font-size: 14px; }
.attrs-col-catid { padding: 0 4px; font-size: 12px; }
.attrs-col-price { padding: 0 4px; font-size: 12px; }
.attrs-col-shop { padding: 0 6px; }
.attrs-col-op { display: flex; justify-content: flex-end; }
.attrs-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
  background: transparent;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.attrs-input:hover { border-color: var(--border); background: var(--surface-2); }
.attrs-input:focus { border-color: var(--brand); background: var(--surface); }
.attrs-shop-sel { font-size: 12px; padding: 3px 6px; width: 100%; }
.attrs-empty { padding: 40px 20px; text-align: center; color: var(--muted-2); font-size: 13px; border: 1px solid var(--border); border-top: none; border-radius: 0 0 6px 6px; background: var(--surface); }
.attrs-card-empty { border-top: 1px solid var(--border); border-radius: 6px; }

.taobao-publish-toolbar { margin-top: 24px; }
.taobao-publish-layout {
  width: min(320px, 100%);
}
.taobao-publish-sidebar {
  min-width: 0;
}
.taobao-publish-tree-summary {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}
.taobao-publish-entry-list {
  border: 1px solid var(--border);
  border-radius: 0 0 7px 7px;
  background: var(--surface);
}
.taobao-publish-entry-card {
  min-height: 54px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}
.taobao-publish-entry-card:hover {
  background: color-mix(in srgb, var(--blue) 7%, var(--surface));
}
.taobao-publish-entry-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.taobao-publish-entry-main strong,
.taobao-publish-entry-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taobao-publish-entry-main strong {
  color: var(--text);
  font-size: 13px;
}
.taobao-publish-entry-main span {
  color: var(--muted);
  font-size: 11px;
}
.taobao-publish-entry-action {
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}
.taobao-publish-entry-action:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.taobao-category-browser-modal {
  width: min(980px, calc(100vw - 48px));
  max-height: min(86vh, 760px);
}
.taobao-category-browser-modal .modal-body {
  padding: 14px;
}
.taobao-category-browser-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.taobao-category-browser-breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.taobao-category-browser-breadcrumb button {
  max-width: 180px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taobao-category-browser-breadcrumb button.active {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
  color: var(--blue);
}
.taobao-category-browser-breadcrumb span,
.taobao-category-browser-stats {
  color: var(--muted);
  font-size: 12px;
}
.taobao-category-browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.taobao-category-browser-card {
  width: 100%;
  min-height: 72px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font: inherit;
}
.taobao-category-browser-card:hover,
.taobao-category-browser-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 12%, transparent);
}
.taobao-category-browser-card strong,
.taobao-category-browser-card span,
.taobao-category-browser-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taobao-category-browser-card strong {
  font-size: 13px;
}
.taobao-category-browser-card span {
  color: var(--muted);
  font-size: 11px;
}
.taobao-category-browser-card small {
  color: var(--blue);
  font-size: 11px;
}
.taobao-publish-schema-modal {
  width: min(1240px, calc(100vw - 44px));
  max-height: min(90vh, 820px);
}
.taobao-publish-schema-modal .modal-body {
  padding: 14px 16px 16px;
  background: #f6f7fa;
}
.taobao-publish-schema-modal .modal-footer {
  padding-top: 10px;
  padding-bottom: 10px;
}
.taobao-publish-schema-item {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.taobao-publish-schema-item:hover,
.taobao-publish-schema-item.active {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
}
.taobao-publish-schema-item strong,
.taobao-publish-schema-item span,
.taobao-publish-schema-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taobao-publish-schema-item strong {
  font-size: 13px;
  margin-bottom: 3px;
}
.taobao-publish-schema-item span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.taobao-publish-schema-item small {
  color: var(--blue);
  font-size: 11px;
}
.taobao-publish-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.taobao-publish-title {
  font-size: 15px;
  font-weight: 700;
}
.taobao-publish-title span,
.taobao-required {
  color: #f5222d;
  margin-right: 4px;
}
.taobao-publish-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.taobao-publish-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.taobao-publish-meta span {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.taobao-publish-tip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.taobao-publish-card {
  overflow: hidden;
  border-radius: 7px;
  background: #f6f7fa;
  border: 1px solid var(--border-2);
}
.taobao-publish-section-head {
  padding: 14px 18px 8px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.taobao-publish-section-head strong {
  color: #111827;
  font-size: 14px;
}
.taobao-publish-section-head strong span {
  color: #1a73e8;
}
.taobao-publish-section-head em,
.taobao-publish-other-toggle em {
  color: #9ca3af;
  font-style: normal;
  font-size: 12px;
}
.taobao-publish-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 48px;
  row-gap: 12px;
  padding: 10px 28px 18px;
}
.taobao-publish-field {
  min-width: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 240px);
  align-items: start;
  gap: 10px;
}
.taobao-field-label {
  min-height: 32px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  color: #111827;
  font-size: 13px;
  line-height: 1.2;
  text-align: right;
}
.taobao-field-control {
  min-width: 0;
}
.taobao-field-control select,
.taobao-field-control input {
  width: 100%;
  height: 32px;
  border: 1px solid #dcdfe6;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  padding: 0 10px;
  font: inherit;
  outline: none;
}
.taobao-field-control select:focus,
.taobao-field-control input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
}
.taobao-publish-other-toggle {
  width: 100%;
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-top: 1px solid #eceff4;
  background: #f6f7fa;
  text-align: left;
  cursor: pointer;
  color: #111827;
  font: inherit;
}
.taobao-publish-other-toggle span {
  color: #1a73e8;
}
.taobao-publish-other {
  border-top: 1px solid #eceff4;
}
.taobao-publish-other.hidden { display: none; }

@media (max-width: 1180px) {
  .taobao-publish-layout { width: 100%; }
  .taobao-publish-field-grid { column-gap: 24px; padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 760px) {
  .taobao-publish-field-grid { grid-template-columns: 1fr; }
  .taobao-publish-field { grid-template-columns: 90px minmax(0, 1fr); }
}

.category-combo {
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-align: left;
}
.category-combo-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.category-combo-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}
.category-combo-arrow {
  color: var(--muted);
  font-size: 12px;
}
.category-combo:hover,
.category-combo.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 12%, transparent);
}
.category-path-hint {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-picker-popover {
  position: fixed;
  z-index: 3000;
  width: auto;
  min-width: 180px;
  max-width: calc(100vw - 24px);
  max-height: min(390px, calc(100vh - 32px));
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.category-picker-popover.hidden {
  display: none;
}
.category-picker-toolbar {
  display: grid;
  grid-template-columns: 190px minmax(260px, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.category-picker-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.category-picker-search input {
  width: 100%;
}
.category-picker-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 190px;
  align-items: start;
  min-height: 0;
  max-height: none;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  column-gap: 0;
}
.category-picker-column {
  min-width: 190px;
  width: 190px;
  max-height: 300px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
  overflow-x: hidden;
  overflow-y: auto;
}
.category-picker-column:last-child {
  border-right: 1px solid var(--border);
}
.category-picker-column-title {
  display: none;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.category-picker-item {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  gap: 8px;
  text-align: left;
  font-size: 12px;
}
.category-picker-item:hover,
.category-picker-item.active {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--brand);
}
.category-picker-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-picker-item-id {
  display: none;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.category-picker-actions {
  display: none;
}
.category-picker-empty {
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
}

.attr-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.attr-category-card {
  min-height: 92px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 1px 3px var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.attr-category-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 14%, transparent);
  transform: translateY(-1px);
}
.attr-category-card-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  height: 34px;
  overflow: hidden;
}
.attr-category-card-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attr-category-card-preview {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attr-category-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.attr-category-root-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.attr-category-root-card {
  min-height: 112px;
}
.attr-category-root-card .attr-category-card-title {
  height: auto;
  min-height: 22px;
  font-size: 13px;
}
.attrs-tree-modal {
  width: min(980px, calc(100vw - 48px));
  max-height: min(86vh, 760px);
}
.attrs-tree-summary {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}
.attrs-tree-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
  min-height: 420px;
}
.attrs-tree-branches {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: auto;
  max-height: min(58vh, 560px);
}
.attrs-tree-branch {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
}
.attrs-tree-branch:last-child {
  border-bottom: 0;
}
.attrs-tree-branch:hover,
.attrs-tree-branch.active {
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
}
.attrs-tree-branch.active {
  box-shadow: inset 3px 0 0 var(--brand);
}
.attrs-tree-branch span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.attrs-tree-branch small {
  color: var(--muted);
  font-size: 11px;
}
.attrs-tree-leaves {
  min-width: 0;
}
.attrs-tree-leaves-head {
  height: 34px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.attrs-tree-leaf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.attrs-tree-leaf:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 12%, transparent);
  transform: translateY(-1px);
}
.attrs-tree-leaf-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.attrs-tree-leaf-main strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attrs-tree-leaf-main span,
.attrs-tree-leaf-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attrs-tree-leaf-main span {
  color: var(--muted);
  font-size: 11px;
}
.attrs-tree-leaf-main small {
  color: var(--muted-2);
  font-size: 11px;
}
.attrs-tree-leaf-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
@media (max-width: 760px) {
  .attrs-tree-modal {
    width: calc(100vw - 24px);
  }
  .attrs-tree-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .attrs-tree-branches {
    max-height: 220px;
  }
  .attrs-tree-leaf {
    grid-template-columns: 1fr;
  }
  .attrs-tree-leaf-actions {
    justify-content: flex-start;
  }
}
.btn-link.danger { color: var(--brand); }
.attrs-small-modal { width: min(420px, calc(100vw - 36px)); }
.attrs-category-modal { width: min(680px, calc(100vw - 36px)); max-height: min(86vh, 760px); }
.attrs-modal-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 12px;
}
.attrs-modal-category,
.attrs-modal-category-input {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}
.attrs-modal-category-input {
  width: min(420px, 100%);
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  padding: 5px 7px;
  outline: none;
}
.attrs-modal-category-input:hover {
  border-color: var(--border);
  background: var(--surface-2);
}
.attrs-modal-category-input:focus {
  border-color: var(--brand);
  background: var(--surface);
}
.attrs-modal-table-head,
.attrs-modal-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(210px, 2fr) 54px 58px 54px;
  gap: 10px;
  align-items: center;
}
.attrs-modal-table-head {
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.attrs-modal-row {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
}
.attrs-modal-row:last-child { border-radius: 0 0 6px 6px; }
.attrs-modal-row:hover { background: var(--row-hover); }
.attrs-modal-check { text-align: center; }
.attrs-sort-input { text-align: center; }
.attrs-modal-op { text-align: right; }

/* 类目属性树形结构 */
.attr-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top: none;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.attr-group-header:first-child { border-top: 1px solid var(--border); border-radius: 6px 6px 0 0; }
.attr-group-header:hover { background: var(--surface-3); }
.attr-group-toggle { font-size: 10px; color: var(--muted); width: 12px; flex-shrink: 0; }
.attr-group-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attr-group-count { font-size: 11px; color: var(--muted); font-weight: 400; flex-shrink: 0; }
.attr-group-add { font-size: 12px; color: var(--brand); flex-shrink: 0; }
.attr-group-del { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.attr-group-del:hover { color: var(--brand); }
.attr-group-body .attrs-row { padding-left: 28px; }
.attr-group-body .attrs-row:last-child { border-radius: 0; }
.attr-group-body:last-child .attrs-row:last-child { border-radius: 0 0 6px 6px; }

/* ===================== 账户计费页 ===================== */
.billing-page {
  padding: 18px 22px;
}
.billing-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.billing-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.billing-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.billing-summary-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.billing-summary-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
  min-height: 76px;
}
.billing-summary-card.primary {
  border-color: color-mix(in srgb, var(--blue) 40%, var(--border));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
}
.billing-summary-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.billing-summary-card b {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 1.3;
}
.billing-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 12px;
}
.billing-toolbar .search-input:first-child {
  width: 240px;
}
.billing-toolbar .search-input[type="date"] {
  width: 150px;
}
.billing-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 14px;
}
.billing-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.billing-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.billing-section-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}
.billing-table-wrap {
  overflow-x: auto;
}
.billing-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.billing-table th,
.billing-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--text-2);
  font-size: 12px;
  vertical-align: middle;
}
.billing-table th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}
.billing-table tr:hover td {
  background: var(--row-hover);
}
.billing-table tr:last-child td {
  border-bottom: 0;
}
.billing-ref {
  margin-top: 3px;
  max-width: 260px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.billing-record-code {
  margin-top: 3px;
  color: var(--text);
  font-weight: 800;
}
.billing-prompt-preview {
  max-width: 220px;
  color: var(--text-2);
  line-height: 1.35;
}
.billing-imgs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.billing-img-thumb,
.billing-img-empty {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.billing-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.billing-img-thumb span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1px 2px;
  background: rgba(0,0,0,0.58);
  color: #fff;
  text-align: center;
  line-height: 1.2;
}
.billing-type {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 10%, var(--surface-2));
  color: var(--blue);
  font-weight: 700;
}
.billing-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 800;
}
.billing-status.success {
  color: #248a18;
  background: #edfbe8;
}
.billing-status.fail {
  color: #d9363e;
  background: #fff1f0;
}
.billing-status.processing {
  color: #b26a00;
  background: #fff7e6;
}
.billing-amount {
  font-weight: 800;
  white-space: nowrap;
}
.billing-amount.positive { color: #248a18; }
.billing-amount.negative { color: var(--brand); }
.billing-empty {
  height: 84px;
  text-align: center !important;
  color: var(--muted) !important;
}
.billing-detail-modal {
  width: min(760px, calc(100vw - 32px));
  max-height: min(88vh, 820px);
}
.billing-detail-summary {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  margin-bottom: 12px;
}
.billing-detail-summary > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  margin-bottom: 6px;
}
.billing-detail-prompt {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  white-space: pre-wrap;
  max-height: 130px;
  overflow: auto;
}
.billing-detail-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.billing-detail-media > div {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  padding: 7px;
}
.billing-detail-media span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.billing-detail-media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 5px;
  background: var(--surface-2);
}
.billing-detail-url {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.billing-detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.billing-detail-tabs button {
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  color: var(--text-2);
  padding: 8px 18px;
  cursor: pointer;
  font-weight: 600;
}
.billing-detail-tabs button.active {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--blue);
  border-radius: 6px 6px 0 0;
}
.billing-detail-panel {
  border: 1px solid var(--border);
  border-top: 0;
  background: var(--surface-2);
}
.billing-detail-json {
  margin: 0;
  padding: 14px 16px;
  max-height: 360px;
  overflow: auto;
  color: var(--text);
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

html[data-theme="dark"] .billing-status.success {
  color: #9af27f;
  background: color-mix(in srgb, #52c41a 18%, var(--surface-2));
}
html[data-theme="dark"] .billing-status.fail {
  color: #ff9ca0;
  background: color-mix(in srgb, #ff4d4f 18%, var(--surface-2));
}
html[data-theme="dark"] .billing-status.processing {
  color: #ffd47a;
  background: color-mix(in srgb, #faad14 18%, var(--surface-2));
}
html[data-theme="dark"] .billing-amount.positive { color: #9af27f; }

@media (max-width: 1180px) {
  .billing-summary-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .billing-page { padding: 12px; }
  .billing-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-toolbar { flex-wrap: wrap; }
  .billing-toolbar .search-input:first-child,
  .billing-toolbar .search-input[type="date"] { width: 100%; }
}
.goods-code-row { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.goods-code-input {
  flex: 1;
  min-width: 0;
  max-width: 160px;
  padding: 1px 5px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 11px;
  color: #722ed1;
  background: transparent;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.goods-code-input:hover { border-color: #d3adf7; background: #f9f0ff; }
.goods-code-input:focus { border-color: #722ed1; background: #f9f0ff; }
.goods-code-recalc {
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  color: #aaa;
}
.goods-code-recalc:hover { color: #722ed1; }

/* ===================== 工作流步骤编辑器 ===================== */
.workflow-step-card {
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 10px;
  background: #fafafa;
}
.workflow-step-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 4px;
}
.step-num {
  font-size: 12px;
  font-weight: 600;
  color: #1890ff;
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  border-radius: 4px;
  padding: 1px 7px;
  white-space: nowrap;
}
.step-name-input {
  height: 28px !important;
  font-size: 13px !important;
}
.workflow-section {
  margin-top: 8px;
}
.workflow-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kv-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.kv-row .search-input {
  flex: 1;
  min-width: 0;
  height: 28px !important;
  font-size: 12px !important;
}
.kv-key { max-width: 140px !important; }
.btn-xs {
  padding: 1px 7px !important;
  font-size: 11px !important;
  height: 22px !important;
  line-height: 20px !important;
}

/* ===================== 图片拖放替换 ===================== */
.drop-target {
  position: relative;
  cursor: copy;
}
.drop-hint {
  display: none;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(22,119,255,0.75);
  color: #fff;
  font-size: 11px;
  text-align: center;
  padding: 2px 0;
  border-radius: 0 0 4px 4px;
  pointer-events: none;
}
.drop-target:hover .drop-hint {
  display: block;
}
.drop-target.drag-over {
  outline: 2px dashed #1677ff;
  outline-offset: 2px;
  border-radius: 4px;
  background: rgba(22,119,255,0.06);
}
.drop-target.drag-over .drop-hint {
  display: block;
  background: rgba(22,119,255,0.9);
}
/* 详情弹窗里可拖出的图片 */
.draggable-img {
  cursor: grab;
}
.draggable-img:active {
  cursor: grabbing;
  opacity: 0.7;
}

/* ===================== 主题模式 ===================== */
.sidebar,
.status-tabs,
.batch-category-bar,
.search-bar,
.action-bar,
.settings-section,
.modal-box,
.list-header,
.logs-header,
.attrs-table-header,
.mapping-table-header,
.attr-group-header {
  background-color: var(--surface);
  border-color: var(--border);
}

.products-sticky-header,
.product-list,
.main-content,
.settings-page {
  background-color: var(--bg);
}

.sidebar-logo,
.sidebar-shop,
.sidebar-footer,
.settings-section-header,
.settings-item,
.product-row,
.modal-header,
.modal-footer,
.batch-category-bar,
.search-bar,
.action-bar,
.list-header {
  border-color: var(--border-2);
}

.sidebar-shop-name,
.settings-section-title,
.settings-item-name,
.p-title,
.modal-title,
.detail-section-title,
.tpl-card-name,
.tpl-group-name,
.tpl-list-name {
  color: var(--text);
}

.logo-sub,
.nav-item,
.status-tab,
.action-right,
.quick-date-btn,
.settings-item-meta,
.settings-hint,
.sidebar-user,
.date-sep,
#page-info,
.form-hint,
.shop-label {
  color: var(--muted);
}

.sidebar,
.product-row,
.settings-section,
.modal-box,
.settings-section-header,
.list-header,
.batch-cat-all,
.batch-expand-btn,
.quick-date-btn,
.btn,
.page-btn,
.search-input,
.select-input,
.input,
textarea {
  background-color: var(--surface);
}

.search-input,
.select-input,
.input,
textarea,
.btn,
.page-btn,
.sidebar-shop-switch-btn,
.sidebar-logout-btn,
.batch-cat-all,
.batch-expand-btn {
  color: var(--text);
  border-color: var(--border);
}

.search-input::placeholder,
.input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

.product-row:hover { background: var(--row-hover); }
.product-row.selected { background: var(--row-selected); }
.product-row.selected:hover { background: var(--row-selected); }
.product-list { background: var(--bg); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-default { background: var(--surface); color: var(--text); }
.btn-default:hover,
.page-btn:hover,
.batch-expand-btn:hover,
.batch-cat-all:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.btn-danger-outline {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--brand);
}
.status-tab:hover { color: var(--brand); }
.status-tab.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.nav-item:hover {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}
.nav-item.active {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  border-left-color: var(--blue);
}
.logo-big { color: var(--blue); }
.sidebar-shop-switch-btn,
.sidebar-logout-btn {
  background: var(--surface);
}
.sidebar-shop-switch-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}

html[data-theme="dark"] img {
  color-scheme: light;
}

html[data-theme="dark"] .modal-overlay,
html[data-theme="dark"] .img-preview-overlay {
  background: rgba(0,0,0,0.78);
}

html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .banana-modal-box,
html[data-theme="dark"] .xhs-detail-box,
html[data-theme="dark"] .shein-card,
html[data-theme="dark"] .tpl-card,
html[data-theme="dark"] .tpl-grid-item,
html[data-theme="dark"] .tpl-group-panel,
html[data-theme="dark"] .tpl-list-card,
html[data-theme="dark"] .detail-section,
html[data-theme="dark"] .compare-panel,
html[data-theme="dark"] .workflow-step,
html[data-theme="dark"] .attr-row,
html[data-theme="dark"] .mapping-row,
html[data-theme="dark"] .log-row,
html[data-theme="dark"] .xhs-note-row,
html[data-theme="dark"] .product-detail-sku-panel,
html[data-theme="dark"] .product-detail-color-card {
  background: var(--surface) !important;
  color: var(--text);
  border-color: var(--border) !important;
}

html[data-theme="dark"] .tpl-section,
html[data-theme="dark"] .tpl-section-header,
html[data-theme="dark"] .shein-opportunity-tabs,
html[data-theme="dark"] .shein-opportunity-tab.active,
html[data-theme="dark"] .xhs-detail-info,
html[data-theme="dark"] .xhs-detail-side,
html[data-theme="dark"] .xhs-detail-media,
html[data-theme="dark"] .banana-template-picker,
html[data-theme="dark"] .banana-group-picker,
html[data-theme="dark"] .banana-group-pool,
html[data-theme="dark"] .banana-prompt-tags,
html[data-theme="dark"] .settings-section-header,
html[data-theme="dark"] .logs-header,
html[data-theme="dark"] .attrs-toolbar,
html[data-theme="dark"] .attr-group-header,
html[data-theme="dark"] .workflow-step-header {
  background: var(--surface-2) !important;
  color: var(--text);
  border-color: var(--border) !important;
}

html[data-theme="dark"] .empty-tip,
html[data-theme="dark"] .no-img,
html[data-theme="dark"] .shein-page-head p,
html[data-theme="dark"] .shein-card-cat,
html[data-theme="dark"] .shein-price-line em,
html[data-theme="dark"] .p-id,
html[data-theme="dark"] .p-meta-item,
html[data-theme="dark"] .tpl-card-prompt,
html[data-theme="dark"] .tpl-list-prompt,
html[data-theme="dark"] .detail-section .val,
html[data-theme="dark"] .log-cell,
html[data-theme="dark"] .xhs-source-link,
html[data-theme="dark"] .form-hint,
html[data-theme="dark"] .settings-empty {
  color: var(--muted) !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] code,
html[data-theme="dark"] pre {
  background: var(--surface-3) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
  color: var(--text);
  border-color: var(--border) !important;
}

html[data-theme="dark"] .btn-default,
html[data-theme="dark"] .page-btn,
html[data-theme="dark"] .quick-date-btn,
html[data-theme="dark"] .shein-filter-chip,
html[data-theme="dark"] .sidebar-shop-switch-btn,
html[data-theme="dark"] .sidebar-logout-btn {
  background: var(--surface-3);
  color: var(--text-2);
  border-color: var(--border);
}

html[data-theme="dark"] .btn-danger-outline:hover {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}

html[data-theme="dark"] .product-color-thumb .drop-target-color > img,
html[data-theme="dark"] .main-img-grid img,
html[data-theme="dark"] .detail-imgs img,
html[data-theme="dark"] .tpl-card-img-wrap img,
html[data-theme="dark"] .shein-card-media,
html[data-theme="dark"] .xhs-thumb-wrap img {
  border-color: var(--border);
}

html[data-theme="dark"] .shein-product-grid {
  background: var(--bg);
}

html[data-theme="dark"] .shein-page-head h2,
html[data-theme="dark"] .shein-card-title,
html[data-theme="dark"] .shein-price-line span,
html[data-theme="dark"] .shein-opportunity-tab strong {
  color: var(--text) !important;
}

html[data-theme="dark"] .shein-opportunity-tab {
  border-color: var(--border);
  color: var(--text-2);
}

html[data-theme="dark"] .shein-filter-strip {
  border-top-color: var(--border);
}

/* ===================== 深色模式细节补齐 ===================== */
html[data-theme="dark"] .tpl-page,
html[data-theme="dark"] .logs-page,
html[data-theme="dark"] #template-page,
html[data-theme="dark"] #batch-detail-view {
  background: var(--bg) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .tpl-add-bar,
html[data-theme="dark"] .tpl-single-panel,
html[data-theme="dark"] .tpl-group-panel,
html[data-theme="dark"] .tpl-group-block,
html[data-theme="dark"] .prompt-tpl-card,
html[data-theme="dark"] .tpl-picker-list,
html[data-theme="dark"] .tpl-picker-grid,
html[data-theme="dark"] .banana-group-grid,
html[data-theme="dark"] .banana-group-tpl-card,
html[data-theme="dark"] .banana-history-panel,
html[data-theme="dark"] .final-sku-block,
html[data-theme="dark"] .ai-json-tree,
html[data-theme="dark"] .compare-img-wrap {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .xhs-detail-info-pane,
html[data-theme="dark"] .xhs-detail-info-head,
html[data-theme="dark"] .xhs-detail-scroll,
html[data-theme="dark"] .tpl-editor-side,
html[data-theme="dark"] #modal-edit-template .modal-footer,
html[data-theme="dark"] .logs-toolbar {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .tpl-card,
html[data-theme="dark"] .tpl-grid-item,
html[data-theme="dark"] .banana-mode-row label,
html[data-theme="dark"] .banana-group-btn,
html[data-theme="dark"] .banana-group-pager button,
html[data-theme="dark"] .product-detail-color-card,
html[data-theme="dark"] .product-detail-size-chip,
html[data-theme="dark"] .final-color-chip,
html[data-theme="dark"] .final-size-chip,
html[data-theme="dark"] .btn-hist-query,
html[data-theme="dark"] .detail-scroll-btn {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .tpl-card-img-wrap,
html[data-theme="dark"] .tpl-group-head,
html[data-theme="dark"] .tpl-source-row,
html[data-theme="dark"] .placeholder-tip,
html[data-theme="dark"] .banana-group-btn.active,
html[data-theme="dark"] .tpl-grid-item:hover,
html[data-theme="dark"] .tpl-grid-item.selected {
  background: var(--surface-3) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .tpl-card:hover,
html[data-theme="dark"] .prompt-tpl-card:hover,
html[data-theme="dark"] .tpl-grid-item:hover,
html[data-theme="dark"] .tpl-card.selected {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 42%, transparent) !important;
}

html[data-theme="dark"] .prompt-tag {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .prompt-tag:hover {
  background: color-mix(in srgb, var(--brand) 14%, var(--surface-2)) !important;
  border-color: var(--brand) !important;
  color: var(--brand) !important;
}

html[data-theme="dark"] .prompt-tag.active,
html[data-theme="dark"] .banana-group-btn.active {
  background: color-mix(in srgb, var(--blue) 20%, var(--surface-2)) !important;
  border-color: var(--blue) !important;
  color: var(--blue) !important;
}

html[data-theme="dark"] .tpl-section-title,
html[data-theme="dark"] .tpl-subhead,
html[data-theme="dark"] .tpl-group-head strong,
html[data-theme="dark"] .tpl-card .tpl-name,
html[data-theme="dark"] .tpl-grid-name,
html[data-theme="dark"] .prompt-tpl-name,
html[data-theme="dark"] .xhs-detail-info-title,
html[data-theme="dark"] .xhs-detail-author,
html[data-theme="dark"] .xhs-detail-author a,
html[data-theme="dark"] .product-detail-sku-label,
html[data-theme="dark"] .final-sku-label,
html[data-theme="dark"] .ai-json-title-val {
  color: var(--text) !important;
}

html[data-theme="dark"] .tpl-subhead small,
html[data-theme="dark"] .tpl-group-head span,
html[data-theme="dark"] .tpl-group-caret,
html[data-theme="dark"] .tpl-empty,
html[data-theme="dark"] .tpl-more-note,
html[data-theme="dark"] .tpl-prompt-preview,
html[data-theme="dark"] .prompt-tpl-text,
html[data-theme="dark"] .banana-group-btn em,
html[data-theme="dark"] .banana-group-tpl-card span,
html[data-theme="dark"] .banana-group-pager,
html[data-theme="dark"] .detail-item label,
html[data-theme="dark"] .detail-section-title,
html[data-theme="dark"] .compare-col-label,
html[data-theme="dark"] .compare-nav-info,
html[data-theme="dark"] .logs-total,
html[data-theme="dark"] .log-id,
html[data-theme="dark"] .log-time,
html[data-theme="dark"] .ai-json-title-label {
  color: var(--muted) !important;
}

html[data-theme="dark"] .tpl-source-title,
html[data-theme="dark"] .tpl-source-empty {
  color: #ff9aa2 !important;
}

html[data-theme="dark"] .tpl-source-author,
html[data-theme="dark"] .detail-item .val,
html[data-theme="dark"] .product-detail-color-card span,
html[data-theme="dark"] .final-color-chip,
html[data-theme="dark"] .final-size-chip,
html[data-theme="dark"] .log-cell,
html[data-theme="dark"] .log-prompt,
html[data-theme="dark"] .placeholder-tip,
html[data-theme="dark"] .placeholder-log-item b,
html[data-theme="dark"] .banana-history-panel,
html[data-theme="dark"] .banana-hist-item {
  color: var(--text-2) !important;
}

html[data-theme="dark"] .detail-section-title,
html[data-theme="dark"] .compare-col-label,
html[data-theme="dark"] .compare-actions,
html[data-theme="dark"] .ai-json-title-val,
html[data-theme="dark"] .ai-attrs-table th,
html[data-theme="dark"] .ai-attrs-table td,
html[data-theme="dark"] .banana-hist-item {
  border-color: var(--border) !important;
}

html[data-theme="dark"] .ai-attrs-table th,
html[data-theme="dark"] .ai-attrs-table td {
  background: var(--surface) !important;
  color: var(--text-2) !important;
}

html[data-theme="dark"] .img-preview,
html[data-theme="dark"] .img-preview video,
html[data-theme="dark"] .xhs-detail-box,
html[data-theme="dark"] .xhs-detail-media-pane,
html[data-theme="dark"] .xhs-detail-media-stage {
  background: #050506 !important;
}

html[data-theme="dark"] .btn-warning {
  background: color-mix(in srgb, #d48806 18%, var(--surface-2)) !important;
  border-color: color-mix(in srgb, #d48806 48%, var(--border)) !important;
  color: #f5bd58 !important;
}

html[data-theme="dark"] .btn-danger,
html[data-theme="dark"] .btn-row-banana-del {
  background: color-mix(in srgb, #cf1322 18%, var(--surface-2)) !important;
  border-color: color-mix(in srgb, #cf1322 48%, var(--border)) !important;
  color: #ff8585 !important;
}

html[data-theme="dark"] .btn-row-banana-regen,
html[data-theme="dark"] .btn-row-banana-export,
html[data-theme="dark"] .btn-compare-bar,
html[data-theme="dark"] .active-shop-badge {
  background: color-mix(in srgb, #389e0d 18%, var(--surface-2)) !important;
  border-color: color-mix(in srgb, #389e0d 48%, var(--border)) !important;
  color: #8fd46a !important;
}

html[data-theme="dark"] .tag-collected,
html[data-theme="dark"] .compose-status-none {
  background: var(--surface-3) !important;
  color: var(--muted) !important;
}

html[data-theme="dark"] .tag-processing {
  background: color-mix(in srgb, #d48806 16%, var(--surface-2)) !important;
  color: #f5bd58 !important;
}

html[data-theme="dark"] .tag-fail {
  background: color-mix(in srgb, #cf1322 16%, var(--surface-2)) !important;
  color: #ff8585 !important;
}

/* 深色模式文字对比度加强 */
html[data-theme="dark"] .list-header,
html[data-theme="dark"] .xhs-list-header,
html[data-theme="dark"] .logs-header,
html[data-theme="dark"] .ailogs-header,
html[data-theme="dark"] .attrs-table-header,
html[data-theme="dark"] .mapping-table-header {
  color: var(--text-2) !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .list-header > div,
html[data-theme="dark"] .logs-header > div,
html[data-theme="dark"] .ailogs-header > div,
html[data-theme="dark"] .attrs-table-header > div,
html[data-theme="dark"] .mapping-table-header > div {
  color: var(--text-2) !important;
}

html[data-theme="dark"] .sidebar-shop-name,
html[data-theme="dark"] #sidebar-shop-name,
html[data-theme="dark"] #batch-detail-title,
html[data-theme="dark"] .shop-label,
html[data-theme="dark"] .action-right strong,
html[data-theme="dark"] #total-num,
html[data-theme="dark"] #xhs-total-num,
html[data-theme="dark"] #batch-total-num {
  color: var(--text) !important;
}

html[data-theme="dark"] .sidebar-shop-switch-btn {
  background: color-mix(in srgb, var(--blue) 12%, var(--surface-3)) !important;
  border-color: color-mix(in srgb, var(--blue) 48%, var(--border)) !important;
  color: #d8e9ff !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .sidebar-shop-switch-btn:hover {
  background: color-mix(in srgb, var(--blue) 22%, var(--surface-3)) !important;
  border-color: var(--blue) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .btn-purple,
html[data-theme="dark"] .btn[id*="banana"],
html[data-theme="dark"] #btn-banana,
html[data-theme="dark"] #xhs-btn-banana,
html[data-theme="dark"] #btn-batch-banana {
  background: #7c4dff !important;
  border-color: #8b63ff !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .btn-purple:hover,
html[data-theme="dark"] .btn[id*="banana"]:hover,
html[data-theme="dark"] #btn-banana:hover,
html[data-theme="dark"] #xhs-btn-banana:hover,
html[data-theme="dark"] #btn-batch-banana:hover {
  background: #9270ff !important;
  border-color: #a58bff !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .btn-batch,
html[data-theme="dark"] #btn-add-to-batch {
  background: #00a4ad !important;
  border-color: #18c4cc !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .btn-ai,
html[data-theme="dark"] #btn-fill-attrs,
html[data-theme="dark"] #xhs-btn-fill-attrs,
html[data-theme="dark"] #btn-batch-ai {
  background: #1f78ff !important;
  border-color: #4b95ff !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .btn-danger-outline,
html[data-theme="dark"] #btn-fivecut,
html[data-theme="dark"] #xhs-btn-fivecut,
html[data-theme="dark"] #btn-batch-fivecut,
html[data-theme="dark"] #btn-delete,
html[data-theme="dark"] #xhs-btn-delete,
html[data-theme="dark"] #btn-batch-remove {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface-3)) !important;
  border-color: color-mix(in srgb, var(--brand) 58%, var(--border)) !important;
  color: #ffb6b8 !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .btn:disabled {
  opacity: 0.72 !important;
  filter: saturate(0.82);
}

html[data-theme="dark"] .action-right,
html[data-theme="dark"] #page-info,
html[data-theme="dark"] #xhs-page-info,
html[data-theme="dark"] #batch-page-info,
html[data-theme="dark"] #batch-detail-count,
html[data-theme="dark"] .selected-tip {
  color: var(--text-2) !important;
}

html[data-theme="dark"] .selected-tip {
  font-weight: 700 !important;
}

/* 操作按钮颜色修正：避免主题通用按钮底色冲淡主操作 */
.btn-purple,
.btn[id*="banana"],
#btn-banana,
#xhs-btn-banana,
#btn-batch-banana {
  background: #722ed1 !important;
  border-color: #722ed1 !important;
  color: #ffffff !important;
  font-weight: 700;
}

.btn-purple:hover,
.btn[id*="banana"]:hover,
#btn-banana:hover,
#xhs-btn-banana:hover,
#btn-batch-banana:hover {
  background: #9254de !important;
  border-color: #9254de !important;
  color: #ffffff !important;
}

.btn-ai,
#btn-fill-attrs,
#xhs-btn-fill-attrs,
#btn-batch-ai {
  background: #0958d9 !important;
  border-color: #0958d9 !important;
  color: #ffffff !important;
  font-weight: 700;
}

.btn-ai:hover,
#btn-fill-attrs:hover,
#xhs-btn-fill-attrs:hover,
#btn-batch-ai:hover {
  background: #1677ff !important;
  border-color: #1677ff !important;
  color: #ffffff !important;
}

.btn-batch,
#btn-add-to-batch {
  background: #08979c !important;
  border-color: #08979c !important;
  color: #ffffff !important;
  font-weight: 700;
}

.btn-batch:hover,
#btn-add-to-batch:hover {
  background: #13c2c2 !important;
  border-color: #13c2c2 !important;
  color: #ffffff !important;
}

.btn-danger-outline {
  background: #ffffff !important;
  border-color: #e4393c !important;
  color: #e4393c !important;
  font-weight: 700;
}

.btn-danger-outline:hover {
  background: #fff1f0 !important;
  border-color: #e4393c !important;
  color: #e4393c !important;
}

.action-bar .btn:disabled {
  opacity: 0.68;
}

html[data-theme="dark"] .size-thumb-grid .editable-thumb-slot,
html[data-theme="dark"] .size-thumb-grid .editable-thumb-empty {
  background: #050506 !important;
  border-color: #30323b !important;
  color: var(--muted) !important;
}

html[data-theme="dark"] .size-thumb-grid .editable-thumb-slot.drag-over,
html[data-theme="dark"] .size-thumb-grid .editable-thumb-empty.drag-over {
  background: #0b1220 !important;
  border-color: var(--blue) !important;
}
