/* ===== 亿方广告业务管理系统 · 设计系统 ===== */
:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-weak: #EFF6FF;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --border-light: #EEF0F3;
  --text: #1F2328;
  --text-2: #57606A;
  --text-3: #8B949E;
  --zebra: #F7F8FA;
  --head: #F0F2F5;
  --success: #16A34A;
  --warn: #D97706;
  --danger: #DC2626;
  --radius: 6px;
  --radius-lg: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; }

/* ===== 登录 ===== */
.login-wrap {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 32px 28px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.login-brand .logo {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.login-brand h1 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: .2px; }
.login-sub { color: var(--text-3); font-size: 12px; margin: 0 0 24px 38px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.input, .select {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.login-err {
  color: var(--danger);
  font-size: 12px;
  margin: 0 0 12px;
  min-height: 16px;
}

/* 密码框眼睛 */
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 40px; }
.pwd-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
}
.pwd-eye:hover { color: var(--text-2); background: var(--bg); }
.pwd-eye svg { width: 16px; height: 16px; }

/* 保存密码 */
.remember-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  margin: 2px 0 10px;
  cursor: pointer;
  user-select: none;
}
.remember-row input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; accent-color: var(--primary); }
.btn {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #D0D5DD; background: #FAFBFC; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.block { width: 100%; height: 36px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 主框架 ===== */
.shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 208px;
  flex: 0 0 208px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: .2px;
}
.brand .logo {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-img {
  width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex: 0 0 24px;
}
.brand-ver { font-size: 10px; color: var(--text-3); font-weight: 400; letter-spacing: .2px; }
.menu { flex: 1; padding: 8px; overflow-y: auto; }
.menu-item {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  margin-bottom: 2px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.menu-item:hover { background: var(--bg); }
.menu-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 500; }
.menu-item.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 9px; bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.menu-item svg { width: 18px; height: 18px; flex: 0 0 18px; stroke-width: 1.7; }
.sidebar-foot {
  border-top: 1px solid var(--border-light);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-3);
}
.sidebar-foot .who { color: var(--text); font-size: 13px; margin-bottom: 2px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px;
  flex: 0 0 56px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.topbar .title { font-size: 15px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-weak); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 20px;
  display: flex;
  flex-direction: column;
}
/* 列表页：卡片撑满内容区，只有表格内部滚动 */
.content > .card { flex: 0 0 auto; min-height: 0; }
.content > .card:has(.table-wrap) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.content > .card:has(.table-wrap) > .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
/* 非列表页：卡片自己滚动，不撑破外壳 */
.content > .card:not(:has(.table-wrap)) {
  margin-bottom: 16px;
}

/* ===== 工具条 / 卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  row-gap: 10px;
}
.toolbar .spacer { flex: 1; }

/* 工具栏分组：查询区 / 操作区 */
.tb-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  row-gap: 8px;
}
.tb-group .btn, .tb-group .filter, .tb-group .input { height: 32px; }
.tb-actions { margin-left: auto; }
.tb-divider {
  width: 1px;
  align-self: center;
  height: 22px;
  background: #D5DAE1;
  margin: 0 6px;
  flex: 0 0 1px;
}

.filter {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
}
.filter:focus { border-color: var(--primary); }
.filter.date { width: 128px; }

/* ===== 表格 ===== */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--head);
  color: var(--text-2);
  font-weight: 600;
  text-align: left;
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody td {
  height: 38px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: var(--zebra); }
tbody tr:hover { background: #F0F7FF; }
tbody tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: left; }

