/* ============ 智影单据打印系统 · 设计系统 ============ */
:root {
  --brand: #2b6cb0;
  --brand-700: #25598f;
  --brand-800: #1f4c7a;
  --brand-050: #eef4fb;
  --brand-100: #d9e8f7;
  --brand-200: #b9d3ee;

  --ink-1: #1f2937;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --ink-4: #9ca3af;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e5e7eb;
  --line-2: #eef1f5;

  --ok: #16a34a;
  --ok-bg: #e8f6ee;
  --warn: #d97706;
  --warn-bg: #fdf3e3;
  --danger: #dc2626;
  --danger-bg: #fdeaea;
  --info: #0891b2;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sh-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-2: 0 2px 8px rgba(16, 24, 40, .07);
  --sh-3: 0 8px 24px -6px rgba(16, 24, 40, .13);
  --sh-4: 0 20px 48px -12px rgba(16, 24, 40, .24);

  --sidebar-w: 216px;
  --topbar-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-1);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 启动加载 ---------- */
.boot-loading {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; background: var(--bg);
}
.boot-spinner {
  width: 34px; height: 34px; border: 3px solid var(--brand-100);
  border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite;
}
.boot-text { color: var(--ink-3); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 登录 ---------- */
.login-page {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f4c7a 0%, #2b6cb0 45%, #4a8fd0 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 880px; background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--sh-4); display: flex; overflow: hidden; min-height: 440px;
}
.login-side {
  flex: 1; padding: 44px 38px; color: #fff;
  background: linear-gradient(160deg, #25598f, #1f4c7a);
  display: flex; flex-direction: column; justify-content: center;
}
.login-side h1 { font-size: 25px; margin-bottom: 10px; letter-spacing: .5px; }
.login-side p { color: rgba(255, 255, 255, .82); font-size: 13.5px; margin: 0 0 22px; }
.login-feat { display: flex; flex-direction: column; gap: 13px; }
.login-feat-item { display: flex; gap: 11px; align-items: flex-start; }
.login-feat-ico {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: rgba(255, 255, 255, .16); display: flex; align-items: center; justify-content: center;
}
.login-feat-item b { display: block; font-size: 13.5px; font-weight: 600; }
.login-feat-item span { font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.login-form { flex: 1; padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { font-size: 21px; margin-bottom: 5px; }
.login-sub { color: var(--ink-3); font-size: 13px; margin-bottom: 26px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--ink-4); text-align: center; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30;
}
.sb-logo {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 16px; border-bottom: 1px solid var(--line-2); flex: none;
}
.sb-logo-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-800) 100%);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.sb-logo-txt { font-weight: 600; font-size: 15px; letter-spacing: .3px; color: var(--ink-1); }
.sb-logo-sub { font-size: 11px; color: var(--ink-4); }
.sb-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sb-group { font-size: 11px; color: var(--ink-4); padding: 12px 10px 6px; letter-spacing: .5px; }
.sb-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--r-md);
  color: var(--ink-2); cursor: pointer; margin-bottom: 2px; font-size: 13.5px; transition: .15s;
}
.sb-item:hover { background: var(--surface-2); color: var(--ink-1); }
.sb-item.active { background: var(--brand-050); color: var(--brand); font-weight: 500; }
.sb-item .ico { width: 18px; text-align: center; flex: none; opacity: .9; }
.sb-foot { padding: 12px; border-top: 1px solid var(--line-2); flex: none; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 20px; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.tb-title { font-size: 16px; font-weight: 600; }
.tb-crumb { font-size: 12px; color: var(--ink-4); }
.tb-spacer { flex: 1; }
.tb-user { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 5px 9px; border-radius: var(--r-md); }
.tb-user:hover { background: var(--surface-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, var(--brand), var(--brand-800)); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 58px; height: 58px; font-size: 21px; }
.content { padding: 18px 20px 40px; flex: 1; min-width: 0; }

/* ---------- 通用组件 ---------- */
.card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-1); border: 1px solid var(--line-2); }
.card-head {
  padding: 14px 16px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; }
.card-body { padding: 16px; }
.card-flush { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; font-size: 13.5px;
  transition: .15s; white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--brand-200); color: var(--brand); background: var(--brand-050); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-800) 100%);
  border-color: transparent; color: #fff; box-shadow: 0 3px 10px -3px rgba(43, 108, 176, .55);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-800) 100%); color: #fff; }
