/* ============================================================
 *  UNI 一体化中台 —— 统一视觉（冷静克制 · 高级灰）
 *  近黑侧栏 + off-white 背景 + 单一墨绿强调色
 * ============================================================ */
:root {
  --bg: #FBFBF9;
  --panel: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #8C8C84;
  --line: #ECECE6;
  --accent: #2F5D54;
  --accent-d: #244A43;
  --green: #5B8C6E;
  --red: #B05545;
  --sidebar: #16181A;
  --sidebar-text: #C7CBD0;
}
html { overflow: auto; }
* { box-sizing: border-box; }
body { margin: 0; display: flex; min-height: 100vh; min-width: 100vw; overflow: auto; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
#app { display: flex; min-height: 100vh; min-width: 0; overflow: auto; width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; }

/* ===== 侧边导航 ===== */
#nav { width: 212px; background: var(--sidebar); color: var(--sidebar-text); padding: 20px 12px; min-height: 100vh; flex-shrink: 0; overflow: auto; }
#nav .brand { font-size: 20px; font-weight: 700; color: #fff; padding: 6px 10px 2px; letter-spacing: 2px; }
#nav .sub { font-size: 12px; color: #6F7378; padding: 0 10px 18px; letter-spacing: 1px; }
.navitem { display: block; padding: 11px 12px; border-radius: 9px; cursor: pointer; margin-bottom: 4px; color: var(--sidebar-text); text-decoration: none; font-size: 14px; }
.navitem:hover { background: #23262A; }
.navitem.active { background: var(--accent); color: #fff; }

/* ===== 顶栏 ===== */
main { flex: 1; display: flex; flex-direction: column; min-width: 0; width: 100%; overflow: auto; }
.topbar { height: 58px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 20px; gap: 14px; flex-shrink: 0; }
.topbar .title { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.topbar .mode-tag { margin-left: auto; font-size: 12px; padding: 4px 10px; border-radius: 20px; background: #EEF3F1; color: var(--accent); }
#view { padding: 20px; flex: 1; overflow: auto; min-width: 0; min-height: 0; }

.muted { color: var(--muted); }
.tip, .hint { color: var(--muted); font-size: 12.5px; background: #F4F6F4; border: 1px solid #E4E8E2; padding: 10px 12px; border-radius: 8px; margin-top: 14px; line-height: 1.7; }

/* ===== 仪表盘 ===== */
.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.card .num { font-size: 26px; font-weight: 800; color: var(--accent); }
.card .lbl, .card div:last-child { color: var(--muted); margin-top: 4px; font-size: 12.5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: .5px; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.logs { list-style: none; margin: 0; padding: 0; }
.logs li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; color: #444; }

/* ===== 工具栏 / 表格 ===== */
.toolbar, .toolbar.at { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .search, .inp { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 13px; width: 100%; outline: none; }
.toolbar .search { width: 260px; } .toolbar .search:focus { border-color: var(--accent); }
.toolbar .spacer { flex: 1; } .toolbar .pg { color: var(--muted); font-size: 13px; }
.btn { background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-family: inherit; }
.btn:hover { background: var(--accent-d); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.warn { background: var(--red); } .btn.warn:hover { background: #925045; }
.btn.ghost { background: #F0F1EE; color: #3A3A36; } .btn.ghost:hover { background: #E7E9E3; }
.btn.file { display: inline-block; } .btn.file input { display: none; }
.tablewrap { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 78vh; position: relative; }
.grid { display: inline-table; width: auto; min-width: 100%; table-layout: auto; border-collapse: collapse; font-size: 13px; }
.grid td, .grid th { white-space: nowrap; }
main { min-width: 0; }
/* 表格基础：固定首列（多选框），取消末列 sticky 避免右侧列被截断 */
.grid th:first-child, .grid td:first-child { position: sticky; left: 0; background: var(--panel); z-index: 2; width: 42px; min-width: 42px; }
.grid th, .grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid td:last-child, .grid th:last-child { min-width: 100px; text-align: right; }
.grid thead th { background: #F7F8F6; position: sticky; top: 0; font-weight: 600; color: #44506A; z-index: 1; }
.grid thead th:first-child { z-index: 3; }
.grid tbody tr:hover { background: #F7F9F7; }
.grid tbody tr:hover td:first-child { background: #F7F9F7; }
.grid tbody tr.selected { background: #EEF3F1; }
.grid tbody tr.selected td:first-child { background: #EEF3F1; }

/* 表头排序 / 筛选 */
.sort { cursor: pointer; user-select: none; } .sort:hover { background: #EEF3F1; }
.filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.flt { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #44506A; }
.flt span { font-size: 11.5px; color: var(--muted); }
.flt select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; min-width: 110px; background: #fff; }
#resetFilters { min-width: max-content; white-space: nowrap; flex-shrink: 0; }

/* 批量操作栏 */
.batchbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; padding: 8px 12px; background: #FBF6EF; border: 1px solid #EDE2D2; border-radius: 10px; overflow-x: auto; }
.batchbar .batch-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: max-content; }
.batchbar .pg { color: #8A5A2B; white-space: nowrap; flex-shrink: 0; }
.batchbar .btn, .batchbar .pgctl, .batchbar .jump { white-space: nowrap; flex-shrink: 0; min-width: max-content; height: auto; line-height: 1.5; padding: 6px 12px; }
.batchbar .btn { display: inline-flex; align-items: center; }
.pgctl { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; background: #fff; font-family: inherit; }
.jump { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; width: 56px; font-family: inherit; }

/* 面料选择 / 图片上传 */
.fld-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fld-hd label { margin-bottom: 0 !important; }
.inline-btns { display: inline-flex; gap: 6px; }
.fabric-search-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.fabric-btns { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; align-items: center; }
.fabric-btns .btn { flex: 0 0 auto; white-space: nowrap; min-width: max-content; }
#fabricDisplay { margin-bottom: 6px; }
.imgslot { position: relative; display: inline-block; margin-right: 4px; }
.rmimg { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; line-height: 16px; font-size: 12px; cursor: pointer; padding: 0; }
.thumb { max-width: 60px; max-height: 60px; width: auto; height: auto; object-fit: contain; background: #fff; border-radius: 4px; display: block; }
.noimg { font-size: 12px; color: #aaa; }

.file-alert { background: #FBF6EF; border: 1px solid #EDE2D2; border-radius: 12px; padding: 18px 20px; line-height: 1.8; }
.file-alert code { background: #F0F1EE; padding: 1px 6px; border-radius: 4px; }

/* 模板下载 / 导入导出 */
.io { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.io .panel .btn { margin-right: 8px; margin-bottom: 8px; }
.doc { line-height: 1.9; padding-left: 20px; } .doc code { background: #F0F1EE; padding: 1px 6px; border-radius: 4px; }
.tpl { color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 13px; } .tpl:hover { color: var(--accent-d); }

/* 详情弹窗（只读） */
.detail .fld { margin-bottom: 10px; }
.detail .roval { padding: 8px 10px; background: #F7F8F6; border: 1px solid var(--line); border-radius: 8px; min-height: 34px; font-size: 13px; color: var(--ink); word-break: break-all; }
.detail .roval .med { margin-right: 6px; }
.colors.ro .crow { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.colors.ro .cv { color: #33405A; font-size: 12.5px; } .colors.ro .cv b { color: var(--muted); font-weight: 400; margin-right: 4px; }

/* toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #1A1A1A; color: #fff; padding: 11px 20px; border-radius: 10px; z-index: 80; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.ok { background: var(--green); } .toast.hidden { display: none; }

/* ============================================================
 *  搭配工坊（新增 · 源自 FUJI UNI 中台，适配 UNI 数据）
 * ============================================================ */
.at-main { display: grid; grid-template-columns: 250px 1fr 340px; grid-template-rows: auto 1fr; height: calc(100vh - 98px); gap: 0; }
.at-side { grid-column: 1; grid-row: 2; background: var(--panel); border-right: 1px solid var(--line); padding: 14px 14px 40px; overflow-y: auto; font-size: 13px; height: 100%; }
.at-side .fs { margin-bottom: 14px; border-bottom: 1px solid #F2F2EE; padding-bottom: 12px; }
.at-side .fs:last-child { border: none; }
.at-side h3 { font-size: 12px; font-weight: 600; letter-spacing: 1px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.at-side h3 .clr { font-size: 10px; color: #B0AEBC; font-weight: 400; cursor: pointer; }
.at-side h3 .clr:hover { color: var(--accent); }
.at-srch { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; font: inherit; outline: none; }
.at-srch:focus { border-color: var(--accent); }
.at-side .fs.sticky { position: sticky; bottom: -14px; background: var(--panel); padding: 12px 0; border-top: 1px solid var(--line); margin-bottom: 0; z-index: 2; }
.at-tree .row.active .lbl, .at-tree .row.active > label > span:first-of-type { font-weight: 700; color: var(--accent); }
.at-chk { display: flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; padding: 4px 0; }
.at-chk input { margin: 0; cursor: pointer; accent-color: var(--accent); width: 14px; height: 14px; flex: 0 0 14px; }
.at-chk span { flex: 1; }
.at-chk .n { margin-left: auto; font-size: 10px; color: #B0AEBC; flex: 0 0 auto; }
.at-tree { list-style: none; margin: 0; padding: 0; } .at-tree li { padding: 1px 0; }
.at-tree .row { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.at-tree .row.parent { cursor: pointer; }
.at-tree .row.parent .lbl { font-weight: 600; flex: 1; }
/* active 必须覆盖 parent 的默认 600，父级祖先被选中子级后仍加粗 */
.at-tree .row.active .lbl,
.at-tree .row.active > label > span:first-of-type { font-weight: 700; color: var(--accent); }
.at-tree .row input[type=checkbox] { margin: 0; accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.at-tree .row .n { font-size: 10px; color: #B0AEBC; }
.at-tree .tog { width: 14px; text-align: center; color: #9A97A8; cursor: pointer; font-size: 10px; user-select: none; flex: 0 0 14px; }
.at-tree .kids { list-style: none; padding-left: 18px; display: none; }
.at-tree li.open > .kids { display: block; }
.at-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.at-chip { font-size: 11px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; background: #fff; user-select: none; display: flex; align-items: center; gap: 6px; color: #444; }
.at-chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.at-chip .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.at-chip .n { font-size: 9px; color: #B0AEBC; }
.at-chip.on .n { color: rgba(255,255,255,.8); }
/* 颜色筛选：色系分组 + 二级具体色展开 */
.at-colorgroups { display: flex; flex-direction: column; gap: 4px; max-height: 250px; overflow-y: auto; padding-right: 4px; }
.cgrp-head { width: 100%; justify-content: flex-start; }
.cgrp-head .tog { width: 12px; text-align: center; color: #9A97A8; font-size: 9px; user-select: none; flex: 0 0 12px; }
.cgrp-kids { display: none; flex-wrap: wrap; gap: 5px; padding: 6px 0 2px 18px; }
.cgrp.open > .cgrp-kids { display: flex; }
.at-subchip { font-size: 10px; padding: 3px 8px; background: #fff; }
.at-subchip .cdot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex: 0 0 10px; }
/* 颜色三级分类（物料大类 → 色相 → 具体色）视觉层级 */
.cgrp.mat > .cgrp-head { font-weight: 600; font-size: 11.5px; }
.cgrp.hue > .cgrp-head { font-weight: 500; background: #fafafa; }
.cgrp.hue > .cgrp-head .dot { width: 10px; height: 10px; }
.at-colorgroups .cgrp.mat + .cgrp.mat { margin-top: 3px; }
.at-zone-req { font-size: 10px; color: #B07F3A; background: #FBF3E6; border: 1px solid #F0DDBE; border-radius: 6px; padding: 5px 10px; margin: 6px 0 8px; }
.at-reset { width: 100%; background: #F0F1EE; color: #3A3A36; border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; font-size: 12px; }
.at-reset:hover { background: #E7E9E3; }

.at-grid-wrap { grid-column: 2; grid-row: 2; padding: 0 18px 40px; overflow-y: auto; height: 100%; min-height: 0; background: var(--bg); }
.at-content-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; flex-wrap: wrap; gap: 8px; }
.at-content-head h2 { font-size: 14px; font-weight: 600; letter-spacing: 1px; }
.at-content-head .stat { font-size: 11px; color: var(--muted); }
.at-sticky-head { display: none; }
.at-sentinel { height: 1px; }
.at-selbar { display: none; grid-column: 2; grid-row: 1; position: sticky; top: 0; z-index: 6; background: var(--bg); border-bottom: 1px solid #C9DED8; padding: 8px 18px; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.at-selbar.on { display: flex; animation: atSelIn .2s ease; }
@keyframes atSelIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.at-selbar b { color: var(--accent); }
.at-selbar .btn-mini { background: var(--accent); color: #fff; border: none; border-radius: 5px; padding: 5px 10px; font-size: 11px; cursor: pointer; font-family: inherit; }
.at-selbar .btn-mini.ghost { background: #fff; color: var(--muted); border: 1px solid #CCC; }
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 13px; grid-auto-rows: 1fr; }
.at-card { background: #fff; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; cursor: grab; transition: .15s; position: relative; display: flex; flex-direction: column; height: 100%; max-height: 360px; }
.at-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(47,93,84,.08); }
.at-card.dragging { opacity: .4; } .at-card.sel { border: 1.5px solid var(--accent); }
.at-card .img { background: #fff; aspect-ratio: 3/4; position: relative; overflow: hidden; flex: 0 0 auto; }
.at-card .img img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.at-card .chkbox { position: absolute; bottom: 6px; left: 6px; width: 20px; height: 20px; z-index: 3; accent-color: var(--accent); cursor: pointer; }
.at-card .badges { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.at-card .badge { font-size: 9px; padding: 2px 6px; border-radius: 3px; color: #fff; letter-spacing: .5px; }
.badge.new { background: var(--green); } .badge.alt { background: #8C8C84; } .badge.sub { background: #C27C3A; }
.at-card .cimg-n { position: absolute; bottom: 6px; right: 6px; background: rgba(26,26,26,.72); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.at-card .meta { padding: 8px 10px 10px; overflow-y: auto; min-height: 0; }
.at-card .sku { font-size: 9px; color: var(--muted); font-family: ui-monospace, monospace; margin-bottom: 3px; }
.at-card .name { font-size: 12px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.at-card .price { font-size: 12px; color: var(--accent); font-weight: 600; } .at-card .price small { color: #aaa; font-weight: 400; font-size: 10px; }
.at-card .price.wholesale { color: #8C8C84; font-weight: 500; margin-top: 1px; }
.at-card .cat { font-size: 9px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.at-empty { padding: 60px; text-align: center; color: var(--muted); }

.at-right { grid-column: 3; grid-row: 2; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 13px 20px; overflow-y: auto; height: 100%; }
.at-right h3 { font-size: 13px; font-weight: 600; margin-bottom: 3px; letter-spacing: 1px; }
.at-right .hint { margin-top: 0; margin-bottom: 12px; }
.at-dropzone { background: #FAFAF8; border: 1.5px dashed var(--line); border-radius: 9px; padding: 11px 13px; margin-bottom: 12px; transition: .15s; }
.at-dropzone.hover { background: rgba(47,93,84,.06); border-color: var(--accent); border-style: solid; }
.at-dropzone.look { border-color: var(--accent); } .at-dropzone.item { border-color: #8C8C84; } .at-dropzone.catalog { border-color: var(--accent); background: rgba(47,93,84,.03); border-style: solid; }
.at-zone-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.at-zone-title { font-size: 12px; font-weight: 600; } .at-zone-count { font-size: 10px; color: var(--muted); }
.at-zone-empty { font-size: 10px; color: #BBB; padding: 12px 0; text-align: center; letter-spacing: .5px; }
.at-zone-items { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.at-zone-item { display: flex; gap: 7px; padding: 5px; background: #fff; border: 1px solid #EEE; border-radius: 5px; font-size: 10px; align-items: center; }
.at-zone-item .mini-img { width: 28px; height: 35px; background: #fff; border-radius: 3px; flex-shrink: 0; overflow: hidden; }
.at-zone-item .mini-img img { width: 100%; height: 100%; object-fit: cover; }
.at-zone-item .mini-name { flex: 1; min-width: 0; line-height: 1.25; } .at-zone-item .mini-name b { font-weight: 600; }
.at-zone-item .mini-color { font-size: 9px; color: #8C8C84; }
.at-zone-item .mini-sub { font-size: 9px; color: var(--accent); background: #EEF3F1; padding: 1px 5px; border-radius: 4px; display: inline-block; margin-top: 1px; }
.at-sku-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.at-sku-chip { cursor: pointer; border: 1px solid #EEE; border-radius: 8px; padding: 6px 8px; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 58px; background: #fff; transition: border-color .15s, background .15s; }
.at-sku-chip .dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #EEE; }
.at-sku-chip .cname { font-weight: 600; }
.at-sku-chip small { color: #8C8C84; font-size: 9px; word-break: break-all; text-align: center; }
.at-sku-chip.on { border-color: var(--accent); background: #EAF0EE; }
.at-sku-chip:hover { border-color: var(--accent); }
.at-dt-actions { display: flex; gap: 8px; margin-top: 16px; }
.at-dt-actions .btn { flex: 1; padding: 9px 0; font-size: 12px; cursor: pointer; border-radius: 6px; background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.at-dt-actions .btn:hover { background: #264E47; }
.at-zone-item .rm { color: #CCC; cursor: pointer; padding: 0 4px; font-size: 14px; } .at-zone-item .rm:hover { color: var(--red); }
.at-zone-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.at-btn-generate { flex: 1; background: var(--accent); color: #fff; border: none; padding: 8px 0; font-size: 11px; cursor: pointer; border-radius: 5px; font-weight: 600; letter-spacing: 1px; font-family: inherit; }
.at-btn-generate:disabled { background: #CCC; cursor: not-allowed; }
.at-btn-clear { background: #fff; color: var(--muted); border: 1px solid var(--line); padding: 8px 11px; font-size: 11px; cursor: pointer; border-radius: 5px; font-family: inherit; }
.at-layers { display: flex; flex-direction: column; gap: 8px; }
.at-layer { background: #fff; border: 1px solid #ECECE6; border-radius: 7px; padding: 8px; }
.at-layer-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.at-layer-title { font-size: 11px; font-weight: 600; }
.at-layer-sub { font-size: 9px; color: var(--muted); background: #F4F6F4; padding: 1px 5px; border-radius: 99px; }
.at-layer .at-zone-empty { padding: 6px 0; }

/* 预览浮层（iframe） */
.at-ov { position: fixed; inset: 0; background: rgba(20,22,24,.55); z-index: 120; display: none; align-items: center; justify-content: center; padding: 24px; }
.at-ov.on { display: flex; }
.at-pv-box { background: #fff; border-radius: 12px; width: 100%; max-width: 960px; height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.at-pv-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.at-pv-head .t { font-size: 14px; font-weight: 600; } .at-pv-head .r { display: flex; gap: 8px; }
.at-ov iframe { flex: 1; border: none; width: 100%; background: #fff; }

/* 详情图廊弹窗 */
.at-dt-ov { position: fixed; inset: 0; background: rgba(20,22,24,.55); z-index: 120; display: none; align-items: center; justify-content: center; padding: 24px; }
.at-dt-ov.on { display: flex; }
.at-dt-box { background: #fff; border-radius: 16px; max-width: 1000px; width: 100%; height: 90vh; overflow: hidden; display: grid; grid-template-columns: 1.05fr 1fr; grid-template-rows: 1fr; position: relative; }
.at-gal { background: #F2EEE7; padding: 18px; display: flex; flex-direction: column; gap: 11px; }
.at-gal-main { position: relative; aspect-ratio: 3/4; background: #fff; border-radius: 10px; overflow: hidden; }
.at-gal-main img { width: 100%; height: 100%; object-fit: contain; }
.at-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.9); border: 1px solid var(--line); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.at-nav.prev { left: 9px; } .at-nav.next { right: 9px; }
.at-thumbs { display: flex; gap: 7px; overflow-x: auto; }
.at-thumbs img { width: 52px; height: 66px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; flex: 0 0 auto; background: #fff; }
.at-thumbs img.sel { border-color: var(--accent); }
.at-info { padding: 22px 24px; overflow-y: auto; } .at-info h2 { font-size: 20px; font-weight: 600; margin-bottom: 3px; }
.at-info .mono { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.at-info .price-big { font-size: 21px; font-weight: 600; color: var(--accent); margin-top: 6px; }
.at-info .price-big.wholesale { font-size: 18px; color: #8C8C84; margin-top: 2px; }
.at-info .sec-t { font-size: 11px; color: #9A97A8; letter-spacing: 2px; margin: 15px 0 6px; }
.at-info .kv { display: grid; grid-template-columns: 72px 1fr; gap: 6px 12px; font-size: 13px; } .at-info .kv .k { color: #9A97A8; }
.at-info .sw { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 11px; cursor: default; font-size: 12px; display: inline-block; margin: 3px 4px 0 0; }
.at-dt-close { position: absolute; top: 14px; right: 18px; font-size: 26px; color: #1A1A1A; cursor: pointer; z-index: 10; line-height: 1; }
.at-dt-close:hover { color: var(--accent); }

.at-toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-20px); background: #1A1A1A; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 200; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.at-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1080px) { .at-main { grid-template-columns: 220px 1fr 300px; grid-template-rows: auto 1fr; } }
@media (max-width: 820px) { .at-dt-box { grid-template-columns: 1fr; } .at-main { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; } .at-selbar, .at-side, .at-grid-wrap, .at-right { grid-column: 1; } .at-selbar { grid-row: 1; } .at-side { grid-row: 2; } .at-grid-wrap { grid-row: 3; } .at-right { grid-row: 4; } }
.at-card .main { font-size: 9px; color: var(--muted); font-family: ui-monospace, monospace; margin-bottom: 3px; }
.at-card .colors { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.at-card .at-cdot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex: 0 0 12px; }
.at-card .at-cdot.more { background: #F2F2EE; color: #8C8C84; font-size: 8px; display: flex; align-items: center; justify-content: center; width: auto; padding: 0 4px; border-radius: 99px; }
.at-card .count { font-size: 9px; color: #8C8C84; margin-top: 5px; }

/* ===== 设置页：数据治理面板 ===== */
.settings-wrap { display: grid; gap: 14px; max-width: 980px; }
.settings-wrap .panel p { line-height: 1.7; }
.settings-wrap .panel label { display: inline-block; margin: 5px 0; }
.stat-row { display: flex; gap: 12px; margin: 12px 0; }
.stat-card { background: #F7F8F6; border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; min-width: 120px; text-align: center; }
.stat-card b { display: block; font-size: 22px; color: var(--accent); }
.stat-card span { font-size: 12px; color: var(--muted); }
.log-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.log-list li { padding: 7px 10px; border-bottom: 1px dashed var(--line); font-size: 12.5px; display: flex; gap: 10px; color: #444; }
.log-list li:last-child { border-bottom: none; }
.log-list .t { color: var(--muted); white-space: nowrap; }
.log-list .act { background: #EEF3F1; color: var(--accent); border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.log-list .id { flex: 1; word-break: break-all; }

/* ===== 全局滚动条强制可见 ===== */
html, body, #app, main, #view, .tablewrap, .at-side, .at-grid-wrap, .at-right, .modalbd, .at-colorgroups, .log-list { scrollbar-width: auto; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #F2F2EE; border-radius: 6px; }
*::-webkit-scrollbar-thumb { background: #C9C9C2; border-radius: 6px; border: 2px solid #F2F2EE; }
*::-webkit-scrollbar-thumb:hover { background: #A8A8A0; }
*::-webkit-scrollbar-corner { background: #F2F2EE; }
