:root {
  --bg: #efece6;
  --card: #ffffff;
  --line: #e6e3dd;
  --text: #23201c;
  --muted: #8b857c;
  --accent: #8a5a2b;
  --accent-soft: #f3ece3;
  --warn: #c47a12;
  --danger: #c0392b;
  --ok: #2e7d5b;
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

button, input, select, textarea { font-family: inherit; font-size: 15px; }
button { cursor: pointer; }
a { color: var(--accent); }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #efe6d9 0%, var(--bg) 60%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; padding: 30px 26px 26px;
  box-shadow: 0 12px 40px rgba(60, 45, 30, .08);
}
.login-card h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: .5px; }
.login-logo { height: 46px; width: auto; display: block; margin: 0 auto 14px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #5d5548; font-weight: 600; margin-bottom: 6px; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field label .opt { font-weight: 400; color: #a29a8c; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #d2cabb;
  border-radius: 10px; background: #fff; outline: none; transition: .15s;
  box-shadow: inset 0 1px 2px rgba(90, 70, 40, .05);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b7a98f; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(138, 90, 43, .14);
}
.hintline { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); transition: .15s; white-space: nowrap;
}
.btn:hover { background: #faf8f5; }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #7a4d22; }
.btn-danger { background: #fff; border-color: #e3bcb7; color: var(--danger); }
.btn-danger:hover { background: #fdf2f0; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #256a4c; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 600; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; }
.topbar .brand img { height: 20px; width: auto; display: block; }
.topbar .spacer { flex: 1; }
.userchip {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--muted); background: var(--accent-soft);
  padding: 5px 10px; border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.userchip b { color: var(--text); font-weight: 600; }

.nav {
  display: flex; gap: 4px; padding: 10px 20px 0; overflow-x: auto;
  border-bottom: 1px solid var(--line); background: #fff;
  position: sticky; top: 53px; z-index: 30;
}
.nav button {
  border: none; background: none; padding: 10px 14px; color: var(--muted);
  border-bottom: 2px solid transparent; font-size: 14px; white-space: nowrap;
}
.nav button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.nav .badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px;
  background: var(--danger); color: #fff; border-radius: 9px; font-size: 11px; line-height: 18px;
}

.page { max-width: 1180px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 17px; margin: 0; }
.page-head .hint { color: var(--muted); font-size: 13px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 录单表单分区 ---------- */
.form-sec { border-top: 1px dashed #d9d0bf; padding-top: 18px; margin-top: 16px; }
.form-sec:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.form-sec-title {
  display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
  font-size: 14.5px; font-weight: 700; color: var(--text);
}
.form-sec-title .no {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 12px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; flex: none;
}
.form-sec-title .sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.file-zone {
  border: 1.5px dashed #c3b393; border-radius: 10px; padding: 6px;
  background: #fdfbf6; text-align: center;
}
.file-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-zone input[type=file] {
  border: none; background: none; box-shadow: none; padding: 8px; width: 100%;
}

.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat.warn .v { color: var(--warn); }
.stat.danger .v { color: var(--danger); }
.stat.ok .v { color: var(--ok); }
.stat.accent .v { color: var(--accent); }
.stat .v small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }

/* ---------- 概览日期筛选 ---------- */
.dash-filter { margin-bottom: 16px; }
.dash-filter .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 6px 15px; font-size: 13.5px; transition: .15s;
}
.chip:hover { border-color: #d6cfc4; color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.dash-custom { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.dash-custom input[type=date] {
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px;
  background: var(--card); color: var(--text); font-size: 13.5px;
}
.dash-custom input[type=date]:focus { outline: none; border-color: var(--accent); }
.dash-custom .to { color: var(--muted); font-size: 13px; }

/* 订单列表：日期筛选 + 条数汇总 */
.pool-datebar { margin-bottom: 12px; }
.pool-sum {
  font-size: 13.5px; color: var(--muted); margin: 2px 2px 12px;
}
.pool-sum b { color: var(--text); font-size: 15px; }
.pool-sum .dot { color: #cfc8bd; }
.pool-sum .pool-sdate { color: var(--muted); }
/* 超时视角 chip：平时低调，选中时用红色提醒 */
.chip.chip-risk.active { background: var(--danger); border-color: var(--danger); color: #fff; }

.sec-title {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 14px; font-weight: 600; margin-bottom: 10px;
}
.sec-title span { font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* ---------- 画师工作量 ---------- */
.wk-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.wk-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.wk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wk-name {
  font-size: 13.5px; font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-num { font-size: 12px; color: var(--muted); white-space: nowrap; }
.wk-num b { font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }
.wk-bar { height: 6px; background: #f0eee9; border-radius: 4px; overflow: hidden; margin: 9px 0 7px; }
.wk-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #c08a52, #8a5a2b); }
.wk-foot { font-size: 12px; color: var(--muted); }
.wk-item.idle .wk-num b { color: var(--muted); }
.wk-item.idle { background: #fbfaf8; }
/* 画师手上订单弹窗：图案/开始画/画完了 缩略图 */
.ao-card { padding: 10px 12px; }
.ao-idx {
  flex: 0 0 22px; height: 22px; border-radius: 50%; margin-top: 2px;
  background: #f0ebe2; color: #8a5a2b; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ao-pic {
  width: 56px; flex: 0 0 56px; cursor: zoom-in; text-align: center;
}
.ao-pic img {
  width: 56px; height: 74px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); background: #fafafa; display: block;
}
.ao-pic span { font-size: 10.5px; color: var(--muted); display: block; margin-top: 2px; }

/* ---------- 订单卡 ---------- */
.order-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; gap: 14px; padding: 14px; margin-bottom: 10px; transition: .15s;
}
.order-card:hover { border-color: #d6cfc4; box-shadow: 0 4px 16px rgba(60,45,30,.05); }
.order-thumb {
  width: 92px; height: 92px; flex: 0 0 92px; border-radius: 9px; overflow: hidden;
  background: #f0eee9; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 11px; text-align: center;
}
.order-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-main { flex: 1; min-width: 0; }
.order-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.order-title .no { font-weight: 600; font-size: 15px; }
.order-title .shop { font-size: 12px; color: var(--accent); background: var(--accent-soft);
  padding: 1px 7px; border-radius: 4px; }
.order-meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.order-meta b { color: var(--text); font-weight: 500; }
.order-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.tag {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 5px;
  background: #f1efeb; color: var(--muted);
}
.tag.warn { background: #fdf4e3; color: var(--warn); }
.tag.ok { background: #eaf5ef; color: var(--ok); }
.tag.danger { background: #fdecea; color: var(--danger); }
.tag.work { background: #eef2fa; color: #3a5a99; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #f0eee9; white-space: nowrap; }
th { background: #faf9f7; font-weight: 600; font-size: 13px; color: var(--muted); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fdfcfa; }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px;
}
.toolbar input, .toolbar select {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--accent); }
.toolbar input[type=text] { flex: 1; min-width: 160px; }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(35,32,28,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal h3 { margin: 0 0 16px; font-size: 17px; }
.modal-lg { width: min(760px, 94vw); max-height: 92vh; overflow: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- 提示 ---------- */
#toast-wrap {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: calc(100% - 32px); max-width: 420px;
}
.toast {
  background: #2b2723; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: tin .2s ease;
  max-width: 100%;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; color: var(--muted); padding: 44px 16px; font-size: 14px; }
.empty a { color: var(--accent); }

/* ---------- 图片预览 ---------- */
.viewer {
  position: fixed; inset: 0; background: rgba(18,16,14,.94); z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.viewer img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  touch-action: pinch-zoom; transition: transform .1s;
}
.viewer .close {
  position: absolute; top: 14px; right: 14px; width: 42px; height: 42px;
  border-radius: 50%; background: rgba(255,255,255,.18); color: #fff;
  border: none; font-size: 22px; line-height: 1;
}
.viewer .hintbar {
  position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.6); font-size: 12px;
}

/* ---------- 流转单：A4 上下两联，中间虚线可撕 ---------- */
.modal.modal-wide { max-width: 830px; }

.slip-sheet {
  width: 198mm; height: 285mm; margin: 0 auto; background: #fff; color: #000;
  display: flex; flex-direction: column; border: 1px dashed #c9c9c9;
}
.slip-half {
  flex: 1 1 0; min-height: 0; padding: 4mm 5mm 3mm;
  display: flex; flex-direction: column;
  overflow: hidden;   /* 兜底：任何内容都不允许溢出到另一联/第二页 */
}
.slip-head {
  display: flex; align-items: center; gap: 8px;
  border-bottom: 2px solid #222; padding-bottom: 2.5mm;
}
.slip-head img { height: 7mm; width: auto; display: block; }
.slip-head .co { font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.slip-head .tag {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  border: 1.2px solid #222; border-radius: 3px; padding: 1px 7px; white-space: nowrap;
}
/* 左图右信息 */
.slip-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 4mm; margin-top: 2.5mm; }
.slip-pic {
  flex: 0 0 44%; width: 44%;
  display: flex; align-items: flex-start; justify-content: center;
}
.slip-pic img {
  width: 100%; max-height: 98mm; object-fit: contain;
  border: 1px solid #ddd; background: #fff;
}
.slip-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.slip-info h4 {
  margin: 0 0 2mm; font-size: 15px; letter-spacing: 3px; text-align: center;
}
.slip-half table { width: 100%; border-collapse: collapse; font-size: 11.5px; table-layout: fixed; }
.slip-half td { border: 1px solid #999; padding: 2.5px 6px; word-break: break-all; vertical-align: top; }
.slip-half td.k { width: 58px; background: #f4f4f4; color: #444; white-space: nowrap; }
.slip-foot { margin-top: auto; padding-top: 1.5mm; font-size: 9.5px; color: #666; text-align: right; }

/* 备注单元格：默认正常字号；超过 100 字自动缩小，保证不挤出表格 */
.slip-half td.rm-cell { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; }
.slip-half tr.rm-m  td.rm-cell { font-size: 10.5px; line-height: 1.35; }
.slip-half tr.rm-l  td.rm-cell { font-size: 9.8px;  line-height: 1.3; }
.slip-half tr.rm-xl td.rm-cell { font-size: 9px;    line-height: 1.25; }

.slip-cut { position: relative; border-top: 1.5px dashed #666; }
.slip-cut span {
  position: relative; top: -8px; background: #fff; padding: 0 10px;
  font-size: 10px; color: #666; letter-spacing: 1px;
}

@media print {
  @page { size: A4 portrait; margin: 6mm; }
  /* 打印流转单时只保留弹窗里的单子本体：
     其余内容一律 display:none（不占布局位），否则订单列表等长页面会把
     一张 A4 撑成好几页（历史 bug：打印预览显示 4 张） */
  body > :not(#modal-root) { display: none !important; }
  #modal-root .modal-mask { position: static; inset: auto; display: block; padding: 0; background: none; }
  #modal-root .modal {
    width: auto; max-width: none; max-height: none; overflow: visible;
    padding: 0; border-radius: 0; box-shadow: none;
  }
  /* 弹窗标题和说明文字不用打印 */
  #modal-root .modal > h3, #modal-root .modal > .hintline { display: none !important; }
  /* 单子本体回到文档流顶部：198×285mm 正好一页 A4（上下两联） */
  .print-area {
    position: static; width: 198mm; height: 285mm;
    border: none; margin: 0; padding: 0; overflow: hidden;
  }
  .no-print { display: none !important; }
}

/* ---------- 图库 ---------- */
.gal-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 14px;
}
.gal-bar input {
  flex: 1; min-width: 150px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none;
}
.gal-bar input:focus { border-color: var(--accent); }
.gal-bar select {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none;
}
.gal-count {
  font-size: 12.5px; color: var(--muted); margin: 2px 0 10px;
}
.gal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}
.gal-item {
  position: relative; background: #fff; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(60,45,30,.05);
  display: flex; flex-direction: column;
}
.gal-item > img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: contain; display: block;
  background: #f4f2ee; cursor: zoom-in;
}
.gal-del {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff;
  font-size: 17px; line-height: 1; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.gal-del:hover { background: var(--danger); }
.gal-meta { padding: 8px 10px 9px; display: flex; flex-direction: column; gap: 3px; }
.gal-tags {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 7px 10px 0;
}
.gal-tag {
  font-size: 11px; padding: 1px 6px; border-radius: 5px;
  background: #f3ece2; color: #8a5a2b; white-space: nowrap;
}
.gal-tag.more { background: #f0eee9; color: var(--muted); }
.gal-title {
  font-size: 13px; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.gal-sub { font-size: 11.5px; color: var(--muted); }
.gu-preview {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px;
}
.gu-preview img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 8px; background: #f4f2ee;
}
.gu-more {
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: #f4f2ee; color: var(--muted); font-size: 13px;
}

/* 图库筛选条 */
.gal-filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
}
.gal-filters select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none; font-size: 13.5px; color: var(--text);
  max-width: 42vw;
}
.gal-filters select:focus { border-color: var(--accent); }

/* 上传页：选图 */
.up-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.up-tip { font-size: 12.5px; color: var(--muted); }
.up-empty {
  margin-top: 12px; padding: 18px; text-align: center; font-size: 13px;
  color: var(--muted); background: #faf8f5; border: 1px dashed var(--line);
  border-radius: 10px;
}
.up-count { font-size: 12.5px; color: var(--muted); margin: 12px 0 8px; }
.up-thumb { position: relative; }
.up-rm {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.up-rm:hover { background: var(--danger); }
.up-foot { display: flex; justify-content: flex-end; margin: 14px 0 6px; }

/* 上传页：维度多选 */
.dim-card { padding: 14px 16px; }
.dim-head {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 14px; font-weight: 600;
}
.dim-head span { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.chip {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 20px;
  background: #fff; color: var(--text); font-size: 13.5px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--accent); }
.chip.on {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.dim-empty { font-size: 13px; color: var(--muted); }


/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar .brand { font-size: 14px; gap: 6px; }
  .topbar .brand img { height: 17px; }
  .brand-sub { display: none; }
  .topbar .btn { padding: 6px 9px; font-size: 12.5px; }
  .userchip { padding: 4px 8px; font-size: 12px; gap: 5px; max-width: 34vw; }
  .uc-role { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page { padding: 14px 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .wk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wk-item { padding: 10px 11px; }
  .wk-name { font-size: 13px; }
  .wk-num b { font-size: 16px; }
  .stat .v { font-size: 20px; }
  .order-card { gap: 11px; padding: 12px; }
  .order-thumb { width: 74px; height: 74px; flex-basis: 74px; }
  .nav { padding: 8px 12px 0; top: 49px; }
  .nav button { padding: 9px 11px; font-size: 13.5px; }
  .order-actions .btn { flex: 1; min-height: 42px; }
  .modal { padding: 18px 16px; max-height: 94vh; border-radius: 14px; }
  .grid-2.mobile-1 { grid-template-columns: 1fr; }
  .gal-bar { padding: 10px; gap: 8px; }
  .gal-bar input { flex: 1 1 60%; min-width: 0; }
  .gal-filters { gap: 6px; }
  .gal-filters select { flex: 1 1 calc(50% - 6px); max-width: none; font-size: 13px; }
  .chip { padding: 8px 13px; font-size: 13.5px; }
  .dim-card { padding: 12px 13px; }
  .up-foot .btn { width: 100%; min-height: 44px; }
  .gu-preview { grid-template-columns: repeat(3, 1fr); }
  .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .gal-meta { padding: 7px 8px 8px; }
  .gal-title { font-size: 12.5px; }
  th, td { padding: 10px 9px; font-size: 13px; }
}

/* 画师端专用 */
.artist-body { background: #f3f1ed; }
.artist-hero {
  background: linear-gradient(140deg, #8a5a2b 0%, #6b4420 100%);
  color: #fff; padding: 18px 16px 20px; border-radius: 0 0 20px 20px;
}
.artist-hero .name { font-size: 18px; font-weight: 600; }
.artist-hero .row { display: flex; gap: 22px; margin-top: 14px; }
.artist-hero .row .item .n { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.artist-hero .row .item .l { font-size: 11.5px; opacity: .75; }
.artist-card {
  background: #fff; border-radius: 14px; overflow: hidden; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(60,45,30,.06);
}
.artist-card .pic {
  width: 100%; height: 210px; background: #eceae5; display: flex;
  align-items: center; justify-content: center; color: #a9a29a; font-size: 12px;
  position: relative; overflow: hidden;
}
.artist-card .pic img { width: 100%; height: 100%; object-fit: contain; }
.artist-card .pic .zoomtip {
  position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55);
  color: #fff; font-size: 11px; padding: 4px 9px; border-radius: 12px;
}
.artist-card .body { padding: 13px 14px 14px; }
.artist-card .row1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.artist-card .ono { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.artist-card .shop { font-size: 12px; color: var(--muted); margin-top: 2px; }
.artist-card .wage { font-size: 19px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.artist-card .wage small { font-size: 11px; font-weight: 400; color: var(--muted); }
.artist-card .specs { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0; }
.artist-card .specs span {
  font-size: 12.5px; background: #f4f2ee; padding: 3px 9px; border-radius: 6px; color: #5d564d;
}
.artist-card .remark {
  font-size: 13px; background: #fdf6ea; color: #8a5a1b; padding: 8px 10px;
  border-radius: 8px; margin-bottom: 11px; border-left: 3px solid #e0b26a;
}
.artist-card .due { font-size: 12.5px; color: var(--muted); margin-bottom: 11px; }
.artist-card .due b { color: var(--danger); }
.artist-card .big-btn {
  width: 100%; padding: 13px; border-radius: 10px; border: none;
  background: var(--ok); color: #fff; font-size: 15.5px; font-weight: 600;
}
.artist-card .big-btn:active { background: #256a4c; }
.artist-card .big-btn:disabled { background: #cbc5bb; cursor: not-allowed; }
.artist-card .started-line { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.artist-done-badge {
  background: #eaf5ef; color: var(--ok); text-align: center; padding: 10px;
  border-radius: 9px; font-size: 14px; font-weight: 600;
}
.seg {
  display: flex; background: #e9e6e0; padding: 4px; border-radius: 11px; margin-bottom: 14px;
}
.seg button {
  flex: 1; border: none; background: none; padding: 9px; border-radius: 8px;
  font-size: 14px; color: #6d675f;
}
.seg button.active { background: #fff; color: var(--text); font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* 画师待画：紧凑列表（一屏 4-6 单） */
.artist-row {
  display: flex; align-items: center; gap: 11px; background: #fff;
  border-radius: 12px; padding: 10px 12px; margin-bottom: 9px;
  box-shadow: 0 1px 6px rgba(60,45,30,.06); cursor: pointer;
}
.artist-row:active { background: #faf7f2; }
.artist-row .thumb {
  width: 64px; height: 84px; flex: 0 0 64px; border-radius: 8px;
  overflow: hidden; background: #eceae5;
}
.artist-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.artist-row .thumb span {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 11px; color: #a9a29a;
}
.artist-row .mid { flex: 1; min-width: 0; }
.artist-row .line1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.artist-row .sz { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.artist-row .fr { font-size: 12px; background: #f4f2ee; padding: 2px 7px; border-radius: 6px; color: #5d564d; }
.artist-row .line2 { margin-top: 4px; display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.artist-row .due { font-size: 12px; color: var(--muted); }
.artist-row .due.danger { color: var(--danger); font-weight: 600; }
.artist-row .due.warn { color: #b06a00; font-weight: 600; }
.artist-row .started-tag { font-size: 11px; background: #eaf5ef; color: var(--ok); padding: 1px 7px; border-radius: 6px; }
.artist-row .line3 {
  font-size: 11.5px; color: var(--muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.artist-row .wage {
  text-align: right; font-size: 17px; font-weight: 700;
  color: var(--accent); white-space: nowrap; flex: 0 0 auto;
}
.artist-row .wage small { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); }

/* 待画页分段隔条：上面能开的画 / 下面排上来的新单（投图未完成） */
.artist-sec-divider {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 16px 0 9px; padding: 9px 12px; border-radius: 9px;
  background: #eceae4; color: #6d675f; font-size: 13.5px; font-weight: 600;
}
.artist-sec-divider span {
  font-size: 11.5px; font-weight: 400; color: #8a8378; width: 100%;
}

/* 画师详情：全屏层（大画面 + 画师关心的四样信息 + 操作按钮） */
.artist-detail {
  position: fixed; inset: 0; z-index: 90; background: #f4f1ec;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.ad-top {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; padding: 10px 14px;
  background: rgba(244,241,236,.95); backdrop-filter: blur(6px);
  border-bottom: 1px solid #e7e2da;
}
.ad-close {
  border: none; background: #fff; padding: 8px 14px; border-radius: 20px;
  font-size: 14px; color: #6d675f; box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.ad-no {
  font-size: 13.5px; font-weight: 600; color: #5d564d;
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ad-body { padding: 12px 14px 40px; }
.ad-pic {
  background: #fff; border-radius: 12px; overflow: hidden; position: relative;
  box-shadow: 0 2px 10px rgba(60,45,30,.06);
}
.ad-pic img {
  width: 100%; max-height: 56vh; object-fit: contain; display: block; cursor: zoom-in;
}
.ad-pic .zoomtip {
  position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55);
  color: #fff; font-size: 11px; padding: 4px 9px; border-radius: 12px;
}
.ad-info {
  background: #fff; border-radius: 12px; margin-top: 10px; padding: 12px;
  box-shadow: 0 2px 10px rgba(60,45,30,.06);
}
.ad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ad-grid .cell { background: #f8f6f2; border-radius: 9px; padding: 9px 11px; }
.ad-grid .cell small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.ad-grid .cell b { font-size: 16.5px; font-weight: 700; letter-spacing: .3px; }
.ad-grid .cell.wage b { color: var(--accent); }
.ad-grid .cell i {
  font-style: normal; font-size: 11.5px; margin-left: 6px;
  color: var(--muted); font-weight: 400;
}
.ad-grid .cell i.danger { color: var(--danger); font-weight: 700; }
.ad-grid .cell i.warn { color: #b06a00; font-weight: 700; }
.ad-info .remark {
  margin-top: 10px; font-size: 13px; background: #fdf6ea; color: #8a5a1b;
  padding: 8px 10px; border-radius: 8px; border-left: 3px solid #e0b26a;
}
.ad-meta { margin-top: 10px; font-size: 12px; color: var(--muted); }
.ad-photo {
  width: 100%; max-height: 200px; object-fit: contain;
  border-radius: 9px; margin-top: 10px; cursor: zoom-in; display: block;
}
.artist-detail .big-btn {
  width: 100%; padding: 15px; border-radius: 11px; border: none; margin-top: 12px;
  background: var(--ok); color: #fff; font-size: 16px; font-weight: 600;
}
.artist-detail .big-btn:active { background: #256a4c; }
.artist-detail .started-line {
  margin-top: 12px; font-size: 12.5px; color: var(--muted); text-align: center;
}

/* 现货库存 */
.stock-code { font-weight: 700; font-size: 14px; letter-spacing: .5px; display: flex; align-items: center; }
.stock-acts { display: flex; justify-content: center; padding: 0 8px 8px; }
.stock-acts .btn { width: 100%; }
.tag.stock { background: #eef2fa; color: #3a5a99; }
.tag.dist { background: #f3eefb; color: #6b4fa8; }


/* 图库里的现货角标 */
.gal-item { position: relative; }
.gal-item .gal-stock { position: absolute; left: 8px; top: 8px; z-index: 2; }

/* 框师傅：需要做的框（手机上操作，卡片整体放大、上下两行） */
.fr-card { flex-direction: column; gap: 8px; padding: 16px 14px; }
.fr-main { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.fr-main .tag { font-size: 14.5px; padding: 4px 11px; border-radius: 7px; }
.fr-size { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.fr-card .order-sub {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  font-size: 14.5px; color: var(--muted); margin-top: 6px;
}

/* ============ 分销商（外部客户）订单进度 ============ */
.dist-steps { display: flex; margin-top: 12px; padding: 10px 4px 2px; border-top: 1px dashed var(--border, #e5e0d5); }
.dist-step { flex: 1; text-align: center; position: relative; color: var(--muted); font-size: 12px; min-width: 0; }
.dist-step .dot {
  width: 12px; height: 12px; border-radius: 50%; margin: 0 auto 4px;
  background: var(--border, #ddd6c8); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border, #ddd6c8);
}
.dist-step.done .dot { background: #2e9e5b; box-shadow: 0 0 0 1px #2e9e5b; }
.dist-step.done { color: #1d6b3f; }
.dist-step.cur .dot { background: #e6a23c; box-shadow: 0 0 0 1px #e6a23c; }
.dist-step.cur { color: #8a5a1b; font-weight: 600; }
.dist-step .n { white-space: nowrap; }
.dist-step .t { font-size: 10.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dist-card { background: #fcfbf7; }
/* 分销商订单卡：开工照/成品照 小图条（紧凑，点击放大） */
.dist-photos { display: flex; gap: 10px; margin-top: 10px; }
.dist-photos .ph { width: 72px; text-align: center; }
.dist-photos .ph img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border, #e5e0d5); cursor: zoom-in; display: block;
  background: #f2efe9;
}
.dist-photos .ph span { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---------- 画画视频 ---------- */
.vm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
  background: #fff;
}
.vm-info { min-width: 0; flex: 1; }
.vm-name { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }
.vm-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vm-acts { display: flex; gap: 6px; flex: none; }

.vplayer {
  position: fixed; inset: 0; background: rgba(10, 9, 8, .96); z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.vplayer .close {
  position: absolute; top: 14px; right: 18px; z-index: 10;
  background: rgba(255,255,255,.12); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%; font-size: 22px; cursor: pointer;
}
.vbox { position: relative; width: min(92vw, 860px); max-height: 88vh; }
.vbox video { width: 100%; max-height: 80vh; display: block; border-radius: 10px; background: #000; }
.wm-layer {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-around; align-items: center;
}
.wm-layer span {
  color: rgba(255,255,255,.34); font-size: 15px; font-weight: 600;
  transform: rotate(-22deg); white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.vnote {
  margin-top: 10px; text-align: center; color: rgba(255,255,255,.75);
  font-size: 13px;
}

/* ---- 视频库（类似现货库存的整页列表） ---- */
.vl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.vl-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(60,45,30,.05);
  display: flex; flex-direction: column;
}
.vl-thumb {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #1d1a16; cursor: pointer; overflow: hidden;
}
.vl-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .2s;
}
.vl-thumb:hover img { transform: scale(1.04); }
.vl-noimg {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; color: rgba(255,255,255,.8); font-size: 30px;
}
.vl-thumb::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 40px; height: 40px; border-radius: 50%; pointer-events: none;
  background: rgba(0,0,0,.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/22px no-repeat;
}
.vl-dur {
  position: absolute; right: 7px; bottom: 7px; z-index: 1;
  background: rgba(0,0,0,.6); color: #fff; font-size: 11.5px;
  padding: 1px 6px; border-radius: 5px; pointer-events: none;
}
.vl-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 4px; }
.vl-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vl-order {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px;
}
.vl-order a { color: var(--accent); text-decoration: none; font-weight: 600; }
.vl-order a:hover { text-decoration: underline; }
.vl-sub { font-size: 11.5px; color: var(--muted); }
.vl-acts { display: flex; gap: 6px; margin-top: 4px; }
