/* ============ 冷特危官网 · 后台管理系统 ============ */
:root {
  --primary: #1a56db;
  --primary-dark: #1544b0;
  --danger: #d93025;
  --success: #188038;
  --warning: #ea8600;
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e3e8ef;
  --text: #1f2937;
  --text-2: #6b7280;
  --sidebar-w: 220px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ---------- 数值输入框：去掉上下调节键（spinner） ---------- */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- 按钮 ---------- */
.btn { border: 1px solid transparent; border-radius: 8px; padding: 0 16px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: #c4cdd8; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b3261e; }
.btn-sm { padding: 0 10px; height: 30px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }

/* ============ 登录页 ============ */
.login-view {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  /* 第120批：改用 webp（504KB → 42KB），登录页首帧明显变快 */
  background: url("assets/login-bg.webp") center / cover no-repeat fixed;
  position: relative;
  padding: 20px;
}
.login-view::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(15, 30, 80, .55) 0%, rgba(26, 60, 160, .35) 55%, rgba(10, 20, 60, .55) 100%);
}
.login-card {
  position: relative; z-index: 1;
  background: rgba(255, 255, 255, .38);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 16px; padding: 40px 36px;
  width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0, 0, 20, .4);
  text-align: center;
}
.login-card h1, .login-card .field label { color: #fff; }
.login-card .login-sub, .login-card .login-hint { color: rgba(255, 255, 255, .75); }
.login-card .field input {
  background: rgba(255, 255, 255, .25);
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
}
.login-card .field input::placeholder { color: rgba(255, 255, 255, .55); }
.login-card .field input:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .2);
}
.login-logo { font-size: 44px; }
.login-card h1 { font-size: 22px; margin-top: 8px; }
.login-sub { color: var(--text-2); margin: 6px 0 24px; }
.login-card form { text-align: left; }
.login-error { color: var(--danger); font-size: 12px; margin: -4px 0 10px; }
.login-info { color: #34c77b; font-size: 12px; margin: -4px 0 10px; }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--text-2); }
/* 登录页按钮行：注册 + 登录（或返回登录 + 申请注册）一行等宽显示 */
.btn-row { display: flex; gap: 10px; }
.btn-row .btn-flex { flex: 1; min-width: 0; }
/* 注册申请审核弹窗 */
.review-tip { font-size: 12px; color: var(--text-2); background: rgba(255,255,255,.04); border-radius: 6px; padding: 8px 10px; margin: 4px 0 0; }
.modal input[readonly] { opacity: .85; cursor: default; }

/* ---------- 表单字段 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field label em { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea,
.toolbar input, .toolbar select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus,
.toolbar input:focus, .toolbar select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
textarea { resize: vertical; }
/* 表单项内的小字提示 */
.fld-tip { font-weight: 400; color: #98a2b3; font-size: 12px; margin-left: 4px; }
/* 新建派车：可添加的「柜量 × 柜型」分组 */
.cbx-block {
  border: 1px dashed #cbd5e1; border-radius: 10px;
  padding: 12px 12px 6px; margin-bottom: 16px; background: #fafbfd;
}
.cbx-head { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.cbx-head em { color: var(--danger); font-style: normal; }
.cbx-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.cbx-row .field { margin-bottom: 0; }
.cbx-row .field label { margin-bottom: 5px; }
.cbx-qty { flex: 0 0 120px; }
.cbx-ct { flex: 1; }
.cbx-del { flex-shrink: 0; margin-bottom: 2px; color: var(--danger); }
.cbx-total { font-size: 13px; color: var(--text-2); padding: 4px 0 8px; }
.cbx-total b { color: var(--primary); font-size: 15px; }

/* ============ 往来单位 ============ */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 2px; gap: 10px; }
.pager-info { font-size: 13px; color: var(--text-2); }
.pager-btns { display: flex; gap: 8px; }
.pager-btns .btn:disabled { opacity: .45; cursor: not-allowed; }
.tag-vip { background: #fef3c7; color: #b45309; }
.tag-signed { background: #e6f4ea; color: #188038; }

/* 编辑弹窗：分组表单 */
.p-group { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 4px; margin-bottom: 14px; }
.p-group-title { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 10px; }
.pg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.pg-grid .field.full { grid-column: 1 / -1; }
.pg-grid .field label { font-size: 12px; }
.pg-grid .field input, .pg-grid .field select, .pg-grid .field textarea { padding: 8px 10px; font-size: 13px; }
@media (max-width: 640px) { .pg-grid { grid-template-columns: 1fr; } }

/* 合同模板卡片 */
.tpl-card { margin-top: 4px; }
.tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tpl-head h3 { margin: 0; }
.tpl-src { font-size: 12px; color: var(--text-2); background: #f1f5f9; border-radius: 20px; padding: 3px 10px; }
.tpl-body { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; margin-top: 14px; }
@media (max-width: 900px) { .tpl-body { grid-template-columns: 1fr; } }
.tpl-cur { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.tpl-upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tpl-upload label.btn { display: inline-flex; align-items: center; cursor: pointer; }
.tpl-tip { font-size: 12px; color: #94a3b8; line-height: 1.6; margin: 8px 0; }
.tpl-tip code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; color: #475467; }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; max-height: 96px; overflow-y: auto; }
.tpl-chip {
  font-size: 12px; padding: 3px 8px; border-radius: 6px; cursor: pointer;
  background: #eef2ff; color: #3730a3; border: 1px solid #e0e7ff; user-select: none;
}
.tpl-chip:hover { background: #e0e7ff; }
.tpl-details summary { font-size: 13px; color: var(--primary); cursor: pointer; }
.tpl-preview {
  margin-top: 8px; max-height: 220px; overflow: auto; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 12px; line-height: 1.7; color: #475467; white-space: pre-wrap; font-family: inherit;
}
/* ---------- 合同模板编辑器（原文所见即所得） ---------- */
.tem-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 8px; padding: 7px 10px; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 10px;
}
.tt-group { display: inline-flex; align-items: center; gap: 6px; }
.tt-lab { font-size: 12px; color: var(--text-2); }
.tt-btn {
  min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: 7px; background: #fff; font-size: 13px; color: var(--text);
}
.tt-btn:hover { border-color: var(--primary); color: var(--primary); }
.tt-sel {
  height: 28px; padding: 0 6px; border: 1px solid var(--border);
  border-radius: 7px; background: #fff; font-size: 13px; color: var(--text);
}
.tt-sel.wide { min-width: 138px; }
.tt-hint { font-size: 12px; color: #98a2b3; margin-left: auto; white-space: nowrap; }
.tem-paper {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 26px 34px; max-height: 50vh; overflow-y: auto; outline: none;
  font-family: "Songti SC", "SimSun", "STSong", serif;
  font-size: 14px; line-height: 1.95; color: #111; text-align: justify;
}
.tem-paper:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 86, 219, .1); }
.tem-paper h1 { text-align: center; font-size: 1.7em; font-weight: 700; margin: 0 0 18px; }
.tem-paper h2 { font-size: 1.16em; font-weight: 700; margin: 16px 0 8px; }
.tem-paper p { margin: 0 0 9px; }
.tem-paper br { line-height: inherit; }
.tem-paper table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.tem-paper td, .tem-paper th { border: 1px solid #999; padding: 6px 8px; font-size: .9em; }
.tem-paper ul, .tem-paper ol { padding-left: 1.6em; margin: 0 0 9px; }
.tem-paper .tpl-ph, .tpl-ph-demo {
  background: #eef2ff; color: #3730a3; border: 1px dashed #c7d2fe;
  border-radius: 4px; padding: 0 4px; font-family: -apple-system, "PingFang SC", sans-serif;
  font-size: .88em; white-space: nowrap; user-select: none;
}
.tpl-ph-demo { user-select: auto; }

/* ---------- 合同中心：结算条件（票结 / 月结） ---------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-btn {
  padding: 8px 14px; font-size: 13px; background: #fff; border: 0; color: var(--text-2);
  border-right: 1px solid var(--border);
}
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { color: var(--primary); }
.seg-btn.on { background: var(--primary); color: #fff; font-weight: 600; }
.dock-field.settle-num input { min-width: 0; width: 92px; padding-right: 26px; }
.num-wrap { position: relative; display: inline-flex; align-items: center; }
.num-suf { position: absolute; right: 9px; font-size: 12px; color: var(--text-2); pointer-events: none; }
.dock-field.dim label { color: #b8c0cc; }
.dock-field.dim input { background: #f8fafc; color: #a9b1bd; }
.dock-field.dim .num-suf { color: #c3cad6; }
.dock-settle-hint { flex-basis: 100%; font-size: 12px; color: var(--text-2); margin: 4px 0 0; }
.dock-settle-hint b { color: var(--primary); }
.dock-bar.dock-locked .seg-btn, .dock-bar.dock-locked .settle-num { opacity: .45; pointer-events: none; }
.tpl-right { border-left: 1px dashed var(--border); padding-left: 18px; }
@media (max-width: 900px) { .tpl-right { border-left: none; padding-left: 0; border-top: 1px dashed var(--border); padding-top: 14px; } }
.tpl-export-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }

/* ============ 主应用布局 ============ */
.app-view { min-height: 100vh; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
}
.brand-logo { max-height: 34px; max-width: 170px; width: auto; height: auto; object-fit: contain; flex-shrink: 0; }
.topbar-title { font-weight: 600; font-size: 16px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.menu-toggle {
  background: none; border: none; font-size: 20px; color: var(--text);
  display: none; line-height: 1;
}

/* 登录页 logo（大图，随官网页头 Logo 同步） */
.login-logo-img { height: 168px; max-width: 230px; width: auto; object-fit: contain; margin-bottom: 6px; }

/* 登录身份分段选择 */
.seg-control { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-btn {
  flex: 1; padding: 10px 0; border: none; background: #f7f9fc; font-size: 13px; color: var(--text-2);
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn.active { background: var(--primary); color: #fff; }

.sidebar {
  position: fixed; top: 56px; bottom: 0; left: 0; width: var(--sidebar-w);
  background: #fff; border-right: 1px solid var(--border);
  padding: 16px 12px; display: flex; flex-direction: column; z-index: 40;
  transition: transform .2s;
  overflow-y: auto; /* 子目录展开后可滚动查看全部 */
}
.nav { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.nav-group { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.nav-group-title {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 4px; font-size: 12px; font-weight: 600;
  color: #98a2b3; letter-spacing: .5px;
}
.nav-item.nav-sub { padding-left: 28px; font-size: 13px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 8px; color: var(--text-2); font-size: 14px;
  transition: .15s;
}
.nav-item:hover { background: #f0f4ff; color: var(--primary); }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar-footer { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: #b0b8c4; text-align: center; flex-shrink: 0; }
.sidebar-mask {
  position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,.4); z-index: 35;
}

.main {
  margin-left: var(--sidebar-w); margin-top: 56px;
  padding: 24px; min-height: calc(100vh - 56px);
}

/* ---------- 页面通用 ---------- */
.page-title { font-size: 20px; margin-bottom: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .page-title { margin-bottom: 18px; }
.page-desc { font-size: 13px; color: var(--text-2); }
.head-acts { display: flex; align-items: center; gap: 8px; }
#page-site .page-desc { margin: -8px 0 16px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card h3 { font-size: 15px; margin-bottom: 14px; }

/* ---------- 看板统计 ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.stat-num { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-2); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart { width: 100%; height: auto; }

/* ---------- 表格 ---------- */
/* contain 把重排/重绘的影响范围限制在表格内部，列表刷新时不牵动整页布局 */
.table-wrap { overflow-x: auto; contain: layout style; }
table { width: 100%; border-collapse: collapse; min-width: 560px; table-layout: auto; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--text-2); font-weight: 500; background: #fafbfd; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: none; }
/* 第94批：完成状态（billConfirmed）订单整行灰字——状态徽标自有配色不受影响 */
#ord-tbody tr.ord-done > td { color: var(--text-2); }
body.theme-dark #ord-tbody tr.ord-done > td { color: #7c8798; }
/* 第95批：外部详情「状态」栏 = 状态文本 + 查看账单按钮 + 已更新徽标 */
.e-status-wrap { display: flex; align-items: center; gap: 8px; }
.e-status-wrap input { flex: 1 1 auto; min-width: 0; }
.e-status-wrap .op-btn { flex: 0 0 auto; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; text-align: center; }
.req-star { color: var(--danger); font-style: normal; }
.tag-published { background: #e6f4ea; color: var(--success); }
.tag-draft { background: #fef7e0; color: var(--warning); }
.tag-cat { background: #eef2f7; color: #475467; }
.tag-internal { background: #e8f0fe; color: #1a56db; }
.tag-external { background: #fce8e6; color: #c5221f; }
.tag-running { background: #e8f0fe; color: #1a73e8; }
.tag-done { background: #e6f4ea; color: var(--success); }
.tag-pending { background: #fef7e0; color: var(--warning); }
.tag-approved { background: #e6f4ea; color: var(--success); }
.tag-rejected { background: #fce8e6; color: var(--danger); }
.tag-checking { background: #fef7e0; color: var(--warning); }
.tag-out { background: #eef2f7; color: #475467; }
.tag-disabled { background: #fce8e6; color: var(--danger); }
.tag-active { background: #e6f4ea; color: var(--success); }

.op-btn { background: none; border: none; color: var(--primary); font-size: 13px; padding: 2px 6px; }
.op-btn.del { color: var(--danger); }
.op-btn:hover { text-decoration: underline; }

.meta-line { font-size: 12px; color: var(--warning); margin-top: 3px; }

/* ---------- 工具栏 / 分页 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { flex: 2; min-width: 180px; }
.toolbar select { flex: 1; min-width: 110px; width: auto; }
.pagination { display: flex; justify-content: flex-end; gap: 6px; padding-top: 14px; }
.pagination button {
  min-width: 32px; height: 32px; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; font-size: 13px;
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; cursor: default; }

/* ---------- 表单页 ---------- */
.form-card { max-width: 760px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------- 模块管理 ---------- */
.module-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
}
.module-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; transition: .15s;
}
.module-card.off { opacity: .55; }
.module-card .mod-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.module-card .mod-name { font-weight: 600; }
.module-card .mod-desc { font-size: 12px; color: var(--text-2); margin-bottom: 12px; min-height: 32px; }

.switch { position: relative; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: #cfd6e0; border-radius: 20px; cursor: pointer; transition: .2s;
}
.switch .track::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* ---------- 弹窗 / Toast ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 360px;
  box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.modal-box h3 { margin-bottom: 10px; }
.modal-box p { color: var(--text-2); margin-bottom: 20px; }

.toast {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 13px; z-index: 200; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.empty-tip { text-align: center; color: var(--text-2); padding: 30px 0; }

/* 批次号：只读（系统生成，不可编辑） */
.batch-ro { background: #f5f7fa; color: var(--text); cursor: not-allowed; letter-spacing: .5px; font-weight: 600; }
.batch-cell { cursor: copy; border-bottom: 1px dashed #c3cdd9; }
.batch-cell:hover { color: var(--primary); }

/* 仓库列表：单元格上下多行结构，整格垂直居中 */
#page-warehouse tbody td { white-space: nowrap; vertical-align: middle; padding-top: 9px; padding-bottom: 9px; }
.wh-stack { display: flex; flex-direction: column; justify-content: center; gap: 2px; line-height: 1.4; }
.wh-stack .l1 { font-weight: 600; color: #1f2733; }
.wh-stack .l2 { font-size: 12px; color: #8a94a6; }
.wh-stack .l2-out { color: #d93025; }

/* 库位：字母（区）+ 数字（号）双下拉 */
.loc-pair { display: flex; align-items: center; gap: 6px; }
.loc-pair select { flex: 1; min-width: 0; }
.loc-pair .loc-sep { color: #8a94a6; font-weight: 600; }
.sub-inline { font-size: 12px; color: #8a94a6; margin-left: 6px; }
.sub-inline b { color: inherit; }

/* 新建订单 · 委托客户选择弹窗 */
#partner-modal { z-index: 120; } /* 从客户选择弹窗新增往来单位时，浮于其上 */

/* 箱量 × 箱型 小控件（订单表单右栏）· 宽度随内容自适应（JS 按字符测量写入 width） */
.ctn-pair { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctn-pair input { flex: 0 0 auto; width: 5ch; min-width: 0; }
.ctn-pair .ctn-x { color: #8a94a6; font-weight: 600; }
.ctn-pair select { flex: 0 0 auto; min-width: 0; }
.ctn-pair .mini-btn { white-space: nowrap; }
/* 新建订舱：航次港口子卡片（起运港/目的港/ETD/箱量/箱型一行五列 + 船名航次一行） */
.extbk-sub { border: 1px solid var(--line, #e3e8ef); border-radius: 10px; padding: 12px 14px 4px; margin-bottom: 12px; }
.extbk-voy { display: grid; grid-template-columns: 1.2fr 1.2fr 1.1fr 0.7fr 0.7fr; gap: 12px; margin-bottom: 12px; }
.extbk-voy select { width: 100%; }
/* 第86批：起运港/目的港一行与收发货人等高——字段纵向铺满、输入框贴底对齐 */
.extbk-voy .field, .extbk-ship .field { display: flex; flex-direction: column; justify-content: flex-end; min-height: 100%; }
.extbk-voy .field input, .extbk-voy .field select { margin-top: auto; }
.extbk-ship .field input { margin-top: auto; }
/* 新建订舱：唛头（窄高）+ 货物描述（窄高）+ 件数/包装/毛重/体积（2 行 2 列，货物描述右侧） */
.extbk-cargo { display: grid; grid-template-columns: 0.55fr 1.4fr 1fr; gap: 12px; align-items: stretch; margin-bottom: 4px; } /* 第86批：stretch 让右侧列与货物描述等高 */
.extbk-qtys { display: grid; gap: 12px; align-content: space-between; } /* 第86批：内容纵向分布铺满，与货物描述等高 */
.extbk-qtys .grid2 { gap: 12px; }
.extbk-cargo textarea { min-height: 168px; resize: vertical; }
/* 第86批：唛头/货物描述列 flex 拉伸，与件数~货物性质列严格等高（去掉 .field 底部外边距，否则拉伸后差 16px） */
.extbk-cargo .field { display: flex; flex-direction: column; margin-bottom: 0; }
.extbk-cargo .field textarea { flex: 1 1 auto; }
/* 第87批：件数/包装（含毛重/体积）标签与唛头/货物描述标签同行高（30px），输入框顶边与货物描述框顶边对齐；货物性质位置不变，整体保持等高 */
.extbk-qtys .field label { display: flex; align-items: center; min-height: 30px; white-space: nowrap; margin-bottom: 6px; }
.extbk-marks label, .extbk-goods label { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; white-space: nowrap; } /* 第85批：标签等高(30px=N/M按钮高)不折行，唛头与货物描述上边框对齐 */
/* 第85批：船名 1/4 · 航次 1/4 · 靠左（原各占一半） */
.extbk-ship { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.extbk-ship .field { min-width: 0; }
/* 第85批：货物性质标记（危险品 / 冷冻柜 · 互斥单选，同 SI 编辑器口径） */
.extbk-cmark { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.extbk-cmark-label { font-size: 12.5px; color: var(--text-2, #6b7280); font-weight: 600; }
.cmark-btn { border: 1px solid var(--border, #dbe2ea); background: var(--card, #fff); color: var(--text, #1f2937); border-radius: 999px; padding: 5px 14px; font-size: 12.5px; cursor: pointer; transition: all .15s; }
.cmark-btn:hover { border-color: var(--primary, #1a56db); color: var(--primary, #1a56db); }
.cmark-btn.on { background: var(--primary, #1a56db); border-color: var(--primary, #1a56db); color: #fff; font-weight: 600; }
.extbk-cmark-tag { font-size: 12px; color: #b45309; background: #fff8e6; border: 1px solid #f3d48a; border-radius: 999px; padding: 3px 10px; }
.ext-mark-box { width: min(520px, 94vw); }
.ext-mark-temp { display: flex; align-items: center; gap: 8px; }
.ext-mark-temp .seg { display: inline-flex; }
.ext-mark-temp input { width: 90px; }
.ext-mark-deg { color: var(--text-2, #6b7280); font-size: 13px; }
/* 第85批：订舱申请除起运港/目的港外英文大写输入 */
.ext-upper { text-transform: uppercase; }
@media (max-width: 900px) { .extbk-cargo, .extbk-voy, .extbk-ship { grid-template-columns: 1fr; } }
.oc-search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.oc-search-row input { flex: 1; }
.oc-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line, #e3e8ef); border-radius: 10px; }
.oc-row { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line, #eef1f5); }
.oc-row:last-child { border-bottom: 0; }
.oc-row:hover { background: #f0f5ff; }
.oc-row strong { font-size: 14px; }
.oc-sub { display: block; font-size: 12px; color: #8a94a6; margin-top: 2px; }
.oc-empty { padding: 22px 14px; text-align: center; color: #8a94a6; font-size: 13px; }
.oc-reg { font-style: normal; color: #188038; font-weight: 600; }

/* ---------- 订单编辑页「客户」栏：模糊搜索下拉 ---------- */
/* 输入框宽度 = 原来的 3/5；提示内容（cust-ac-msg）同行显示在输入框后面 */
.cust-ac { position: relative; flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.bl-metabar .mb-item.grow .cust-ac > input, .cust-ac > input { flex: 0 1 60%; width: 60%; min-width: 0; }
.cust-ac-panel {
  position: absolute; left: 0; width: 60%; top: calc(100% + 4px); z-index: 60;
  max-height: 300px; overflow-y: auto; background: #fff;
  border: 1px solid var(--line, #e3e8ef); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .14);
}
.cust-ac-hint { padding: 9px 14px; font-size: 12px; color: #8a94a6; border-bottom: 1px solid #eef1f5; }
.cust-ac-row { padding: 9px 14px; cursor: pointer; border-bottom: 1px solid #eef1f5; display: flex; align-items: baseline; gap: 8px; }
.cust-ac-row:last-child { border-bottom: 0; }
.cust-ac-row:hover { background: #f0f5ff; }
.cust-ac-name { font-size: 13.5px; font-weight: 600; color: #1f2733; }
.cust-ac-meta { font-size: 12px; color: #8a94a6; }
.cust-ac-reg { margin-left: auto; font-size: 11.5px; color: #188038; background: #e7f6ec; border-radius: 20px; padding: 1px 8px; }
.cust-ac-empty { padding: 16px 14px 10px; text-align: center; color: #8a94a6; font-size: 13px; }
.cust-ac-new {
  display: block; margin: 0 auto 14px; padding: 7px 16px; font-size: 13px; cursor: pointer;
  color: var(--primary, #1a56db); background: #f0f5ff; border: 1px dashed #9db8f5; border-radius: 8px;
}
.cust-ac-new:hover { background: #e3edff; }
.cust-ac-msg { flex: 1 1 200px; min-width: 0; font-size: 12px; line-height: 1.5; }
.cust-ac-msg.warn { color: #b06000; }
/* 订单列表两行式单元格：上行主信息，下行次信息 */
.cell-2l { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.cell-2l .l1 { font-weight: 600; color: #1f2733; }
.cell-2l .l2 { font-size: 12px; color: #8a94a6; min-height: 1em; }
.cell-2l .l3 { font-size: 12px; color: #1a56db; }

/* 订单列表：多选列 + 操作下拉 */
.sel-col { width: 34px; text-align: center; }
.sel-col input { width: 15px; height: 15px; cursor: pointer; }
.opmenu { position: relative; }
/* 第131批：订单管理工具栏的「⚙ 操作」入口按要求隐藏（元素与逻辑保留，去掉 hidden 即可恢复） */
.opmenu[hidden] { display: none !important; }
/* 第131批：服务器上一单都没有而本机有订单时的显式恢复入口（服务器重装 / 手工删库后整本上传） */
.ord-sync-up {
  margin-left: 6px; padding: 0 7px; font-size: 11px; line-height: 18px; font-style: normal;
  font-weight: 600; color: #1a56db; background: #fff; border: 1px solid var(--border, #e3e8ef);
  border-radius: 4px; cursor: pointer; vertical-align: 1px;
}
.ord-sync-up:hover { border-color: #1a56db; background: #f0f5ff; }
.opmenu-list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  background: #fff; border: 1px solid var(--border, #e3e8ef); border-radius: 10px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .14); padding: 6px; min-width: 176px;
}
.opmenu-list button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0;
  background: transparent; border-radius: 7px; font-size: 13px; font-family: inherit; color: #1f2733; cursor: pointer;
}
.opmenu-list button:hover { background: #f0f5ff; color: #1a56db; }
.sel-count { align-self: center; font-size: 12px; color: #1a56db; background: #eaf1ff; border-radius: 20px; padding: 4px 10px; }
.ob-fields .field { margin-bottom: 14px; }
.ob-tip { font-size: 12px; color: #8a94a6; margin-bottom: 14px; }

/* ============ 订单管理 / 提单（BILL OF LADING）页面 ============ */
.form-actions { display: flex; gap: 8px; align-items: center; }
.bl-metabar { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bl-metabar .meta-lab { font-size: 12px; color: #66707d; margin-right: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

/* —— 提单关系方（左一列三行）＋ 航次与港口（右 4×2）左右等高 —— */
.bl-cols { display: flex; gap: 20px; align-items: stretch; }
.bl-cols .field { margin-bottom: 0; }
.bl-party { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.bl-party .field { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.bl-party .field textarea { flex: 1 1 auto; min-height: 72px; resize: vertical; }
.bl-voy { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; align-content: space-between; gap: 12px 16px; }
.bl-voy-ph { visibility: hidden; }
@media (max-width: 900px) {
  .bl-cols { flex-direction: column; }
  .bl-voy { grid-template-columns: 1fr; }
  .bl-voy-ph { display: none; }
}

/* 字段标签内的小按钮（同装货港 / 同卸货港） */
.mini-btn {
  margin-left: 8px; padding: 1px 8px; font-size: 11px; line-height: 1.5; font-family: inherit;
  color: var(--primary, #2563eb); background: #eef4ff; border: 1px solid #c9dcff;
  border-radius: 6px; cursor: pointer; font-weight: 600; vertical-align: 1px; transition: all .15s;
}
.mini-btn:hover { background: #dbe8ff; border-color: #9cc0ff; }
.mini-btn:active { transform: translateY(1px); }

/* —— 货物信息四列：唛头/箱数窄，货物描述宽，毛重与体积上下 —— */
/* 网格命名区域：l=标签行，t=输入行；m=唛头 p=件数 g=货描 w=毛重/体积 */
.cargo-grid4 {
  display: grid;
  grid-template-columns: .88fr .88fr 2.4fr 1.15fr;
  grid-template-areas:
    "lm lp lg lw"
    "tm tp tg tw";
  gap: 8px 16px;
}
.cargo-grid4 > *:nth-child(1) { grid-area: lm; }
.cargo-grid4 > *:nth-child(2) { grid-area: lp; }
.cargo-grid4 > *:nth-child(3) { grid-area: lg; }
.cargo-grid4 > *:nth-child(4) { grid-area: lw; }
.cargo-grid4 > *:nth-child(5) { grid-area: tm; }
.cargo-grid4 > *:nth-child(6) { grid-area: tp; }
.cargo-grid4 > *:nth-child(7) { grid-area: tg; }
.cargo-grid4 > *:nth-child(8) { grid-area: tw; }
.cg-lab {
  font-size: 13px; color: var(--text-2, #66707d); line-height: 1.35;
  min-height: 44px; display: block;
}
.cg-lab em { display: block; font-style: normal; font-size: 11px; color: #9aa4b2; margin-top: 2px; }
.cargo-grid4 textarea { height: 100%; min-height: 88px; resize: vertical; }
.cargo-wm { display: flex; flex-direction: column; gap: 10px; }
.cargo-wm input { width: 100%; }
@media (max-width: 900px) {
  .cargo-grid4 {
    grid-template-columns: 1fr;
    grid-template-areas: "lm" "tm" "lp" "tp" "lg" "tg" "lw" "tw";
    gap: 6px 0;
  }
  .cg-lab { min-height: 0; margin-top: 6px; }
  .cargo-grid4 textarea { min-height: 72px; }
  .cargo-wm { flex-direction: row; }
}
@media (max-width: 900px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
.dt-pair { display: flex; gap: 8px; }
.dt-pair select { width: 110px; flex-shrink: 0; }
.ord-note { font-size: 12px; color: #8a94a6; padding: 8px 0; line-height: 1.7; }
.bl-note { font-size: 10px; font-style: italic; font-weight: 600; color: #8a94a6; }
.file-btn { position: relative; cursor: pointer; }

/* 订单页 Tab */
.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid var(--border, #e3e8ef); margin-bottom: 16px; }
.tab-btn { border: none; background: transparent; padding: 10px 18px; font-size: 14px; font-weight: 600; color: #66707d; cursor: pointer; border-radius: 8px 8px 0 0; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn:hover { color: var(--primary); background: #f0f4f9; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }

/* 费用页 P/C、O/R/S 选项芯片 */
.opt-row { display: flex; gap: 8px; flex-wrap: wrap; }
.opt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1.5px solid var(--border, #d8dee7); border-radius: 8px; font-size: 13px; cursor: pointer; background: #f8fafc; transition: all .15s; }
.opt-chip:hover { border-color: var(--primary); }
.opt-chip input { accent-color: var(--primary); }
.opt-chip:has(input:checked) { border-color: var(--primary); background: #e8f0fe; font-weight: 600; }
.opt-chip b { color: var(--primary); }

/* 预览弹窗 */
.pv-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pv-head h3 { margin: 0; }
.pv-head-actions { display: flex; align-items: center; gap: 8px; }
.pv-head-actions select { min-width: 140px; }
.pv-body { background: #e9edf2; border-radius: 10px; padding: 20px; overflow: auto; max-height: 62vh; display: flex; justify-content: center; }
/* 上传模版 PDF 预览（pdf.js 画布渲染） */
.pv-pages { width: 100%; max-height: 62vh; overflow: auto; background: #e9edf2; border-radius: 8px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pv-page-cv { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); max-width: 100%; height: auto; }
.pv-busy { padding: 70px 0; color: #66708a; font-size: 14px; }
.pv-foot { margin-top: 12px; }
.pv-tip { font-size: 12px; color: #8a94a6; margin-left: auto; }

/* 提单纸张（预览 / 导出用） */
.bl-paper {
  background: #fff; width: 800px; max-width: 100%; flex-shrink: 0;
  padding: 34px 38px 26px; box-shadow: 0 4px 18px rgba(0, 0, 0, .14);
  color: #1c1c1c; font-family: Arial, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 13px; line-height: 1.45;
}
.bl-logo { font-size: 28px; font-weight: 800; font-style: italic; letter-spacing: -1px; color: #111; }
.bl-head { display: grid; grid-template-columns: 1.05fr 1fr; gap: 0 28px; }
.bl-head-l .bl-f { margin-top: 12px; }
.bl-lab { font-weight: 700; font-size: 11px; color: #222; display: inline-block; margin-bottom: 2px; }
.bl-note { font-size: 9px; font-style: italic; font-weight: 700; color: #333; margin-left: 8px; }
.bl-val { min-height: 18px; border-bottom: 1px solid #999; padding-bottom: 2px; word-break: break-all; }
.bl-head-r { text-align: right; }
.bl-title { font-size: 28px; font-weight: 800; letter-spacing: 1px; color: #5a5a5a; }
.bl-blno-box { border: 2px solid #333; padding: 8px 10px 6px; margin-top: 12px; text-align: left; }
.bl-copy { font-size: 21px; font-weight: 800; color: #444; font-family: Georgia, "Times New Roman", serif; margin-top: 14px; line-height: 1.25; }
.bl-ports { margin-top: 20px; border-top: 1px solid #666; border-bottom: 1px solid #666; }
.bl-ports-row3 { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr; gap: 0 18px; padding: 9px 0; border-bottom: 1px solid #666; }
.bl-ports-row2 { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr; gap: 0 18px; padding: 9px 0; }
.bl-cargo { display: grid; grid-template-columns: 29% 13% 38% 20%; border: 2px solid #333; margin-top: 16px; position: relative; }
.bl-cc { padding: 8px 10px; border-left: 1px dashed #888; min-height: 150px; }
.bl-cc.bl-c1 { border-left: 0; padding-left: 28px; }
.bl-vert { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; font-size: 9px; color: #555; letter-spacing: 1px; white-space: nowrap; }
.bl-w { margin-top: 10px; display: flex; align-items: baseline; gap: 6px; }
.bl-w .bl-val { flex: 1; }
.bl-unit { font-size: 12px; color: #333; }
.bl-bordert { border-top: 1px solid #333; }
.bl-grid4 { display: grid; grid-template-columns: 1.2fr .8fr 1fr 1.6fr; gap: 0 14px; padding: 10px 0; }
.bl-arr { padding: 12px 2px; font-size: 12px; }
.bl-foot { display: grid; grid-template-columns: 1fr 1.8fr; gap: 0 20px; padding: 10px 0 2px; align-items: end; }
.bl-agent { font-size: 12px; line-height: 1.55; }

/* 用户管理：可用板块勾选 */
/* 可用板块：两组选框（网站 / 功能，点击变蓝=可用） */
.mods-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 6px; }
.mods-grid .mod-check {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1.2; cursor: pointer;
  padding: 4px 3px; border-radius: 8px; min-width: 0;
  background: #f3f5f8; border: 1px solid transparent; color: #66707d;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  user-select: none; text-align: center;
}
.mods-grid .mod-check span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mods-grid .mod-check:hover { border-color: var(--primary); color: var(--primary); }
.mods-grid .mod-check input { display: none; }
.mods-grid .mod-check:has(input:checked) {
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 1px 4px rgba(37, 99, 235, .28);
}
.mods-grid .mod-check:has(input:disabled) { cursor: default; }
.mods-grid .mod-check:has(input:disabled:checked) { background: var(--primary); color: #fff; }
/* 可用板块：两组常驻展开（组头勾选 = 全选该组；官网管理组仅管理员可见） */
.mods-grid .mod-group { display: flex; flex-direction: column; gap: 5px; grid-column: 1 / -1; }
.mods-grid .mod-subs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 5px; padding: 2px 0; }
.mods-grid .mod-check.sub { padding: 3px 2px; font-size: 11px; }

/* 仓库：危险类别两行标签选择 */
.dg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.dg-tag {
  font-size: 12px; padding: 6px 2px; text-align: center; cursor: pointer;
  border-radius: 8px; background: #f3f5f8; border: 1px solid transparent; color: #66707d;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  user-select: none; white-space: nowrap;
}
.dg-tag:hover { border-color: var(--primary); color: var(--primary); }
.dg-tag.on {
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 1px 4px rgba(37, 99, 235, .28);
}
/* 用户编辑：只能查看自己的订单 勾选行 */
.chk-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; margin: 0; }
.chk-line input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* 登录页：记住密码 + 找回密码辅助行 */
.login-aux { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 10px; }
.login-aux .chk-line { font-size: 12px; }
.login-aux a { font-size: 12px; color: var(--primary); text-decoration: none; }
.login-aux a:hover { text-decoration: underline; }
/* 找回密码：主按钮（获取验证码/重置密码）与返回登录上下排列，间距分开不重合 */
.btn-stack { margin-top: 10px; }
/* 登录页 Logo：以黑色「冷特危」文字块为参照水平居中（图形整体右移 4.4%） */
.login-logo-img { transform: translateX(4.4%); }

/* 用户管理：身份/权限/状态列按内容自适应宽度 */
#page-users th.col-fit, #page-users td:nth-child(2), #page-users td:nth-child(3), #page-users td:nth-child(6) { width: 1%; white-space: nowrap; }
/* 身份 / 状态列进一步收窄：单元格与标签内边距压缩 */
#page-users th:nth-child(2), #page-users td:nth-child(2),
#page-users th:nth-child(6), #page-users td:nth-child(6) { padding-left: 6px; padding-right: 6px; }
#page-users td:nth-child(2) .tag, #page-users td:nth-child(6) .tag { padding-left: 7px; padding-right: 7px; }
/* 权限列加宽 */
#page-users th:nth-child(3), #page-users td:nth-child(3) { min-width: 108px; }

/* 弹窗字段行：label 内的小字提示不换行，保证下方输入框与同行其他字段对齐 */
.field-row .field > label { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.field-row .field > label .fld-tip {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* 侧边栏用户管理徽标（待审申请数） */
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger, #e5484d); color: #fff;
  font-size: 11px; font-weight: 700; font-style: normal; line-height: 18px; text-align: center;
}

/* 用户弹窗加宽以容纳 4 列板块选框 */
#user-modal .modal-box { max-width: 460px; }

/* 往来单位重复检测 / 合并 */
/* 弹窗高度自适应内容（与往来单位编辑窗共用 xl 结构，但不需要固定 92vh） */
#dup-modal .modal-box.xl { height: auto; min-height: 0; }
#dup-modal .xl-body { padding: 14px 24px 18px; }
/* 检测结果反馈栏：浅红信息条，与标题/底栏左右对齐 */
.dup-sub {
  background: #fef4f3; border: 1px solid #fadbd8; border-radius: 10px;
  padding: 10px 14px; margin: 0 0 14px;
  font-size: 13px; line-height: 1.7; color: #6b4a47;
}
.dup-sub b { color: #d93025; }
.dup-list { max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
/* 底部操作栏：右对齐、与内容区同宽栅格 */
#dup-modal .dup-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.dup-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fafbfc; }
.dup-card-head { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; color: #b3261e; }
.dup-row { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; flex-wrap: wrap; }
.dup-row:hover { background: #eef3fa; }
/* 用 dup-main 避开全局 .main（主内容区）的类名冲突，否则选中行会被撑成 894px 高 */
.dup-row.dup-main { background: #e8f0fe; }
.dup-row input { accent-color: var(--primary); flex-shrink: 0; }
.dup-name { font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.dup-meta { font-size: 12px; color: #77808e; }
.dup-card-actions { margin-top: 6px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.tag-dup { background: #fde8e8; color: #b3261e; }

/* 订单文件页：套打导出 */
.of-grid { display: grid; grid-template-columns: 180px 1fr; gap: 0 18px; align-items: start; }
.of-pages { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 8px 0 2px; }
.of-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; }
#of-anchor-json { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fafbfd; }
@media (max-width: 900px) { .of-grid { grid-template-columns: 1fr; } }

/* 权限：可查看（只读）账号隐藏全部操作与新增按钮 */
body.perm-view .op-btn { display: none !important; }
body.perm-view .perm-hide { display: none !important; }
body.perm-view .op-btn + .empty-hint { display: inline; }

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 30px rgba(0,0,0,.15); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-num { font-size: 20px; }
  .field-row { flex-direction: column; gap: 0; }
  .cbx-row { flex-wrap: wrap; }
  .cbx-qty { flex: 1 1 90px; }
  .cbx-ct { flex: 1 1 150px; }
  .user-chip span { display: none; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .login-card { padding: 30px 24px; }
}

/* ============ 派车管理 v5 ============ */
@media (max-width: 1180px) { .hide-md { display: none; } }
.op-btn:disabled { color: #b0b8c4; cursor: not-allowed; text-decoration: none; }
.op-btn.del:disabled { color: #b0b8c4; }

.tag-wait { background: #eef2f7; color: #475467; }
.tag-picked { background: #fef7e0; color: #b45309; }
.tag-partial { background: #fce8e6; color: #d93025; font-weight: 600; }
.part-note { font-size: 11px; color: #d93025; margin-top: 3px; }

.cell-main { font-weight: 600; }
.kv-sub { font-size: 12px; color: #98a2b3; margin-top: 2px; }
.vline { font-size: 12px; line-height: 1.7; color: #475467; }
.cno-cell { color: var(--primary); cursor: pointer; border-bottom: 1px dashed rgba(26, 86, 219, .55); padding-bottom: 1px; user-select: none; }
.cno-empty { color: #b0b8c4; }

/* 箱号悬浮提示 */
.box-tip {
  position: fixed; z-index: 400; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
  padding: 10px 12px; font-size: 12px; color: var(--text);
  pointer-events: auto; max-width: 240px;
}
.box-tip::before {
  content: ""; position: absolute; top: -6px; left: 18px;
  width: 12px; height: 12px; background: #fff;
  border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.tip-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; }
.tip-row + .tip-row { border-top: 1px dashed #eef1f5; }
.tip-copy {
  border: 1px solid #d4def5; background: #f5f8ff; color: var(--primary);
  font-size: 11px; border-radius: 5px; padding: 2px 8px; flex-shrink: 0;
}
.tip-copy:hover { background: #e8f0fe; }

/* 车队端页签 */
.fleet-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ftab {
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  padding: 8px 16px; border-radius: 8px; font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.ftab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.badge {
  background: var(--danger); color: #fff; font-size: 11px; min-width: 18px; height: 18px;
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.ftab.active .badge { background: rgba(255, 255, 255, .25); }
.audit-note { font-size: 12px; color: var(--text-2); background: #f8faff; border: 1px dashed #cdd9f3; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }

/* 弹窗扩展宽度 */
.modal-box.wide { max-width: 680px; max-height: 88vh; overflow-y: auto; }
.modal-box.view-wide { max-width: min(880px, 94vw); width: min(880px, 94vw); }
.tvm-frame { width: 100%; height: 66vh; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* ---------- 侧边栏分组折叠 ---------- */
.nav-group-title { cursor: pointer; user-select: none; justify-content: space-between; }
.nav-caret { font-style: normal; font-size: 10px; transition: transform .15s; }
.nav-group:not(.open) .nav-caret { transform: rotate(-90deg); }
.nav-group:not(.open) .nav-sub { display: none; }

/* ---------- 合同中心 · 固定页面底部 ---------- */
.tpl-dock {
  position: sticky; bottom: 12px; z-index: 30;
  background: rgba(255, 255, 255, .97);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 -8px 28px rgba(15, 23, 42, .12), 0 6px 24px rgba(15, 23, 42, .06);
  padding: 12px 16px; margin-top: 16px;
}
.dock-bar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.dock-title { font-weight: 700; font-size: 15px; padding-bottom: 9px; white-space: nowrap; }
.dock-field { display: flex; flex-direction: column; gap: 4px; }
.dock-field label { font-size: 12px; color: var(--text-2); }
.dock-field input, .dock-field select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: #fff; min-width: 130px;
}
.dock-field.grow { flex: 1; min-width: 180px; }
.dock-field.grow input { width: 100%; }
.dock-bar .btn { margin-bottom: 1px; }
.dock-panel { border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 14px; }
.dock-cols { display: flex; gap: 24px; }
.dock-col { flex: 1; min-width: 0; }
.dock-col h4 { font-size: 14px; margin-bottom: 10px; }
.tpl-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; font-size: 13px;
}
.tpl-row .tr-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-row .tr-src { color: #98a2b3; font-size: 12px; }
.tpl-row .tr-ops { white-space: nowrap; }
.tpl-def { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.seal-row { display: flex; gap: 16px; align-items: flex-start; }
#seal-img {
  width: 100px; height: 97px; object-fit: contain; flex-shrink: 0;
  border: 1px dashed var(--border); border-radius: 10px; background: #fafafa; padding: 4px;
}
.seal-ops { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ---------- PDF 渲染舞台（离屏） ---------- */
#pdf-stage {
  position: fixed; left: -9999px; top: 0; width: 794px;
  background: #fff; color: #1a1a1a;
  font-family: "Songti SC", "SimSun", "STSong", serif;
  font-size: 15px; line-height: 1.9; padding: 0 54px;
}
#pdf-stage h1 { text-align: center; font-size: 1.6em; font-weight: 700; margin: 0 0 18px; }
#pdf-stage h2 { font-size: 1.13em; font-weight: 700; margin: 16px 0 8px; }
#pdf-stage p { margin: 0 0 9px; text-align: justify; }
#pdf-stage table { width: 100%; border-collapse: collapse; margin: 10px 0; }
#pdf-stage td, #pdf-stage th { border: 1px solid #999; padding: 6px 8px; font-size: .9em; }
#pdf-stage .pdf-foot {
  margin-top: 30px; padding-top: 10px; border-top: 1px solid #bbb;
  color: #2f2f2f; font-size: .86em; font-weight: 600; text-align: center; letter-spacing: .5px;
}
/* 每页页脚条（离屏渲染成图片后贴到每页底部，中文清晰、页码精确） */
.pdf-footer-strip {
  position: fixed; left: -9999px; top: 0; width: 794px; height: 56px; box-sizing: border-box;
  background: transparent; color: #333; font-family: "Songti SC", "SimSun", "STSong", serif;
  font-size: 13px; line-height: 1; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 54px 13px;
}
.pdf-footer-strip .pf-rule { position: absolute; left: 54px; right: 54px; top: 8px; border-top: 1px solid #c4c4c4; }
.pdf-footer-strip span { letter-spacing: .5px; white-space: nowrap; }
.pdf-footer-strip .pf-company { font-weight: 600; color: #1f1f1f; }
.pdf-footer-strip .pf-page { color: #444; }
.pdf-footer-strip .pf-seal-slot { width: 128px; }
@media (max-width: 900px) {
  .dock-cols { flex-direction: column; }
  .dock-bar { align-items: stretch; }
  .dock-title { padding-bottom: 0; }
}

/* 往来单位编辑大窗口：标题栏/操作栏固定，中间内容滚动 */
.modal-box.xl {
  max-width: min(1080px, 96vw); width: min(1080px, 96vw);
  height: 92vh; max-height: 92vh;
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
.modal-box.xl > h3 {
  margin: 0; padding: 16px 24px 14px; flex-shrink: 0;
  border-bottom: 1px solid var(--border); font-size: 17px;
}
.modal-box.xl .xl-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-box.xl .xl-body { flex: 1; overflow-y: auto; padding: 16px 24px 20px; }
.modal-box.xl .xl-foot {
  margin: 0; padding: 13px 24px; flex-shrink: 0;
  border-top: 1px solid var(--border); background: #f8fafc;
  border-radius: 0 0 14px 14px;
}
@media (min-width: 900px) {
  .modal-box.xl .pg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
}
.modal-box.xl .p-group { padding: 14px 16px 6px; margin-bottom: 14px; }
.modal-box.xl .pg-grid .field { margin-bottom: 14px; }
.modal-box.xl .pg-grid .field label { font-size: 13px; margin-bottom: 6px; }
.modal-box.xl .pg-grid .field input,
.modal-box.xl .pg-grid .field select,
.modal-box.xl .pg-grid .field textarea { padding: 10px 12px; font-size: 14px; }
/* 分组可折叠 */
.p-group summary {
  display: flex; align-items: center; cursor: pointer;
  list-style: none; user-select: none;
}
.p-group summary::-webkit-details-marker { display: none; }
.p-group summary::after { content: "▾"; margin-left: auto; color: #98a2b3; font-size: 12px; }
.p-group:not([open]) summary::after { content: "▸"; }
.pg-count { font-size: 12px; color: #98a2b3; font-weight: 400; margin-left: 10px; }
.modal-box.mid { max-width: 540px; }
.modal-meta {
  font-size: 13px; color: #475467; background: #f4f6fa;
  padding: 10px 12px; border-radius: 8px; line-height: 1.7; margin-bottom: 14px;
}

/* 每柜编辑/提箱行 */
.container-row { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.container-row.off-row { background: #fffaf7; border-style: dashed; }
.cr-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.cr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cr-grid.two { grid-template-columns: repeat(2, 1fr); }
.cr-grid .field { margin-bottom: 0; }
.cr-grid .field input { font-size: 13px; padding: 8px 10px; }
.fe-hint { font-size: 12px; color: #98a2b3; margin: 4px 0 14px; }
@media (max-width: 560px) {
  .cr-grid, .cr-grid.two { grid-template-columns: 1fr; gap: 8px; }
  .cr-grid .field { margin-bottom: 6px; }
}

/* 详情只读 */
.kv-line { display: flex; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed #eef1f5; }
.kv-k { width: 96px; color: #98a2b3; flex-shrink: 0; }
.kv-v { flex: 1; color: var(--text); word-break: break-all; }
table.kv-tbl { min-width: 0; margin-top: 4px; }
table.kv-tbl th, table.kv-tbl td { padding: 7px 10px; font-size: 13px; }

/* ============ 文件页：我的提单模版 + 锚点可视化编辑器 ============ */
.ct-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ct-list { display: flex; flex-direction: column; gap: 8px; }
.ct-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border, #e3e8ef); border-radius: 10px; background: #fafbfd;
}
.ct-item .ct-info { min-width: 0; }
.ct-item .ct-info strong { display: block; font-size: 14px; }
.ct-item .ct-info .sub-inline { color: #98a2b3; font-size: 12px; }
.ct-item .ct-acts { white-space: nowrap; }
.ct-item .ct-acts .op-btn { margin-left: 6px; }
.ct-empty { color: #98a2b3; font-size: 13px; padding: 14px; text-align: center; border: 1px dashed var(--border, #e3e8ef); border-radius: 10px; }

/* 锚点编辑器弹窗 */
.ae-box {
  max-width: min(1280px, 97vw); width: min(1280px, 97vw); height: min(92vh, 940px);
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
.ae-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border, #e3e8ef); }
.ae-head h3 { margin: 0; font-size: 16px; }
.ae-head-actions { display: flex; align-items: center; gap: 10px; }
.ae-body { flex: 1; display: flex; min-height: 0; }
.ae-side { width: 252px; flex-shrink: 0; border-right: 1px solid var(--border, #e3e8ef); overflow-y: auto; padding: 12px; }
.ae-prop { border: 1px solid var(--border, #e3e8ef); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: #fafbfd; min-height: 46px; }
.ae-prop .ae-p-name { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.ae-prop .ae-p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; align-items: center; font-size: 12px; }
.ae-prop input, .ae-prop select { width: 100%; padding: 4px 6px; font-size: 12px; }
.ae-side-lab { font-size: 12px; color: #66707d; margin: 4px 0 8px; line-height: 1.5; }
.ae-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-field-chip {
  font-size: 12px; padding: 4px 9px; border: 1px solid var(--border, #d8dee7); border-radius: 999px;
  background: #f8fafc; cursor: pointer; color: #333f4e; transition: all .15s;
}
.ae-field-chip:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.ae-field-chip.on { background: #e8f0fe; border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); font-weight: 600; }
.ae-stage-wrap { flex: 1; overflow: auto; background: #4b5057; padding: 18px; display: flex; justify-content: center; align-items: flex-start; }
.ae-stage { position: relative; box-shadow: 0 6px 28px rgba(0, 0, 0, .45); background: #fff; flex-shrink: 0; }
.ae-stage canvas { display: block; }
.ae-layer { position: absolute; inset: 0; touch-action: none; }
.ae-box {
  position: absolute; border: 1.5px dashed rgba(220, 38, 38, .85); background: rgba(220, 38, 38, .07);
  cursor: move; overflow: visible; user-select: none;
}
.ae-box .ae-box-lab {
  position: absolute; left: 0; top: -16px; font-size: 10px; line-height: 14px; white-space: nowrap;
  color: #fff; background: rgba(190, 30, 30, .82); border-radius: 3px; padding: 0 5px; pointer-events: none;
}
.ae-box .ae-box-fill { position: absolute; inset: 0; pointer-events: none; }
.ae-box.sel { border-color: #2563eb; border-style: solid; background: rgba(37, 99, 235, .10); z-index: 5; }
.ae-box.sel .ae-box-lab { background: rgba(37, 99, 235, .9); }
.ae-grip {
  position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px;
  background: #2563eb; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.ae-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border, #e3e8ef); }
.ae-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; background: rgba(0,0,0,.35); z-index: 9; }

/* ===== 官网管理：可重复行编辑器（repeater） ===== */
.rp { display: flex; flex-direction: column; gap: 10px; }
.rp:empty { display: none; }
.rp-item { border: 1px solid var(--border, #e3e8ef); border-radius: 10px; padding: 10px 12px 2px; background: #fbfcfe; }
.rp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rp-idx { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; background: var(--primary, #1a73e8); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.rp-title { flex: 1; font-size: 13px; font-weight: 600; color: var(--text, #1d2939); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-item .field { margin-bottom: 12px; }
.rp-item .field-row { flex-wrap: wrap; }
.rp-item .field-row .field { min-width: 150px; }
.rp-thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border, #e3e8ef); background: #fff; flex: 0 0 auto; }
.rp-empty { font-size: 13px; color: var(--text-2, #667085); padding: 10px 0; }
.site-flow { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2, #667085); margin-bottom: 14px; flex-wrap: wrap; }
.site-flow b { color: var(--primary, #1a73e8); font-weight: 600; }

/* ===== 官网管理：门户导航页图标选择器 ===== */
.icon-pick { display: flex; align-items: center; gap: 8px; }
.icon-pick select { flex: 1; min-width: 0; }
.icon-pv {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border, #e3e8ef); background: #f5f8fc;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-pv svg { width: 20px; height: 20px; }

/* ===== 官网管理：卡片折叠（内容超过一行默认收起，点击标题行展开，同容器互斥） ===== */
.rp-item.rp-foldable > .rp-head { cursor: pointer; user-select: none; }
.rp-item .rp-caret {
  flex: 0 0 auto; font-size: 12px; color: var(--text-2, #667085);
  transition: transform .15s ease; margin-left: 2px;
}
.rp-item.rp-fold > .field-row { display: none; }
.rp-item.rp-fold > .rp-head .rp-caret { transform: rotate(-90deg); }
.rp-item.rp-foldable.rp-fold > .rp-head { padding-bottom: 10px; }

/* ===== 侧边栏收起 / 展开（收起后内容区全屏） ===== */
.side-toggle { font-size: 18px; }
.main { transition: margin-left .2s ease; }
@media (min-width: 769px) {
  .side-toggle { display: block; }
  body.sb-collapsed .sidebar { transform: translateX(-100%); }
  body.sb-collapsed .main { margin-left: 0; }
}
@media (max-width: 768px) { .side-toggle { display: none; } }

/* ===== 主题切换按钮 ===== */
/* 按钮背景与页面颜色相反：白色主题（浅色页面）→ 暗色按钮；黑色主题（深色页面）→ 白色按钮 */
.theme-btn { gap: 6px; white-space: nowrap; background: #1f2937; border-color: #1f2937; color: #fff; }
.theme-btn:hover { background: #374151; border-color: #374151; color: #fff; }
body.theme-dark .theme-btn { background: #f7f9fc; border-color: #f7f9fc; color: #0e1320; }
body.theme-dark .theme-btn:hover { background: #e6ebf5; border-color: #e6ebf5; color: #0e1320; }
.theme-btn #theme-icon { font-size: 13px; line-height: 1; }
@media (max-width: 900px) { .theme-btn #theme-text { display: none; } }

/* ===== 侧边栏分组标题右侧（徽标 + 箭头） ===== */
.nav-group-title .ng-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-group-title .nav-badge { margin-left: 0; }

/* ===== 用户管理：外部联系人 ↔ 往来单位 雷同提示 ===== */
.dup-tip {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 10px;
  background: #fff8e6; border: 1px solid #f3d48a; color: #7a4a00; font-size: 13px;
}
.dup-tip-head { display: block; font-weight: 700; margin-bottom: 8px; }
.dup-tip-list { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.dup-tip-item { background: rgba(0, 0, 0, .045); border-radius: 20px; padding: 3px 10px; font-size: 12px; }
.dup-tip-item em { font-style: normal; color: #b26a00; margin-left: 6px; }

/* 往来单位「已注册」标记 */
.tag-reg { background: #e0e7ff; color: #3730a3; }

/* ===== 订单表单：顶部信息条 + 提单号行 排版统一 ===== */
.bl-metabar { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.bl-metabar .mb-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bl-metabar .mb-item input { width: 190px; max-width: 220px; }
.bl-metabar .mb-item.grow { flex: 1 1 260px; }
.bl-metabar .mb-item.grow input { width: 100%; max-width: none; }
.bl-metabar .meta-lab em { color: var(--danger); font-style: normal; }
.bl-basic .field label { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.bl-basic .dt-pair { display: flex; gap: 8px; }
.bl-basic .dt-pair select { width: 110px; flex-shrink: 0; }
/* 列表中用订单号回退显示时的弱化样式 */
.ord-no-fb { color: var(--text-2); }

/* ===== 黑色主题 ===== */
body.theme-dark {
  --bg: #0e1320;
  --card: #161d2c;
  --border: #2a3446;
  --text: #e6ebf5;
  --text-2: #9aa5b8;
  --primary: #4d84ff;
  --primary-dark: #3a6fe0;
  --shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
body.theme-dark .topbar, body.theme-dark .sidebar { background: var(--card); }
body.theme-dark .field input, body.theme-dark .field select, body.theme-dark .field textarea,
body.theme-dark .toolbar input, body.theme-dark .toolbar select,
body.theme-dark .dock-field input, body.theme-dark .dock-field select {
  background: #1b2434; color: var(--text); border-color: var(--border);
}
body.theme-dark .field input::placeholder, body.theme-dark .field textarea::placeholder,
body.theme-dark .toolbar input::placeholder { color: #6f7c92; }
body.theme-dark th { background: #1b2434; color: #9aa5b8; }
body.theme-dark tbody tr:hover { background: #1c2536; }
body.theme-dark .nav-item:hover { background: #1c2536; }
body.theme-dark .modal-box, body.theme-dark .oc-list { background: #161d2c; }
body.theme-dark .modal-box.xl .xl-foot { background: #1b2434; }
body.theme-dark .seg, body.theme-dark .seg-btn, body.theme-dark .seg-btn.active { color: var(--text); }
body.theme-dark .seg-btn { background: #1b2434; }
body.theme-dark .seg-btn.active { background: var(--primary); color: #fff; }
body.theme-dark .opmenu-list { background: #161d2c; }
body.theme-dark .opmenu-list button { color: var(--text); }
body.theme-dark .opmenu-list button:hover { background: #1c2536; }
body.theme-dark .batch-ro { background: #1b2434; }
body.theme-dark .cbx-block, body.theme-dark .dup-card, body.theme-dark .rp-item,
body.theme-dark .container-row, body.theme-dark .ae-prop, body.theme-dark .ct-item,
body.theme-dark .audit-note, body.theme-dark #of-anchor-json, body.theme-dark .tpl-preview,
body.theme-dark .tp-field, body.theme-dark .dock-panel, body.theme-dark .p-group,
body.theme-dark .pagination button, body.theme-dark .ftab { background: #1b2434; border-color: var(--border); }
body.theme-dark .container-row.off-row { background: #241c1a; }
body.theme-dark .opt-chip, body.theme-dark .ae-field-chip, body.theme-dark .mods-grid .mod-check {
  background: #1b2434; border-color: var(--border); color: var(--text-2);
}
body.theme-dark .opt-chip:has(input:checked) { background: rgba(77, 132, 255, .22); border-color: var(--primary); color: var(--text); }
body.theme-dark .mods-grid .mod-check:has(input:checked),
body.theme-dark .mods-grid .mod-check:has(input:disabled:checked) { background: var(--primary); color: #fff; }
body.theme-dark .tab-btn:hover { background: #1c2536; }
body.theme-dark .dock-field.dim input { background: #1b2434; color: #6f7c92; }
body.theme-dark .mini-btn { background: #1b2434; border-color: #33456b; }
body.theme-dark .sel-count { background: rgba(77, 132, 255, .18); color: #9dbaff; }
body.theme-dark .tpl-src, body.theme-dark .tpl-tip code, body.theme-dark .tg-line { background: #1b2434; }
body.theme-dark .kv-line { border-bottom-color: #26304174; }
body.theme-dark .dup-tip { background: rgba(234, 134, 0, .14); border-color: rgba(234, 134, 0, .38); color: #f2c684; }
body.theme-dark .dup-tip-item { background: rgba(255, 255, 255, .07); }
body.theme-dark .dup-tip-item em { color: #f2c684; }
body.theme-dark .tag-cat, body.theme-dark .tag-out, body.theme-dark .tag-wait { background: #253044; color: #b9c4d6; }
body.theme-dark .tag-reg { background: #2b3566; color: #b9c8ff; }
body.theme-dark .toast { background: #2b3446; }
body.theme-dark .pv-body, body.theme-dark .pv-pages { background: #202836; }
body.theme-dark .tb-tip, body.theme-dark .tip-pop { background: #1f2839; color: var(--text); }
/* 图表：网格线与文字在深色底上保持可读 */
body.theme-dark #chart-bar line { stroke: #2a3446 !important; }
body.theme-dark #chart-bar text, body.theme-dark #chart-donut text { fill: #9aa5b8 !important; }
body.theme-dark #chart-donut text[font-size="22"] { fill: #e6ebf5 !important; }
body.theme-dark .cell-2l .l1 { color: var(--text); }
body.theme-dark .cell-2l .l2 { color: #8a94a6; }
body.theme-dark .wh-stack .l1 { color: var(--text); }
.bl-metabar .meta-lab { white-space: nowrap; flex-shrink: 0; }

/* ===== 订单编辑：信息条 / 货物栏 圆润输入框（与页面统一风格） ===== */
.bl-metabar .mb-item input,
.cargo-grid4 textarea,
.cargo-wm input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff;
  transition: border-color .15s;
}
.bl-metabar .mb-item input:focus,
.cargo-grid4 textarea:focus,
.cargo-wm input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 86, 219, .12);
}
.bl-metabar .mb-item input { width: 190px; max-width: 220px; }
.bl-metabar .mb-item.grow input { width: 100%; max-width: none; }
body.theme-dark .bl-metabar .mb-item input,
body.theme-dark .cargo-grid4 textarea,
body.theme-dark .cargo-wm input { background: #1b2434; color: var(--text); border-color: var(--border); }
body.theme-dark .bl-metabar .mb-item input::placeholder,
body.theme-dark .cargo-grid4 textarea::placeholder,
body.theme-dark .cargo-wm input::placeholder { color: #6f7c92; }

/* 毛重 / 体积：输入框右后方单位（KGS / CBM） */
.cargo-wm { gap: 10px; }
.wm-wrap { position: relative; display: flex; align-items: center; }
.wm-wrap input { padding-right: 54px; }
.wm-unit {
  position: absolute; right: 12px; font-size: 12px; font-weight: 600;
  color: #98a2b3; letter-spacing: .5px; pointer-events: none; user-select: none;
}

/* 截单 / 截港列：字体与粗细一致，取小字 */
.cell-2l.cut-cell .l1, .cell-2l.cut-cell .l2 {
  font-size: 12px; font-weight: 400; color: #475467; line-height: 1.4;
}
body.theme-dark .cell-2l.cut-cell .l1, body.theme-dark .cell-2l.cut-cell .l2 { color: var(--text-2); }

/* ===== 在线服务入口：标题行快捷显示 / 隐藏开关 ===== */
.rp-en-btn {
  flex-shrink: 0; border: 1px solid #bfe3cd; background: #e6f4ea; color: #188038;
  font-size: 12px; font-weight: 600; border-radius: 20px; padding: 3px 12px;
  cursor: pointer; transition: all .15s;
}
.rp-en-btn:hover { background: #d3ecdf; }
.rp-en-btn.off { border-color: #f3d48a; background: #fff8e6; color: #b26a00; }
body.theme-dark .rp-en-btn { background: rgba(24, 128, 56, .2); border-color: rgba(24, 128, 56, .5); color: #7fd79a; }
body.theme-dark .rp-en-btn.off { background: rgba(234, 134, 0, .16); border-color: rgba(234, 134, 0, .45); color: #f2c684; }

/* ===== 仪表盘：订单统计卡片头 + 图例 ===== */
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chart-head h3 { margin: 0; }
.seg-sm .seg-btn { padding: 5px 14px; font-size: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 2px; padding: 0 4px; }
.chart-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #475467; }
.chart-legend .lg-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
body.theme-dark .chart-legend .lg-item { color: var(--text-2); }

/* ===== 站点设置指定板块折叠 ===== */
.fold-card > h3 { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.fold-card > h3:hover { color: var(--primary); }
.fold-card .fold-caret { margin-left: auto; font-style: normal; font-size: 12px; color: #98a2b3; }
.fold-card:not(.open) > .fold-body { display: none; }

/* ===== 唛头 N/M 快捷按钮（与下方输入框右对齐） ===== */
.cg-lab { position: relative; }
.nm-btn {
  position: absolute; right: 0; bottom: -2px;
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
  color: var(--primary); background: rgba(26, 86, 219, .08);
  border: 1px solid rgba(26, 86, 219, .28); border-radius: 12px;
  padding: 1px 10px; cursor: pointer; transition: all .15s;
}
.nm-btn:hover { background: var(--primary); color: #fff; }

/* ===== 订单费用编辑器（应收 / 应付 左右分布） ===== */
.fee-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.fee-col { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: rgba(148, 163, 184, .05); }
.fee-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fee-col-head.recv b { color: #188038; }
.fee-col-head.pay b { color: #d93025; }
.fee-rows { display: flex; flex-direction: column; gap: 8px; }
.fee-row { display: grid; grid-template-columns: 24px 1fr 112px 86px 54px 58px 58px 92px 44px 26px; gap: 6px; align-items: center; }
.fee-row.is-tax { background: rgba(26, 115, 232, 0.06); border-radius: 6px; }
/* 已应用 6% 专票后：勾选框隐藏（勾选消失），含税/免税分栏显示 */
.fee-rows.taxed .fee-sel { display: none; }
/* 免税 / 含税小计：卡片式左右分布，卡片内 USD 左、CNY 右（不用「＋」连接） */
.fee-tax-sub .tax-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fee-tax-sub .tax-card { border: 1px solid var(--border, #e3e8ef); border-radius: 10px; padding: 8px 12px; background: rgba(100, 116, 139, 0.08); }
.fee-tax-sub .tax-card:not(.free) { background: rgba(26, 115, 232, 0.07); border-color: rgba(26, 115, 232, 0.25); }
.fee-tax-sub .tax-card .tc-t { font-size: 11.5px; color: #64748b; margin-bottom: 4px; }
.fee-tax-sub .tax-card .tc-m { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; gap: 8px; }
body.theme-dark .fee-tax-sub .tax-card { background: #121826; border-color: var(--border); }
body.theme-dark .fee-tax-sub .tax-card .tc-t { color: #8fa0b5; }
.fee-tax-split { display: flex; align-items: center; gap: 10px; margin: 8px 0; color: #64748b; font-size: 11.5px; }
.fee-tax-split i { flex: 1; border-top: 2px dashed #94a3b8; }
.fee-tax-sub { display: grid; gap: 4px; margin: 8px 0 2px; }
.fee-tax-sub .tax-line { display: flex; justify-content: space-between; font-size: 12px; color: #475569; padding: 4px 10px; background: rgba(26, 115, 232, 0.06); border-radius: 6px; }
.fee-tax-sub .tax-line.free { background: rgba(100, 116, 139, 0.08); }
.fee-tax-sub .tax-line.all { background: rgba(24, 128, 56, 0.10); font-weight: 700; }
.fee-tax-sub .tax-line b { font-weight: 700; }
body.theme-dark .fee-tax-split { color: #8fa0b5; }
body.theme-dark .fee-row.is-tax { background: rgba(26, 115, 232, 0.14); }
body.theme-dark .fee-tax-sub .tax-line { color: #aeb9c9; }
.fee-row-hints {
  display: grid; grid-template-columns: 24px 1fr 112px 86px 54px 58px 58px 92px 44px 26px; gap: 6px;
  font-size: 11px; color: #98a2b3; padding: 0 2px 6px;
}
.fee-row-hints span:not(:nth-child(2)):not(:nth-child(3)) { text-align: center; }
/* 财务中心 · 订单结算应收两行（美金在上 / 人民币在下） */
.money-2l { display: flex; flex-direction: column; line-height: 1.35; }
.money-2l .l1 { color: #b45309; font-weight: 700; }
.money-2l .l2 { color: #188038; font-weight: 600; }
body.theme-dark .money-2l .l1 { color: #fbbf24; }
body.theme-dark .money-2l .l2 { color: #34d399; }
.stat-num.money-2l { font-size: 18px; }
/* 财务中心 · 汇率设置 */
.fin-fx-form { display: grid; gap: 10px; margin-bottom: 14px; }
.fin-fx-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fin-fx-row label { font-size: 13px; font-weight: 600; color: #475467; min-width: 64px; }
.fin-fx-row select, .fin-fx-row input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; background: #fff; }
.fin-fx-row input { width: 130px; }
/* 财务中心 · 结算费用页 */
.fin-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; }
.fin-info-grid > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: #f8fafc; border-radius: 8px; font-size: 13px; }
.fin-info-grid span { color: #64748b; white-space: nowrap; }
.fin-info-grid b { font-weight: 600; color: var(--text); text-align: right; word-break: break-all; }
body.theme-dark .fin-info-grid > div { background: rgba(255,255,255,0.05); }
body.theme-dark .fin-info-grid span { color: #8fa0b5; }
.fin-fee-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fin-settle-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.fin-settle-label { font-size: 13px; color: #475467; font-weight: 600; }
.fin-money { font-size: 13px; color: #475467; }
.fin-money input { width: 110px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; }
.fin-locked { margin-top: 12px; padding: 12px 16px; border: 1px dashed #f59e0b; background: rgba(245, 158, 11, 0.08); border-radius: 10px; color: #b45309; font-size: 13px; font-weight: 600; }
body.theme-dark .fin-locked { color: #fbbf24; }
@media (max-width: 900px) { .fin-info-grid, .fin-fee-grid { grid-template-columns: 1fr; } }
.fee-row input, .fee-row select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; font-family: inherit; background: #fff; min-width: 0;
}
.fee-row .fee-cust { background: #f8fafc; }
.fee-row .fee-cur { padding: 8px 6px; cursor: pointer; font-weight: 600; color: #475467; }
.fee-row .fee-sel { width: 16px; height: 16px; padding: 0; margin: 0 auto; cursor: pointer; accent-color: var(--primary); }
.fee-row input:focus, .fee-row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 86, 219, .12); }
.fee-row .fee-del { justify-self: center; }
/* 订单列表：提单号可点击复制（独立类名，避免与提单模版的 .bl-copy 冲突） */
.blno-copy { cursor: pointer; }
.blno-copy:hover { color: var(--primary); text-decoration: underline dotted; }
.fee-sub { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 13px; color: #475467; }
.fee-sub b { font-size: 14px; color: var(--text); }
.fee-total {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 14px;
  margin-top: 14px; padding: 10px 16px; border-radius: 10px;
  background: rgba(26, 86, 219, .06); font-size: 13px; color: #475467;
}
.fee-total b { font-size: 18px; color: var(--primary); }
.fee-total b.neg { color: #d93025; }

/* ===== 财务中心 ===== */
.num-cell { font-variant-numeric: tabular-nums; text-align: right; }
.num-cell.pay { color: #d93025; }
.num-cell.neg { color: #d93025; font-weight: 700; }
.meta-line { font-size: 11px; color: #98a2b3; }

/* ===== 深色主题适配 ===== */
body.theme-dark .fee-col { background: #1b2434; border-color: var(--border); }
body.theme-dark .fee-row input, body.theme-dark .fee-row select { background: #161d2c; color: var(--text); border-color: var(--border); }
body.theme-dark .fee-row .fee-cust { background: #121826; }
body.theme-dark .fee-row input::placeholder { color: #6f7c92; }
body.theme-dark .fee-row-hints { color: #6f7c92; }
body.theme-dark .fee-sub { color: var(--text-2); }
body.theme-dark .fee-total { background: rgba(77, 132, 255, .1); color: var(--text-2); }
body.theme-dark .nm-btn { color: #9dbaff; background: rgba(77, 132, 255, .14); border-color: rgba(77, 132, 255, .4); }
body.theme-dark .nm-btn:hover { background: var(--primary); color: #fff; }

/* ===== 分箱明细（订单编辑 · 「＋ 追加柜型」生成行，支持混拼） ===== */
.boxdet-head {
  display: grid; grid-template-columns: 1.5fr .8fr 1.3fr .62fr .74fr .7fr 1fr .9fr 30px; gap: 8px;
  font-size: 11.5px; font-weight: 600; color: #98a2b3; padding: 0 2px 6px;
}
.boxdet-rows { display: flex; flex-direction: column; gap: 8px; }
.box-row { display: grid; grid-template-columns: 1.5fr .8fr 1.3fr .62fr .74fr .7fr 1fr .9fr 30px; gap: 8px; align-items: center; }
.box-row input, .box-row select {
  width: 100%; min-width: 0; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; font-family: inherit; background: #fff; box-sizing: border-box;
}
.box-row input:focus, .box-row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 86, 219, .12); }
.box-row .box-ef, .box-row .box-sw { padding: 8px 6px; text-align: center; letter-spacing: .5px; font-weight: 600; }
/* 第84批：SI 已提交后 空满/箱属 锁定态 */
.box-row select.si-locked { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; border-style: dashed; }
.box-row select.si-locked:focus { box-shadow: none; border-color: var(--border); }
body.theme-dark .box-row select.si-locked { background: #2a3444; color: #7c8aa0; }
.box-row .box-del { justify-self: center; }
.boxdet-empty { padding: 14px 4px; font-size: 12.5px; color: #98a2b3; }
.boxdet-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.boxdet-count { margin-right: 8px; font-size: 12.5px; color: var(--primary, #1a56db); background: #eef4ff; border-radius: 999px; padding: 1px 10px; vertical-align: 1px; }
body.theme-dark .boxdet-count { background: #1b2a4a; }
body.theme-dark .box-row input, body.theme-dark .box-row select { background: #161d2c; color: var(--text); border-color: var(--border); }
body.theme-dark .box-row input::placeholder { color: #6f7c92; }
body.theme-dark .boxdet-head, body.theme-dark .boxdet-empty { color: #6f7c92; }

/* ===== 外部工作台：对外订单 ===== */
.ext-badge {
  display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; color: #b45309; background: #fef3c7; border: 1px solid #fcd34d;
}
body.theme-dark .ext-badge { color: #fbbf24; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .35); }
#ext-detail input[readonly], #ext-detail textarea[readonly] { background: #f6f8fb; color: #64748b; cursor: default; }
#ext-detail input[readonly]:focus, #ext-detail textarea[readonly]:focus { border-color: var(--border); box-shadow: none; }
body.theme-dark #ext-detail input[readonly], body.theme-dark #ext-detail textarea[readonly] { background: #101624; color: #8b98ad; }

body.theme-dark .fold-card .fold-caret { color: #6f7c92; }
body.theme-dark .num-cell.pay, body.theme-dark .num-cell.neg { color: #ff8a80; }

/* ===== 深色主题：仪表盘 SVG 图表文字（订单柱状图 / 浏览量趋势折线 / 环形图） ===== */
body.theme-dark #chart-ord-bar text, body.theme-dark #chart-pv-k text,
body.theme-dark #chart-cust-donut text { fill: #9aa5b8 !important; }
body.theme-dark #chart-ord-bar text[font-weight="600"] { fill: #dce3ee !important; }
body.theme-dark #chart-ord-bar line, body.theme-dark #chart-pv-k line { stroke: #2a3446 !important; }
body.theme-dark #chart-ord-bar rect[fill="#cfd6e0"] { fill: #2a3446 !important; }

/* ===== 费用页签：预览 / 打印工具栏 + 费用单（DEBIT NOTE） ===== */
.fee-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin: -4px 0 12px; }
.fee-stmt-box { max-width: 860px; }
/* ===== 账单预览：全屏显示完整内容（不截断，内容区自适应滚动） ===== */
.modal-box.bill-full {
  width: min(1180px, 96vw); max-width: min(1180px, 96vw);
  height: 92vh; max-height: 92vh; display: flex; flex-direction: column;
}
.modal-box.bill-full .pv-body { flex: 1; min-height: 0; max-height: none; }
.modal-box.bill-full .pv-body .fee-stmt { max-width: 1080px; width: 100%; }
@media (max-width: 900px) {
  .modal-box.bill-full { width: 98vw; max-width: 98vw; height: 94vh; max-height: 94vh; }
}
.fee-stmt {
  background: #fff; color: #1f2733; padding: 28px 32px; border: 1px solid #e3e8ef; border-radius: 12px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.fee-stmt .fs-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #1f2733; padding-bottom: 12px; }
.fee-stmt .fs-co { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.fee-stmt .fs-title { font-size: 15px; font-weight: 700; }
.fee-stmt .fs-title span { margin-left: 8px; font-size: 11px; color: #64748b; font-weight: 600; letter-spacing: 2px; }
.fee-stmt .fs-info { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 20px; margin: 14px 0 18px; font-size: 12.5px; }
.fee-stmt .fs-info span { color: #64748b; margin-right: 8px; }
.fee-stmt .fs-info b { font-weight: 600; }
.fee-stmt .fs-sec { font-size: 13px; font-weight: 700; margin: 14px 0 8px; }
.fee-stmt table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fee-stmt th, .fee-stmt td { border: 1px solid #dfe4ec; padding: 6px 8px; text-align: left; }
.fee-stmt th { background: #f4f6fa; font-weight: 600; }
.fee-stmt .fs-num, .fee-stmt th:last-child { text-align: right; }
.fee-stmt .fs-empty { text-align: center; color: #98a2b3; }
.fee-stmt .fs-split td { border: none; border-top: 2px dashed #94a3b8; height: 10px; }
.fee-stmt .fs-subrow td { background: #f8fafc; font-weight: 700; border-top: 1px solid #cbd5e1; }
.fee-stmt .fs-subrow.fs-allrow td { background: #eef7f0; }
.fee-stmt .fs-sum { text-align: right; font-size: 12.5px; margin-top: 8px; color: #475569; }
.fee-stmt .fs-sum b { color: #1f2733; }
.fee-stmt .fs-total { margin-top: 14px; padding: 10px 14px; background: #f0f5ff; border: 1px solid #c7d7f7; border-radius: 8px; text-align: right; font-size: 13.5px; font-weight: 700; }
.fee-stmt .fs-note { margin-top: 16px; font-size: 11.5px; color: #98a2b3; }
#fee-print-root { display: none; }
body.theme-dark .fee-stmt { background: #fff; color: #1f2733; } /* 费用单固定白底黑字（打印纸面） */

/* ===== 表单中心：费用账单模板（类 Word 编辑） ===== */
/* 表单列表：按文件名罗列的模板卡片 */
.tpl-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-tab {
  text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border, #e3e8ef); background: var(--card, #fff);
}
.tpl-tab:hover { border-color: var(--primary, #1a56db); }
.tpl-tab.active { border-color: var(--primary, #1a56db); background: rgba(26, 115, 232, 0.07); box-shadow: 0 0 0 1px var(--primary, #1a56db) inset; }
.tpl-tab .tt-name { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13.5px; color: var(--text, #1f2937); }
.tpl-tab .tt-dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; display: inline-block; }
.tpl-tab .tt-desc { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-2, #6b7280); }
@media (max-width: 900px) { .tpl-tabs { grid-template-columns: 1fr; } }
body.theme-dark .tpl-tab { background: #161d2c; border-color: var(--border); }
body.theme-dark .tpl-tab.active { background: #1b2740; }
.tpl-toolbar {  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 10px; margin: -4px 0 12px;
  background: var(--bg, #f4f6fa); border: 1px solid var(--border, #e3e8ef); border-radius: 10px;
}
.tpl-toolbar select { height: 30px; padding: 0 8px; font-size: 12.5px; border-radius: 6px; border: 1px solid var(--border, #e3e8ef); background: var(--card, #fff); color: var(--text, #1f2937); }
.tpl-sep { width: 1px; height: 18px; background: var(--border, #e3e8ef); }
.tpl-btn {
  min-width: 30px; height: 30px; padding: 0 8px; font-size: 13px; border-radius: 6px;
  border: 1px solid var(--border, #e3e8ef); background: var(--card, #fff); color: var(--text-2, #6b7280);
}
.tpl-btn:hover { color: var(--text, #1f2937); border-color: var(--primary, #1a56db); }
.tpl-hint { margin-left: auto; font-size: 11.5px; color: var(--text-2, #6b7280); }
.tpl-paper-wrap { background: #e9edf2; border-radius: 10px; padding: 20px; overflow: auto; max-height: 74vh; }
.tpl-paper { max-width: 1000px; margin: 0 auto; outline: none; }
.tpl-paper:focus { box-shadow: 0 0 0 2px rgba(26, 86, 219, .35); }
.tpl-paper:empty::before { content: "在此编辑账单模板…"; color: #98a2b3; }
.tpl-paper table { border-collapse: collapse; }
.tpl-tokens { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-token-chip {
  padding: 5px 10px; border-radius: 20px; font-size: 12px; font-family: ui-monospace, Menlo, monospace;
  border: 1px solid var(--border, #e3e8ef); background: var(--card, #fff); color: var(--primary, #1a56db);
}
.tpl-token-chip:hover { background: var(--primary, #1a56db); color: #fff; border-color: var(--primary, #1a56db); }
body.theme-dark .tpl-paper-wrap { background: #202836; }

/* ===== 第82批：表单中心头部（卡片式 · 模板图标/名称/状态徽标/用途说明） ===== */
.fc-hero { display: flex; align-items: flex-start; gap: 14px; flex: 1 1 460px; min-width: 320px; }
.fc-hero-icon {
  width: 46px; height: 46px; border-radius: 12px; flex: none; margin-top: 2px;
  background: var(--primary-soft, #eef3ff); color: var(--primary, #1a56db);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.fc-hero-main { min-width: 0; }
.fc-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fc-hero-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; white-space: nowrap;
  color: var(--primary, #1a56db); background: var(--primary-soft, #eef3ff);
  padding: 2px 10px; border-radius: 999px;
}
.fc-hero-name { font-size: 18px; margin: 0; }
.fc-hero-badge {
  font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0;
}
.fc-hero-badge.is-custom { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.fc-hero-badge.is-dirty { background: #fff7e6; color: #b54708; border-color: #fedf89; }
.fc-hero-desc { font-size: 12.5px; color: var(--text-2, #6b7280); margin-top: 4px; }
.fc-hero-note { font-size: 10.5px; font-style: italic; color: #98a2b3; margin-top: 2px; }
.fc-actions { align-items: center; }
.fc-act-sep { width: 1px; height: 20px; background: var(--border, #e3e8ef); margin: 0 2px; flex: none; }
body.theme-dark .fc-hero-icon { background: rgba(96, 140, 255, .16); }
body.theme-dark .fc-hero-kicker { background: rgba(96, 140, 255, .16); }
body.theme-dark .fc-hero-badge { background: #2a3444; color: #94a3b8; border-color: #3a4658; }
body.theme-dark .fc-hero-badge.is-custom { background: #123524; color: #4ade80; border-color: #1f5c3a; }
body.theme-dark .fc-hero-badge.is-dirty { background: #3a2c12; color: #fbbf24; border-color: #6b5216; }
body.theme-dark .fc-act-sep { background: #3a4658; }

/* ===== 第83批：费用模板（订单费用页签 · 保存 / 套用 / 删除） ===== */
.fee-tpl-box { width: min(560px, 94vw); max-height: 86vh; overflow: auto; }
.fee-tpl-save { display: flex; gap: 8px; margin: 4px 0 12px; }
.fee-tpl-save input { flex: 1; height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border, #e3e8ef); background: var(--card, #fff); color: var(--text, #1f2937); }
.fee-tpl-list { display: flex; flex-direction: column; gap: 8px; }
.fee-tpl-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border, #e3e8ef); border-radius: 8px; padding: 8px 12px; background: var(--card, #fff); }
.fee-tpl-item .ftp-main { flex: 1; min-width: 0; }
.fee-tpl-item .ftp-name { font-weight: 700; font-size: 13px; }
.fee-tpl-item .ftp-meta { font-size: 11px; color: var(--text-2, #6b7280); margin-top: 2px; }
.fee-tpl-empty { text-align: center; color: #98a2b3; font-size: 12.5px; padding: 18px 0; }
body.theme-dark .fee-tpl-item { background: #232c3a; }

/* ===== 第85批：费用行自动补全面板（客户名称 / 费用名称 / 单位 · 点击弹出全量候选，输入即模糊过滤） ===== */
#fee-ac { position: absolute; z-index: 1200; max-height: 264px; overflow: auto; background: var(--card, #fff); border: 1px solid var(--border, #dbe2ea); border-radius: 8px; box-shadow: 0 10px 28px rgba(16, 24, 40, .16); padding: 4px; }
#fee-ac .fee-ac-it { padding: 6px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text, #1f2937); }
#fee-ac .fee-ac-it:hover { background: #eef2f7; }
#fee-ac .fee-ac-it.on { background: var(--primary-soft, #e8f0fe); color: var(--primary, #1a56db); font-weight: 600; }
#fee-ac .fee-ac-empty { padding: 10px; font-size: 12.5px; color: #98a2b3; text-align: center; }
body.theme-dark #fee-ac { background: #1d2531; border-color: #3a4658; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
body.theme-dark #fee-ac .fee-ac-it { color: #e5eaf2; }
body.theme-dark #fee-ac .fee-ac-it:hover { background: #2a3444; }
body.theme-dark #fee-ac .fee-ac-it.on { background: #1d2c4d; color: #93b4ff; }

/* ===== 订单编辑页只读（已完成的订单仅可查看） ===== */
.ord-ro-note { font-size: 12.5px; color: #b45309; background: #fff8e6; border: 1px solid #f3d48a; border-radius: 20px; padding: 3px 12px; }
body.theme-dark .ord-ro-note { background: #3a2f14; border-color: #6b5416; color: #f5c669; }
body.perm-view .ord-ro-note { display: none; }

/* 打印：仅输出费用单（body.print-fee 期间隐藏其余全部内容） */
@media print {
  /* 费用单打印：纵向 A4 纸面 */
  @page { size: A4 portrait; margin: 12mm; }
  body.print-fee > *:not(#fee-print-root) { display: none !important; }
  body.print-fee #fee-print-root { display: block !important; }
  body.print-fee #fee-print-root .fee-stmt { border: 0; border-radius: 0; padding: 0; max-width: none; }
  body.print-fee { background: #fff !important; }
}

/* ===== 第67批：外部工作台界面调整 ===== */
/* 侧栏「我的订单」下方使用说明 */
/* 第87批：侧栏说明与导航项同宽（去掉 46px 左缩进，占满侧栏可用宽度） */
.ext-side-note {
  margin: 2px 12px 10px 12px; padding: 8px 10px;
  font-size: 11.5px; line-height: 1.7; color: #8a94a6;
  background: rgba(0,0,0,.03); border-left: 3px solid var(--border, #e3e8ef); border-radius: 6px;
}
body.theme-dark .ext-side-note { color: #97a3b8; background: rgba(255,255,255,.05); }
/* 外部表单系统顶部滚动宣传条（官网管理→站点设置可配置，第77批） */.ext-banner {
  overflow: hidden; height: 34px; flex: 0 0 auto;
  background: linear-gradient(90deg, #123f8f, #1c63c9);
  color: #fff; font-size: 13px; line-height: 34px; font-weight: 500;
}
body.theme-dark .ext-banner { background: linear-gradient(90deg, #0f2a55, #173f7e); }
.ext-banner-track {
  display: inline-flex; white-space: nowrap; width: max-content;
  animation: extBannerMove 26s linear infinite; will-change: transform;
}
.ext-banner-track > span { padding-right: 110px; }
@keyframes extBannerMove { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* 外部详情页「截单样本 / 电放申请文件」卡片（第80批；第87批改为列表显示，不显示缩略图） */
.si-files { display: flex; flex-direction: column; gap: 8px; }
.si-file-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid #e3e8f2; border-radius: 10px; padding: 10px; background: #fff; }
/* 第87批：列表行样式——整行可点击查看，图标 + 名称 + 操作按钮横排 */
.si-file-item.si-list-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: zoom-in; transition: .15s; }
.si-file-item.si-list-item:hover { border-color: var(--primary, #2563eb); background: #f5f8ff; }
.si-list-item .si-ico { font-size: 18px; flex-shrink: 0; }
.si-list-item .si-file-meta { flex: 1 1 auto; flex-direction: row; align-items: center; gap: 10px; min-width: 0; }
.si-list-item .si-file-meta .si-fname { max-width: none; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-list-item .si-acts { display: flex; gap: 6px; flex-shrink: 0; }
.si-file-item .si-thumb { width: 150px; height: auto; border: 1px solid #dfe5ef; border-radius: 6px; cursor: zoom-in; display: block; }
.si-file-meta { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #4a5468; align-items: flex-start; }
.si-file-meta b { font-size: 13px; color: #1f2733; white-space: nowrap; }
.si-file-meta .si-fname { word-break: break-all; max-width: 170px; }
/* 第87批：查看大图——白底 A4 版面（210:297 比例）自适应屏幕，图片完整呈现 */
#si-lightbox { position: fixed; inset: 0; background: rgba(15,22,35,.72); z-index: 9999; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
#si-lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.4); background: #fff; }
#si-lightbox .si-a4-page {
  width: min(92vw, calc(92vh * 210 / 297)); aspect-ratio: 210 / 297;
  background: #fff; border-radius: 6px; box-shadow: 0 12px 48px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 6px;
}
#si-lightbox .si-a4-page img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 2px; }
body.theme-dark .si-file-item { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); }
body.theme-dark .si-file-meta b { color: #e8edf6; }
body.theme-dark .si-file-meta { color: #a7b1c4; }
/* ===== 第120批：注册审核弹窗改横向宽幅布局 ===== */
.modal-box.review-wide { max-width: min(1040px, 96vw); width: min(1040px, 96vw); max-height: 90vh; overflow-y: auto; }
.rv-head-tip { font-size: 12px; font-weight: 400; color: var(--text-2); margin-left: 8px; }
/* 申请信息：横向一排（自适应列数，窄屏自动折行） */
.rv-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 14px; margin-bottom: 2px; }
.rv-grid .field { margin-bottom: 12px; }
/* 左主体 + 右侧栏：横向并排 */
.rv-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
.rv-col-side { border-left: 1px dashed var(--border); padding-left: 18px; }
.rv-sec-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.6; }
.rv-col-side .review-tip { margin-top: 2px; }
.rv-col-main .rv-plist { max-height: 300px; }
body.theme-dark .rv-col-side { border-left-color: rgba(255,255,255,.14); }
/* 注册审核弹窗：往来单位处理列表（第78批） */
.rv-plist { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.rv-p-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; border: 1px solid transparent; flex-wrap: wrap; }
.rv-p-row:hover { background: #f6f8fc; }
.rv-p-row.rv-p-sel { border-color: var(--primary); background: #f0f4ff; }
.rv-p-main { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); flex-shrink: 0; cursor: pointer; }
.rv-p-name { font-weight: 600; font-size: 13px; }
.rv-p-meta { font-size: 12px; color: #98a2b3; }
.rv-p-actions { display: flex; align-items: center; gap: 10px; padding: 4px 2px 0; flex-wrap: wrap; }
body.theme-dark .rv-plist { border-color: rgba(255,255,255,.12); }
body.theme-dark .rv-p-row:hover { background: rgba(255,255,255,.05); }
body.theme-dark .rv-p-row.rv-p-sel { background: rgba(80,130,255,.15); }
/* 船名航次变更：醒目换船标志 */
.swap-flag {
  display: inline-block; margin-right: 6px; padding: 1px 7px;
  font-size: 11px; font-weight: 700; color: #fff; background: #e8590c;
  border-radius: 9px; vertical-align: 1px;
}
/* 第86批：多次换船背景色递进（1 次=橙 · 2 次=红 · 3 次及以上=深红黑） */
.swap-flag.swap-l1 { background: #e8590c; }
.swap-flag.swap-l2 { background: #e03131; }
.swap-flag.swap-l3 { background: #a61e4d; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
body.theme-dark .swap-flag.swap-l3 { color: #ffd8e2; }
/* 第86批：提单信息「箱号」汇总行（一行显示 · 高度增加） */
.boxno-line { display: flex; gap: 10px; align-items: stretch; }
.boxno-line textarea { flex: 1; min-height: 64px; font-family: Consolas, Menlo, monospace; letter-spacing: 1px; font-size: 13.5px; line-height: 1.5; background: var(--card-2, #f7f9fc); }
.boxno-line .btn { align-self: stretch; display: flex; align-items: center; }
body.theme-dark .boxno-line textarea { background: #202836; }
/* 第86批：箱号弹窗（分箱明细格式） */
.boxno-box { width: min(980px, 94vw); max-height: 88vh; overflow: auto; }
#boxno-rows .box-row input, #boxno-rows .box-row select { width: 100%; }
.flex-sp { flex: 1; }
/* 提单号后「已确认」绿色椭圆 */
.pill-ok {
  display: inline-block; margin-left: 8px; padding: 1px 9px;
  font-size: 11px; font-weight: 600; color: #188038;
  border: 1px solid #34a853; background: #e6f4ea; border-radius: 999px;
}
/* 外部详情：提单关系方纵向排列（发货人/收货人/通知人各占一行） */
.ext-parties { display: flex; flex-direction: column; gap: 14px; }
.ext-parties .field { margin-bottom: 0; }
.ext-parties textarea { resize: vertical; }

/* ===== 第68批：状态口径 / 日期框 / 按钮与提示 ===== */
/* 状态标签：新建（灰）· 完成（无底色灰字）· 已电放（绿色 + 底部绿色虚线） */
.tag-new { background: #eef2f7; color: #667085; }
.tag-plain { background: transparent; color: #98a2b3; border: 0; padding-left: 0; font-weight: 600; }
.tag-released { border-bottom: 1px dashed var(--success, #12b76a); border-radius: 6px 6px 2px 2px; }
/* 无提单号：提单号栏显示订单号，灰色 */
.ord-no-fb { color: #98a2b3; }
/* 提单号后「确认账单」提示（区别于「已确认」绿胶囊） */
.pill-bill { color: #0f5132; border-color: #198754; background: #d1e7dd; }
/* 「查看账单」绿色填充按钮 */
.btn-success { background: var(--success, #12b76a); border-color: var(--success, #12b76a); color: #fff; }
.btn-success:hover { filter: brightness(.94); }
/* 日期框：去掉原生日历图标，点击整框直接弹出日期选择（app.js bindDatePickers） */
input[type="date"]::-webkit-calendar-picker-indicator { display: none; width: 0; height: 0; opacity: 0; }
input[type="date"]::-webkit-inner-spin-button { display: none; }
input[type="date"] { cursor: pointer; }

/* ===== 第88批：表单中心「危险品信息模块 / 危品订舱资料」内嵌编辑器页 ===== */
.fe-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fe-bar label { font-size: 12.5px; color: #4a5468; font-weight: 600; white-space: nowrap; }
.fe-bar select { min-width: 340px; max-width: 60vw; padding: 6px 10px; border: 1px solid var(--border, #dbe2ec); border-radius: 8px; font-size: 13px; background: #fff; }
.fe-bar .fe-bar-note { font-size: 11.5px; color: #98a2b3; }
/* 第151批：按提单号提取表单 —— 搜索栏 + 候选列表 */
.fe-bl-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 11px; margin-bottom: 10px;
  background: #f7f9fc; border: 1px solid var(--border, #dbe2ec); border-radius: 10px;
}
.fe-bl-bar label { font-size: 12.5px; color: #4a5468; font-weight: 600; white-space: nowrap; }
.fe-bl-bar input {
  flex: 1; min-width: 220px; max-width: 520px;
  padding: 6px 10px; border: 1px solid var(--border, #dbe2ec); border-radius: 8px;
  font-size: 13px; background: #fff; font-family: Consolas, "SF Mono", monospace; letter-spacing: .5px;
  text-transform: uppercase;
}
.fe-bl-bar input:focus { outline: none; border-color: #e02b2b; box-shadow: 0 0 0 3px rgba(224, 43, 43, .1); }
/* 第178批：提示语移出操作条（否则挤压提单号输入框） */
.fe-hint-line { margin: -4px 0 10px; line-height: 1.5; }
.fe-bl-hint { font-size: 11.5px; color: #98a2b3; }
.fe-bl-hint.ok { color: #15803d; font-weight: 600; }
.fe-bl-hint.warn { color: #b45309; font-weight: 600; }
.fe-bl-hint.bad { color: #d92d20; font-weight: 600; }
.fe-cand { display: flex; flex-direction: column; gap: 4px; margin: -4px 0 10px; }
.fe-cand-it {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 7px 10px; border: 1px solid var(--border, #dbe2ec); border-radius: 8px;
  background: #fff; font-size: 12.5px; cursor: pointer; color: #1f2937;
}
.fe-cand-it:hover { border-color: #e02b2b; background: #fff7f7; }
.fe-cand-it.on { border-color: #e02b2b; background: #fff1f1; }
.fe-cand-it b { font-family: Consolas, monospace; letter-spacing: .4px; }
.fe-cand-it .fe-cand-meta { color: #98a2b3; font-size: 11.5px; margin-left: auto; white-space: nowrap; }
#page-form-external #fe-frame { width: 100%; height: 76vh; border: 1px solid var(--border, #dbe2ec); border-radius: 10px; background: #fff; display: block; }
/* 第177批：危险品资料填写链接 / 第178批与提单号提取合并 / 第179批删链接输出行 */
.fe-merge-note {
  font-size: 11.5px; color: #6b7688; line-height: 1.6; margin-bottom: 10px;
  padding: 6px 10px; border-left: 3px solid #cfe0ff; background: #f7faff; border-radius: 0 6px 6px 0;
}
/* AC 候选项中的客户编码角标（费用客户栏 KH**** 命中提示） */
.fee-ac-it .fee-ac-code { font-style: normal; font-size: 10.5px; color: #98a2b3; margin-left: 6px; }

/* ============================================================
   第96批：统一扁平化主题层（覆盖式，不改 DOM/类名，可整体回退）
   设计语言：无阴影 · 细边框 · 小圆角 · 单一主色 · 高对比文字
   ============================================================ */
:root {
  --radius: 8px;            /* 卡片/弹窗统一圆角 */
  --radius-sm: 6px;         /* 按钮/输入/导航 */
  --radius-xs: 4px;         /* 徽标/小元素 */
  --shadow: none;           /* 卡片阴影归零，靠边框分层 */
  --border: #e2e6ed;
}

/* ---------- 阴影归零（精准列出，保留 switch 圆钮等必要阴影） ---------- */
.card, .stat-card, .modal-box, .toast, .login-card,
.bill-full, .tpl-preview, .tem-paper { box-shadow: none !important; }
.topbar { box-shadow: none; }

/* ---------- 按钮扁平化 ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-primary { box-shadow: none; }
.btn-primary:active, .btn-danger:active { transform: none; }
.btn-ghost { background: #fff; }
.btn-ghost:hover { background: #f5f7fa; border-color: #c9d2de; }
.btn-success { border-radius: var(--radius-sm); }
.btn-sm { border-radius: var(--radius-xs); }
.op-btn { font-weight: 500; }

/* ---------- 输入扁平化：白底细边框，focus 主色描边（无光晕） ---------- */
.field input, .field select, .field textarea,
.toolbar input, .toolbar select,
.dock-field input, .dock-field select {
  border-radius: var(--radius-sm);
  border-color: #d5dae2;
  box-shadow: none;
}
.field input:focus, .field select:focus, .field textarea:focus,
.toolbar input:focus, .toolbar select:focus,
.dock-field input:focus, .dock-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);  /* 1px 描边代替 3px 光晕 */
}
.tem-paper, .tem-toolbar, .p-group, .cbx-block, .tpl-preview { border-radius: var(--radius-sm); }
.seg, .seg-control { border-radius: var(--radius-sm); }

/* ---------- 侧栏扁平：active 浅主色底 + 左侧 3px 主色条 ---------- */
.nav-item { border-radius: var(--radius-sm); border-left: 3px solid transparent; }
.nav-item:hover { background: #f2f5f9; color: var(--text); }
.nav-item.active {
  background: #e8effc; color: var(--primary); font-weight: 600;
  border-left-color: var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---------- 顶栏/表格 ---------- */
th { background: #fff; color: #4a5468; font-weight: 600; border-bottom: 2px solid #d9dee6; }
tbody tr:hover { background: #f6f8fb; }
td, th { border-bottom-color: #eaeef3; }

/* ---------- 卡片/统计 ---------- */
.stat-card { padding: 16px; }
.stat-icon { border-radius: var(--radius-sm); }

/* ---------- 弹窗/Toast/徽标 ---------- */
.modal { background: rgba(15, 23, 42, .4); }
.modal-box { border-radius: var(--radius); border: 1px solid var(--border); }
.toast { border-radius: var(--radius-sm); }
.tag { border-radius: var(--radius-xs); }
.tpl-src { border-radius: var(--radius-xs); }

/* ---------- 页签（订单页/表单中心等 tab 按钮） ---------- */
.tab-btn, .ptab { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }

/* ---------- 滚动条细扁化 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9d2de; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aeb9c8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 深色主题同步 ---------- */
body.theme-dark .nav-item { border-left-color: transparent; }
body.theme-dark .nav-item:hover { background: #263043; color: #dfe6f2; }
body.theme-dark .nav-item.active {
  background: #1c2f55; color: #7ea6f5; border-left-color: #7ea6f5;
}
body.theme-dark .field input, body.theme-dark .field select, body.theme-dark .field textarea,
body.theme-dark .toolbar input, body.theme-dark .toolbar select {
  box-shadow: none; border-color: #3a4559;
}
body.theme-dark .field input:focus, body.theme-dark .field select:focus, body.theme-dark .field textarea:focus,
body.theme-dark .toolbar input:focus, body.theme-dark .toolbar select:focus {
  border-color: #5b8def; box-shadow: 0 0 0 1px #5b8def;
}
body.theme-dark th { background: transparent; color: #97a3b8; border-bottom: 2px solid #39435a; }
body.theme-dark td, body.theme-dark th { border-bottom-color: #2c3548; }
body.theme-dark tbody tr:hover { background: #232c3d; }
body.theme-dark ::-webkit-scrollbar-thumb { background: #3a4559; }

/* ===== 第96批补丁：外部宣传条扁平化重设计（纯色无渐变 + 公告徽标） ===== */
/* 关键修复：banner 之前被 fixed topbar（z-index:50, top:0）完全遮挡——77 批以来「启用后不显示」的真正根因。
   现改为 fixed 置顶，显示时 body.ext-banner-on 将顶栏/侧栏/主区整体下移 36px */
.ext-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 49;
  background: var(--primary);
  height: 36px; line-height: 36px; font-size: 13px; font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  display: flex; align-items: center; overflow: hidden;
}
.ext-banner-badge {
  flex: 0 0 auto; padding: 0 14px; margin-right: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .5px;
  background: rgba(255, 255, 255, .16); line-height: 36px; white-space: nowrap;
}
/* 滚动视口：独立裁剪区，保证徽标不被 transform 动画内容覆盖 */
.ext-banner-viewport { flex: 1 1 auto; overflow: hidden; height: 36px; }
.ext-banner-track > span { padding-right: 0; }
.ext-banner-track > span::after { content: "・"; margin: 0 60px; opacity: .55; }
body.theme-dark .ext-banner { background: #1c2f55; }
body.ext-banner-on .topbar { top: 36px; }
body.ext-banner-on .sidebar { top: 92px; }
body.ext-banner-on .sidebar-mask { inset: 92px 0 0 0; }
body.ext-banner-on .main { margin-top: 92px; }
@media (max-width: 900px) { body.ext-banner-on .sidebar { top: 92px; } }

/* ===== 第98批：SO 上传工具条（后台提单信息页签） ===== */
.so-bar-card { padding: 10px 14px; }
.so-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.so-status { font-size: 12.5px; color: var(--primary, #1a56db); font-weight: 500; }
.so-status:empty { display: none; }

/* 第98批：提单基本信息新增字段（到港时间 / TFC Code）后保持三列标签严格等高 */
.bl-basic .field label { min-height: 18px; }

/* ===== 第99批：备注栏全宽（右缘与卡片内容对齐）+ 箱号输入框 / 弹窗 UI 优化 ===== */
/* 备注：裸 textarea 无 .field 包裹 → 浏览器默认宽度（约 20ch）挤在左侧，现占满卡片内容宽 */
#b-remark, .remark-ta {
  display: block; width: 100%; box-sizing: border-box;
  min-height: 74px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px); font-family: inherit; font-size: 13px;
  line-height: 1.6; resize: vertical; background: #fff; color: var(--text);
}
#b-remark:focus, .remark-ta:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
#b-remark:read-only, .remark-ta:read-only { background: #f6f8fb; color: #64748b; }
body.theme-dark #b-remark, body.theme-dark .remark-ta { background: #1b2434; color: var(--text); border-color: var(--border); }
body.theme-dark #b-remark:read-only, body.theme-dark .remark-ta:read-only { background: #101624; color: #8b98ad; }

/* 箱号汇总行：只读汇总 + 「🧱 箱号」「📋 复制」按钮同高 */
.boxno-line textarea { min-height: 62px; cursor: default; }
.boxno-line textarea:focus { box-shadow: none; border-color: var(--border); }
.boxno-line .btn { white-space: nowrap; }

/* 箱号弹窗：.modal-box 基础规则 max-width:360px 会把 .boxno-box 的 980px 宽度压回 ~340px（列被挤成窄条）——
   这里放开上限，让分箱明细各列恢复可读宽度 */
#boxno-modal .modal-box.boxno-box { max-width: none; width: min(1080px, 96vw); }
#boxno-modal .boxdet-head, #boxno-modal .box-row { grid-template-columns: 1.6fr .8fr 1.2fr .55fr .58fr .62fr .72fr .72fr 30px; }
#boxno-modal .box-row input, #boxno-modal .box-row select { padding: 7px 9px; border-radius: var(--radius-xs, 4px); }
#boxno-modal .pv-head { margin-bottom: 6px; }

/* 箱号汇总「共 N 箱」角标（hidden 时不占位） */
.boxdet-count[hidden] { display: none; }

/* 分箱明细合计行（件数 / 重量 / 体积 → SI ⑦ 货物信息 / 外部订舱同口径） */
.boxdet-sum {
  margin-top: 10px; padding: 8px 12px; border-radius: var(--radius-sm, 6px);
  background: #f2f6ff; border: 1px solid #d6e2ff;
  font-size: 12.5px; color: #1a3f8f;
}
.boxdet-sum b { font-family: Consolas, Menlo, monospace; font-size: 13px; }
.boxdet-sum-tip { margin-left: 8px; font-size: 11.5px; color: #6b82b8; }
body.theme-dark .boxdet-sum { background: #16233c; border-color: #24365c; color: #9fbbf5; }
body.theme-dark .boxdet-sum-tip { color: #7b8db3; }

/* ========== 第101批：费用客户选择 + IVC 费用发票 ========== */
/* 费用工具栏客户选择下拉（应收费用含 ≥2 个客户时显示） */
.fee-cust-sel {
  height: 28px; max-width: 230px; padding: 0 6px;
  border: 1px solid var(--line, #d7dde8); border-radius: 6px;
  background: var(--card, #fff); color: var(--text, #1f2733); font-size: 12px;
}
.fee-cust-sel:focus { outline: none; border-color: var(--primary, #3b82f6); }
body.theme-dark .fee-cust-sel { background: #16233c; border-color: #24365c; color: #dbe6fb; }

/* ========== 第103批：IVC 模板 · 提单号搜索 + 客户选择 ========== */
.ivc-search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ivc-search-input {
  flex: 0 1 340px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line, #d7dde8); border-radius: 6px;
  background: var(--card, #fff); color: var(--text, #1f2733);
  font-size: 13px; font-family: Consolas, Menlo, monospace; letter-spacing: .4px;
}
.ivc-search-input::placeholder { font-family: inherit; letter-spacing: 0; color: #9aa7bd; }
.ivc-search-input:focus { outline: none; border-color: var(--primary, #3b82f6); }
.ivc-search-sep { width: 1px; height: 20px; background: var(--line, #d7dde8); }
.ivc-search-lab { font-size: 12px; color: #6b7a92; }
.ivc-cust-sel { height: 32px; max-width: 300px; font-size: 12.5px; }
.ivc-search-hint { font-size: 12px; color: #6b7a92; }
.ivc-search-hint.is-ok { color: #1a7f46; }
.ivc-search-hint.is-bad { color: #c0392b; }
body.theme-dark .ivc-search-input { background: #16233c; border-color: #24365c; color: #dbe6fb; }
body.theme-dark .ivc-search-input::placeholder { color: #6b82b8; }
body.theme-dark .ivc-search-sep { background: #24365c; }
body.theme-dark .ivc-search-lab, body.theme-dark .ivc-search-hint { color: #8fa3c4; }
body.theme-dark .ivc-search-hint.is-ok { color: #6cd08f; }
body.theme-dark .ivc-search-hint.is-bad { color: #ff8f80; }

/* ========== 第105批：往来单位按创建人隔离 ========== */
.p-scope {
  margin-left: auto; font-size: 12px; line-height: 1; padding: 5px 10px;
  border-radius: 999px; white-space: nowrap; font-weight: 600;
}
.p-scope.is-admin { background: #eef2ff; color: #4f46e5; }
.p-scope.is-own { background: #fef3c7; color: #b45309; }
.tag-own { background: #f1f5f9; color: #475569; }
body.theme-dark .p-scope.is-admin { background: #1e2545; color: #a5b4fc; }
body.theme-dark .p-scope.is-own { background: #3a2f18; color: #fbbf24; }
body.theme-dark .tag-own { background: #26324a; color: #a9b8d0; }

/* ========== 第110批：发送账单客户校验（客户未注册 → 禁用 + 账单客户提示） ========== */
/* 费用工具栏左侧「账单客户」提示条；仅提示不可发送时标红 */
.fee-send-note {
  margin-right: auto; align-self: center; font-size: 12px; line-height: 1.4;
  color: #6b7a92; display: inline-flex; align-items: center;
}
.fee-send-note b { color: var(--text, #1f2733); font-weight: 600; margin: 0 2px; }
.fee-send-note.is-bad { color: #c0392b; font-weight: 600; }
/* 发送账单按钮因「客户未注册 / 无应收费用」禁用时的视觉 */
.fee-toolbar .btn:disabled { opacity: .45; cursor: not-allowed; }
body.theme-dark .fee-send-note { color: #8fa3c4; }
body.theme-dark .fee-send-note b { color: #dbe6fb; }
body.theme-dark .fee-send-note.is-bad { color: #ff8f80; }

/* ========== 第111批：网站维护模式 + 账单发件箱 ========== */
/* 站点设置里的开关行标签（checkbox 跟在 label 里，与正文左对齐） */
.ck-label { display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
/* 维护模式状态条：一眼看清「已开启 / 已关闭」与例外页面 */
.maint-state {
  margin-top: 4px; padding: 8px 12px; border-radius: 8px; font-size: 12px; line-height: 1.6;
  background: #f4f7fb; color: #6b7a92; border: 1px solid #e5ebf3;
}
.maint-state b { color: var(--text, #1f2733); font-weight: 600; }
.maint-state.is-on { background: #fff6e8; border-color: #f6dfb8; color: #9a6a12; }
.maint-state.is-on b { color: #a15c00; }
.maint-state code { background: #fff; border: 1px solid #e5ebf3; border-radius: 4px; padding: 0 4px; font-size: 11px; }
/* 发件箱操作行：按钮靠左，状态文字跟在按钮后面 */
.form-actions-left { justify-content: flex-start; flex-wrap: wrap; }
.mc-state { font-size: 12px; line-height: 1.6; color: #6b7a92; }
.mc-state.is-ok { color: #1c7c54; font-weight: 600; }
.mc-state.is-bad { color: #c0392b; font-weight: 600; }
.mc-state code { background: #f4f7fb; border: 1px solid #e5ebf3; border-radius: 4px; padding: 0 4px; font-size: 11px; }
body.theme-dark .maint-state { background: #1c2432; border-color: #2b3648; color: #8fa3c4; }
body.theme-dark .maint-state b { color: #dbe6fb; }
body.theme-dark .maint-state.is-on { background: #33280f; border-color: #5a4517; color: #e8b95c; }
body.theme-dark .maint-state.is-on b { color: #ffd479; }
body.theme-dark .maint-state code { background: #232c3b; border-color: #2b3648; }
body.theme-dark .mc-state { color: #8fa3c4; }
body.theme-dark .mc-state.is-ok { color: #5fd39a; }
body.theme-dark .mc-state.is-bad { color: #ff8f80; }
body.theme-dark .mc-state code { background: #232c3b; border-color: #2b3648; }

/* ========== 第112批：维护模式服务端同步状态 ========== */
/* 状态条里追加的一行「官网服务端已生效 / 未连接」说明 */
.maint-state .maint-srv { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed #dfe6f0; font-size: 12px; }
.maint-state .maint-srv code { margin: 0 2px; }
/* 已开启维护、但本地服务没跑（只在本浏览器生效）→ 整体标红提醒 */
.maint-state.is-bad { background: #fdecea; border-color: #f5c6c0; color: #b03a2e; }
.maint-state.is-bad b { color: #9c2f24; }
.maint-state.is-bad .maint-srv { border-top-color: #f0cdc8; }
body.theme-dark .maint-state .maint-srv { border-top-color: #2b3648; }
body.theme-dark .maint-state.is-bad { background: #3a1c1a; border-color: #6a2f2a; color: #ff9c8d; }
body.theme-dark .maint-state.is-bad b { color: #ffb3a6; }

/* ========== 第113批：订单草稿池（已退舱订单归档）+ 财务中心报表中心 ========== */
/* ---- 草稿池卡片：置于订单列表最底部，默认收起 ---- */
.pool-card { margin-top: 16px; }
.pool-head { display: flex; align-items: center; gap: 8px; }
.pool-toggle {
  flex: 0 0 auto; width: 22px; height: 22px; line-height: 1; padding: 0;
  border: 1px solid var(--border, #e3e8ef); border-radius: 6px; background: #fff;
  color: var(--text-2, #6b7a92); font-size: 12px; cursor: pointer;
}
.pool-toggle:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.pool-count {
  margin-left: auto; flex: 0 0 auto; font-size: 12px; font-weight: 600;
  background: #f1f4f9; color: #5b6b85; border-radius: 999px; padding: 2px 10px;
}
.pool-count.is-empty { background: #f6f7f9; color: #a3adbd; font-weight: 500; }
.pool-body { margin-top: 10px; }
.pool-tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #fdecea; color: #b03a2e; font-weight: 600; }
.pool-time { font-size: 12px; color: var(--text-2, #6b7a92); }
.pool-row .op-btn.restore { color: #188038; }
body.theme-dark .pool-toggle { background: #232c3b; border-color: #2b3648; }
body.theme-dark .pool-count { background: #232c3b; color: #9fb0ca; }
body.theme-dark .pool-tag { background: #3a1c1a; color: #ff9c8d; }
body.theme-dark .pool-time { color: #8fa3c4; }
body.theme-dark .pool-row .op-btn.restore { color: #5fd39a; }

/* ---- 报表中心：报表页签 ---- */
.rep-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.rep-tab {
  border: 1px solid var(--border, #e3e8ef); background: #fff; color: var(--text-2, #55637a);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .15s;
}
.rep-tab:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.rep-tab.active { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; font-weight: 600; }
.rep-note { align-self: center; margin-left: auto; font-size: 12px; color: var(--text-2, #6b7a92); }
.rep-table { min-width: 860px; }
.rep-table tfoot td { background: #f7f9fc; font-weight: 700; }
.rep-table td.rep-cust { font-weight: 600; }
.rep-group-wrap { margin-top: 18px; border-top: 1px dashed var(--border, #e3e8ef); padding-top: 12px; }
.rep-sub-title { margin: 0 0 8px; font-size: 14px; }
.rep-settled td { color: #9aa4b2; }
.rep-diff-neg { color: #d93025; }
body.theme-dark .rep-tab { background: #232c3b; border-color: #2b3648; color: #a8b6cc; }
body.theme-dark .rep-tab.active { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; }
body.theme-dark .rep-table tfoot td { background: #232c3b; }
body.theme-dark .rep-settled td { color: #7d8a9e; }
body.theme-dark .rep-diff-neg { color: #ff8a80; }

/* ---- 报表打印：仅输出报表内容（A4 横向，不影响费用单打印） ---- */
#rep-print-root { display: none; }
@page rep { size: A4 landscape; margin: 10mm; }
@media print {
  body.print-rep { page: rep; }
  body.print-rep > *:not(#rep-print-root) { display: none !important; }
  body.print-rep #rep-print-root { display: block !important; }
  body.print-rep { background: #fff !important; }
}

/* ========== 第114批：订单管理三个子目录 + 报表中心未收/未付预览 ========== */
/* ---- 订单管理页内标签栏（与侧栏三个子目录联动） ---- */
.ord-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 2px 0 12px; }
.ord-tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border, #e3e8ef); background: #fff; color: var(--text-2, #55637a);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .15s;
}
.ord-tab:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.ord-tab.active { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; font-weight: 600; }
.ord-tab-n {
  font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 6px; border-radius: 999px;
  background: #f1f4f9; color: #5b6b85;
}
.ord-tab.active .ord-tab-n { background: rgba(255, 255, 255, .25); color: #fff; }
.ord-tab-n.is-zero { background: #f6f7f9; color: #a3adbd; font-weight: 500; }
.ord-tab.active .ord-tab-n.is-zero { background: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .85); }
.ord-tab-note { margin-left: auto; font-size: 12px; color: var(--text-2, #6b7a92); }
/* 「退舱列表」子目录下：隐藏统计卡与主表，退舱表成为主内容 */
#page-orders.scope-void .stat-grid { display: none; }
body.theme-dark .ord-tab { background: #232c3b; border-color: #2b3648; color: #a8b6cc; }
body.theme-dark .ord-tab.active { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; }
body.theme-dark .ord-tab-n { background: #2b3648; color: #9fb0ca; }
body.theme-dark .ord-tab-note { color: #8fa3c4; }

/* ---- 报表中心：按视角（明细 / 未收预览 / 未付预览 / 按客户统计）切换时的补充样式 ---- */
/* 「按客户统计」视角下客户表即主表，加一条合计线 */
.rep-table tfoot td.rep-total-line { border-top: 2px solid var(--border, #d8e0ec); }
.rep-view-hint {
  display: block; margin: -4px 0 10px; font-size: 12px; color: var(--text-2, #6b7a92);
  padding: 7px 12px; border-radius: 8px; background: #f4f7fb; border: 1px solid #e5ebf3;
}
.rep-view-hint b { color: var(--text, #1f2733); }
.rep-view-hint.is-recv { background: #eaf6ee; border-color: #cfe9d8; color: #1c6b45; }
.rep-view-hint.is-recv b { color: #14563a; }
.rep-view-hint.is-pay { background: #fdf3e3; border-color: #f5dfbd; color: #8a5a12; }
.rep-view-hint.is-pay b { color: #74490b; }
.rep-view-hint.is-cust { background: #eef2fd; border-color: #d5dcf7; color: #31459c; }
.rep-view-hint.is-cust b { color: #24347a; }
body.theme-dark .rep-view-hint { background: #1c2432; border-color: #2b3648; color: #8fa3c4; }
body.theme-dark .rep-view-hint b { color: #dbe6fb; }
body.theme-dark .rep-view-hint.is-recv { background: #14291f; border-color: #23543a; color: #6ed3a0; }
body.theme-dark .rep-view-hint.is-recv b { color: #a5ecc4; }
body.theme-dark .rep-view-hint.is-pay { background: #2c2312; border-color: #54431d; color: #e8b95c; }
body.theme-dark .rep-view-hint.is-pay b { color: #ffd479; }
body.theme-dark .rep-view-hint.is-cust { background: #1b2136; border-color: #2d3654; color: #9fb0e6; }
body.theme-dark .rep-view-hint.is-cust b { color: #c7d3ff; }

/* ---- 第115批：报表中心「每一票业务」费用单预览 ---- */
/* 明细表 / 按客户逐票明细表的「业务文件」列 */
.rep-table th#rep-th-file, .rep-file-cell { white-space: nowrap; text-align: center; width: 1%; }
.rep-prev-btn { white-space: nowrap; font-weight: 500; }
.rep-prev-btn:hover { text-decoration: none; opacity: .8; }
.rep-table tr.rep-settled .rep-prev-btn { color: var(--text-2, #6b7a92); }
/* 按客户逐票明细：每个客户一组（汇总抬头 + 该客户名下每一票） */
.rep-cd-wrap { margin-top: 18px; border-top: 1px dashed var(--border, #e3e8ef); padding-top: 12px; }
.rep-cd-group { margin-bottom: 14px; }
.rep-cd-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: 8px 8px 0 0;
  background: #f4f7fb; border: 1px solid #e5ebf3; border-bottom: 0;
  font-size: 13px; color: var(--text, #1f2733);
}
.rep-cd-name { font-weight: 600; }
.rep-cd-n { font-size: 12px; color: var(--text-2, #6b7a92); }
.rep-cd-sum { font-size: 12px; color: var(--text-2, #6b7a92); display: inline-flex; align-items: center; gap: 6px; }
.rep-cd-sum .money-2l { display: inline-flex; gap: 8px; }
.rep-cd-table { border-top-left-radius: 0; border-top-right-radius: 0; }
.rep-cd-group .table-wrap { border: 1px solid #e5ebf3; border-top: 0; border-radius: 0 0 8px 8px; }
body.theme-dark .rep-cd-head { background: #1c2432; border-color: #2b3648; color: #dbe6fb; }
body.theme-dark .rep-cd-group .table-wrap { border-color: #2b3648; }
body.theme-dark .rep-cd-n, body.theme-dark .rep-cd-sum { color: #8fa3c4; }

/* ---- 第115批：顶部用户名后「更改密码」 ---- */
.pwd-btn { white-space: nowrap; }
#pwd-modal .field { margin-bottom: 10px; }
.pwd-err { margin: 4px 0 0; font-size: 12.5px; color: var(--danger, #d93025); }

/* ==================================================================
   第120批：手机端适配（登录页 + 后台全站）
   目标：375~430px 宽的手机上可正常登录与操作
   ① 登录页：卡片贴合屏幕、logo 收小、输入框 16px 防 iOS 聚焦缩放
   ② 后台：顶栏紧凑、侧栏抽屉更宽、弹窗全宽、表格横滑、按钮触控 ≥40px
   ================================================================== */
@media (max-width: 768px) {
  /* ---- 登录页 ---- */
  .login-view { padding: 14px; background-attachment: scroll; }   /* fixed 背景在 iOS 上会闪烁 */
  .login-card { padding: 26px 20px; max-width: 100%; border-radius: 14px; }
  .login-logo-img { height: 108px; max-width: 168px; }
  .login-card h1 { font-size: 19px; }
  .login-sub { margin: 4px 0 18px; }
  .login-card .btn-row { gap: 8px; }

  /* ---- 顶栏 ---- */
  .topbar { height: 52px; gap: 10px; padding: 0 12px; }
  .brand-logo { max-height: 26px; max-width: 108px; }
  .topbar-title { font-size: 14px; }
  .topbar-right { gap: 8px; }
  .user-chip { font-size: 12px; }
  .user-chip span { display: none; }      /* 只留头像/图标，节省横向空间 */
  #role-badge { display: none; }
  .pwd-btn { padding: 0 8px; font-size: 12px; }
  .sidebar { top: 52px; width: min(300px, 84vw); }
  .sidebar-mask { inset: 52px 0 0 0; }
  .main { margin-top: 52px; padding: 14px 12px 28px; }

  /* ---- 输入框：字号 16px 以下 iOS 会自动放大页面 ---- */
  .field input, .field select, .field textarea,
  .toolbar input, .toolbar select, .login-card .field input,
  .modal input, .modal select, .modal textarea,
  input[type="search"], input[type="text"], input[type="tel"], input[type="email"], select, textarea {
    font-size: 16px;
  }
  /* 触控友好：按钮/分段/操作链接加大 */
  .btn { height: 40px; padding: 0 16px; font-size: 14px; }
  .btn-sm { height: 36px; padding: 0 12px; font-size: 13px; }
  .seg-btn { padding: 11px 0; }
  .op-btn { padding: 6px 8px; font-size: 13px; }
  .nav-item { padding: 13px 14px; }

  /* ---- 弹窗：占满宽度、顶部对齐、可滚动 ---- */
  .modal { padding: 10px; align-items: flex-start; }
  .modal-box,
  .modal-box.wide, .modal-box.mid,
  .modal-box.view-wide, .modal-box.review-wide,
  .modal-box.xl, .modal-box.bill-full,
  .boxno-box {
    max-width: 100% !important; width: 100% !important;
    max-height: 92vh; overflow-y: auto;
    padding: 16px; border-radius: 12px;
  }
  .modal-box.xl { height: auto; }
  .modal-box.xl .xl-body { padding: 12px 14px; overflow: visible; }
  .modal-box h3 { font-size: 16px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1; min-width: 120px; }

  /* ---- 注册审核弹窗：横向网格折行 ---- */
  .rv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-cols { grid-template-columns: minmax(0, 1fr); }
  .rv-col-side { border-left: 0; padding-left: 0; border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 2px; }
  .rv-head-tip { display: none; }

  /* ---- 表格：横向滑动更顺滑，避免列被压扁 ---- */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 560px; }
  .table-wrap::-webkit-scrollbar { height: 6px; }
  .table-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 3px; }

  /* ---- 卡片与栅格 ---- */
  .card { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .page-title { font-size: 18px; }
  .page-head { gap: 8px; }
  .toolbar { gap: 8px; }
  .toolbar input, .toolbar select { min-width: 0; flex: 1 1 46%; }
  /* 通用两列/多列网格在窄屏折行 */
  .fee-grid, .fin-grid, .rep-grid, .ord-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .mods-grid { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 430px) {
  .login-logo-img { height: 92px; max-width: 140px; }
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .rv-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar input, .toolbar select { flex: 1 1 100%; }
  .table-wrap table { min-width: 520px; }
}

/* ==================================================================
   第124批：账号库同步卡片（用户管理页）
   手机 / 新电脑打开后台时，本地账号库是出厂默认值，靠服务器上这份账号库校验登录。
   ================================================================== */
.auth-sync-ok, .auth-sync-bad {
  font-size: 13px; line-height: 1.7; margin: 2px 0 12px;
  padding: 9px 12px; border-radius: 8px;
}
.auth-sync-ok { color: #0f5132; background: #e8f6ee; border: 1px solid #c6e9d5; }
.auth-sync-bad { color: #842029; background: #fdecec; border: 1px solid #f5c2c7; }

/* ===== 暗色主题：重复往来单位检测弹窗（第126批） ===== */
/* 选中主记录行原来是固定浅蓝 #e8f0fe，暗色下浅色文字落在浅底上看不见公司名称 */
body.theme-dark .dup-sub { background: rgba(217, 48, 37, .12); border-color: rgba(217, 48, 37, .35); color: #efb9b3; }
body.theme-dark .dup-sub b { color: #ff8a80; }
body.theme-dark .dup-row:hover { background: #1c2536; }
body.theme-dark .dup-row.dup-main { background: rgba(77, 132, 255, .22); outline: 1px solid rgba(77, 132, 255, .45); }
body.theme-dark .dup-card-head { color: #ff8a80; }
body.theme-dark .dup-meta { color: #8b96a8; }
body.theme-dark .dup-name .tag-published { background: rgba(52, 168, 83, .22); color: #7ee2a0; }
body.theme-dark .tag-dup { background: rgba(217, 48, 37, .2); color: #ff8a80; }

/* ========== 第140批：表单中心 · 模板库（命名保存 / 重命名 / 载入 / 删除 / 导出选择） ========== */
.tpl-lib-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tpl-lib-lab { font-size: 12px; color: #6b7a92; }
.tpl-lib-cur {
  font-size: 12.5px; font-weight: 600; color: var(--primary, #1a56db);
  background: rgba(26, 86, 219, .07); border: 1px solid rgba(26, 86, 219, .22);
  border-radius: 999px; padding: 3px 12px;
}
.tpl-lib-sep { width: 1px; height: 20px; background: var(--line, #d7dde8); }
.tpl-lib-export-row { display: inline-flex; align-items: center; gap: 8px; }
.tpl-lib-sel {
  height: 30px; min-width: 200px; max-width: 340px; padding: 0 8px;
  border: 1px solid var(--line, #d7dde8); border-radius: 6px;
  background: var(--card, #fff); color: var(--text, #1f2733); font-size: 12.5px;
}
.tpl-lib-sel:focus { outline: none; border-color: var(--primary, #3b82f6); }
.tpl-lib-list { display: flex; flex-direction: column; gap: 6px; }
.tpl-lib-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 12px; border: 1px solid var(--line, #d7dde8); border-radius: 8px;
  background: #fbfcfe; font-size: 13px;
}
.tpl-lib-item.is-cur { border-color: var(--primary, #1a56db); background: rgba(26, 86, 219, .06); }
.tpl-lib-dot { width: 7px; height: 7px; border-radius: 50%; background: #c3ccdb; flex: 0 0 auto; }
.tpl-lib-item.is-cur .tpl-lib-dot { background: var(--primary, #1a56db); }
.tpl-lib-name { font-weight: 600; color: var(--text, #1f2733); cursor: text; }
.tpl-lib-time { font-size: 11.5px; color: #8a97ad; }
.tpl-lib-ops { margin-left: auto; display: inline-flex; gap: 6px; }
.tpl-lib-ops .btn { padding: 3px 10px; font-size: 12px; }
.tpl-lib-ops .btn.is-danger { color: var(--danger, #d93025); border-color: rgba(217, 48, 37, .35); }
.tpl-lib-empty { font-size: 12.5px; color: #8a97ad; padding: 6px 2px 0; }
body.theme-dark .tpl-lib-lab, body.theme-dark .tpl-lib-time, body.theme-dark .tpl-lib-empty { color: #8fa3c4; }
body.theme-dark .tpl-lib-cur {
  color: #8ab4ff; background: rgba(77, 132, 255, .14); border-color: rgba(77, 132, 255, .38);
}
body.theme-dark .tpl-lib-sep { background: #24365c; }
body.theme-dark .tpl-lib-sel { background: #16233c; border-color: #24365c; color: #dbe6fb; }
body.theme-dark .tpl-lib-item { background: #131f36; border-color: #24365c; }
body.theme-dark .tpl-lib-item.is-cur { border-color: #4d84ff; background: rgba(77, 132, 255, .12); }
body.theme-dark .tpl-lib-dot { background: #3a4658; }
body.theme-dark .tpl-lib-item.is-cur .tpl-lib-dot { background: #4d84ff; }
body.theme-dark .tpl-lib-name { color: #dbe6fb; }
/* 第140批：表单中心头部按钮增多（保存 / 另存为），窄屏允许换行，避免「另存为」被裁切 */
.fc-actions { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }

/* ========== 第142批：IVC 第二页编辑区（账户确认函 · 与第 1 页一样可在线编辑） ========== */
/* 模板自带的 <style> 只在第 1 页编辑器里，第 2 页编辑器需要这里补一份纸面基础样式 */
#tpl-editor2 .ivc-doc {
  max-width: 760px; margin: 0 auto; background: #fff; color: #111;
  font-family: 'Times New Roman','PingFang SC',Georgia,serif;
}
#tpl-editor2 img.ivc-appendix { display: block; width: 100%; height: auto; }
#tpl-ivc-p2-card .tpl-paper-wrap { max-height: 60vh; }
/* 第142批：深色主题下模板工具条的「插入占位符」下拉与纸面协调（第 1 / 2 页共用） */
body.theme-dark .tpl-toolbar select { background: #16233c; border-color: #24365c; color: #dbe6fb; }
body.theme-dark .tpl-toolbar .tpl-btn { background: #1b2434; border-color: #2a3446; color: #cbd6e8; }
/* ========== 第143批：深色主题下卡片说明文字（含第 2 页长提示）可读性 ========== */
body.theme-dark .card .bl-note { color: #8fa3c4; }

/* ========== 第151批：合同中心迁到表单中心后的排版修正 ==========
   合同中心原来在「往来单位」页，那里空间宽松；迁到表单中心后一行放不下，
   .seg-btn 的通用规则（flex:1 + 左右 padding:0）会把「票结 / 月结」压成 30px 的竖排。
   这里只对合同中心做定向修正：控件不收缩、允许整体换行、分段按钮保持原样。 */
.tpl-dock .dock-bar { gap: 10px 12px; row-gap: 10px; }
.tpl-dock .dock-field { flex: 0 0 auto; }
.tpl-dock .dock-field.grow { flex: 1 1 220px; min-width: 200px; }
.tpl-dock .dock-bar > .btn { flex: 0 0 auto; }
#dock-settle-seg { flex: 0 0 auto; }
#dock-settle-seg .seg-btn { flex: 0 0 auto; padding: 8px 16px; white-space: nowrap; }
.tpl-dock .dock-settle-hint { flex: 1 1 auto; min-width: 0; margin: 0; align-self: center; }
@media (max-width: 900px) {
  .tpl-dock .dock-field.grow { flex: 1 1 100%; }
  .tpl-dock .dock-field input, .tpl-dock .dock-field select { min-width: 0; width: 100%; }
}

/* ---------- 第152批：合同中心独立成页（原为表单中心页底部浮动条） ---------- */
/* 复用 .tpl-dock 的全部工具栏规则（.dock-bar / .dock-field / #dock-settle-seg），只把
   sticky 浮动条改回普通卡片，避免抬头遮挡内容；整页布局下空间充足，管理区默认展开。 */
#page-contract-center .tpl-dock {
  position: static; bottom: auto; z-index: auto;
  background: var(--card);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 18px;
}
#page-contract-center .tpl-dock > h3 { margin-bottom: 14px; }
#page-contract-center .dock-bar { align-items: flex-end; }
#page-contract-center .dock-panel { border-top: 1px dashed var(--border); margin-top: 16px; padding-top: 16px; }
#page-contract-center .dock-cols { flex-wrap: wrap; }
@media (max-width: 900px) {
  #page-contract-center .dock-cols { flex-direction: column; gap: 16px; }
}
/* 第152批：合同参数两个结算字段的标签不换行（整页布局下字段宽度由内容决定，压窄会把标签折成两行） */
#page-contract-center #dock-days-field > label,
#page-contract-center #dock-month-field > label { white-space: nowrap; }
/* 第152批：暗色主题下日期 / 数字输入框按深色渲染（原生控件默认跟随 color-scheme，否则整块白底） */
body.theme-dark #page-contract-center .dock-field input[type="date"],
body.theme-dark #page-contract-center .dock-field input[type="number"] {
  color-scheme: dark; background: #1b2434; color: var(--text); border-color: var(--border);
}
body.theme-dark .dock-field input::placeholder { color: #6f7c92; }

/* ========== 第153批：合同中心（去 IVC 行 / 结算方式反色 / 多枚印章 / 印章位置） ========== */

/* 1) 票结 / 月结选中态取「系统背景反色」：浅色主题=深底白字，深色主题=浅底深字 */
#dock-settle-seg .seg-btn.on,
#dock-settle-seg .seg-btn.on:hover {
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #0f172a;
}
body.theme-dark #dock-settle-seg .seg-btn.on,
body.theme-dark #dock-settle-seg .seg-btn.on:hover {
  background: #e6ebf5;
  color: #0b1220;
  box-shadow: inset 0 0 0 1px #e6ebf5;
}

/* 2) 印章库：缩略图多枚并排，红框=当前使用 */
.seal-grid { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 10px; }
.seal-item {
  position: relative; width: 76px; height: 76px; padding: 6px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.seal-item img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.seal-item:hover { border-color: #f0a8a8; }
.seal-item.on { border-color: #e02b2b; box-shadow: 0 0 0 2px rgba(224, 43, 43, .16); }
.seal-item .seal-del {
  position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; padding: 0;
  border-radius: 50%; border: 1px solid var(--border); background: #fff; color: #9aa5b8;
  font-size: 13px; line-height: 1; display: none; align-items: center; justify-content: center; cursor: pointer;
}
.seal-item:hover .seal-del { display: flex; }
.seal-item .seal-del:hover { background: #e02b2b; color: #fff; border-color: #e02b2b; }
.seal-ops { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

/* 3) 印章位置弹窗：左侧 A4 示意（可拖动印章），右侧数值 */
#seal-pos-modal .modal-box { max-width: 840px; }
.sp-lead { font-size: 13px; margin-bottom: 16px; line-height: 1.7; }
.sp-lead b { color: var(--text); }
.seal-pos-wrap { display: flex; gap: 24px; align-items: flex-start; }
.seal-page {
  position: relative; flex: 0 0 320px; width: 320px; aspect-ratio: 210 / 297;
  background: #fff; border: 1px solid #d8dee9; border-radius: 3px; overflow: hidden;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .08); touch-action: none;
}
.seal-page-lines { position: absolute; left: 34px; right: 34px; top: 46px; display: flex; flex-direction: column; gap: 14px; }
.seal-page-lines i { display: block; height: 5px; border-radius: 3px; background: #e8ecf4; }
.seal-page-lines i.sp-gap { height: 12px; background: transparent; }
.seal-page-tag { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: #b6bfcd; letter-spacing: .5px; }
#seal-pos-img {
  position: absolute; left: 0; top: 0; cursor: grab; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .12));
}
#seal-pos-img.dragging { cursor: grabbing; }
.seal-pos-form { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.seal-pos-form .field { margin: 0; }
.seal-pos-form .field label { font-size: 12px; color: var(--text-2); }
.seal-pos-form .tpl-tip { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) {
  .seal-pos-wrap { flex-direction: column; }
  .seal-page { width: 100%; flex: 1 1 auto; }
  .seal-pos-form { grid-template-columns: 1fr; width: 100%; }
}
/* 触屏设备没有 hover：多枚印章时删除按钮常显，避免无法删除 */
@media (hover: none) {
  .seal-item .seal-del { display: flex; }
}

/* ========== 第154批：模板预览改图片模式（含印章）/ 印章位置真实底图 / 合同管理默认收起 ========== */

/* 预览：整页图片纵向排列，浅灰底衬托纸张 */
.tvm-pages {
  max-height: 68vh; overflow: auto; padding: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: #eef1f6; border: 1px solid var(--border); border-radius: 10px;
}
.tvm-pages .tvm-page {
  display: block; width: 100%; max-width: 720px; height: auto;
  background: #fff; border-radius: 2px; box-shadow: 0 6px 20px rgba(15, 23, 42, .16);
}
.tvm-busy { padding: 46px 12px; font-size: 13px; color: var(--text-2); }
body.theme-dark .tvm-pages { background: #111a28; }
body.theme-dark .tvm-busy { color: #9aa7bd; }

/* 印章位置弹窗：模板第一页作为底图，印章叠在最上层 */
.seal-page-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #fff; z-index: 1; pointer-events: none;
}
.seal-page-lines { z-index: 1; }
#seal-pos-img { z-index: 3; }
.seal-page-tag { z-index: 4; }

/* ---------- 第155批：白色主题下「切换主题」按钮为黑色 ----------
   原 .theme-btn 的深色底被扁平化区的 .btn-ghost { background:#fff }（更靠后）盖掉，
   这里在文件末尾重申一次：白色主题 = 黑底白字；黑色主题仍由 body.theme-dark 规则（双类优先级）接管。 */
.theme-btn { background: #111418; border-color: #111418; color: #fff; }
.theme-btn:hover { background: #2b3240; border-color: #2b3240; color: #fff; }

/* ---------- 第155批：SI 预览弹窗 ---------- */
.si-preview-name { font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-left: 8px; }
.si-preview-body {
  max-height: 62vh; overflow: auto;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; margin-bottom: 4px;
}
.si-preview-body .tvm-busy { padding: 46px 14px; text-align: center; }
.si-xlsx-view { min-width: 100%; width: max-content; }
.si-xlsx-view table { border-collapse: collapse; font-size: 12px; }
.si-xlsx-view td {
  border: 1px solid #e3e8ef; padding: 4px 9px;
  white-space: nowrap; min-width: 36px; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  color: #1f2937; background: #fff;
}
body.theme-dark .si-preview-body { background: #131c2b; }
body.theme-dark .si-xlsx-view td { border-color: #2a3547; background: transparent; color: #dbe3ef; }

/* ---------- 第156批：服务内容编辑 / 联系我们编辑 ---------- */
.svc-edit-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.svc-list { display: flex; flex-direction: column; gap: 8px; }
.svc-item {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card-bg, #fff); color: var(--text); cursor: pointer;
}
.svc-item b { font-size: 13px; font-weight: 600; }
.svc-item span { font-size: 11.5px; color: var(--text-2); }
.svc-item:hover { border-color: #1a56db; }
.svc-item.on { border-color: #1a56db; background: #eef3ff; }
.svc-editor, .cp-editor { padding: 16px 18px; }
.svc-editor h3, .cp-editor h3 { margin: 0 0 12px; font-size: 15px; }
.svc-editor .field, .cp-editor .field { margin-bottom: 10px; }
.svc-editor textarea, .cp-editor textarea { resize: vertical; }

/* ---------- 第188批：文章正文配图上传 ---------- */
.news-img-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.news-img-hint { font-size: 11.5px; color: var(--text-2); line-height: 1.5; }
.news-img-hint code { font-size: 11px; padding: 1px 4px; border-radius: 4px; background: rgba(120, 140, 170, .14); }
.news-img-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.news-img-chip {
  position: relative; width: 108px; height: 72px; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; background: #f3f5f9;
}
.news-img-chip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.news-img-chip em {
  position: absolute; left: 0; right: 0; bottom: 0; font-style: normal; font-size: 10.5px;
  padding: 2px 6px; color: #fff; background: rgba(12, 22, 36, .58);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.news-img-chip button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0; line-height: 18px;
  border: none; border-radius: 50%; background: rgba(12, 22, 36, .62); color: #fff; cursor: pointer; font-size: 12px;
}
.news-img-chip button:hover { background: #b42318; }
body.theme-dark .news-img-chip { background-color: #16202f; border-color: #2a3547; }

/* ---------- 第189批：封面图选择（输入框 + 选择按钮 + 预览 + 图片库弹窗） ---------- */
.cover-pick { display: flex; align-items: center; gap: 8px; }
.cover-pick input[type="text"] { flex: 1 1 auto; min-width: 0; }
.cover-pick .btn { flex: 0 0 auto; white-space: nowrap; }
.cover-prev { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--text-2); }
.cover-prev img {
  width: 110px; height: 68px; object-fit: cover; display: block;
  border: 1px solid var(--border); border-radius: 6px; background: #f3f5f9;
}
.cover-prev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-modal {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(10, 18, 30, .55);
}
.cover-modal[hidden] { display: none; }
.cover-box {
  position: relative;
  width: min(1180px, 100%); height: 88vh; max-height: 900px; display: flex; flex-direction: column;
  background: var(--card, #fff); border-radius: 12px; overflow: hidden;
  box-shadow: 0 22px 64px rgba(8, 16, 28, .38);
}
.cover-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cover-head b { font-size: 14px; }
.cover-head-tip { font-size: 11.5px; color: var(--text-2); }
.cover-head-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cover-x {
  width: 26px; height: 26px; padding: 0; border: none; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--text-2); font-size: 18px; line-height: 1;
}
.cover-x:hover { background: rgba(120, 140, 170, .16); color: #b42318; }
.cover-search { display: flex; align-items: center; gap: 10px; padding: 10px 16px 4px; }
.cover-search input { flex: 1 1 auto; }
.cover-search span { flex: 0 0 auto; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.cover-grid {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 16px 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  grid-auto-rows: min-content; align-content: start; gap: 14px;
}
.cover-cell {
  position: relative; padding: 0; text-align: left; cursor: pointer; overflow: hidden;
  border: 1px solid var(--border); border-radius: 8px; background: #eef1f6;
}
/* 完整显示整张图（contain），不裁切；方底衬托竖图 / 宽图 */
.cover-cell img {
  width: 100%; height: 150px; object-fit: contain; display: block;
  padding: 4px; box-sizing: border-box; background: #eef1f6;
}
.cover-cell em {
  display: block; font-style: normal; font-size: 11px; color: var(--text-2); padding: 5px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--card, #fff);
}
.cover-cell:hover { border-color: #1a56db; }
.cover-cell:hover .cover-zoom-btn { opacity: 1; }
.cover-cell.on { border-color: #1a56db; box-shadow: 0 0 0 2px rgba(26, 86, 219, .26); }
.cover-cell i {
  position: absolute; top: 6px; left: 6px; font-style: normal; font-size: 10px;
  padding: 1px 5px; border-radius: 999px; color: #fff; background: rgba(12, 22, 36, .62);
}
/* 右上角「看大图」按钮 */
.cover-zoom-btn {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; cursor: zoom-in; opacity: 0; transition: opacity .12s;
  border: none; border-radius: 6px; color: #fff; background: rgba(12, 22, 36, .62);
}
.cover-zoom-btn:hover { background: #1a56db; }
.cover-zoom {
  position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center;
  padding: 30px; background: rgba(8, 14, 24, .9); cursor: zoom-out;
}
.cover-zoom[hidden] { display: none; }
.cover-zoom-in { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cover-zoom-in img {
  max-width: min(1050px, 100%); max-height: calc(88vh - 100px); width: auto; height: auto;
  object-fit: contain; display: block; border-radius: 8px; background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.cover-zoom-bar { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #dbe4f2; }
.cover-zoom-bar span { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-zoom-bar em { font-style: normal; color: #93a3ba; }
.cover-empty { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-2); padding: 20px 2px; }
.cover-foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); }
.cover-cur { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.theme-dark .cover-box { background: #131b27; }
body.theme-dark .cover-cell, body.theme-dark .cover-cell img, body.theme-dark .cover-prev img { background-color: #16202f; }
body.theme-dark .cover-cell em { background: #131b27; }
@media (max-width: 900px) {
  .cover-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .cover-cell img { height: 118px; }
}
@media (max-width: 640px) {
  .cover-modal { padding: 10px; }
  .cover-box { height: 92vh; max-height: none; }
  .cover-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .cover-cell img { height: 96px; }
  .cover-zoom { padding: 12px; }
}
.svc-sub { margin: 18px 0 10px; font-size: 14px; font-weight: 600; }
.cp-history { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.cp-history .svc-sub { margin: 0; }
body.theme-dark .svc-item { background: #16202f; border-color: #2a3547; color: #e6ebf5; }
body.theme-dark .svc-item.on { background: #1d3358; border-color: #5b8def; }
@media (max-width: 900px) { .svc-edit-wrap { grid-template-columns: 1fr; } .svc-list { flex-direction: row; flex-wrap: wrap; } .svc-item { flex: 1 1 140px; } }

/* ---------- 第157批：官网管理 → 导航显示 ---------- */
.nd-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.nd-bar-sp { flex: 1; }
.nd-dirty {
  font-size: 12px; color: #b54708; background: #fff7ed;
  border: 1px solid #fed7aa; border-radius: 6px; padding: 4px 9px;
}
.nd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 12px; }
.nd-card { margin: 0; }
.nd-card .mod-desc { min-height: 32px; }
.nd-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border);
  font-size: 11.5px; color: var(--text-2);
}
.nd-meta .nd-state { font-weight: 600; color: #15803d; }
.nd-card.off .nd-meta .nd-state { color: #b42318; }
body.theme-dark .nd-dirty { background: #3a2a12; border-color: #7a5a1e; color: #fdb022; }
body.theme-dark .nd-meta .nd-state { color: #6ee7a8; }
body.theme-dark .nd-card.off .nd-meta .nd-state { color: #fda29b; }
@media (max-width: 640px) { .nd-grid { grid-template-columns: 1fr; } }

/* ---------- 第158批：导航显示 → 下拉菜单显示按钮 ---------- */
.nd-bar-label { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
@media (max-width: 760px) { .nd-bar { flex-wrap: wrap; } }

/* ---------- 第161批：下拉菜单整合进栏目卡片；子菜单项 = 可点击蓝色标签（蓝=显示，非蓝=隐藏） ---------- */
.nd-bar-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
/* 栏目卡片内的下拉菜单区：整组行 + 子菜单项纵向排列 */
.nd-drop-area {
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border);
}
.nd-group-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
/* 第167批：在线服务卡内「菜单显示名称」行（整合自旧 导航与页脚 页） */
.nd-online-label {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border);
}
.nd-online-label label { font-size: 11.5px; color: var(--text-2); flex-shrink: 0; }
.nd-online-label input {
  flex: 1; min-width: 120px; font-size: 12.5px; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text);
}
body.theme-dark .nd-online-label input { background: #16202f; border-color: #2a3547; color: #dbe4f0; }
.ndi-count {
  font-size: 11px; color: var(--text-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 7px;
}
.ndi-state { font-size: 12px; font-weight: 600; color: #15803d; min-width: 26px; text-align: right; }
.ndi-state.off { color: #b42318; }
.nd-drop-btn {
  font-size: 12px; line-height: 1.2; min-width: 62px; padding: 5px 11px; cursor: pointer;
  border-radius: 6px; border: 1px solid #b6d4f5; background: #eef5ff; color: #17509b;
}
.nd-drop-btn:hover { background: #dceaff; }
.nd-drop-btn.off { border-color: #e3c2bd; background: #fdf1ef; color: #a5382b; }
.nd-drop-btn.off:hover { background: #fbe2de; }
.nd-group-row .nd-drop-btn { margin-left: auto; }
/* 子菜单项标签：点击切换；蓝色 = 显示，非蓝 = 隐藏 */
.nd-items { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.nd-items.groupoff { opacity: .55; }
.nd-chip {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 1px solid var(--border); background: #f4f6fa; color: var(--text-2);
  border-radius: 7px; padding: 6px 10px; cursor: pointer; line-height: 1.3;
}
.nd-chip:hover { border-color: #9db8d9; }
.nd-chip-name { font-size: 12.5px; font-weight: 600; color: var(--text); flex-shrink: 0; }
.nd-chip-href {
  font-size: 11px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nd-chip-state { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--text-2); flex-shrink: 0; }
/* 蓝色 = 显示 */
.nd-chip.on { background: #2563eb; border-color: #2563eb; }
.nd-chip.on .nd-chip-name { color: #fff; }
.nd-chip.on .nd-chip-href { color: #cfe0ff; }
.nd-chip.on .nd-chip-state { color: #fff; }
.nd-chip.on:hover { background: #1d4ed8; }
/* 非蓝 = 隐藏 */
.nd-chip.off .nd-chip-name { color: var(--text-2); }
body.theme-dark .ndi-state { color: #6ee7a8; }
body.theme-dark .ndi-state.off { color: #fda29b; }
body.theme-dark .nd-drop-btn { border-color: #35527a; background: #1c2c46; color: #a9c9f5; }
body.theme-dark .nd-drop-btn:hover { background: #263d60; }
body.theme-dark .nd-drop-btn.off { border-color: #6d403b; background: #3a2321; color: #f7a99f; }
body.theme-dark .nd-drop-btn.off:hover { background: #4a2c29; }
body.theme-dark .nd-chip { background: #16202f; border-color: #2a3547; }
body.theme-dark .nd-chip-name { color: #e6ebf5; }
body.theme-dark .nd-chip.on { background: #2563eb; border-color: #2563eb; }
body.theme-dark .nd-chip.on .nd-chip-name { color: #fff; }
body.theme-dark .nd-chip.off .nd-chip-name { color: #98a2b3; }
body.theme-dark .nd-bar-sep { background: #2a3547; }
@media (max-width: 760px) {
  .nd-bar { flex-wrap: wrap; }
}
/* 第165批说明：在线服务入口已从「同款卡片」改为与案例等栏目下拉菜单同款的 .nd-chip 标签
   （仅显示名称，蓝=显示/非蓝=隐藏），复用既有 .nd-chip/.nd-drop-area/.nd-items 样式，无需新增。 */

/* ==================== 第164批：登录页密码「小眼睛」显示/隐藏 ==================== */
/* 密码框包一层 .pwd-wrap；右侧悬浮小眼睛按钮（内联 SVG，Windows 也有字形）。
   默认密码隐藏（type=password，亮眼睛图标）；点击 → 明文 + 划线眼睛图标（.on）。 */
.pwd-wrap { position: relative; }
.field .pwd-wrap input { padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: none; border-radius: 6px; cursor: pointer; line-height: 1;
  color: var(--text-2, #667085);
}
.pwd-eye:hover { background: rgba(0, 0, 0, .06); }
.pwd-eye svg { display: block; }
.pwd-eye .eye-off { display: none; }
.pwd-eye.on .eye-on { display: none; }
.pwd-eye.on .eye-off { display: block; }
/* 登录页是毛玻璃白卡 + 白字，小眼睛用白色系（压过上面的通用色） */
.login-card .field .pwd-wrap .pwd-eye { color: rgba(255, 255, 255, .78); }
.login-card .field .pwd-wrap .pwd-eye:hover { color: #fff; background: rgba(255, 255, 255, .14); }