.btn-danger { color: var(--danger); border-color: #f3c7c7; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); border-color: #eaa; }
/* min-width 保证纯图标按钮（如“下载”）也有 28x28 的可点击区域 */
.btn-sm { height: 28px; min-width: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-lg { height: 42px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: #fff; color: var(--ink-1); outline: none; transition: .15s;
}
.textarea { height: auto; padding: 8px 11px; resize: vertical; min-height: 72px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--ink-4); }
.input-sm { height: 30px; font-size: 13px; }

.field { margin-bottom: 15px; }
.field-label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field-hint { font-size: 12px; color: var(--ink-4); margin-top: 5px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 5px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tb th {
  text-align: left; padding: 11px 14px; color: var(--ink-3); font-weight: 500;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px;
}
table.tb td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tb tbody tr:hover { background: var(--surface-2); }
table.tb tbody tr:last-child td { border-bottom: none; }
.td-ops { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 20px;
  background: var(--brand-050); color: var(--brand); font-weight: 500; line-height: 1.6;
}
.tag.gray { background: #f1f5f9; color: var(--ink-3); }
.tag.green { background: var(--ok-bg); color: var(--ok); }
.tag.red { background: var(--danger-bg); color: var(--danger); }
.tag.orange { background: var(--warn-bg); color: var(--warn); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 16px; flex-wrap: wrap; }
.pager-info { color: var(--ink-4); font-size: 12.5px; margin-right: auto; }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-4); }
.empty-ico { font-size: 34px; opacity: .35; margin-bottom: 10px; }
.empty p { margin: 0 0 14px; font-size: 13.5px; }

.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 120px; }
.search-box { position: relative; width: 240px; max-width: 100%; }
.search-box .input { padding-left: 32px; }
.search-box .s-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-4); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border-radius: var(--r-lg); padding: 16px 18px; border: 1px solid var(--line-2);
  box-shadow: var(--sh-1); display: flex; align-items: center; gap: 14px;
}
.stat-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: flex;
  align-items: center; justify-content: center; font-size: 19px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-800));
}
.stat-ico.green { background: linear-gradient(135deg, #22c55e, #15803d); }
.stat-ico.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-ico.cyan { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.stat-num { font-size: 23px; font-weight: 600; line-height: 1.2; }
.stat-label { font-size: 12.5px; color: var(--ink-3); }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s ease;
}
.modal {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-4); width: 100%;
  max-width: 520px; max-height: 88vh; display: flex; flex-direction: column; animation: pop .18s ease;
}
.modal.wide { max-width: 760px; }
.modal.xwide { max-width: 980px; }
.modal-head {
  padding: 15px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; flex: none;
}
.modal-head h3 { font-size: 15.5px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--line-2); display: flex; gap: 9px; justify-content: flex-end; flex: none; }
.modal-close { cursor: pointer; color: var(--ink-4); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: var(--surface-2); color: var(--ink-1); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(31, 41, 55, .94); color: #fff; padding: 9px 16px; border-radius: 22px;
  font-size: 13.5px; box-shadow: var(--sh-3); animation: pop .18s ease;
}
.toast.ok { background: rgba(22, 163, 74, .95); }
.toast.err { background: rgba(220, 38, 38, .95); }

