/* 选材库面板样式（在线工具内） */

.pkb-fab {
  position: fixed; right: 18px; bottom: 96px; z-index: 900;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, #d9b975, #ffffff);
  color: #1a1206; border: none; font-size: 13px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(255,255,255,.35);
}
.pkb-fab:hover { filter: brightness(1.06); }

.pkb-mask {
  position: fixed; inset: 0; background: rgba(4,7,12,.55); z-index: 950;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.pkb-mask.open { opacity: 1; pointer-events: auto; }

.pkb-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
  background: #0c1119; border-left: 1px solid #1c2331; z-index: 960;
  transform: translateX(102%); transition: transform .22s ease;
  display: flex; flex-direction: column; padding: 14px 14px 0;
}
.pkb-panel.open { transform: none; }

.pkb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pkb-head strong { color: #f5f7fa; font-size: 15px; }
.pkb-close { background: none; border: none; color: #8b93a5; font-size: 22px; cursor: pointer; line-height: 1; }

.pkb-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.pkb-tabs button {
  flex: 1; padding: 7px 0; border-radius: 8px; cursor: pointer; font-size: 12.5px;
  border: 1px solid #232b3a; background: #0b101c; color: #98a2b3;
}
.pkb-tabs button.on { border-color: #ffffff; color: #f5f7fa; background: rgba(255,255,255,.12); }

.pkb-search { display: flex; gap: 6px; margin-bottom: 8px; }
.pkb-search input, .pkb-search select {
  background: #0b101c; border: 1px solid #232b3a; color: #e6e9ef;
  border-radius: 8px; padding: 7px 10px; font-size: 12.5px; min-width: 0;
}
.pkb-search input { flex: 1; }
.pkb-search select { width: 132px; }

.pkb-sysbar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.pkb-chip {
  white-space: nowrap; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid #232b3a; background: #0b101c; color: #98a2b3; font-size: 11.5px;
}
.pkb-chip.on { border-color: #ffffff; color: #f5f7fa; background: rgba(255,255,255,.12); }

.pkb-count { font-size: 11.5px; color: #6f7889; margin: 4px 0 8px; }

.pkb-grid { flex: 1; overflow-y: auto; display: grid; gap: 8px; padding-right: 2px; }
.pkb-card { border: 1px solid #1c2331; border-radius: 10px; padding: 10px 12px; cursor: pointer; background: rgba(255,255,255,.015); }
.pkb-card:hover { border-color: #2c3547; background: rgba(255,255,255,.035); }
.pkb-card h4 { margin: 0 0 4px; font-size: 13px; color: #f5f7fa; }
.pkb-meta { font-size: 11px; color: #6f7889; margin-bottom: 4px; }
.pkb-note { font-size: 11.5px; color: #98a2b3; line-height: 1.55; }
.pkb-tags { margin-top: 6px; }
.pkb-tag { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 999px; border: 1px solid #2c3547; color: #98a2b3; margin: 0 4px 3px 0; }
.pkb-tag.R { border-color: #3f7d52; color: #7fd39a; }
.pkb-tag.C { border-color: #8a6d2f; color: #f5f7fa; }
.pkb-tag.H { border-color: #8a3b3b; color: #ff9b9b; }

.pkb-detail { border-top: 1px solid #1c2331; padding: 10px 2px 14px; max-height: 34%; overflow-y: auto; }
.pkb-detail.hidden { display: none; }
.pkb-detail h4 { margin: 0 0 8px; color: #f5f7fa; font-size: 13.5px; }
.pkb-detail dl { display: grid; grid-template-columns: 76px 1fr; gap: 5px 10px; margin: 0; font-size: 11.5px; }
.pkb-detail dt { color: #6f7889; }
.pkb-detail dd { margin: 0; color: #cfd6e4; }

.pkb-empty { color: #6f7889; font-size: 12.5px; padding: 24px 0; text-align: center; }

@media (max-width: 860px) {
  .pkb-fab { bottom: 78px; right: 12px; }
  .pkb-panel { width: 100%; max-width: 100%; }
}

/* 官网入口（工具 / CEP 插件内） */
.xs-site-link {
  position: fixed; right: 18px; bottom: 48px; z-index: 880;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 15px; border-radius: 999px; text-decoration: none;
  background: rgba(12,17,25,.92); border: 1px solid #2c3547;
  color: #cfd6e4; font-size: 12.5px; letter-spacing: .5px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: border-color .15s, color .15s, transform .15s;
}
.xs-site-link:hover { border-color: #ffffff; color: #f5f7fa; transform: translateY(-1px); }
.xs-site-link::before {
  content: "↗"; margin-right: 5px; color: #ffffff; font-size: 12px;
}
@media (max-width: 860px) {
  .xs-site-link { right: 12px; bottom: 36px; padding: 8px 12px; font-size: 12px; }
}

/* 在线更新提示条（网页版 / 插件内） */
.xs-update-bar {
  position: fixed; right: 18px; bottom: 152px; z-index: 970;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 360px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(180deg, #1a2231, #131a26);
  border: 1px solid #3a4a63;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  animation: xsUpdateIn .22s ease both;
}
@keyframes xsUpdateIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.xs-update-bar-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 150px; }
.xs-update-bar-text strong { color: #f5f7fa; font-size: 13px; }
.xs-update-bar-text span { color: #8b93a5; font-size: 11.5px; }
.xs-update-bar-actions { display: flex; align-items: center; gap: 6px; }
.xs-update-bar-go {
  padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
  border: 1px solid #ffffff; background: rgba(255,255,255,.16); color: #f5f7fa;
}
.xs-update-bar-go:hover { background: rgba(255,255,255,.28); }
.xs-update-bar-skip, .xs-update-bar-close {
  padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 12px;
  border: 1px solid #2c3547; background: transparent; color: #8b93a5;
}
.xs-update-bar-skip:hover, .xs-update-bar-close:hover { color: #cfd6e4; border-color: #3a4a63; }
@media (max-width: 860px) {
  .xs-update-bar { left: 12px; right: 12px; max-width: none; bottom: 120px; }
}

/* 展开视频按钮 + 场地阴影 + 录制提示 */
.xs-unfold-bar {
  position: fixed; right: 24px; bottom: 86px; z-index: 320;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: 12px;
  border: 1px solid #2c3547; background: rgba(12,17,25,.94);
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
}
.xs-unfold-bar:empty { display: none; }
@media (max-width: 860px) {
  .xs-unfold-bar { right: 12px; bottom: 74px; padding: 7px 10px; }
}
.xs-unfold-btn {
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
  border: 1px solid #ffffff; background: rgba(255,255,255,.16); color: #f5f7fa;
}
.xs-unfold-btn:hover { background: rgba(255,255,255,.3); }
.xs-unfold-btn:disabled { opacity: .6; cursor: default; }
.xs-unfold-shadow { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #98a2b3; }
.xs-unfold-shadow input {
  width: 14px; height: 14px; margin: 0; accent-color: #ffffff; vertical-align: middle;
}
.xs-unfold-shadow { white-space: nowrap; }

.xs-ground-shadow {
  position: absolute; left: 50%; bottom: 14%;
  width: var(--shadow-w, 42%); height: var(--shadow-h, 7%);
  transform: translateX(-50%);
  pointer-events: none; z-index: 2;
}
.xs-ground-shadow-core,
.xs-ground-shadow-blur {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,var(--shadow-o,.4)) 0%, rgba(0,0,0,0) 70%);
}
.xs-ground-shadow-core { filter: blur(2px); }
.xs-ground-shadow-blur { filter: blur(10px); opacity: .7; transform: scale(1.25); }

.xs-record-banner {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%);
  z-index: 999; padding: 9px 16px; border-radius: 999px;
  background: rgba(180,60,60,.92); color: #fff; font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

/* 产品信息（标题栏）输入 */
.custom-product-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.custom-product-row .custom-field { display: flex; flex-direction: column; gap: 4px; }
.custom-product-row .custom-field span { font-size: 11.5px; color: #6f7889; }
.custom-product-row .custom-field input {
  background: #0b101c; border: 1px solid #232b3a; border-radius: 8px;
  color: #e6e9ef; padding: 7px 10px; font-size: 12.5px; width: 100%;
}
.custom-product-row .custom-field input:focus { border-color: #ffffff; outline: none; }
@media (max-width: 520px) { .custom-product-row { grid-template-columns: 1fr; } }

/* 下载按钮 + 保存提示 */
.xs-save-local {
  margin-left: 8px; padding: 0 16px; height: 34px; border-radius: 8px; cursor: pointer;
  border: 1px solid #ffffff; background: rgba(255,255,255,.14); color: #f5f7fa;
  font-size: 13px; font-weight: 600;
}
.xs-save-local:hover { background: rgba(255,255,255,.26); }
.xs-save-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px);
  max-width: 80vw; padding: 10px 16px; border-radius: 10px; z-index: 1200;
  background: rgba(20,28,40,.96); border: 1px solid #2c3547; color: #cfd6e4;
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: all .2s;
  word-break: break-all;
}
.xs-save-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 插件管理（版本 / 更新 / 卸载） */
.xs-plugin-gear {
  position: fixed; right: 18px; bottom: 10px; z-index: 880;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(12,17,25,.92); border: 1px solid #2c3547; color: #cfd6e4;
  font-size: 12px;
}
.xs-plugin-gear:hover { border-color: #ffffff; color: #f5f7fa; }
.xs-plugin-panel {
  position: fixed; right: 18px; bottom: 52px; z-index: 890; width: 240px;
  padding: 12px 14px; border-radius: 12px; display: none;
  background: rgba(12,17,25,.97); border: 1px solid #2c3547;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.xs-plugin-panel.open { display: block; }
.xs-plugin-row { display: flex; justify-content: space-between; font-size: 12px; color: #8b93a5; margin-bottom: 6px; }
.xs-plugin-row b { color: #cfd6e4; font-weight: 600; }
.xs-plugin-btn {
  width: 100%; margin-top: 8px; padding: 8px 0; border-radius: 8px; cursor: pointer;
  border: 1px solid #2c3547; background: rgba(255,255,255,.03); color: #cfd6e4; font-size: 12.5px;
}
.xs-plugin-btn:hover { border-color: #ffffff; color: #f5f7fa; }
.xs-plugin-danger { border-color: #7a3b3b; color: #ffb3b1; }
.xs-plugin-danger:hover { border-color: #c0504d; color: #ff9b9b; background: rgba(192,80,77,.12); }
.xs-plugin-note { font-size: 11px; color: #6f7889; line-height: 1.6; margin: 10px 0 0; }

/* 3D 预览：贴设计稿 */
.xs-design-wrap { display: inline-flex; gap: 6px; margin: 0 6px; }
.xs-design-button {
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
  border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.10); color: #f5f7fa;
}
.xs-design-button:hover { background: rgba(255,255,255,.20); border-color: rgba(255,255,255,.7); }

/* ── 参数面板：四段折叠（对齐包装助手pro） ───────────────── */
.xs-param-groups { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.xs-group { border: 1px solid #1e2531; border-radius: 12px; background: rgba(255,255,255,.012); overflow: hidden; }
.xs-group-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 12px 14px; cursor: pointer; background: none; border: 0;
  color: #e6e9ef; font-size: 15px; font-weight: 700; text-align: left;
}
.xs-group-head:hover { background: rgba(255,255,255,.03); }
.xs-group-caret {
  width: 0; height: 0; border-left: 5px solid #ffffff; border-top: 4px solid transparent;
  border-bottom: 4px solid transparent; transition: transform .18s;
}
.xs-group.is-open .xs-group-caret { transform: rotate(90deg); }
.xs-group-body { display: none; padding: 0 14px 14px; }
.xs-group.is-open .xs-group-body { display: block; }
.xs-group-sub { margin-left: auto; font-size: 12px; color: #7d8598; font-weight: 400; }

.xs-group-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.xs-box-search {
  flex: 1 1 auto; min-width: 0; padding: 9px 12px; border-radius: 9px;
  background: #0d121b; border: 1px solid #232b3a; color: #dfe4ec; font-size: 13px;
}
.xs-box-search::placeholder { color: #6c748a; }
.xs-box-search:focus { outline: none; border-color: #ffffff; }
.xs-preview-size { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #98a1b3; }
.xs-preview-size select {
  padding: 8px 10px; border-radius: 9px; background: #0d121b; border: 1px solid #232b3a; color: #dfe4ec; font-size: 13px;
}

/* 预览大小：缩放盒型卡片 */
.type-grid.size-s .type-card { min-height: 54px; }
.type-grid.size-s .type-card-visual { width: 34px; height: 34px; }
.type-grid.size-s .type-card-visual svg { width: 26px; height: 26px; }
.type-grid.size-l .type-card { min-height: 92px; }
.type-grid.size-l .type-card-visual { width: 58px; height: 58px; }
.type-grid.size-l .type-card-visual svg { width: 44px; height: 44px; }

/* 出血与输出 */
.xs-output-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.xs-out-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #cfd6e4; cursor: pointer; }
.xs-out-item input { width: 16px; height: 16px; accent-color: #ffffff; }
.xs-bleed-wrap .xs-bleed-field { display: block; margin-bottom: 12px; }
.xs-generate-button {
  width: 100%; padding: 15px 0; border-radius: 12px; cursor: pointer;
  border: 1px solid #ffffff; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(226,232,240,.9));
  color: #17130a; font-size: 15.5px; font-weight: 800; letter-spacing: .5px;
}
.xs-generate-button:hover { filter: brightness(1.06); }

/* 反面预览 */
.web-carton-preview.is-reverse .web-preview-canvas { transform: scaleX(-1); }

/* ── 参数面板：四段折叠（section 级，不改变原有 grid 定位）─── */
#cartonPackaging > .xs-group-sec {
  grid-column: 1; display: block; border: 1px solid #1e2531; border-radius: 12px;
  background: rgba(255,255,255,.012); overflow: hidden; padding: 0;
}
#cartonPackaging > .xs-group-sec .xs-group-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 12px 14px; cursor: pointer; background: none; border: 0;
  color: #e6e9ef; font-size: 15px; font-weight: 700; text-align: left;
}
#cartonPackaging > .xs-group-sec .xs-group-head:hover { background: rgba(255,255,255,.03); }
.xs-group-caret {
  width: 0; height: 0; border-left: 5px solid #ffffff;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .18s; flex: 0 0 auto;
}
.xs-group-sec.is-open .xs-group-caret { transform: rotate(90deg); }
.xs-group-sec .xs-group-body { display: none; padding: 0 14px 14px; }
.xs-group-sec.is-open .xs-group-body { display: block; }
.xs-group-sub { margin-left: auto; font-size: 12px; color: #7d8598; font-weight: 400; }

.xs-group-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.xs-box-search {
  flex: 1 1 auto; min-width: 0; padding: 9px 12px; border-radius: 9px;
  background: #0d121b; border: 1px solid #232b3a; color: #dfe4ec; font-size: 13px;
}
.xs-box-search::placeholder { color: #6c748a; }
.xs-box-search:focus { outline: none; border-color: #ffffff; }
.xs-preview-size { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #98a1b3; white-space: nowrap; }
.xs-preview-size select {
  padding: 8px 10px; border-radius: 9px; background: #0d121b;
  border: 1px solid #232b3a; color: #dfe4ec; font-size: 13px;
}

.type-grid.size-s .type-card { min-height: 54px; }
.type-grid.size-s .type-card-visual { width: 34px; height: 34px; }
.type-grid.size-l .type-card { min-height: 92px; }
.type-grid.size-l .type-card-visual { width: 56px; height: 56px; }

#cartonPackaging > #xsOutputSection { grid-column: 1; grid-row: 4; }
#cartonPackaging > .legend { grid-row: 5 !important; }
#cartonPackaging > .bottom-action-dock { grid-row: 6 !important; }

.xs-output-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.xs-out-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #cfd6e4; cursor: pointer; }
.xs-out-item input { width: 16px; height: 16px; accent-color: #ffffff; }
.xs-bleed-wrap .xs-bleed-field { display: block; margin-bottom: 12px; }
.xs-generate-button {
  width: 100%; padding: 15px 0; border-radius: 12px; cursor: pointer;
  border: 1px solid #ffffff; background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(226,232,240,.92));
  color: #17130a; font-size: 15.5px; font-weight: 800; letter-spacing: .5px;
}
.xs-generate-button:hover { filter: brightness(1.06); }
.web-carton-preview.is-reverse .web-preview-canvas { transform: scaleX(-1); }

/* 覆盖：结构与模型整行（原设计如此），其余折叠区块限定左栏 */
#cartonPackaging > .xs-group-sec[data-xs-group="size"],
#cartonPackaging > .xs-group-sec[data-xs-group="structure"] { grid-column: 1; }
#cartonPackaging > section[aria-labelledby="type-heading"] { grid-column: 1 / -1; grid-row: 1; }
#cartonPackaging > .xs-group-sec .xs-group-body { max-height: none; }
/* 类型卡片在整行折叠块里改成四列，避免右半边空着 */
#cartonPackaging > section[aria-labelledby="type-heading"] .type-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── 结构与模型：分类胶囊 + 缩略图单选圆点 ─────────────── */
.xs-category-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.xs-category-chip {
  padding: 9px 16px; border-radius: 9px; cursor: pointer; font-size: 13.5px;
  border: 1px solid #2a3241; background: #0e141d; color: #c9d1de;
}
.xs-category-chip:hover { border-color: #3a4457; }
.xs-category-chip.is-active {
  background: #dfe7c8; border-color: #cdd8b2; color: #1b2410; font-weight: 700;
}
.type-card { position: relative; }
.type-card-radio {
  position: absolute; top: 8px; right: 8px; width: 12px; height: 12px;
  border-radius: 50%; border: 1.5px solid #6b7688; background: transparent;
}
.type-card[aria-checked="true"] .type-card-radio { border-color: #dfe7c8; background: #dfe7c8; }

/* ── 尺寸与材料：头部工具条 + 四列 ─────────────────────── */
.xs-size-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.xs-size-reset {
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  border: 1px solid #2a3241; background: #0e141d; color: #cfd6e4; font-size: 15px;
}
.xs-size-range {
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  border: 1px solid #2a3241; background: #0e141d; color: #cfd6e4;
}
.xs-size-range.is-on { border-color: #dfe7c8; color: #dfe7c8; }
.xs-size-spacer { flex: 1 1 auto; }
.xs-mat-type { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: #e6e9ef; white-space: nowrap; }
.xs-mat-type select {
  padding: 8px 12px; border-radius: 8px; background: #0e141d;
  border: 1px solid #2a3241; color: #e6e9ef; font-size: 13.5px; min-width: 120px;
}

#cartonPackaging .custom-size-panel .custom-dimension-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px; }
#cartonPackaging .custom-size-panel .custom-dimension > span:first-child { font-size: 13px; color: #c9d1de; }

.xs-sub-structure { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.xs-sub-structure label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #c9d1de; }
.xs-sub-structure select {
  padding: 10px 12px; border-radius: 9px; background: #0e141d;
  border: 1px solid #2a3241; color: #e6e9ef; font-size: 13.5px;
}
input.is-range-shown { outline: 1px dashed rgba(223,231,200,.5); }

/* ── 结构参数弹窗 ─────────────────────────────────────── */
.xs-modal {
  position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 7, 12, .72); backdrop-filter: blur(2px);
}
.xs-modal[hidden] { display: none; }
.xs-modal-dialog {
  width: min(560px, 92vw); max-height: 86vh; overflow: auto; border-radius: 16px;
  background: #12171f; border: 1px solid #2a3241; box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.xs-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px; border-bottom: 1px solid #1e2531;
}
.xs-modal-head h3 { margin: 0; font-size: 19px; color: #eef1f6; }
.xs-modal-close {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 18px;
  border: 1px solid #2a3241; background: #0e141d; color: #cfd6e4;
}
.xs-modal-close:hover { border-color: #4a5568; color: #fff; }
.xs-modal-body { padding: 16px 20px 22px; }
.xs-modal-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.xs-modal-row > span { font-size: 14px; color: #cfd6e4; min-width: 64px; }
.xs-modal-row select {
  flex: 1 1 auto; padding: 10px 12px; border-radius: 9px; background: #0b1017;
  border: 1px solid #2a3241; color: #e6e9ef; font-size: 14px;
}
.xs-modal-note { font-size: 12.5px; line-height: 1.7; color: #8b95a6; margin: 8px 0 14px; }
.xs-modal-unsupported { border-top: 1px dashed #232b3a; padding-top: 10px; }
.xs-modal-sub { font-size: 15px; color: #eef1f6; margin: 16px 0 6px; }
.xs-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.xs-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #c9d1de; }
.xs-field input {
  padding: 9px 10px; border-radius: 8px; background: #0b1017;
  border: 1px solid #2a3241; color: #e6e9ef; font-size: 13.5px;
}
.xs-field input:focus { outline: none; border-color: #7f8ba0; }

/* 结构参数分组标题右侧的入口按钮 */
.xs-struct-open {
  margin-left: auto; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
  border: 1px solid #2a3241; background: #0e141d; color: #cfd6e4;
}
.xs-struct-open:hover { border-color: #7f8ba0; color: #fff; }

/* 出血与输出：单行紧凑排版（对齐参考软件） */
#cartonPackaging > .xs-group-sec .xs-output-row,
#xsOutputSection .xs-output-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 4px 0 14px;
}
#xsOutputSection .xs-out-item { font-size: 13.5px; gap: 6px; }
#xsOutputSection .xs-out-item input[type="checkbox"] { width: 17px; height: 17px; }
.xs-out-num {
  width: 62px; padding: 8px 10px; text-align: center; border-radius: 9px;
  background: #0d121b; border: 1px solid #2a3241; color: #e6e9ef; font-size: 13.5px;
}
.xs-out-num:focus { outline: none; border-color: #7f8ba0; }
#xsOutputSection .xs-bleed-wrap { display: none; }   /* 出血输入已并入单行 */
#xsOutputSection .xs-generate-button { margin-top: 6px; }

/* 3D 弹窗：3D / 刀版 双页签 */
.xs-preview-tabs {
  display: flex; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid #1e2531;
}
.xs-preview-tabs button {
  flex: 1 1 0; padding: 11px 0; border-radius: 10px; cursor: pointer;
  border: 1px solid #2a3241; background: #0e141d; color: #cfd6e4; font-size: 14px;
}
.xs-preview-tabs button.is-active {
  border-color: #dfe7c8; background: #dfe7c8; color: #1b2410; font-weight: 700;
}
.xs-flat-preview {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #0b0f16; padding: 18px; z-index: 5;
}
.xs-flat-preview[hidden] { display: none; }
.xs-flat-preview svg { width: 100%; height: 100%; }

/* 修正：页签固定在画布区底部中央 */
.xs-preview-tabs {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: flex; gap: 8px; padding: 6px; border-radius: 12px; z-index: 6;
  background: rgba(10,14,22,.86); border: 1px solid #2a3241; backdrop-filter: blur(4px);
}
.xs-preview-tabs button {
  padding: 8px 20px; border-radius: 9px; cursor: pointer; font-size: 13px;
  border: 1px solid transparent; background: transparent; color: #cfd6e4;
}
.xs-preview-tabs button.is-active {
  background: #dfe7c8; color: #1b2410; font-weight: 700; border-color: #cdd8b2;
}

/* 条码勾选：从页签行挪到主区域顶部 */
.xs-barcode-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 18px 10px; max-width: var(--max, 1160px); margin: 0 auto;
}
.xs-barcode-row .barcode-enable { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #b9c0cd; }

/* 左栏：三块折叠面板放进同一列容器，折叠后不留空隙 */
#cartonPackaging > #xsLeftColumn {
  grid-column: 1; grid-row: 2 / 6;
  display: flex; flex-direction: column; gap: 14px; align-self: start;
}
#cartonPackaging > #xsLeftColumn > * { grid-column: auto !important; grid-row: auto !important; }

/* ── 折叠面板视觉优化 ─────────────────────────────────── */
#cartonPackaging > .xs-group-sec,
#cartonPackaging > #xsLeftColumn > * {
  border: 1px solid #1c2331;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,.008));
  transition: border-color .18s, background .18s;
}
#cartonPackaging > .xs-group-sec:hover,
#cartonPackaging > #xsLeftColumn > *:hover { border-color: #2a3444; }

.xs-group-head {
  padding: 14px 16px; gap: 10px; border-radius: 14px;
  position: relative;
}
.xs-group-sec.is-open > .xs-group-head {
  border-bottom: 1px solid #1a212d;
  border-radius: 14px 14px 0 0;
  background: rgba(255,255,255,.02);
}
.xs-group-caret {
  border-left-width: 6px; border-top-width: 5px; border-bottom-width: 5px;
  border-left-color: #d8b877;
}
.xs-group-title {
  font-size: 15.5px; font-weight: 700; letter-spacing: .2px;
  color: #f0f3f8;
}
.xs-group-sub {
  margin-left: auto; font-size: 12.5px; font-weight: 500;
  color: #7f8ba0; background: rgba(255,255,255,.04);
  border: 1px solid #222b3a; border-radius: 999px; padding: 3px 10px;
  max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.xs-group-sec.is-open .xs-group-sub { color: #9aa6ba; }
.xs-group-body { padding: 14px 16px 16px; }

/* 左栏容器再收紧一点 */
#cartonPackaging > #xsLeftColumn { gap: 12px; }

/* 分组内部的第一行标题（旧标题）弱化，避免和折叠标题打架 */
.xs-group-body > .custom-size-head h2,
.xs-group-body > #type-heading {
  font-size: 13.5px; color: #8b95a6; font-weight: 600; margin-bottom: 10px;
}
.xs-group-body > .type-heading-row { margin-bottom: 10px; }

/* 其他包装入口卡片 */
.xs-other-pack {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #232b3a;
}
.xs-mode-card { align-items: center; }
.xs-mode-card.selected { border-color: #dfe7c8; box-shadow: inset 0 0 0 1px #dfe7c8; }
.xs-mode-card .type-card-copy small { color: #8b95a6; font-size: 11.5px; }

/* 出血与输出：单行排版 */
.xs-output-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 4px 0 14px; }
.xs-out-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: #cfd6e4; cursor: pointer; }
.xs-out-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: #c9a45c; }
.xs-out-num {
  width: 62px; padding: 8px 10px; text-align: center; border-radius: 9px;
  background: #0d121b; border: 1px solid #2a3241; color: #e6e9ef; font-size: 13.5px;
}
.xs-out-num:focus { outline: none; border-color: #7f8ba0; }
#xsOutputSection .xs-bleed-wrap { display: none; }
#xsOutputSection .xs-generate-button {
  width: 100%; padding: 15px 0; border-radius: 12px; cursor: pointer; margin-top: 4px;
  border: 1px solid #c9a45c; background: linear-gradient(180deg, rgba(201,164,92,.9), rgba(178,142,72,.92));
  color: #17130a; font-size: 15.5px; font-weight: 800;
}
.web-carton-preview.is-reverse .web-preview-canvas { transform: scaleX(-1); }

/* 导出额度用完的页内提示条 */
.xs-quota-notice {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; z-index: 2400;
  padding: 12px 16px; border-radius: 12px; max-width: 92vw;
  background: rgba(20,26,36,.97); border: 1px solid #3a2f22; color: #e6e9ef;
  box-shadow: 0 14px 38px rgba(0,0,0,.5); font-size: 13.5px;
}
.xs-quota-notice a { color: #f0c987; text-decoration: underline; white-space: nowrap; }
.xs-quota-notice button {
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  border: 1px solid #2a3241; background: #0e141d; color: #cfd6e4; font-size: 14px;
}