/* 状态列内联下拉：看起来像文字，点开是选项 */
.status-trigger {
  display: inline-block;
  padding: 2px 6px;
  margin-left: 2px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.status-trigger:hover { background: var(--primary-weak); color: var(--primary); }

.status-mask { position: fixed; inset: 0; z-index: 59; }
.status-pop {
  position: fixed;
  z-index: 60;
  min-width: 116px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
  padding: 4px;
}
.status-pop-item {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.status-pop-item:hover { background: var(--primary-weak); color: var(--primary); }
.status-pop-item.active { background: var(--bg); font-weight: 600; }

/* 付款状态可点切换 */
.pay-toggle {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
}
.pay-toggle:hover { background: var(--primary-weak); color: var(--primary); }

.empty {
  padding: 64px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.empty svg { width: 40px; height: 40px; stroke: #C9CED6; stroke-width: 1.2; margin-bottom: 10px; }

/* ===== 状态点 ===== */
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.blue { background: var(--primary); }
.dot.green { background: var(--success); }
.dot.orange { background: var(--warn); }
.dot.red { background: var(--danger); }
.dot.gray { background: #C9CED6; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  background: var(--bg);
  color: var(--text-2);
}
.tag.blue { background: var(--primary-weak); color: var(--primary); }
.tag.green { background: #ECFDF3; color: #15803D; }
.tag.orange { background: #FFFAEB; color: #B45309; }
.tag.red { background: #FEF2F2; color: #B91C1C; }

/* ===== 弹窗 ===== */
.mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .32);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.dialog {
  background: #fff;
  border-radius: 10px;
  width: 480px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .16);
}
.dialog-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  font-size: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.dialog-body { padding: 18px 20px; overflow: auto; flex: 0 1 auto; }
.dialog-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 10px;
}
.form-row { display: flex; gap: 12px; margin-bottom: 14px; }
.form-row > * { flex: 1; min-width: 0; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.form-item label .req { color: var(--danger); margin-left: 2px; }

.hint { font-size: 12px; color: var(--text-3); }

/* ===== 可编辑表格 ===== */
.edit-table tbody td { padding: 3px 6px; height: 40px; }
.edit-table tbody tr:nth-child(even) { background: transparent; }
.edit-table tbody tr:hover { background: #FAFBFC; }
.edit-table tfoot td {
  height: 46px;
  padding: 0 12px;
  border-top: 1px solid var(--border);
  border-bottom: none;
  background: #fff;
  font-size: 13px;
}
.cell-input {
  width: 100%;
  height: 30px;
  border: 1px solid #BFDBFE;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  outline: none;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.cell-input:hover { border-color: #93C5FD; background: #fff; }
.cell-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.cell-input.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-input::-webkit-outer-spin-button,
.cell-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== 打印单据 ===== */
.print-sheet { display: none; }
.print-sheet .ps-title { text-align: center; font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.print-sheet .ps-sub { text-align: center; font-size: 11px; color: #444; margin-bottom: 14px; }
.print-sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.print-sheet th, .print-sheet td { border: 1px solid #333; padding: 5px 6px; word-break: break-all; font-size: 12px; }
.print-sheet th { background: #f2f2f2; font-weight: 600; text-align: center; }
.print-sheet td.num { text-align: right; font-variant-numeric: tabular-nums; }
.print-sheet .ps-total { margin-top: 10px; text-align: right; font-size: 13px; font-weight: 600; }
.print-sheet .ps-sign { margin-top: 40px; display: flex; justify-content: space-between; font-size: 12px; }

@media print {
  body { background: #fff !important; }
  .shell, .login-wrap, .mask { display: none !important; }
  .print-sheet { display: block !important; }
  @page { size: A4 portrait; margin: 14mm 12mm; }
}

/* 滚动条细化 */
.table-wrap::-webkit-scrollbar { width: 9px; height: 9px; }
.table-wrap::-webkit-scrollbar-thumb { background: #D0D5DD; border-radius: 5px; border: 2px solid #fff; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: #B8BFC8; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
/* 表头可拖动调整列宽 */
thead th { position: relative; }
thead th::after {
  content: '';
  position: absolute;
  right: 0;
  top: 26%;
  height: 48%;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  transition: background .12s;
}
thead th:hover::after { background: #C9D2DE; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
/* 列表底部统计行（与表格列对齐，滚动时吸底） */
tfoot .summary-row td {
  position: sticky;
  bottom: 0;
  height: 42px;
  padding: 0 12px;
  background: #F7F9FC;
  border-top: 1px solid var(--border);
  border-bottom: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  z-index: 2;
}
tfoot .summary-row td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
tfoot .summary-row td.danger { color: var(--danger); }
/* 已完工订单：明细只读 */
tr.locked .cell-input {
  border-color: transparent !important;
  background: transparent !important;
  cursor: default;
  pointer-events: none;
  color: var(--text);
}
.input:disabled, .select:disabled {
  background: #F7F8FA;
  color: var(--text-2);
  cursor: not-allowed;
}
/* 表单里的状态选择器（与列表一致） */
.status-field {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.status-field:hover { border-color: #B8C0CC; }
.status-field .dot { margin-right: 0; }
/* ===== 自绘日期选择器 ===== */
.dp-wrap { width: 100%; }
.dp-field {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.dp-field:hover { border-color: #B8C0CC; }
.dp-ph { color: var(--text-3); }
.dp-mask { position: fixed; inset: 0; z-index: 69; }
.dp-pop {
  position: fixed;
  z-index: 70;
  width: 252px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
  padding: 12px;
}
.dp-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--text);
}
.dp-nav {
  width: 26px; height: 26px; border: none; background: none; cursor: pointer;
  font-size: 16px; color: var(--text-2); border-radius: 5px; line-height: 1;
}
.dp-nav:hover { background: var(--bg); color: var(--primary); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { height: 26px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-3); }
.dp-cell {
  height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; border-radius: 6px; cursor: pointer; color: var(--text);
}
.dp-cell:hover { background: var(--bg); }
.dp-cell.other { color: var(--text-3); }
.dp-cell.today { color: var(--primary); font-weight: 600; }
.dp-cell.sel { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.dp-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.dp-link {
  border: none; background: none; color: var(--primary);
  font-size: 13px; cursor: pointer; padding: 4px 10px; border-radius: 5px;
}
.dp-link:hover { background: var(--primary-weak); }
.login-hint { text-align: center; font-size: 12px; color: var(--text-3); margin: 14px 0 0; }
.top-name { font-size: 13px; color: var(--text); font-weight: 500; margin-right: 4px; }
/* 编辑页返回按钮：浅蓝底，好找 */
.back-btn {
  background: var(--primary-weak) !important;
  border-color: #BFDBFE !important;
  color: var(--primary) !important;
  font-weight: 500;
}
.back-btn:hover { background: #DBEAFE !important; border-color: var(--primary) !important; }
/* 分段筛选按钮 */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: 32px; }
.seg-btn {
  border: none; background: #fff; padding: 0 14px; font-size: 13px;
  color: var(--text-2); cursor: pointer; font-family: inherit;
  border-right: 1px solid var(--border);
}
.seg-btn:last-child { border-right: none; }
.seg-btn:hover { background: var(--bg); }
.seg-btn.on { background: var(--primary); color: #fff; }

/* 客户对账 */
.recon-summary {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); background: #fff;
}
.recon-summary strong { color: var(--text); font-weight: 600; }
.recon-summary .danger { color: var(--danger); }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  background: #F3F4F6; color: var(--text-2); font-size: 12px;
}
.tag.tag-ok { background: #ECFDF5; color: #047857; }
tr.detail-row td { border-bottom: 1px solid var(--border); }
tr.detail-row table th { background: #F1F3F7; }


/* 明细缩略图与蓝色文字按钮 */
.thumb-btn {
  width: 38px; height: 30px; padding: 0;
  border: 1px dashed #BFDBFE; border-radius: 5px;
  background: #F8FAFF; cursor: pointer; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 15px; line-height: 1;
}
.thumb-btn:hover { border-color: var(--primary); background: #EFF6FF; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-blue {
  border: none; background: none; color: var(--primary);
  font-size: 13px; cursor: pointer; padding: 0 5px; font-family: inherit;
}
.link-blue:hover { text-decoration: underline; }
.link-danger {
  border: none; background: none; color: var(--danger);
  font-size: 13px; cursor: pointer; padding: 0 5px; font-family: inherit;
}
.link-danger:hover { text-decoration: underline; }
.view-switch .view-switch-arrow { font-weight: 700; opacity: .92; }

.drop-zone {
  height: 320px; border: 1.5px dashed #BFDBFE; border-radius: 8px;
  background: #F8FAFF; cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; font-size: 13px; color: var(--text-2);
}
.drop-zone.dragging { border-color: var(--primary); background: #EFF6FF; }
.drop-zone img { max-width: 100%; max-height: 100%; object-fit: contain; }


/* 图片放大查看 */
.viewer-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .78);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.viewer-mask img {
  max-width: 94vw; max-height: 94vh;
  border-radius: 6px; box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
  transition: transform .08s ease-out;
  transform-origin: center center;
}
.viewer-tip {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .75); font-size: 12.5px; letter-spacing: .5px;
}
.drop-zone.hasimg { cursor: zoom-in; }


/* 列表里的缩略图 */
.list-thumb {
  width: 40px; height: 28px; object-fit: cover;
  border-radius: 4px; border: 1px solid var(--border);
  cursor: zoom-in; vertical-align: middle;
}
.list-thumb:hover { border-color: var(--primary); }


/* 客户对账：收款按钮与对账状态 */
.pay-btn {
  color: var(--primary) !important;
  border-color: #BFDBFE !important;
  background: var(--primary-weak) !important;
  font-weight: 500;
}
.pay-btn:hover { background: #DBEAFE !important; border-color: var(--primary) !important; }
.recon-tag {
  display: inline-block; padding: 3px 0; border-radius: 12px;
  font-size: 12.5px; line-height: 1.3; cursor: pointer;
  border: 1px solid transparent; user-select: none; white-space: nowrap;
  min-width: 76px; text-align: center; box-sizing: border-box;
}
.recon-tag.pending { background: #FFF7ED; color: #C2410C; border-color: #FED7AA; }
.recon-tag.warn { background: #FEF9C3; color: #A16207; border-color: #FDE68A; }
.recon-tag.warn:hover { background: #FEF08A; }
.recon-tag.pending:hover { background: #FFEDD5; }
.recon-tag.ok { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.recon-tag.ok:hover { background: #D1FAE5; }


/* 订单状态标签（与对账标签统一） */
.state-tag {
  display: inline-block; padding: 3px 0; border-radius: 12px;
  font-size: 12.5px; line-height: 1.3; cursor: pointer;
  border: 1px solid transparent; user-select: none; white-space: nowrap;
  min-width: 76px; text-align: center; box-sizing: border-box;
}
.state-tag:hover { filter: brightness(0.97); }
.state-tag.st-open { background: #FFF7ED; color: #C2410C; border-color: #FED7AA; }
.state-tag.st-new { background: #F3F4F6; color: #4B5563; border-color: #E5E7EB; }
.state-tag.st-design { background: #FFF7ED; color: #C2410C; border-color: #FED7AA; }
.state-tag.st-making { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.state-tag.st-done { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.state-tag.st-void { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }

/* 明细里的制作员（双击可改） */
.assignee-cell {
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); user-select: none;
}
.assignee-cell:hover { border-color: var(--primary); color: var(--primary); }

/* 制作单订单类别：蓝色符号 + 黑字 */
.src-cell { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }
.src-mark { color: var(--primary); font-size: 12px; line-height: 1; }

.source-tag {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 12.5px; line-height: 1.3; white-space: nowrap;
  border: 1px solid transparent; user-select: none; min-width: 76px;
  text-align: center; box-sizing: border-box;
}
.source-tag.assoc { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.source-tag.standalone { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }


/* 业务订单列表：表头居中（客户、订单概要除外） */
.orders-table thead th { text-align: center; }
.orders-table thead th.th-left { text-align: left; }


/* 排序箭头按钮 */
.order-btn {
  width: 24px; height: 24px; margin-right: 4px; padding: 0;
  border: 1px solid var(--border); background: #fff; border-radius: 4px;
  color: var(--text-2); font-size: 10px; line-height: 1; cursor: pointer;
}
.order-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.order-btn:disabled { opacity: .35; cursor: not-allowed; }

.link-red { background: none; border: none; padding: 0; color: #DC2626; font-size: 12.5px; cursor: pointer; }
.link-red:hover { text-decoration: underline; }

/* 业务订单对账：单据摘要行（合并居中）与明细表的衔接 */
.recon-head-row td { background: #fff; }
.recon-head-row:not(:first-child) td { border-top: 2px solid #EEF0F3; }
.detail-row td { padding: 0 !important; background: #FAFBFC; }
.detail-row > td { padding: 0 !important; background: #FAFBFC; }
.recon-detail-wrap { width: 100%; overflow: hidden; }
.recon-detail-table { width: 100%; table-layout: fixed; background: #FAFBFC; }
.recon-detail-table thead th {
  text-align: left; font-weight: 600; color: var(--text-2);
  background: #F0F2F5; padding: 7px 10px; font-size: 12.5px;
}
.recon-detail-table thead th.num { text-align: right; }
.recon-detail-table tbody td {
  padding: 7px 10px; font-size: 12.5px;
  border-bottom: 1px solid #EEF0F3;
}
.recon-detail-table tbody td.num { text-align: right; }

/* 业务订单对账：表头共用、明细按单据合并 */
/* 与业务订单列表一致：宽度交给列宽拖动脚本（fixed + 最后一列吃剩余） */
.recon-table { width: 100%; }
/* 表头/单元格样式全部沿用全局，不另外覆盖，保证列宽逻辑与业务订单列表一致 */
.recon-table thead th { font-size: 12.5px; text-align: center; }
.recon-table thead th.num { text-align: center; }
.recon-table tbody td { font-size: 12.5px; vertical-align: middle; }
.recon-table tbody td.num { text-align: right; }
/* 对账表：单据列浅色固定，明细列走斑马纹 */
.recon-table tbody tr { background: #fff; }
.recon-table tbody tr:nth-child(even) { background: var(--zebra, #FAFBFC); }
.recon-table tbody tr:hover { background: #F4F8FF; }
.recon-table tbody td.fixed-col { background: #fff; }
.recon-table tbody tr.recon-first td { border-top: 1px solid #E3E7EC; }
.recon-table tbody tr:first-child td { border-top: none; }

/* 表头列边界：右侧短竖线（提示可拖动），不贯穿整个表头 */
/* 表头列边界：右边缘一段短竖线（用背景渐变绘制，兼容性好） */
.table-wrap table thead th {
  position: relative;
  background-image: linear-gradient(to bottom,
    transparent 22%, #C2C8D0 22%, #C2C8D0 78%, transparent 78%);
  background-repeat: no-repeat;
  background-size: 1px 100%;
  background-position: right center;
}
.table-wrap table thead th:last-child { background-image: none; }


/* 制作订单 / 外协订单：表头居中（长文本列除外） */
.make-table thead th, .outsource-table thead th { text-align: center; }
.make-table thead th.th-left, .outsource-table thead th.th-left { text-align: left; }

/* 明细行里的加图按钮 */
.thumb-add {
  width: 26px; height: 26px; padding: 0; border: 1px dashed var(--border);
  background: #fff; border-radius: 5px; color: var(--text-2); font-size: 15px;
  line-height: 1; cursor: pointer;
}
.thumb-add:hover { border-color: var(--primary); color: var(--primary); }

/* 合同价 / 协议价清单：固定列宽，最后一列吃剩余宽度，可拖拽 */
.price-table { table-layout: fixed; width: 100%; }
.price-table thead th { text-align: center; }
.price-table thead th:nth-child(4) { text-align: left; }
.price-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-table td:nth-child(4) { text-align: left; }
.price-table thead th:last-child, .price-table td:last-child { padding: 0; border-right: none; }

/* 合同项选择弹窗：选中行高亮 */
.picker-row-on { background: #EFF6FF !important; }
.picker-row-on td { background: #EFF6FF !important; box-shadow: inset 0 0 0 9999px rgba(37,99,235,.06); }

/* 登录页与侧栏的品牌图标 */
.login-logo { background: transparent !important; object-fit: contain; }
.brand-img { background: transparent !important; object-fit: contain; }

/* 授权状态提示条 */
.license-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 24px; font-size: 12.5px; flex-wrap: wrap;
}
.license-bar.lb-trial { background: #FFFBEB; border-bottom: 1px solid #FDE68A; color: #92400E; }
.license-bar.lb-expired { background: #FEF2F2; border-bottom: 1px solid #FECACA; color: #B91C1C; }
.license-bar .lb-icon { font-size: 14px; }
.license-bar .lb-text b { font-weight: 700; }
.license-bar .lb-code {
  margin-left: auto; font-family: Consolas, monospace; font-size: 11.5px;
  background: rgba(255,255,255,.7); padding: 2px 8px; border-radius: 4px;
}
.license-bar .btn { height: 26px; font-size: 12px; }

/* 系统配置里的多卡片页：卡片之间保留间距 */
.settings-stack > .card { margin-bottom: 14px; }
.settings-stack > .card:last-child { margin-bottom: 0; }
/* 紧凑表格：行高小一点 */
.compact-table td, .compact-table th { padding: 6px 10px; }