/* ---------- PDF 视图 ---------- */
.pdf-view { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pdf-page {
  position: relative; background: #fff; box-shadow: var(--sh-2); border-radius: 3px;
  overflow: visible; flex: none;
}
.pdf-page canvas { display: block; width: 100%; height: 100%; border-radius: 3px; }
.pdf-loading, .pdf-error { padding: 40px; color: var(--ink-4); font-size: 13.5px; text-align: center; }
.pdf-error { color: var(--danger); }

/* ---------- 设计器 ---------- */
.designer { display: flex; flex-direction: column; gap: 12px; }
.dsg-toolbar {
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 10px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; box-shadow: var(--sh-1);
}
.dsg-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.dsg-body { display: flex; gap: 14px; align-items: flex-start; }
.dsg-canvas {
  flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 16px; max-height: calc(100vh - 210px); overflow: auto; box-shadow: var(--sh-1);
}
.dsg-side {
  width: 296px; flex: none; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); overflow: hidden;
}
.dsg-side h4 { font-size: 13.5px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.dsg-side-body { padding: 14px; max-height: calc(100vh - 300px); overflow-y: auto; }
.dsg-hint { font-size: 12px; color: var(--ink-4); padding: 12px 14px; border-top: 1px solid var(--line-2); line-height: 1.7; }
.dsg-hint b { color: var(--ink-2); }

.dsg-box {
  position: absolute; z-index: 3; cursor: move; box-sizing: border-box; border: 1px dashed var(--brand-200);
  background: rgba(43, 108, 176, .05); border-radius: 2px; overflow: visible;
  display: flex; align-items: center; padding: 0 3px; user-select: none;
}
.dsg-box:hover { border-color: var(--brand); background: rgba(43, 108, 176, .09); }
.dsg-box.active { border: 1.5px solid var(--brand); background: rgba(43, 108, 176, .13); box-shadow: 0 0 0 2px rgba(43, 108, 176, .2); }
.dsg-box.active::after { content: ''; }
.dsg-box .box-txt { white-space: pre-wrap; word-break: break-all; line-height: 1.25; width: 100%; max-height: 100%; overflow: hidden; pointer-events: none; }
.dsg-box .box-img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.dsg-box .box-ph { color: var(--ink-4); font-size: 12px; pointer-events: none; }
/* 纸张选择 */
.paper-btn {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer;
  font-size: 13px; color: var(--ink-2); transition: .15s; text-align: left;
}
.paper-btn b { color: var(--ink-1); font-weight: 600; flex: 1; }
.paper-btn span { font-size: 12px; color: var(--brand); }
.paper-btn:hover { border-color: var(--brand); }
.paper-btn.on { border-color: var(--brand); background: var(--brand-050); }
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.paper-item {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 8px 9px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; cursor: pointer; text-align: left; transition: .15s;
}
.paper-item b { font-size: 13px; color: var(--ink-1); font-weight: 600; }
.paper-item span { font-size: 11.5px; color: var(--ink-4); }
.paper-item:hover { border-color: var(--brand); background: var(--brand-050); }
.paper-item.on { border-color: var(--brand); background: var(--brand-050); box-shadow: inset 0 0 0 1px var(--brand); }
.paper-sum { background: var(--surface-2); border-radius: var(--r-sm); padding: 11px 12px; font-size: 13px; }
.paper-note {
  margin: 8px 14px 0; padding: 7px 10px; font-size: 12.5px; color: var(--brand);
  background: var(--brand-050); border-radius: var(--r-sm); display: flex; align-items: center; gap: 6px;
}
.paper-sum b { color: var(--brand); font-size: 13.5px; margin-left: 6px; }
/* 自定义纸张：可打印区域之外的留白提示 */
.dsg-mask {
  position: absolute; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(15, 23, 42, .13) 0 5px, rgba(15, 23, 42, .05) 5px 10px);
}
.dsg-safe {
  position: absolute; z-index: 2; pointer-events: none;
  border: 1px dashed rgba(34, 139, 94, .9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.dsg-handle { position: absolute; width: 9px; height: 9px; background: #fff; border: 1.5px solid var(--brand); border-radius: 2px; z-index: 5; }
.dsg-handle::after { content: ''; position: absolute; left: -5px; top: -5px; right: -5px; bottom: -5px; }
.dsg-handle.nw { left: -5px; top: -5px; cursor: nwse-resize; }
.dsg-handle.n  { left: 50%; top: -5px; margin-left: -4.5px; cursor: ns-resize; }
.dsg-handle.ne { right: -5px; top: -5px; cursor: nesw-resize; }
.dsg-handle.e  { right: -5px; top: 50%; margin-top: -4.5px; cursor: ew-resize; }
.dsg-handle.se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.dsg-handle.s  { left: 50%; bottom: -5px; margin-left: -4.5px; cursor: ns-resize; }
.dsg-handle.sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.dsg-handle.w  { left: -5px; top: 50%; margin-top: -4.5px; cursor: ew-resize; }
.dsg-box.active .dsg-handle { display: block; }

/* 只读覆盖层（预览/打印） */
.ov-box { position: absolute; overflow: hidden; display: flex; align-items: center; padding: 0 2px; }
.ov-box span { white-space: pre-wrap; word-break: break-all; line-height: 1.25; width: 100%; }
.ov-box img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- 填写/预览 ---------- */
.fill-body { display: flex; gap: 14px; align-items: flex-start; }
.fill-preview {
  flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 16px; max-height: calc(100vh - 200px); overflow: auto; box-shadow: var(--sh-1);
}
.fill-form {
  width: 340px; flex: none; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); overflow: hidden;
}
.fill-form h4 { font-size: 13.5px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.fill-form-body { padding: 14px; max-height: calc(100vh - 320px); overflow-y: auto; }
.fill-form-foot { padding: 12px 14px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; }
.img-slot {
  border: 1px dashed var(--line); border-radius: var(--r-md); height: 92px; display: flex;
  align-items: center; justify-content: center; color: var(--ink-4); font-size: 12.5px;
  cursor: pointer; overflow: hidden; background: var(--surface-2);
}
.img-slot:hover { border-color: var(--brand); color: var(--brand); }
.img-slot img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- 上传 ---------- */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--r-lg); padding: 32px 20px; text-align: center;
  background: var(--surface-2); cursor: pointer; transition: .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-050); }
