:root {
  --bg: #f4f4f2; --panel: #fff; --ink: #1d1d1f; --muted: #6e6e73; --line: #e2e2e0;
  --accent: #f5a623; --accent-ink: #1d1d1f; --ok: #1f9d55; --err: #d64545; --run: #2f6bff;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; }
a { color: inherit; }
button, .btn {
  font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 12px;
  cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap;
}
button:hover, .btn:hover { border-color: #999; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.danger { color: var(--err); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; background: #fff; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: #111; color: #eee; position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; text-decoration: none; color: var(--accent); font-size: 16px; }
.topbar nav { display: flex; gap: 16px; }
.topbar nav a { text-decoration: none; color: #ccc; }
.topbar nav a:hover { color: #fff; }
.mode { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #333; }
.mode.mock { background: #7a4d00; color: #ffd27a; }
.who { margin-left: auto; font-size: 13px; color: #aaa; }
.who input { width: 120px; margin-left: 6px; }

main { max-width: 1440px; margin: 0 auto; padding: 24px; }
h2 { margin: 0 0 12px; font-size: 18px; }
h3 { margin: 0; font-size: 15px; }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { padding: 4px 10px; border-radius: 14px; background: #e8e8e5; font-size: 12px; color: var(--muted); }
.steps span.done { background: #dff3e7; color: var(--ok); }

.grid-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; }
.pcard img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #ddd; }
.pcard div { padding: 10px 12px; }

/* 项目卡片和列表共用筛选、进度与状态。 */
.project-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; }
.project-filters input[type=search] { flex: 1; min-width: 180px; }
.project-mine { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.project-view { display: flex; gap: 4px; margin-left: auto; }
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.project-cards > #projectResults, .project-cards > #projectResults > .grid-projects { display: contents; }
.project-number { display: block; font-size: 12px; overflow-wrap: anywhere; }
.project-card-status { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0; }
.project-cards .pcard > div > .tag { display: inline-block; margin: 6px 0 0 5px; }
.project-cards .pcard b { overflow-wrap: anywhere; }
.project-empty { grid-column: 1 / -1; margin: 0; }
.project-footer { display: flex; justify-content: center; gap: 16px; align-items: center; margin: 18px 0; }
.project-footer [hidden] { display: none; }
.project-rows > .upload-card { min-height: 0; flex-direction: row; padding: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.project-rows > .upload-card .upload-plus { font-size: 24px; padding: 0; }
.project-rows > .upload-card br { display: none; }
.project-list { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.project-list-head, .project-list-row { display: grid; grid-template-columns: 48px minmax(160px, 1fr) 110px 105px 54px 90px 136px; gap: 12px; align-items: center; padding: 12px; }
.project-list-head { background: #f1f1ef; color: var(--muted); font-size: 12px; }
.project-list-head button { font-size: 12px; padding: 2px 4px; border-color: transparent; background: transparent; }
.project-list-head button:hover { border-color: var(--line); }
.project-list-row + .project-list-row { border-top: 1px solid var(--line); }
.project-thumb img { width: 48px; height: 64px; object-fit: cover; border-radius: 5px; background: #eee; display: block; }
.project-identity { min-width: 0; overflow-wrap: anywhere; }
.project-identity > a { text-decoration: none; }
.project-identity > a:hover { text-decoration: underline; }
.project-identity .star { position: static; display: inline-flex; vertical-align: middle; margin-left: 5px; width: 26px; height: 26px; color: #c89124; }
.project-row-meta { display: contents; }
.project-state { display: flex; flex-wrap: wrap; gap: 4px; }
.project-progress { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.project-progress progress { width: 100%; height: 6px; accent-color: var(--ok); }
.project-operator { overflow-wrap: anywhere; }
.project-list-row time { font-size: 12px; color: var(--muted); }
@media (max-width: 950px) {
  .project-list-head, .project-list-row { grid-template-columns: 48px minmax(100px, 1fr) 85px 80px 44px 65px 100px; gap: 8px; }
}
@media (max-width: 699px) {
  body:has(#projectBrowser) .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  body:has(#projectBrowser) .topbar .who { margin-left: 0; }
  body:has(#projectBrowser) main { padding: 16px; }
  .project-filters input[type=search] { flex-basis: 100%; min-width: 0; }
  .project-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .project-list-head { display: flex; flex-wrap: wrap; gap: 6px; }
  .project-list-head > span { font-size: 0; }
  .project-list-head > span:not(:has(button)) { display: none; }
  .project-list-row { grid-template-columns: 48px minmax(0, 1fr); align-items: start; }
  .project-thumb { grid-row: 1 / 3; }
  .project-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; grid-column: 2; min-width: 0; }
  .project-progress { width: 88px; }
  .project-operator { max-width: 100%; }
  .project-footer { flex-wrap: wrap; }
}

.top-split { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.side-col > .panel { margin: 0; }
.hero img { width: 100%; border-radius: 8px; display: block; }
textarea.dna { width: 100%; min-height: 360px; font-family: Consolas, monospace; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { background: #f1efe8; border-radius: 12px; padding: 2px 10px; font-size: 12px; }

.checker, [data-print-background="checker"] .print-surface {
  background-image: linear-gradient(45deg, #ddd 25%, transparent 25%), linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%), linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.imgbox { border-radius: 8px; border: 1px solid var(--line); min-height: 120px; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.imgbox img { width: 100%; display: block; cursor: zoom-in; }
.imgbox .status { padding: 20px; text-align: center; font-size: 13px; }
.status.running { color: var(--run); }
.status.error { color: var(--err); word-break: break-all; font-size: 12px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

.grid-combos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.combo { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.combo.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tag { font-size: 12px; background: #eef3ff; color: #2c4fb8; border-radius: 10px; padding: 1px 8px; }
.tag.warn { background: #fdecec; color: var(--err); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; }
.pair .sel { display: flex; gap: 6px; align-items: center; }
.pair select { flex: 1; min-width: 0; }
.sw { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.2); flex: none; display: inline-block; }
.palette { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.palette label { display: flex; align-items: center; gap: 4px; }
.palette input[type=color] { width: 30px; height: 26px; padding: 0 2px; }
.stages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stage-title { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
.stage .imgbox { aspect-ratio: 3/4; min-height: 0; }
.stage .row { margin-top: 6px; gap: 6px; }
.stage button { padding: 3px 8px; font-size: 12px; }
.approved { color: var(--ok); font-size: 12px; font-weight: 600; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td input { width: 100%; }
td input.code { width: 70px; }
td input[type=color] { width: 44px; padding: 0 2px; height: 28px; }
tr.off { opacity: .45; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 99; max-width: 80vw; }
.toast.show { opacity: 1; }
.toast.err { background: var(--err); }

@media (max-width: 1100px) { .top-split { grid-template-columns: 1fr; } }

/* 产品库 */
.admin-dlg.style-info-dlg { width: min(920px, 94vw); max-height: 90vh; overflow-y: auto; }
/* 款号 / 名称 / 分类：三列，标题都在框上方，框一样高、底边对齐 */
.style-basic { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 12px; align-items: end; }
.style-info-dlg .style-basic > label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; color: var(--muted); }
.style-info-dlg .style-basic input, .style-info-dlg .style-basic select { width: 100%; box-sizing: border-box; height: 34px; color: var(--ink); }
.style-info-dlg label:has(textarea) { display: flex; flex-direction: column; gap: 4px; }
/* 产品库卡片顶部：左边款号名称，右边三个带状态的按钮 */
.style-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.style-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.style-title h3 { margin: 0; }
.style-title .muted { font-size: 12px; }
.style-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.act-btn { display: inline-flex; align-items: center; gap: 6px; }
.act-state { font-size: 11px; line-height: 1.6; padding: 0 7px; border-radius: 10px; }
.act-state.ok { background: #dff3e7; color: var(--ok); }
.act-state.warn { background: #fff0e0; color: #c25400; }
.act-state.none { background: #f1f1ef; color: var(--muted); }
.style-field { margin: 6px 0; flex-wrap: nowrap; }
.style-field input { min-width: 0; flex: 1; }
.style-info-dlg textarea { width: 100%; }
.style-schema-field { margin: 10px 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.style-field-title { font-weight: 600; display: block; margin-bottom: 4px; }
.style-schema-field select { width: 100%; }
.style-schema-field [hidden] { display: none; }
.style-info-dlg input[type=checkbox] { width: auto; margin: 0; }
.style-info-dlg label:has(input[type=checkbox]) { display: inline-flex; align-items: center; gap: 4px; }
.style-info-dlg [data-position-group][hidden] { display: none; }
.style-history { margin: 8px 0; }
.style-history pre { white-space: pre-wrap; font: inherit; }
.style-save { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .style-basic { grid-template-columns: 1fr; } }
.style-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.style-pick select { min-width: 280px; margin-bottom: 8px; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.strip figure { margin: 0; flex: none; width: 64px; text-align: center; font-size: 11px; color: var(--muted); }
.strip img { width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.pair img.prod { width: 100%; height: 110px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; margin: 2px 0 4px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 10px 0; }
.vgrid figure { margin: 0; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.vgrid figure:hover { border-color: #999; }
.vgrid figure.off { opacity: .35; }
.vgrid img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.vgrid figcaption { font-size: 12px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.vgrid .sw { width: 12px; height: 12px; }

/* 产品图印花位置 */
.admin-dlg.template-dlg { width: min(1080px, 96vw); max-height: 94vh; overflow-y: auto; }
.template-dlg h2 { margin: 0; }
.standard-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.standard-compare figure { margin: 0; text-align: center; }
.standard-compare img { display: block; width: 100%; height: 42vh; object-fit: contain; background: white; }
.standard-compare figcaption { color: var(--muted); margin-top: 6px; font-size: 13px; }
.template-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.template-preview { text-align: center; margin: 0; background: #f7f7f5; min-height: 240px; }
.template-canvas { position: relative; display: inline-block; max-width: 100%; vertical-align: top; line-height: 0; }
.template-canvas[hidden] { display: none; }
.template-canvas img { display: block; max-width: 100%; max-height: 64vh; width: auto; height: auto; user-select: none; }
.template-overlay { position: absolute; inset: 0; touch-action: none; cursor: crosshair; user-select: none; }
.template-box { position: absolute; border: 2px solid var(--run); background: rgba(47,107,255,.12); cursor: move; }
.template-box > span { position: absolute; left: -2px; bottom: calc(100% + 2px); background: var(--run); color: #fff;
  font-size: 11px; line-height: 1.5; padding: 1px 4px; white-space: nowrap; pointer-events: none; border-radius: 3px; }
.template-handle { position: absolute; width: 12px; height: 12px; border: 2px solid var(--run); background: white; border-radius: 2px; }
.template-handle.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.template-handle.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.template-handle.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.template-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.template-rotate { position: absolute; left: calc(50% - 7px); top: -34px; width: 14px; height: 14px;
  border: 2px solid var(--run); border-radius: 50%; background: #fff; cursor: grab; }
.template-rotate::after { content: ""; position: absolute; width: 2px; height: 18px; top: 12px; left: 4px; background: var(--run); pointer-events: none; }
.template-angles { display: flex; flex-wrap: wrap; gap: 8px; }
.template-dlg .template-angles label { display: flex; align-items: center; gap: 4px; margin: 0; }
.template-dlg .template-angles input { width: 82px; margin: 0; }
.template-side .panel { margin-top: 12px; margin-bottom: 0; }
.template-positions { display: flex; flex-direction: column; gap: 8px; }
.template-positions button { text-align: left; padding: 10px 12px; white-space: normal; }
.template-positions button.on { border-color: var(--accent); background: #fffaf0; }
.template-positions small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.template-positions .tag { float: right; }
.review-entry { margin: 0 0 12px; }
.review-slots { display: grid; gap: 10px; margin-top: 12px; }
.review-slot { margin: 0 !important; border-left: 4px solid var(--review-color); padding: 10px; }
.review-slot img { width: 44px; height: 44px; object-fit: contain; background: #f3f2ee; border-radius: 4px; }
.review-frame { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; }
.review-frame .row { flex-wrap: wrap; gap: 4px; }
.review-frame button { font-size: 12px; padding: 2px 5px; white-space: normal; text-align: left; }
.review-frame .warn { color: var(--err); margin: 5px 0; }
.review-issue p { margin: 5px 0; }
.review-confirmed { color: var(--muted); }
.review-box.has-issue { outline: 2px dashed #c43a30; outline-offset: 3px; }
.review-box.focused { box-shadow: 0 0 0 5px #f5a62355; z-index: 2; }
.print-review-dlg .template-side { max-height: 70vh; overflow-y: auto; padding: 5px; }
@media (max-width: 760px) { .template-layout { grid-template-columns: 1fr; } }

details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 8px; font-size: 13px; }
table.kv th { color: var(--muted); font-weight: 400; white-space: nowrap; width: 1%; padding: 2px 8px 2px 0; }
table.kv td { padding: 2px 0; }
table.kv th, table.kv td { border: 0; }
.issues { margin-top: 12px; }
.issues table td { font-size: 13px; padding: 4px 8px; }
.lv-error td:first-child { color: var(--err); font-weight: 600; }
.lv-warn td:first-child { color: #b26a00; }
.lv-info td:first-child { color: var(--muted); }
@media (max-width: 900px) { .style-pick, .info-grid { grid-template-columns: 1fr; } }

/* 印花位 / 依据 */
.pmode { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.pmode select { margin-left: 6px; font-size: 13px; padding: 3px 6px; }
.slots { display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.slot-img { width: 72px; height: 72px; min-height: 0; flex: none; }
.slot-img img { width: 72px; height: 72px; object-fit: contain; }
.slot-body { flex: 1; min-width: 0; }
.slot button, .slot .btn, .slot select, .slot input { padding: 2px 6px; font-size: 12px; }
.evidence { font-size: 12px; color: #2c4fb8; background: #f2f5ff; border-radius: 6px; padding: 4px 8px; cursor: help;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.evidence.weak { color: var(--err); background: #fdecec; }
.tag.basis-sales { background: #dff3e7; color: var(--ok); }
.tag.basis-platform { background: #e7f0ff; color: #1f4fd1; }
.tag.basis-case { background: #fff3dc; color: #a35f00; }
.tag.basis-trend { background: #f1eafd; color: #6a3fc0; }
.tag.basis-plan { background: #eeeeee; color: #666; }
.tag.basis-theory, .tag.basis-manual { background: #fdecec; color: var(--err); }
.prints { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.prints a { display: block; position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; text-decoration: none; }
.prints img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.prints span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; padding: 1px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.pairings td { vertical-align: top; font-size: 13px; }
table.pairings tr.off { opacity: .45; }

/* 顶部余额与管理员开关 */
.balance { background: #1f2a1f; color: #9be29b; border: 1px solid #2f4a2f; border-radius: 12px; padding: 2px 10px; font-size: 12px; }
.balance:hover { border-color: #5a8a5a; }
.balance.stale { color: #d9c27a; border-color: #5a4a20; }
.admin-btn { background: transparent; color: #aaa; border-color: #444; font-size: 12px; padding: 3px 10px; }
.admin-btn:hover { color: #fff; border-color: #888; }
.admin-btn.on { background: #7a1f1f; color: #ffd0d0; border-color: #a33; }
.pause-banner { background: #fdecec; color: #8a1f1f; border-bottom: 1px solid #f3c2c2; padding: 8px 24px; font-size: 13px; text-align: center; }
.admin-dlg { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; width: min(420px, 92vw); }
.admin-dlg::backdrop { background: rgba(0, 0, 0, .35); }
.admin-dlg h3 { margin: 0 0 6px; }
.admin-dlg label { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.admin-dlg input { width: 100%; margin-top: 4px; }

/* 用量页 */
.stat-tiles { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-tiles div { flex: 1; min-width: 140px; background: #f7f7f5; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.stat-tiles b { display: block; font-size: 22px; }
.stat-tiles span { font-size: 12px; color: var(--muted); }
.effect-stats .stat-empty { font-size: 14px; font-weight: 400; color: var(--muted); }
.effect-table-wrap { overflow-x: auto; margin-top: 14px; }
.effect-table-wrap table { min-width: 760px; }
.effect-note { display: block; font-size: 12px; }

.prod.keep-bottom { height: 110px; display: flex; align-items: center; justify-content: center; background: #f4f6fa; border: 1px dashed var(--line); border-radius: 6px; font-size: 12px; color: var(--muted); margin: 2px 0 4px; }

/* 选款：紧凑色块 */
.swatches { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0 2px; }
.swatches .swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); cursor: help; }
.strip-more summary { font-size: 12px; margin: 2px 0; }
.strip-more .strip { margin-top: 4px; }

/* 爆款分析：可读卡片 */
.dv-summary { margin: 6px 0 10px; font-weight: 600; }
.dna-view { display: grid; grid-template-columns: 72px 1fr; gap: 6px 10px; font-size: 13px; align-items: center; }
.dv-k { color: var(--muted); font-size: 12px; }
.dv-v .chip { margin: 0 4px 4px 0; display: inline-block; }
.dv-v .sw { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.dv-keep { margin-top: 12px; display: grid; gap: 4px; }
.dv-keep textarea { width: 100%; font-size: 13px; }
.dv-keep button { justify-self: start; }
.dv-raw { margin-top: 10px; }
.dv-raw textarea.dna { min-height: 240px; margin: 6px 0; }

.slot-add { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 8px; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; }
.slot-add input { flex: 1; min-width: 140px; font-size: 13px; }
.slot-add select, .slot-add button { font-size: 13px; padding: 3px 8px; }

.slot-add[hidden] { display: none; }

.slot-hint { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.slot-hint.warn { color: #b26a00; }
.slot-hint.ok { color: #2e7d32; }

/* 印花位：按上衣/裤子分组 */
.slot-group { margin: 10px 0 0; }
.slot-group-head { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.slot-group-head .muted { font-weight: 400; font-size: 12px; }
.slot-head { display: flex; align-items: center; gap: 6px; }
.slot-head input { flex: 1; min-width: 0; }
.slot-name { flex: 1; font-size: 13px; }
.slot-actions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.slot .icon-btn { border: none; background: none; color: var(--muted); padding: 0 4px; font-size: 13px; cursor: pointer; }
.slot .icon-btn:hover { color: #c0392b; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.slot-chip { font-size: 12px; padding: 2px 10px; border-radius: 12px; border: 1px dashed var(--line); background: none; cursor: pointer; }
.slot-chip:hover { border-style: solid; }
.slot-custom { display: flex; gap: 6px; margin-top: 6px; }
.slot-custom[hidden] { display: none; }
.slot-custom input { flex: 1; min-width: 0; font-size: 13px; }
.slot-custom button { font-size: 12px; padding: 2px 8px; }

/* 成品墙 */
.combo.result { padding: 8px; gap: 6px; }
.result-img { position: relative; aspect-ratio: 3 / 4; background: #f6f5f1; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
.result-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-img .status { padding: 12px; font-size: 13px; text-align: center; }
.result-qa { position: absolute; font-size: 11px; color: #fff; cursor: help; line-height: 1.4; }
.result-qa.warn { top: 6px; left: 6px; max-width: calc(100% - 12px); background: var(--accent); color: var(--accent-ink); border-radius: 4px; white-space: nowrap; }
/* 深一点的提醒红保证小字可读，仍只使用现有主题颜色。 */
.result-qa.warn.position { background: color-mix(in srgb, var(--err) 85%, var(--ink)); color: var(--panel); font-weight: 600; }
.result-qa .info-trigger { width: auto; height: auto; min-height: 28px; padding: 3px 6px; border-radius: 4px; color: inherit; font: inherit; }
.result-qa .info-trigger:hover, .result-qa .info-trigger[aria-expanded="true"] { background: transparent; color: inherit; }
.result-qa .info-popover { white-space: pre-line; }
/* 卡片里每一行高度固定，几张卡片并排时上下对齐 */
.result-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: nowrap; min-width: 0; white-space: nowrap; }
.result-meta > b, .result-meta > .muted { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.result-meta > .sw, .result-meta > .tag, .result-meta > .result-pick { flex: none; }
.result-meta .tag { cursor: help; }
/* 「选用」放在图片左下角，和右下角的收藏星对称；左上角留给质检提示 */
.result-pick { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.combo.result.selected .result-pick { border-color: var(--accent); background: #fff6e6; }
/* 颜色：上衣、下装各占一半，只有一件时占满；颜色名写全 */
.result-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 0; }
.result-colors.one { grid-template-columns: 1fr; }
.result-colors .color-chip { display: block; min-width: 0; }
.result-colors .cname-btn { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 0;
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; background: #fff; }
.result-colors .cname-btn .chip-label { font-size: 11px; line-height: 1.4; color: var(--muted); text-align: left; }
.result-colors .cname-btn .chip-main { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--ink); }
.result-colors .cname-btn .chip-main b { font-weight: 600; font-size: 13px; }
.result-colors .cname-btn .chip-main i { margin-left: auto; }
.result-colors .color-chip + .color-chip .card-menu { left: auto; right: 0; }
.result-why .tag { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.result-why .batch-tag { flex: none; cursor: pointer; }
.result-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.result-actions > button, .result-actions > .btn, .result-actions .cpick > button { padding: 3px 8px; font-size: 12px; }
#combos .result-actions { gap: 4px; }
#combos .result-actions > button, #combos .result-actions > .btn, #combos .result-actions .cpick > button { min-height: 28px; padding: 3px 6px; font-size: 12px; }
#combos .result-actions > *, #combos .result-actions .cpick > button { flex: none; }
.result-actions .result-more { margin-left: auto; }
#combos .result-actions .result-more > button { width: 28px; padding: 0; font-size: 18px; line-height: 24px; }
.card-menu.result-more-menu { left: auto; right: 0; bottom: calc(100% + 4px); top: auto; }
.result-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.result-actions .icon-btn { margin-left: auto; border: none; background: none; color: var(--muted); cursor: pointer; }
.result-actions .icon-btn:hover { color: #c0392b; }
.adjust > summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.adjust[open] { display: flex; flex-direction: column; gap: 10px; }
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 240px; box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.more-pop label { font-size: 12px; }

.grid-combos:has(.combo.result) { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.hero .dna-view { grid-template-columns: 40px 1fr; gap: 4px 8px; font-size: 12px; }
.dv-more { margin-top: 8px; font-size: 12px; }
.dv-more > summary { color: var(--muted); cursor: pointer; }
.dv-more .dv-summary { font-size: 12px; margin: 6px 0; }
.dv-tags .chip { display: inline-block; margin: 0 4px 4px 0; }

/* 上传卡片 */
.upload-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 220px;
  border: 2px dashed var(--line); background: #fff; cursor: pointer; text-align: center; padding: 16px; }
.upload-card:hover, .upload-card.drag { border-color: var(--accent); background: #fffaf0; }
.upload-card.busy { opacity: .6; pointer-events: none; }
.upload-plus { font-size: 40px; line-height: 1; color: var(--accent); }
.upload-card .muted { font-size: 12px; }
/* 项目名 */
.pname { font-size: 20px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 2px 6px; border-radius: 6px; min-width: 120px; }
.pname:hover, .pname:focus { border-color: var(--line); background: #fff; }
/* AI 看图里的参考图设置 */
.hero-setting { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; }
.hero-setting .dv-k { width: 40px; }
.hero-setting select { font-size: 12px; padding: 2px 4px; }

/* 印花定点修正 */
.slot-fix { display: flex; gap: 6px; margin-top: 6px; }
.slot-fix[hidden] { display: none; }
.slot-fix input { flex: 1; min-width: 0; font-size: 12px; }
.slot-fix button { font-size: 12px; padding: 2px 8px; }

/* 调整：颜色 / 印花 / 依据 */
.adj-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.adj-k { color: var(--muted); font-size: 12px; width: 28px; flex: none; }
.adj-print { align-items: flex-start; }
.adj-print-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.adj-print-body .imgbox { width: 100%; }
.adj-ev { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.adj-ev.weak { color: var(--err); }
.adj-adv { font-size: 12px; }
.adj-adv > summary { color: var(--muted); cursor: pointer; }
.adj-adv button, .adj-adv .btn { font-size: 12px; padding: 2px 8px; margin: 4px 4px 0 0; }

/* 搭配档位 */
.tag.tier-safe { background: #dff3e7; color: var(--ok); }
.tag.tier-advanced { background: #e7f0ff; color: #1f4fd1; }
.tag.tier-creative { background: #fff0e0; color: #c25400; }
.result-why { display: flex; align-items: center; gap: 4px; height: 24px; flex: none; min-width: 0; overflow: hidden; white-space: nowrap; }

/* 印花手法 + 原色对比 */
.adjust .slot-hint { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: help; }
.adj-style { font-size: 12px; color: var(--muted); }
.adj-style select { font-size: 12px; padding: 1px 4px; margin-left: 4px; }
.print-compare { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.print-compare figure { margin: 0; text-align: center; }
.print-compare img { width: 84px; height: 84px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); display: block; }
.print-compare figcaption { font-size: 11px; color: var(--muted); margin-top: 2px; }
.print-compare .arrow { color: var(--muted); }

/* AI 看图 ·「更多」 */
.dv-more[open] { background: #faf9f6; border-radius: 8px; padding: 8px 10px; }
.dv-more .dv-summary { font-weight: 400; font-size: 12px; line-height: 1.6; color: #444; margin: 8px 0 4px;
  padding-left: 8px; border-left: 3px solid var(--accent); }
.dv-sec { font-size: 12px; color: var(--muted); margin: 10px 0 4px; display: flex; align-items: center; justify-content: space-between; }
.dv-list { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.6; color: #333; }
.dv-list li { margin: 1px 0; }
.dv-keeplist li::marker { content: "✓ "; color: var(--ok); }
.dv-edit { font-size: 11px; padding: 1px 8px; }
.dv-keep[hidden] { display: none; }
.dv-keep textarea { font-size: 12px; line-height: 1.5; }
.dv-keep button { font-size: 12px; padding: 2px 10px; }

/* 项目卡片：进行中的项目 */
.pcard-img { position: relative; display: block; }
.pcard.busy { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pcard-badge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20, 20, 20, .78); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 12px; }
.pcard-badge .spin { width: 10px; height: 10px; border-width: 2px; }
.pcard-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0, 0, 0, .25); }
.pcard-progress i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.pcard-fail { font-size: 12px; color: var(--err); }

/* 项目页：①②③④ 分区 */
.sec { padding: 16px 20px; margin-bottom: 16px; }
.sec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sec-h .num { width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sec-h .num.todo { background: #d8d6d0; }
.sec-h h3 { margin: 0; font-size: 16px; }
.sec-h .done { background: var(--ok); color: #fff; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 10px; }
.sec-h .grow { flex: 1; }
.sec-h > button { font-size: 12px; padding: 3px 12px; }

/* ① 参考图 · AI 看图 */
.look { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.look .thumb { width: 210px; height: 280px; border-radius: 10px; object-fit: cover; display: block; cursor: zoom-in; background: #f3f2ee; }
.look .thumb-tip { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }
.facts { display: grid; grid-template-columns: 54px 1fr; gap: 8px 12px; font-size: 13px; align-items: center; }
.facts .k { color: var(--muted); font-size: 12px; }
.facts select { font-size: 12px; padding: 2px 6px; }
.facts .sw, .summary .sw { width: 13px; height: 13px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border-color: rgba(0,0,0,.1); }
.summary { margin: 14px 0 10px; padding-left: 10px; border-left: 3px solid var(--accent); font-size: 13px; color: #444; line-height: 1.7; }
.more-toggle { font-size: 12px; color: var(--muted); background: none; border: 1px dashed var(--line); border-radius: 6px; padding: 4px 12px; }
.more-toggle:hover { color: #333; border-style: solid; }
.more-grid { display: none; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.more-grid.on { display: grid; }
.more-grid > div { border-radius: 10px; padding: 12px 16px; border: 1px solid; }
.more-sell { background: #fff7ec; border-color: #f6dcb8 !important; }
.more-keep { background: #eef8f1; border-color: #c8e8d3 !important; }
.more-sell h4 { color: #c25400 !important; } .more-keep h4 { color: var(--ok) !important; }
.more-sell li::marker { color: #e08a2c; }
.more-grid h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.more-grid ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.more-grid ul[hidden] { display: none; }
.more-grid .keep li::marker { content: "✓ "; color: var(--ok); }

/* ② ③ 并排 */
.two { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.two > .sec { margin: 0; min-width: 0; }

/* ② 选择款式：搜索 + 预览 */
.pickers { display: grid; gap: 16px; }
.picker-head { display: flex; align-items: center; max-width: 360px; margin-bottom: 6px; }
.picker-head label { font-size: 12px; color: var(--muted); }
.seg button:disabled { color: #c4c2bc; cursor: not-allowed; }
.combo-box { position: relative; max-width: 360px; }
.combo-box input { width: 100%; padding: 6px 30px 6px 10px; border: 1px solid #c9c7c1; border-radius: 8px; font-size: 14px; }
.combo-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,166,35,.2); }
.combo-box::after { content: "⌕"; position: absolute; right: 10px; top: 6px; color: var(--muted); pointer-events: none; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.12); max-height: 300px; overflow-y: auto; padding: 4px; display: none; }
.combo-box.open .combo-list { display: block; }
.opt { display: flex; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 8px; cursor: pointer; }
.opt:hover, .opt.hl { background: #fff6e6; }
.opt.cur { background: #fdf0d8; }
/* 缩略图有的白底、有的透明底：套一层底色，白色用正片叠底融进去，所有图看起来同一个底 */
.opt .thumb { width: 40px; height: 40px; background: #f3f2ee; border-radius: 6px; flex: none; isolation: isolate; overflow: hidden; }
.opt .thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; display: block; }
.opt b { font-size: 13px; } .opt span { font-size: 12px; color: var(--muted); }
.opt.keep { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 8px; }
.opt.keep .ico { width: 40px; height: 40px; border-radius: 6px; background: #f1efe8; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.opt-empty { padding: 8px; font-size: 12px; color: var(--muted); }
.preview { display: grid; grid-template-columns: 120px 1fr; gap: 14px; margin-top: 10px; align-items: start; }
.preview .pimg { width: 120px; height: 120px; object-fit: contain; background: #f6f5f1; border-radius: 10px; display: block; }
/* 产品图和下拉缩略图一样：白底用正片叠底融进统一底色 */
.preview .pimg-wrap { display: block; flex: none; width: 120px; height: 120px; background: #f3f2ee; border-radius: 10px; isolation: isolate; overflow: hidden; }
.preview .pimg-wrap .pimg { background: none; mix-blend-mode: multiply; }
.preview .pv-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.preview .cname { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.preview .facts2 { font-size: 12px; color: #555; line-height: 1.7; }
.preview .facts2 b { font-weight: 500; color: var(--muted); }
.chips-c { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.chips-c i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.08); cursor: pointer; }
.chips-c i.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.chips-c span { font-size: 11px; color: var(--muted); margin-right: 4px; }

/* ③ 印花位：出光版 */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 34px; height: 20px; border-radius: 10px; background: #d8d6d0; position: relative; transition: .2s; }
.switch .track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { left: 16px; }
.noprint-note { background: #fff6e6; border: 1px solid #f5d9a8; color: #6b4a00; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.slots-wrap.off { opacity: .35; pointer-events: none; filter: grayscale(1); }
.slots-wrap.off .g-note { display: none; }
.slot-group-head { display: flex; align-items: center; gap: 4px; }
.seg { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; flex: none; }
.seg button { border: none; border-radius: 0; padding: 2px 12px; font-size: 12px; background: #fff; color: var(--muted); font-weight: 400; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: #fff; }
.g-note { font-size: 12px; color: #6b4a00; background: #fff6e6; border-radius: 6px; padding: 4px 10px; margin-bottom: 6px; }
.slot-group.off .g-body { opacity: .35; pointer-events: none; filter: grayscale(1); }
.modes { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; display: flex; gap: 8px 16px; font-size: 13px; flex-wrap: wrap; align-items: center; }
.modes select { font-size: 12px; margin-left: 6px; }
.adv { margin-left: auto; font-size: 12px; }
.adv > summary { color: var(--muted); cursor: pointer; list-style: none; font-size: 12px; }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::before { content: "⚙ "; }
.adv[open] { flex-basis: 100%; margin-left: 0; background: #faf9f6; border-radius: 8px; padding: 8px 10px; }
.adv p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.adv .chk { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 6px; }
.tag.ip-tag { background: #f3e8ff; color: #6b3fa0; cursor: help; }

@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .look, .more-grid, .preview { grid-template-columns: 1fr; } }

/* ④ 颜色范围：按钮 + 弹出面板 */
.rng { position: relative; display: inline-block; }
.rng .rng-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 10px 5px 12px; }
.rng .rng-btn .lbl { color: var(--muted); }
.rng .rng-btn .grp { display: inline-flex; align-items: center; gap: 4px; padding-left: 2px; }
.rng .rng-btn .grp + .grp::before { content: "·"; color: var(--muted); margin-right: 4px; }
.rng .rng-btn .x { color: var(--muted); padding: 0 2px; }
.rng .rng-btn .x:hover { color: var(--err); }
.rng .rng-btn.limited { border-color: var(--accent); background: #fffaf0; }
.rng .mini { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.12); margin-left: -3px; box-shadow: 0 0 0 1px #fff; }
.rng .pop { position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); width: 540px; max-width: 92vw; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 12px 14px; display: none; text-align: left; }
.rng .pop.on { display: block; }
.rng .sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.rng .sub b { color: var(--ink); }
.rng .prow { padding: 8px 0; border-top: 1px dashed var(--line); }
.rng .prow.dim { opacity: .45; }
.rng .prow-h { display: flex; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.rng .prow-h b { color: var(--ink); font-size: 13px; margin-right: 6px; }
.rng .prow-h .grow { flex: 1; }
.rng .prow-h button { font-size: 11px; padding: 0 8px; }
.rng .dots { display: flex; flex-wrap: wrap; gap: 10px; }
.rng .dotw { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 44px; font-size: 11px; color: var(--muted); text-align: center; cursor: pointer; }
.rng .dotw.on { color: var(--ink); font-weight: 600; }
.rng .dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); display: inline-block; position: relative; }
.rng .dot.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.rng .dot.on::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.7); }
.rng .pop-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.rng .pop-foot .grow { flex: 1; }
.rng .mode-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.rng .mode-seg button { border: none; border-radius: 0; padding: 6px 10px; font-size: 13px; font-weight: 600; background: #fff; color: var(--muted); text-align: left; }
.rng .mode-seg button + button { border-left: 1px solid var(--line); }
.rng .mode-seg button small { display: block; font-size: 11px; font-weight: 400; }
.rng .mode-seg button.on { background: var(--ink); color: #fff; }
.rng .mode-seg button.on small { color: #ddd; }
.rng .pairs { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; border-top: 1px dashed var(--line); }
.rng .pair { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: #fff6e6; border: 1px solid #f5d9a8; border-radius: 14px; padding: 2px 4px 2px 6px; }
.rng .pair button { border: none; background: none; padding: 0 4px; color: var(--muted); font-size: 11px; }
.rng .pair-ico { display: inline-flex; flex-direction: column; width: 12px; height: 16px; border-radius: 3px; overflow: hidden; border: 1px solid rgba(0,0,0,.12); vertical-align: middle; }
.rng .pair-ico i { flex: 1; }

/* 收藏 */
/* 圆形磨砂底 + 细线图标；收藏后图标填满。单图（心形）用玫红，项目（书签）用品牌橙 */
.star { border: none; width: 32px; height: 32px; border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #3a3a3c; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.04); transition: transform .15s ease, background .15s ease, color .15s ease; }
.star svg path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.star:hover { transform: scale(1.08); background: #fff; }
.star:active { transform: scale(.94); }
.star.on svg path { fill: currentColor; }
.result-star:hover, .result-star.on { color: #e5484d; }
.pcard-star:hover, .pcard-star.on { color: #e8930c; }
.pcard-favn svg, .pair-fav svg { width: 12px; height: 12px; vertical-align: -1px; }
.pcard-favn svg path, .pair-fav svg path { fill: #e5484d; }
.result-star { position: absolute; right: 8px; bottom: 8px; }
.pcard-star { position: absolute; right: 8px; top: 8px; }
.pcard-favn { font-size: 12px; color: #c23b40; }
.fav-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.fav-tabs a { padding: 6px 16px; border-radius: 18px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-size: 13px; }
.fav-tabs a span { color: var(--muted); margin-left: 2px; }
.fav-tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fav-tabs a.on span { color: #ccc; }
.fav-from { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-from a { color: inherit; }
.fav-grid .result-actions .btn { font-size: 12px; padding: 3px 10px; }
.scheme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.scheme { display: grid; grid-template-columns: 56px 1fr 84px; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.scheme-sw { display: grid; grid-template-rows: 1fr 1fr; height: 76px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,0,0,.08); }
.scheme-body { display: flex; flex-direction: column; gap: 5px; font-size: 13px; min-width: 0; }
.scheme-pal { display: flex; align-items: center; gap: 4px; font-size: 12px; flex-wrap: wrap; }
.scheme-pal > i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); display: inline-block; }
.scheme-pal > i.echo { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--accent); }
.scheme-pal .muted { margin-right: 4px; }
.scheme-pal .tag { margin-left: 6px; }
.scheme-why { font-size: 12px; color: #555; line-height: 1.5; }
.scheme > a img { width: 84px; height: 112px; object-fit: cover; border-radius: 8px; display: block; }
.rng .prow.favs .prow-h { flex-wrap: wrap; }
.rng .fav-picks { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.rng .fav-pick { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border-radius: 10px; font-size: 11px; text-align: left; background: #fff; }
.rng .fav-pick img { width: 34px; height: 45px; object-fit: cover; border-radius: 6px; }
.rng .fav-pick b { font-size: 12px; font-weight: 600; }
.rng .fav-pick.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #fffaf0; }
.rng .fav-pick:disabled { opacity: .4; cursor: not-allowed; }
.rng .fav-pick .mini { margin-left: 0; margin-right: -3px; }
.rng .pair-fav { font-size: 12px; }

/* 卡片提示里的文字按钮（和提示同一行、同一字号） */
.hint-acts { display: inline-flex; gap: 10px; margin-left: 8px; }
.link-btn { border: none; background: none; padding: 0; font: inherit; font-size: 11px; color: var(--ink); text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer; }
.link-btn:hover { color: var(--accent); }

/* 成品图卡片：颜色名点着换、换印花配色菜单 */
.cpick { position: relative; display: inline-flex; min-width: 0; }
.cname-btn { border: none; background: none; padding: 1px 2px; display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 13px;
  min-width: 0; border-radius: 4px; cursor: pointer; color: var(--ink); }
.cname-btn:hover:not(:disabled) { background: #f3f2ee; }
.cname-btn b, .cname-btn span:not(.sw) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cname-btn span:not(.sw) { color: var(--muted); }
.cname-btn i { font-style: normal; font-size: 10px; color: var(--muted); }
.cname-btn .sw { width: 14px; height: 14px; }
.card-menu { display: none; position: absolute; z-index: 25; left: 0; top: calc(100% + 4px); min-width: 140px; max-height: 280px; overflow-y: auto;
  overflow-x: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); padding: 4px; }
.card-menu.on { display: block; }
.card-menu.wide { width: 250px; max-height: 340px; left: auto; right: auto; bottom: calc(100% + 4px); top: auto; }
.card-menu button { display: flex; align-items: center; gap: 6px; width: 100%; border: none; background: none; border-radius: 6px; padding: 5px 8px;
  font-size: 12px; text-align: left; cursor: pointer; }
.card-menu.wide button { flex-direction: column; align-items: flex-start; gap: 1px; }
.card-menu button span:not(.sw) { color: var(--muted); font-size: 11px; line-height: 1.4; }
.card-menu button:hover { background: #fff6e6; }
.card-menu button.on { background: #fdf0d8; }
.card-menu button.on b::after { content: " ✓"; color: var(--accent); }
.card-menu .menu-tip { font-size: 11px; color: var(--muted); padding: 4px 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.card-menu .menu-sep { border-top: 1px solid var(--line); margin: 4px 0; }
.result-actions .cpick > button { font-size: 13px; }

/* 换印花配色：主按钮 + 一排手法标签 */
.card-menu.style-menu { width: 210px; bottom: calc(100% + 4px); top: auto; padding: 6px; }
.card-menu.style-menu .menu-main { flex-direction: row; justify-content: space-between; align-items: baseline; background: #fff6e6; padding: 7px 10px; }
.card-menu.style-menu .menu-main:hover { background: #fdecc9; }
.card-menu.style-menu .menu-main b { font-size: 13px; }
.style-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 2px 2px; }
.card-menu .style-chips button { width: auto; padding: 2px 9px; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; }
.card-menu .style-chips button.on { border-color: var(--accent); background: #fffaf0; color: var(--ink); }
.card-menu .style-chips button.on::after { content: none; }
.card-menu .menu-plain { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 7px; color: var(--muted); }

/* 印花有看不到的部分 */
.tag.ai-fill { background: #fff3df; color: #a8650a; font-size: 11px; cursor: help; margin-left: 6px; }
.miss-flag { font-size: 12px; color: #a8650a; margin-left: 8px; text-decoration: none; white-space: nowrap; }
.miss-flag:hover { text-decoration: underline; }
.slot-head .ai-fill { margin-right: auto; }
.tag.up-tag { background: #eef3ff; color: #2c4fb8; font-size: 11px; cursor: help; margin-left: 6px; margin-right: auto; }
.slot-hint.up-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ref-thumb { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; vertical-align: middle; border: 1px solid var(--line); }
.slot-hint .spin { width: 10px; height: 10px; border-width: 2px; }

/* 看大图（页面内弹出） */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(15, 15, 15, .82); display: flex; align-items: center; justify-content: center; }
.lightbox .lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 48px 72px 64px; box-sizing: border-box; }
.lightbox .lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.4); cursor: default; }
.lightbox .lb-stage.lb-print img { padding: 28px; box-sizing: border-box; border-radius: 12px; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: none; border-radius: 10px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 34px; line-height: 1; cursor: pointer; }
.lightbox .lb-nav:hover { background: rgba(255,255,255,.25); }
.lightbox .lb-nav[hidden] { display: none; }
.lightbox .lb-prev { left: 16px; } .lightbox .lb-next { right: 16px; }
.lightbox .lb-bar { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; align-items: center; gap: 16px; font-size: 13px; color: #ddd; }
.lightbox .lb-bar a { color: #ddd; text-decoration: none; } .lightbox .lb-bar a:hover { color: #fff; text-decoration: underline; }
.lightbox .lb-close { position: fixed; top: 14px; right: 16px; width: 36px; height: 36px; border: none; border-radius: 50%; background: rgba(255,255,255,.15);
  color: #fff; font-size: 16px; cursor: pointer; }
.lightbox .lb-close:hover { background: rgba(255,255,255,.3); }

/* 成品图下面的「历史」 */
.history { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.history > summary { font-size: 13px; color: var(--muted); cursor: pointer; }
.history-grid { margin-top: 10px; }
.grid-combos.history-grid:has(.combo.result) { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hist-tools { display: flex; justify-content: flex-end; margin-top: 8px; }
.hist-tools button { font-size: 12px; padding: 3px 12px; }
.hist-group { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #faf9f6; }
.hist-group[open] { padding-bottom: 12px; }
.hist-group-h { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; list-style: none; min-height: 44px; }
.hist-group-h::-webkit-details-marker { display: none; }
.hist-group-h .muted { font-size: 12px; white-space: nowrap; }
.hist-caret { color: var(--muted); font-size: 11px; transition: transform .15s ease; }
.hist-group[open] .hist-caret { transform: rotate(90deg); }
.hist-strip { display: flex; gap: 4px; margin-left: auto; overflow: hidden; min-width: 0; }
.hist-strip img { width: 33px; height: 44px; object-fit: cover; border-radius: 4px; flex: none; }
.hist-group[open] .hist-strip { display: none; }
.history-grid .combo.result { padding: 6px; gap: 4px; }
.history-grid .result-star { width: 26px; height: 26px; right: 6px; bottom: 6px; }
.history-grid .result-star svg { width: 14px; height: 14px; }
.history-grid .result-meta .sw { width: 11px; height: 11px; }
.history-card { opacity: .85; }
.history-card:hover { opacity: 1; }
.hist-what { font-size: 12px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hist-tag { font-size: 11px; color: var(--muted); }
.btn.dim { opacity: .55; }

/* 详情步骤导航：宽屏留在 main 外侧，窄屏收为左下角按钮。 */
.project-steps { position: fixed; left: var(--steps-left, 12px); top: var(--steps-top, 80px); z-index: 35; width: 128px; }
.steps-menu.panel { width: 128px; padding: 6px; margin: 0; max-height: calc(100dvh - var(--steps-top, 80px) - 16px); overflow-y: auto; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.step-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 8px 10px; font-size: 13px; text-align: left; color: var(--ink); background: var(--panel); }
.steps-menu .step-link { width: 100%; padding: 7px 8px; gap: 2px 6px; margin-bottom: 4px; border-color: transparent; }
.steps-menu .step-link:last-child { margin-bottom: 0; }
.steps-menu .step-link[hidden] { display: none; }
.step-link:hover { border-color: var(--line); background: #fffaf0; }
.step-link.active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.step-state { color: var(--muted); }
.step-link.done .step-state { color: var(--ok); }
.step-link.active .step-state { color: inherit; }
.step-meta { grid-column: 1 / -1; color: var(--muted); font-size: 11px; white-space: normal; }
.step-link.active .step-meta { color: var(--accent-ink); }
.steps-toggle { display: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; align-items: center; justify-content: center; background: var(--panel); box-shadow: 0 3px 12px rgba(0,0,0,.12); }
.project-steps.compact { top: auto; left: 16px; bottom: var(--steps-bottom, 80px); width: 44px; }
.project-steps.compact .steps-toggle { display: flex; }
.project-steps.compact .steps-menu { position: absolute; bottom: 52px; left: 0; max-height: calc(100dvh - var(--steps-top, 80px) - var(--steps-bottom, 80px) - 52px); visibility: hidden; pointer-events: none; }
.project-steps.compact.open .steps-menu { visibility: visible; pointer-events: auto; }
.step-anchor { scroll-margin-top: var(--steps-top, 80px); }
.page-back-top { position: fixed; right: 16px; bottom: var(--steps-bottom, 80px); z-index: 35; border-radius: 10px; background: var(--panel); border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,.16); }
.page-back-top[hidden] { display: none; }

@media (max-width: 699px) {
  body:has(#projectSteps) .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  body:has(#projectSteps) .topbar nav { flex-wrap: wrap; }
  body:has(#projectSteps) .topbar .who { margin-left: 0; }
  body:has(#projectSteps) main { padding: 16px; }
  body:has(#projectSteps) main > .row > h2 { max-width: 100%; flex-wrap: wrap; }
  body:has(#projectSteps) .pname { min-width: 0; max-width: 100%; }
  body:has(#projectSteps) .sec-h, body:has(#projectSteps) .slot-group-head, body:has(#projectSteps) .slot-head { flex-wrap: wrap; }
  body:has(#projectSteps) .look > div { min-width: 0; }
  body:has(#projectSteps) .facts { grid-template-columns: 54px minmax(0, 1fr); }
  body:has(#projectSteps) .facts > * { min-width: 0; max-width: 100%; }
  body:has(#projectSteps) .grid-combos { grid-template-columns: minmax(0, 1fr); }
  /* 展开入口避开手机左下角的固定导航。 */
  .style-pattern .pattern-expand { margin-left: 24px; max-width: calc(100% - 24px); white-space: normal; }
}

/* 批次筛选只隐藏卡片，不改变选用和导出。 */
.batch-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.batch-filter button { font-size: 12px; padding: 3px 10px; min-height: 28px; }
.batch-tag { white-space: nowrap; }
.grid-combos > .combo[hidden] { display: none; }
.hist-group-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.hist-group-title .muted { white-space: normal; }
.hist-group-title + .hist-strip { flex: 0 1 40%; }

/* 共用说明浮层：鼠标、触摸和键盘使用同一份内容。 */
.info-help, .action-help { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
.info-trigger { border: 0; background: transparent; padding: 2px; width: 24px; height: 24px; color: var(--muted); font-size: 16px; line-height: 20px; border-radius: 50%; }
.info-trigger:hover, .info-trigger[aria-expanded="true"] { color: var(--accent-ink); background: #fff3da; }
.info-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.info-popover { position: fixed; z-index: 60; width: min(360px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 4px 16px rgba(0,0,0,.16); color: var(--ink); font-size: 12px; font-weight: 400; line-height: 1.6; white-space: normal; text-align: left; }
.info-popover[hidden] { display: none; }
.info-item { display: block; }
.info-item + .info-item { margin-top: 8px; }
.batch-copy { font-size: 11px; padding: 1px 5px; margin-right: 4px; vertical-align: baseline; }
.hist-title-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.hist-title-line .tag { font-weight: 400; }
.slot-brief { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo.step-target { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 6px #f5a62326; }

/* 对比只读取已有图片，两个画面使用相同裁切范围和显示尺寸。 */
.result-qa.info { top: 6px; left: 6px; background: var(--muted); padding: 1px 6px; border-radius: 4px; }
.admin-dlg.print-compare-dlg { width: min(960px, 94vw); max-height: 92vh; overflow-y: auto; }
.print-compare-head { justify-content: space-between; }
.print-compare-row h4 { margin: 0 0 8px; }
.print-compare-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.print-compare-images figure { margin: 0; min-width: 0; }
.print-compare-images figcaption { margin-bottom: 6px; font-size: 13px; }
.print-compare-images canvas[hidden] { display: none; }
/* 细长袖子也限制在同高画面内，避免按列宽放大后占满数屏。 */
.print-compare-images canvas { display: block; width: 100%; height: 320px; object-fit: contain; background-color: var(--print-fabric, var(--bg)); border-radius: 6px; }
@media (max-width: 600px) {
  .print-compare-images { grid-template-columns: 1fr; }
}

/* 透明印花只换显示底色，所有预览跟随同一个浏览器设置。 */
.print-surface { background-color: var(--print-fabric, #808080); }
[data-print-background="dark"] .print-surface { background-color: var(--ink); }
[data-print-background="light"] .print-surface, [data-print-background="checker"] .print-surface { background-color: var(--panel); }
.print-background-control { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.print-background-control select { font: inherit; padding: 2px 4px; }
.operator-hint { display: inline-block; color: var(--accent); font-size: 12px; margin-left: 6px; }
.operator-hint[hidden] { display: none; }
.who input[aria-invalid="true"] { border-color: var(--accent); }

/* 满印沿用产品库卡片和颜色范围浮层，缩略图直接显示面料。 */
.pattern-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-top: 12px; }
.pattern-card { display: flex; flex-direction: column; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; background: #fff; }
.pattern-card.off { background: #f4f4f2; }
.pattern-card.off img { opacity: .4; filter: grayscale(1); }
.pattern-card.off .pattern-name { color: var(--muted); }
.pattern-zoom { position: relative; display: block; }
.pattern-zoom img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--bg); }
.pattern-state { position: absolute; top: 4px; left: 4px; font-size: 11px; padding: 0 6px; box-shadow: 0 0 0 1px #fff; }
.pattern-state.state-on { background: #dff3e7; color: var(--ok); }
.pattern-state.state-off { background: #e8e8e5; color: #555; }
.pattern-state.state-miss { background: #fdecec; color: var(--err); }
.pattern-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pattern-card .pattern-exclusive { font-size: 11px; align-self: flex-start; }
.pattern-card .row { margin-top: auto; gap: 4px; flex-wrap: nowrap; }
.pattern-card .row button { flex: 1; padding: 2px 4px; font-size: 12px; }
.pattern-card button, .pattern-pick, .rng .pop.pattern-pop .dotw { min-height: 28px; }
.pattern-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.pattern-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.pattern-edit-dlg { width: min(460px, 94vw); max-height: 90dvh; overflow-y: auto; }
.pattern-edit-dlg label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.pattern-edit-dlg label:has(input[type=checkbox]) { flex-direction: row; align-items: center; }
.pattern-edit-dlg input[type=checkbox] { width: auto; margin: 0; flex: none; }
.pattern-edit-dlg textarea, .pattern-edit-dlg input:not([type=checkbox],[type=color]) { width: 100%; }
.pattern-edit-dlg .pattern-preview { width: 100%; max-height: 200px; object-fit: contain; margin-top: 12px; }
.pattern-base-field { margin-top: 10px; }
.pattern-base-field[hidden] { display: none; }
.style-pattern { margin-top: 10px; min-width: 0; }
.style-pattern .seg { margin-left: 0; }
.style-pattern .seg button, #stylesSec [data-keep] { min-height: 28px; }
.style-pattern > .row { margin-top: 8px; }
.style-pattern .slot-hint { margin: 6px 0; }
.style-pattern .pattern-picks { grid-template-columns: repeat(auto-fill, 44px); gap: 8px; max-height: none; overflow: visible; padding: 0; }
.style-pattern .pattern-pick { position: relative; width: 44px; height: 44px; padding: 2px; }
.style-pattern .pattern-pick[hidden] { display: none; }
.style-pattern .pattern-pick img { width: 100%; height: 100%; margin: 0; }
.pattern-check { display: none; position: absolute; right: -2px; top: -2px; min-width: 14px; height: 14px; border-radius: 7px; background: var(--ink); color: var(--panel); font-size: 11px; line-height: 14px; }
.pattern-pick.on .pattern-check { display: block; }
.style-pattern .pattern-expand { min-height: 28px; margin-top: 8px; font-size: 12px; }
.style-pattern .pattern-expand:hover { color: var(--ink); }
.pattern-pick:focus-visible, .color-pick:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pattern-exclusive { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.pattern-edit-dlg [data-pattern-operators][hidden] { display: none; }
.pattern-controls label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pattern-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; max-height: 250px; overflow-y: auto; padding: 4px; }
.pattern-pick { padding: 5px; white-space: normal; color: var(--ink); text-align: center; font-size: 12px; }
.pattern-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 4px; margin-bottom: 3px; }
.pattern-pick.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--bg); }
.rng .pop.pattern-pop .dotw { border: none; background: transparent; padding: 0; }
.rng .pop.pattern-pop .pop-foot { flex-wrap: wrap; }
.rng .pop.pattern-pop { position: fixed; left: 50%; right: auto; top: 16dvh; transform: translateX(-50%); width: min(620px, calc(100vw - 24px)); max-width: none; max-height: 72dvh; overflow-y: auto; }
.pattern-chip .chip-main .sw, .result-meta img.sw { object-fit: cover; }
.pattern-chip .chip-main b, .pattern-card b { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .pattern-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pattern-library .row > label, .pattern-library #patternSearch { width: 100%; }
  .rng .pop.pattern-pop { left: 12px; right: 12px; top: 20dvh; transform: none; width: auto; }
  .pattern-picks { max-height: 210px; }
}

/* 常用颜色留在第2步，搭配表在窗口中按需打开。 */
#stylesSec .preview > div { min-width: 0; }
.color-pick-info { gap: 5px; margin: 8px 0 5px; font-size: 12px; color: var(--muted); }
.color-pick-info button { min-height: 28px; padding: 2px 6px; font-size: 12px; }
.color-picks { display: flex; flex-wrap: wrap; gap: 2px; }
.color-pick { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 2px; position: relative; color: var(--ink); border-color: transparent; border-radius: 50%; background: transparent; }
.color-pick-image { position: relative; display: block; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; background: var(--variant-color, var(--bg)); }
.color-check { display: none; position: absolute; right: -3px; top: -3px; min-width: 12px; height: 12px; border-radius: 6px; background: var(--ink); color: var(--panel); font-size: 10px; line-height: 12px; }
.color-pick.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.color-pick.on .color-check { display: block; }
.color-choices { min-width: 0; margin-top: 8px; border-radius: 8px; }
.range-matrix > .row button { min-height: 28px; font-size: 12px; padding: 3px 8px; }
.range-matrix { min-width: 0; padding-top: 4px; }
.range-matrix > .row { align-items: flex-start; gap: 6px; }
.range-matrix .slot-hint { margin: 4px 0 8px; }
.range-table-scroll { max-width: 100%; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: 7px; }
.range-table { border-collapse: separate; border-spacing: 4px; width: max-content; table-layout: fixed; font-size: 12px; }
.range-table th { min-width: 52px; max-width: 80px; padding: 3px; font-weight: 400; overflow-wrap: anywhere; }
.range-table thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.range-table tbody th { position: sticky; left: 0; z-index: 1; background: var(--panel); }
.range-table td { padding: 0; }
.range-cell { position: relative; display: flex; flex-direction: column; width: 48px; height: 42px; padding: 3px; gap: 1px; border: 1px solid var(--line); border-radius: 5px; }
.range-cell > i, .range-cell > img { display: block; width: 100%; height: 50%; object-fit: cover; min-height: 0; }
.range-cell.outside { opacity: .3; }
.range-cell.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.range-cell.on.outside { opacity: .65; }
.range-matrix .fav-picks { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; }
.range-matrix .fav-pick { display: flex; align-items: center; gap: 6px; padding: 4px; max-width: 100%; white-space: normal; font-size: 12px; }
.range-matrix .fav-pick img { width: 34px; height: 45px; object-fit: cover; border-radius: 5px; }
.range-matrix .fav-pick.on { border-color: var(--ink); }
.range-save-status { min-height: 18px; margin: 6px 0 0; }
.range-highlight { outline: 2px solid var(--accent); outline-offset: 5px; }

.range-save-status button { min-height: 28px; }

.range-entry { margin: 0; }
.range-entry .link-btn { min-height: 28px; }
.admin-dlg.range-dialog { width: min(880px, 96vw); max-height: 90dvh; overflow-y: auto; }
.range-dialog-actions { justify-content: flex-end; margin-top: 12px; }


/* 登录状态不显示上个账号的页面和管理入口。 */
[hidden] { display: none !important; }
.login-panel { width: min(400px, 100%); margin: 56px auto; }
.login-panel form, .account-dlg form { display: flex; flex-direction: column; gap: 12px; }
.login-panel label, .account-dlg label { display: flex; flex-direction: column; gap: 5px; }
.login-panel input, .account-dlg input:not([type=checkbox]), .account-dlg select { width: 100%; min-width: 0; }
.login-panel button, .account-dlg button, .account-table button { min-height: 28px; }
.login-panel .status:empty, .account-dlg .status:empty { display: none; }
.login-panel .status.error, .account-dlg .status.error { color: var(--ink); border-left: 3px solid var(--err); padding: 3px 0 3px 9px; }
.account-area { position: relative; flex: none; }
.account-area > button { max-width: 180px; overflow: hidden; text-overflow: ellipsis; min-height: 28px; background: transparent; color: inherit; }
.account-dropdown { left: auto; right: 0; color: var(--ink); }
.account-dropdown button { min-height: 28px; }
.account-dlg { width: min(440px, 94vw); max-height: 92dvh; overflow-y: auto; }
.account-dlg .account-check { flex-direction: row; align-items: center; }
.account-table-wrap { max-width: 100%; overflow-x: auto; }
.account-table { min-width: 560px; width: 100%; border-collapse: collapse; }
.account-table th, .account-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.account-table button { font-size: 12px; padding: 3px 8px; }
/* 删除账号需保持红色警示，同时让小字号在白底上看得清。 */
.account-table button.danger, .account-dlg button.danger { color: color-mix(in srgb, var(--err) 85%, var(--ink)); border-color: var(--err); }
.signed-out .mode, .signed-out #pauseBanner, .signed-out #balance, .signed-out #adminBtn { display: none; }
@media (max-width: 699px) {
  .topbar { flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px; }
  .topbar nav { flex-wrap: wrap; gap: 8px 12px; }
  .account-area { margin-left: auto; }
  .account-area > button { max-width: 120px; }
  .login-panel { margin: 24px auto; }
}

/* 归属筛选和只读值沿用已有表单与提示样式。 */
.scope-filters { margin: 0 0 14px; }
.scope-filters label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.scope-filters select { max-width: 240px; }
.readonly-value { display: inline-block; overflow-wrap: anywhere; }
.readonly-control { cursor: default; }
.combo-box > .readonly-value { padding: 5px 8px; }
.project-readonly-note { margin: 0 0 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.pattern-user-list { max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; }
.pattern-user-list label { min-height: 28px; overflow-wrap: anywhere; }
.pattern-edit-dlg [data-pattern-users][hidden] { display: none; }
.pattern-edit-dlg .status.error { color: var(--ink); border-left: 3px solid var(--err); padding-left: 8px; }

.account-state { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-state .seg { margin-left: 0; }
.account-username { display: flex; flex-direction: column; gap: 5px; }
.account-disabled td, .account-disabled td button { color: var(--muted); }
.account-disabled-tag { color: var(--muted); background: var(--bg); }
.account-dlg > label { display: flex; flex-direction: column; gap: 5px; }
.account-dlg [data-credential-message] { width: 100%; min-height: 100px; overflow-wrap: anywhere; }
.account-dlg [data-credential-message][hidden] { display: none; }

.account-area:has(.quota-usage) { display: flex; align-items: center; gap: 8px; }
.account-area > .quota-usage { border: 0; padding: 2px 4px; min-height: 28px; font-size: 12px; line-height: 18px; }
.quota-panel h2 { margin-bottom: 0; }
.quota-panel .account-table-wrap { margin-top: 10px; }
.signed-out #quotaUsage { display: none; }
@media (max-width: 699px) {
  .topbar:has(#quotaUsage:not([hidden])) { gap: 2px 14px; padding: 6px 16px; }
  .account-area:has(.quota-usage) { flex-direction: column; align-items: flex-end; gap: 0; }
  .account-area:has(.quota-usage) > #accountMenuBtn { padding: 3px 8px; }
}

/* 反馈复用现有面板和对话框，长说明折叠且不撑宽手机页面。 */
.feedback-header-btn { min-height: 28px; padding: 3px 8px; background: transparent; color: inherit; }
#feedbackNav { display: inline-flex; align-items: center; gap: 4px; }
.feedback-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--err); }
.feedback-dlg { width: min(520px, 94vw); }
.feedback-dlg textarea, .feedback-detail textarea { width: 100%; resize: vertical; min-width: 0; }
.feedback-actions { justify-content: flex-end; }
.feedback-attachments { display: flex; gap: 10px; flex-wrap: wrap; }
.feedback-attachments figure { width: 90px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.feedback-attachments img { width: 90px; height: 90px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.feedback-filters { margin: 12px 0; }
.feedback-filters label { display: flex; align-items: center; gap: 6px; }
.feedback-filters select { max-width: 240px; min-width: 0; }
.feedback-list { display: flex; flex-direction: column; gap: 10px; }
.feedback-row { width: 100%; display: flex; align-items: flex-start; gap: 14px; padding: 12px; text-align: left; white-space: normal; }
.feedback-row > img, .feedback-no-image { width: 72px; height: 96px; object-fit: contain; flex: none; background: var(--bg); border-radius: 6px; }
.feedback-no-image { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.feedback-row-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feedback-description, .feedback-origin, .feedback-reply-preview { overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.feedback-origin { -webkit-line-clamp: 1; }
.feedback-page button, .feedback-detail button { min-height: 28px; }
.feedback-page .tag.warn, .feedback-detail .tag.warn { color: color-mix(in srgb, var(--err) 80%, var(--ink)); }
.feedback-detail { width: min(760px, 94vw); }
.feedback-detail > p { margin: 10px 0; }
.feedback-text, .feedback-response p { white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-pictures { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.feedback-pictures figure { width: 112px; margin: 0; color: var(--muted); font-size: 12px; }
.feedback-pictures img { width: 112px; height: 148px; object-fit: contain; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.feedback-pictures img.print-surface { background: var(--print-fabric, var(--muted)); }
.feedback-detail form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.feedback-snapshot { margin-top: 14px; }
.feedback-snapshot summary { cursor: pointer; min-height: 28px; }
.feedback-snapshot pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 12px; background: var(--bg); border-radius: 6px; padding: 10px; }
dialog.lightbox { margin: 0; padding: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; border: 0; color: var(--ink); }
.lightbox .lb-feedback { min-height: 28px; background: transparent; color: inherit; border-color: var(--muted); }
@media (max-width: 699px) {
  .topbar:has(#feedbackNav), .topbar:has(#feedbackNav):has(#quotaUsage) { gap: 2px 10px; padding: 4px 12px; }
  .topbar:has(#feedbackNav) nav { order: 2; flex-basis: 100%; gap: 4px 10px; }
  .topbar:has(#feedbackNav) .account-area, .topbar:has(#feedbackNav) #adminBtn, .topbar:has(#feedbackNav) #balance { order: 3; }
  .topbar:has(#feedbackNav) .account-area:has(.quota-usage) { flex-direction: row; align-items: center; gap: 6px; }
  .feedback-header-btn { font-size: 12px; padding: 2px 6px; }
  .feedback-filters { align-items: stretch; }
  .feedback-filters label { flex: 1 1 100%; justify-content: space-between; }
  .feedback-filters select { flex: 1; max-width: 76%; }
  .feedback-row { gap: 10px; padding: 10px; }
  .feedback-row > img, .feedback-no-image { width: 54px; height: 72px; }
  .lightbox .lb-bar { gap: 10px; flex-wrap: wrap; padding: 0 12px; }
}
