:root {
  --bg: #f4f5f7;
  --card: #fff;
  --ink: #1d2733;
  --muted: #6b7684;
  --line: #e3e6eb;
  --navy: #232f3e;
  --orange: #ff9900;
  --orange-d: #e88a00;
  --ok: #138a55;
  --err: #c9302c;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 16px; }
a { color: #0a6ebd; }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.hint { margin: 6px 0 10px; color: var(--muted); font-size: 12px; }
.hint.warn { color: #b45f00; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 24px; background: var(--navy); color: #fff; }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand h1 { font-size: 17px; }
.brand p { margin: 0; font-size: 12px; opacity: .7; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--orange); color: var(--navy); font-weight: 800; font-size: 19px; display: grid; place-items: center; }
.topnav { display: flex; gap: 6px; align-items: center; }
.topnav a { color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 8px; opacity: .85; }
.topnav a:hover { background: rgba(255,255,255,.1); opacity: 1; }
.topnav a.on { background: rgba(255,255,255,.16); opacity: 1; }
.pill { padding: 3px 10px !important; border-radius: 99px !important; font-size: 12px; background: rgba(255,255,255,.12); color: #fff; }
.pill.on { background: var(--ok); }
.pill.demo { background: var(--orange); color: var(--navy); }

/* 步骤条 */
.stepbar { display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 54px; z-index: 15; flex-wrap: wrap; }
.proj-name { font-weight: 700; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.steps a { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; text-decoration: none; color: var(--muted); }
.steps a:hover { background: #f1f3f6; }
.steps span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #e7eaee; color: #56606b; }
.steps li.done span { background: #d6f0e2; color: var(--ok); }
.steps li.on a { background: var(--navy); color: #fff; }
.steps li.on span { background: var(--orange); color: var(--navy); }

.page { max-width: 1280px; margin: 0 auto; padding: 20px 24px 60px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 760px) {
  .page { padding: 16px; }
  .topbar, .stepbar { padding: 10px 16px; }
  .brand p { display: none; }
  .stepbar { position: static; }
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.narrow { max-width: 760px; width: 100%; margin: 0 auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.section-title { font-size: 17px; margin-top: 6px; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.pager .disabled { opacity: .45; }

/* 表单 */
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #3c4652; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid #d3d8df; border-radius: 8px; padding: 7px 10px; background: #fff; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255,153,0,.35); border-color: var(--orange); }
label.check { flex-direction: row; align-items: center; gap: 8px; }
label.check input { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.grid2 .span2 { grid-column: span 2; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } .grid2 .span2 { grid-column: auto; } }
.form-col { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.inline-form { display: flex; gap: 10px; margin-top: 8px; }
@media (max-width: 520px) { .inline-form { flex-direction: column; } }

/* 按钮 */
.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid #cfd5dc; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--navy); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--navy); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--orange-d); }
.btn.accent { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--err); border-color: #efc4c2; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* 项目列表 */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.proj { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.proj-cover { display: grid; place-items: center; aspect-ratio: 4 / 3; background: #f7f8fa; color: var(--muted); text-decoration: none; }
.proj-cover img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.proj-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted); background: var(--card); border: 1px dashed #cdd3db; border-radius: var(--radius); }
.empty-ico { font-size: 40px; }

/* 上传 */
.up-title { display: flex; gap: 8px; align-items: center; }
.up-title .count { margin-left: auto; color: var(--muted); }
.req, .opt { font-size: 11px; padding: 1px 7px; border-radius: 4px; font-weight: 500; }
.req { background: #fff1e0; color: #b45f00; }
.opt { background: #eef1f4; color: var(--muted); }
.drop { display: grid; place-items: center; height: 110px; border: 2px dashed #cdd3db; border-radius: 10px; color: var(--muted); cursor: pointer; transition: .15s; background: #fafbfc; }
.drop:hover, .drop.over { border-color: var(--orange); color: var(--orange-d); background: #fff8ee; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 12px; padding: 0; }
.thumb .idx { position: absolute; left: 4px; top: 4px; font-size: 11px; background: rgba(35,47,62,.8); color: #fff; padding: 0 6px; border-radius: 4px; }
.thumb .mv { position: absolute; left: 4px; bottom: 4px; border: 0; font-size: 11px; border-radius: 4px; background: rgba(255,255,255,.92); cursor: pointer; padding: 1px 6px; }
.thumb select { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; border: 0; border-radius: 0; background: rgba(255,255,255,.94); padding: 3px; }

/* 方案 */
.plan-grid { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.plan-row { display: grid; grid-template-columns: 56px 72px 1fr; gap: 10px; align-items: center; }
.plan-row span { font-weight: 600; }
.plan-row small { color: var(--muted); }
.task-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
@media (max-width: 420px) { .task-list { grid-template-columns: 1fr; } }
.trow { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.trow:target { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,153,0,.2); }
.trow-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.trow-b { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.trow-b input, .trow-b textarea { font-size: 12px; padding: 6px 8px; }
.trow-b details summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.trow-b details textarea { margin: 6px 0; font: 11px/1.45 ui-monospace, Menlo, monospace; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #eef1f4; color: #47515d; }
.tag.main { background: #fff1e0; color: #a35600; }
.tag.aplus { background: #e7f0ff; color: #2a5bb5; }
.tag.detail { background: #f0ebff; color: #5b3fb5; }
.tag.ok { background: #d6f0e2; color: var(--ok); }
.code { margin-left: auto; font: 12px ui-monospace, Menlo, monospace; color: var(--muted); }

/* 生成 */
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.results-bar .btn-row { margin-top: 0; }
.progress { height: 6px; background: #e4e7ec; border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--orange); transition: width .3s; }
.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.task { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.task-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.task-img { position: relative; background: repeating-conic-gradient(#f3f4f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; min-height: 180px; cursor: zoom-in; }
.task-img img { width: 100%; display: block; }
.task-img .ph { color: var(--muted); font-size: 13px; padding: 30px; text-align: center; cursor: default; }
.task-img .spin { width: 28px; height: 28px; border: 3px solid #e2e5ea; border-top-color: var(--orange); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.task-img .err { color: var(--err); font-size: 12px; padding: 16px; word-break: break-all; cursor: default; }
.task-copy { padding: 6px 12px 0; font-size: 12px; color: var(--muted); min-height: 6px; }
.check-badge { position: absolute; left: 8px; bottom: 8px; font-size: 11px; padding: 2px 8px; border-radius: 99px; color: #fff; background: var(--ok); }
.check-badge.warn { background: var(--err); }
.task-f { display: flex; gap: 6px; padding: 10px 12px 12px; flex-wrap: wrap; align-items: center; }
.mini { font-size: 12px; color: var(--muted); }
.err-text { color: var(--err); }
.task.running { border-color: var(--orange); }
.task.done { border-color: #bfe3cf; }
.task.error { border-color: #f0c2c0; }

/* 导出 */
.checklist { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.checklist li { padding: 8px 12px; border-radius: 8px; font-size: 13px; background: #f4f6f8; }
.checklist li.ok { background: #e9f7ef; color: #0f6b42; }
.checklist li.warn { background: #fff4e5; color: #8a4b00; }
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ex { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; gap: 0; }
.ex input { position: absolute; top: 10px; left: 10px; width: 18px; height: 18px; z-index: 1; }
.ex img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-bottom: 1px solid var(--line); }
.ex-b { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 13px; }
.ex-b .code { margin: 0; word-break: break-all; }

/* 弹窗 */
dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,26,34,.6); }
#viewer { max-width: min(1100px, 96vw); background: #111; }
.viewer { position: relative; padding: 14px; }
.viewer img { max-width: 100%; max-height: 78vh; display: block; margin: 0 auto; }
.viewer .close { position: absolute; right: 10px; top: 10px; z-index: 2; border: 0; background: rgba(255,255,255,.15); color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.viewer-versions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.viewer-versions img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .6; border: 2px solid transparent; }
.viewer-versions img.on { opacity: 1; border-color: var(--orange); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90vw; }
.toast.err { background: var(--err); }

/* 设置页：固定模型说明 */
.model-box { background: #f6f8fa; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.model-box ul { margin: 6px 0 8px; padding-left: 18px; }
.model-box code { font: 12px ui-monospace, Menlo, monospace; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }

/* ================= AI 画布 ================= */
body.canvas-mode { overflow: hidden; }
body.canvas-mode .stepbar { position: relative; top: 0; }
.cv-root { position: fixed; left: 0; right: 0; bottom: 0; top: 108px; overflow: hidden; }
.cv-stage { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none;
  background-color: #eceef2; background-image: radial-gradient(#c9ced6 1px, transparent 1px); }
.cv-stage.panning { cursor: grabbing; }
.cv-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }

.cv-frame { position: absolute; border-radius: 18px; background: rgba(255,255,255,.55); border: 1px solid rgba(35,47,62,.08); pointer-events: none; }
.cv-frame.main { background: rgba(255,153,0,.07); }
.cv-frame.aplus { background: rgba(42,91,181,.06); }
.cv-frame-title { position: absolute; left: 18px; top: 10px; font-weight: 700; font-size: 15px; color: #2b3540; }
.cv-frame-title span { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 6px; }

.cv-materials { position: absolute; left: 0; top: -30px; background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); box-sizing: content-box; margin-left: -14px; }
.cv-mat-title { font-weight: 700; font-size: 13px; margin: 2px 0 8px; }
.cv-mat-title ~ .cv-mat-title { margin-top: 14px; }
.cv-mat-grid { display: grid; grid-template-columns: repeat(2, 128px); gap: 12px; }
.cv-mat { position: relative; width: 128px; height: 128px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; background: #fff; }
.cv-mat img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cv-mat span { position: absolute; left: 5px; top: 5px; font-size: 11px; background: rgba(35,47,62,.8); color: #fff; padding: 0 6px; border-radius: 4px; }
.cv-mat-edit { display: block; margin-top: 12px; font-size: 12px; text-align: center; color: var(--muted); text-decoration: none; }
.cv-mat-edit:hover { color: var(--orange-d); }

.cv-node { position: absolute; cursor: default; }
.cv-label { position: absolute; left: 0; right: 0; bottom: 100%; padding-bottom: 6px; display: flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; overflow: hidden; }
.cv-label b { overflow: hidden; text-overflow: ellipsis; }
.cv-img { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); transition: box-shadow .15s; }
.cv-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cv-img img.dim { opacity: .35; }
.cv-node:hover .cv-img { box-shadow: 0 0 0 2px rgba(255,153,0,.45), 0 4px 14px rgba(0,0,0,.12); }
.cv-node.sel .cv-img { box-shadow: 0 0 0 3px var(--orange), 0 6px 20px rgba(0,0,0,.16); }
.cv-node[data-status="running"] .cv-img { box-shadow: 0 0 0 3px rgba(255,153,0,.6); animation: cvPulse 1.4s ease-in-out infinite; }
@keyframes cvPulse { 50% { box-shadow: 0 0 0 6px rgba(255,153,0,.25); } }
.cv-node[data-status="error"] .cv-img { box-shadow: 0 0 0 2px #f0c2c0; }
.cv-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--muted); font-size: 14px;
  background: repeating-linear-gradient(45deg, #fafbfc 0 12px, #f3f5f8 12px 24px); }
.cv-ph small { font-size: 12px; margin-top: 4px; }
.cv-ph.err { color: var(--err); background: #fff6f5; }
.cv-ph .spin { width: 28px; height: 28px; border: 3px solid #e2e5ea; border-top-color: var(--orange); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 8px; }
.cv-ver { position: absolute; right: 8px; top: 8px; font-size: 11px; background: rgba(35,47,62,.75); color: #fff; padding: 1px 7px; border-radius: 99px; }
.cv-err-dot { position: absolute; right: 8px; bottom: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--err); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; }

.cv-toolbar { position: absolute; left: 16px; top: 14px; display: flex; gap: 6px; align-items: center; background: #fff; padding: 6px; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.1); flex-wrap: wrap; max-width: calc(100% - 32px); z-index: 3; }
.cv-zoom { min-width: 58px; }
.cv-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }
.cv-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(0,0,0,.05); z-index: 4; }
.cv-progress div { height: 100%; width: 0; background: var(--orange); transition: width .3s; }
.cv-float { position: absolute; transform: translate(-50%, -100%); display: flex; gap: 4px; background: #fff; padding: 4px; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.15); z-index: 3; white-space: nowrap; }
.cv-hint { position: absolute; left: 16px; bottom: 12px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.8); padding: 4px 10px; border-radius: 8px; pointer-events: none; }

.cv-panel { position: absolute; right: 14px; top: 14px; bottom: 14px; width: 340px; background: #fff; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; z-index: 3; }
.cv-panel-h { display: flex; align-items: center; gap: 8px; }
.cv-panel-h b { flex: 1; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-panel-h .code { margin-left: 0; }
.cv-panel label { font-size: 12px; }
.cv-panel input, .cv-panel textarea { font-size: 13px; padding: 6px 8px; }
.cv-panel details summary { cursor: pointer; font-size: 12px; color: var(--muted); margin: 4px 0; }
.cv-panel details textarea { font: 11px/1.45 ui-monospace, Menlo, monospace; margin-bottom: 6px; }
.cv-field-group { display: flex; flex-direction: column; gap: 8px; }
.cv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cv-stats div { background: #f5f7f9; border-radius: 10px; padding: 10px; text-align: center; }
.cv-stats b { display: block; font-size: 22px; }
.cv-stats span { font-size: 12px; color: var(--muted); }
.btn-col { display: flex; flex-direction: column; gap: 8px; }
.cv-tips { background: #f7f8fa; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #4b5560; margin-top: auto; }
.cv-tips ul { margin: 6px 0 0; padding-left: 16px; }
.cv-sel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.cv-sel-list li { display: flex; gap: 6px; align-items: center; }
.cv-error { background: #fff3f2; color: var(--err); border-radius: 8px; padding: 8px 10px; font-size: 12px; word-break: break-all; }
.cv-check { border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.cv-check.ok { background: #e9f7ef; color: #0f6b42; }
.cv-check.warn { background: #fff4e5; color: #8a4b00; }
.cv-versions-title { font-size: 12px; color: var(--muted); }
.cv-versions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cv-versions img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; opacity: .7; }
.cv-versions img.on { border-color: var(--orange); opacity: 1; }

@media (max-width: 900px) {
  .cv-panel { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: 42%; }
  .cv-hint { display: none; }
  .cv-toolbar { left: 10px; top: 10px; }
}
.cv-root.panel-off .cv-panel { display: none; }
.cv-float.below { transform: translate(-50%, 0); }
.cv-elapsed { font-weight: 600; color: var(--orange-d); margin-left: 4px; }
.cv-main-alt { background: #f5f7f9; border-radius: 8px; padding: 8px 10px; font-size: 12px; color: #4b5560; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* 出图方案：勾选图片类型 */
.pick-group + .pick-group { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.pick-h { display: flex; align-items: center; gap: 10px; }
.pick-h b { font-size: 15px; }
.pick-h .muted { margin-right: auto; }
.link-btn { border: 0; background: none; color: #0a6ebd; cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.pick { flex-direction: row; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; transition: .12s; }
.pick:hover { border-color: #c7ccd3; }
.pick.on { border-color: var(--orange); background: #fff8ee; }
.pick input { width: auto; margin-top: 3px; accent-color: var(--orange-d); }
.pick span { display: flex; flex-direction: column; gap: 2px; }
.pick b { font-size: 13px; color: var(--ink); }
.pick small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.pick .rec { font-style: normal; font-size: 11px; color: #a35600; background: #fff1e0; border-radius: 4px; padding: 0 5px; }
.pick-total { font-size: 14px; }
.pick-total b { font-size: 18px; color: var(--orange-d); }
#picker { margin-top: 14px; }

/* 产品信息：颜色识别 */
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 6px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: #f5f7f9; border-radius: 99px; padding: 3px 10px 3px 4px; color: #3c4652; }
.swatch i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); display: inline-block; }

/* 多人版：顶栏账号、排队状态、项目卡片 */
.topnav .me { opacity: .9; }
.linkish { background: none; border: 0; color: #fff; opacity: .75; cursor: pointer; font: inherit; padding: 6px 8px; }
.linkish:hover { opacity: 1; }
.pill.warn { background: #c9302c; color: #fff; text-decoration: none; }
.proj-name small { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 12px; }
.spin.slow { animation-duration: 2.4s; opacity: .6; }
.proj-cover { position: relative; }
.proj-busy { position: absolute; left: 8px; top: 8px; font-style: normal; font-size: 12px; background: var(--orange); color: var(--navy); border-radius: 99px; padding: 2px 8px; }
.list-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; }
.filters select { width: auto; }
.inline-form select { width: auto; min-width: 140px; }
.warn-box { background: #fff4e5; color: #8a4b00; border-radius: 8px; padding: 10px 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 500; background: #fafbfc; }
table.data input, table.data select { padding: 5px 8px; font-size: 13px; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #eef1f4; color: #47515d; }
.badge.admin { background: #fff1e0; color: #a35600; }
.badge.off { background: #f5e1e0; color: var(--err); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; }
.brand-login { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.brand-login h2 { font-size: 18px; }
.brand-login p { margin: 2px 0 0; }
.table-wrap { overflow-x: auto; }
.err-text { color: var(--err); }
.topnav a, .topnav .linkish { white-space: nowrap; }
@media (max-width: 1100px) {
  .brand p { display: none; }
  .topnav { gap: 2px; }
  .topnav a { padding: 6px 8px; font-size: 13px; }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .topnav { overflow-x: auto; max-width: 100%; }
}
.auth-cell { min-width: 140px; }
.auth-cell .badge { margin: 1px 0; display: inline-block; }
.auth-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
/* 表格在窄屏横向滚动，不把输入框挤没 */
table.data th { white-space: nowrap; }
table.data input, table.data select { min-width: 110px; }
table.data td .check input { min-width: 0; }
.topnav .pill { white-space: nowrap; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-row select { width: auto; min-width: 110px; }
tr.readonly input, tr.readonly select { pointer-events: none; background: #f5f7f9; color: var(--muted); }
.inline-form { flex-wrap: wrap; }
.inline-form input { flex: 1 1 180px; }

/* ================= 弹窗 ================= */
dialog { width: calc(100% - 32px); max-width: 560px; }
dialog.dlg-sm { max-width: 520px; }
.dlg { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { font-size: 18px; }
.dlg .hint { margin: 0; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg-kicker { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.dlg-x { border: 0; background: #f2f4f7; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 13px; flex: none; }
.dlg-x:hover { background: #e6e9ee; color: var(--ink); }
.dlg-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 14px; }
.dlg-foot .muted { margin-right: auto; font-size: 12px; }

/* 授权弹窗 */
.role-legend { display: flex; flex-direction: column; gap: 6px; background: #f7f8fa; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #4b5560; }
.role-legend > div { display: flex; align-items: center; gap: 8px; }
.role-chip { display: inline-block; min-width: 46px; text-align: center; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.role-chip.manager { background: #fff1e0; color: #a35600; }
.role-chip.member { background: #e7f0ff; color: #2a5bb5; }
.auth-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; margin: 0 -6px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; }
.user-row:hover { background: #fafbfc; }
.user-row.off { opacity: .5; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 600; flex: none; }
.user-name { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.user-name b { font-size: 14px; }
.user-name small { color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; background: #f0f2f5; border-radius: 9px; padding: 3px; flex: none; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 11px; border-radius: 7px; font-size: 12px; color: #5b6570; white-space: nowrap; transition: .12s; }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg label.manager input:checked + span { background: #fff1e0; color: #a35600; }
.seg label.member input:checked + span { background: #e7f0ff; color: #2a5bb5; }
.seg input:focus-visible + span { outline: 2px solid rgba(255,153,0,.5); }
@media (max-width: 480px) {
  .user-row { flex-wrap: wrap; }
  .seg { width: 100%; justify-content: space-between; }
  .seg label { flex: 1; text-align: center; }
}
dialog { overflow-x: hidden; }
.auth-list { margin: 0; }
.user-row { padding: 8px 0; }
.seg label { position: relative; }
.seg input { left: 0; top: 0; width: 1px; height: 1px; margin: 0; }