.dropzone-ico { font-size: 34px; color: var(--brand-200); margin-bottom: 8px; }
.dropzone b { display: block; font-size: 14px; margin-bottom: 4px; }
.dropzone span { font-size: 12.5px; color: var(--ink-4); }
.file-row { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface-2); }
.file-ico { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 600; flex: none; }
.file-ico.pdf { background: #e2574c; }
.file-ico.docx, .file-ico.doc { background: #2b6cb0; }
.file-meta { flex: 1; min-width: 0; }
.file-meta b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span { font-size: 12px; color: var(--ink-4); }

/* ---------- 设置 ---------- */
.set-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); padding: 0 16px; }
.set-tab { padding: 11px 14px; cursor: pointer; color: var(--ink-3); font-size: 13.5px; border-bottom: 2px solid transparent; }
.set-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }
.kv { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.kv:last-child { border-bottom: none; }
.kv-label { width: 168px; flex: none; font-size: 13.5px; color: var(--ink-2); }
.kv-label small { display: block; color: var(--ink-4); font-size: 11.5px; }
.kv-ctrl { flex: 1; min-width: 0; }

.profile-head { display: flex; align-items: center; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.profile-head h3 { font-size: 18px; margin-bottom: 3px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 > * { min-width: 0; }
.grid-2 .full { grid-column: 1 / -1; }

/* ---------- 打印 ---------- */
#zy-print-area { display: none; }
@media print {
  body > *:not(#zy-print-area) { display: none !important; }
  #zy-print-area { display: block !important; }
  .zy-print-page { page-break-after: always; overflow: hidden; }
  .zy-print-page:last-child { page-break-after: auto; }
  .zy-print-page img { width: 100%; height: 100%; display: block; }
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .dsg-side { width: 260px; }
  .fill-form { width: 300px; }
}
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dsg-body, .fill-body { flex-direction: column; }
  .dsg-canvas { max-height: none; width: 100%; }
  .dsg-side, .fill-form { width: 100%; }
  .dsg-side-body { max-height: none; }
  .fill-preview { max-height: 60vh; width: 100%; }
}
@media (max-width: 768px) {
  .sidebar {
    inset: auto 0 0 0; width: 100%; height: auto; flex-direction: row;
    border-right: none; border-top: 1px solid var(--line); box-shadow: 0 -2px 12px rgba(0, 0, 0, .06);
  }
  .sb-logo, .sb-group, .sb-foot { display: none; }
  .sb-nav { display: flex; padding: 5px 4px; overflow-x: auto; gap: 2px; }
  .sb-item { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; margin: 0; min-width: 60px; text-align: center; }
  .sb-item .ico { font-size: 16px; }
  .main { margin-left: 0; padding-bottom: 62px; }
  .topbar { padding: 0 12px; }
  .tb-crumb { display: none; }
  .content { padding: 12px 12px 30px; }
  .login-card { flex-direction: column; min-height: 0; }
  .login-side { display: none; }
  .login-form { padding: 32px 22px; }
  .card-head { padding: 12px 13px; }
  .card-body { padding: 13px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-num { font-size: 19px; }
  .toolbar { gap: 7px; }
  .search-box { width: 100%; }
  .modal-mask { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; max-width: 100%; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .kv { flex-direction: column; align-items: stretch; gap: 6px; }
  .kv-label { width: auto; }
  .profile-head { padding: 15px; }
  .dsg-toolbar { padding: 8px 10px; gap: 6px; }
  .dsg-canvas { padding: 8px; }
  table.tb th, table.tb td { padding: 9px 10px; font-size: 13px; }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .btn { height: 32px; padding: 0 11px; font-size: 13px; }
}
