/* ============================================================
   国际物流工单系统 WEB 版 v2.0 —— 设计系统样式
   组织：① Token ② 基础 ③ 组件 ④ 全局框架 ⑤ 页面 ⑥ 响应式
   规范来源：《PRD_国际物流工单WEB版_v2.0》第 6/7/8 章 + v2.0 高保真原型
   ============================================================ */

/* ========== ① Token（PRD 6.1-6.3） ========== */
:root {
  /* 品牌 */
  --brand-600: #2F6BFF;
  --brand-700: #1E4FDB;
  --brand-50: #F0F4FF;
  --brand-100-focus: rgba(47, 107, 255, .15);
  /* 中性 */
  --text-1: #1F2329;
  --text-2: #4E5560;
  --text-3: #8A919C;
  --border-1: #D9DEE5;
  --border-2: #EBEDF0;
  --bg-page: #F5F6F8;
  --bg-card: #FFFFFF;
  --bg-hover: #F5F6F8;
  --bg-thead: #F7F8FA;
  --mask: rgba(31, 35, 41, .45);
  /* 功能色 / 状态色 */
  --c-danger: #E23B3B;
  --c-warn: #FF8A00;
  --c-ok: #22A45D;
  --c-info: #2F6BFF;
  --c-neutral: #9AA0A6;
  --c-teal: #00A3A3;
  --c-purple: #6A5CFF;
  --c-amber: #F5A623;
  /* 状态色 10% 底（color-mix 降级常量） */
  --t-red: #FEECEC; --t-orange: #FFF1E3; --t-blue: #EAF0FF; --t-green: #E8F6EE;
  --t-purple: #EFEDFF; --t-teal: #E0F5F5; --t-amber: #FEF5E5; --t-gray: #F1F2F4;
  /* 阴影 */
  --shadow-1: 0 1px 2px rgba(31, 35, 41, .06);
  --shadow-2: 0 4px 12px rgba(31, 35, 41, .08);
  --shadow-3: 0 8px 24px rgba(31, 35, 41, .12);
  /* 圆角 */
  --r-sm: 4px; --r-md: 8px; --r-full: 999px;
  /* 布局 */
  --side-w: 220px;
  --topbar-h: 56px;
}

/* ========== ② 基础 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 22px; color: var(--text-1); background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 24px; line-height: 32px; font-weight: 600; }
h2 { font-size: 20px; line-height: 28px; font-weight: 600; }
h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: 14px; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; color: var(--text-1); }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: var(--bg-hover); border-radius: 3px; padding: 1px 6px; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; border-radius: 2px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-2); }
.muted { color: var(--text-3); font-size: 12px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }

/* ========== ③ 组件 ========== */
/* ---- 按钮（L 40 / M 32 / S 28） ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 16px; border-radius: var(--r-sm);
  background: var(--bg-card); border: 1px solid var(--border-1);
  color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--bg-hover); }
.btn:disabled { background: var(--bg-hover); color: var(--text-3); border-color: var(--border-2); cursor: not-allowed; }
.btn-lg { height: 40px; padding: 0 20px; }
.btn-sm { height: 28px; padding: 0 12px; font-size: 13px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-primary:disabled { background: var(--bg-hover); border-color: var(--border-2); color: var(--text-3); }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #C93030; }
.btn-text { border-color: transparent; background: transparent; color: var(--brand-600); }
.btn-text:hover { background: var(--brand-50); color: var(--brand-700); }
.btn-text.danger { color: var(--c-danger); }
.btn-text.danger:hover { background: var(--t-red); }
/* v4.1.4：主题色描边按钮（详情页返回/关闭跟随主题色） */
.btn-brand-outline { border: 1px solid var(--brand-600); color: var(--brand-600); background: transparent; }
.btn-brand-outline:hover { background: var(--brand-50); border-color: var(--brand-700); color: var(--brand-700); }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 999px;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 表单 ---- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field > label .req { color: var(--c-danger); margin-left: 2px; }
.input, .field input, .field select, .field textarea,
.form-input, .form-textarea, .form-select {
  width: 100%; height: 32px; padding: 0 12px; background: var(--bg-card);
  border: 1px solid var(--border-1); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
.form-textarea, .field textarea { height: auto; min-height: 88px; padding: 8px 12px; resize: vertical; line-height: 20px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus,
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-100-focus);
  outline: none; /* v3.8：去除浏览器默认 focus 轮廓，避免与边框形成双层框（聚焦指示由边框变色 + 光环承担） */
}
/* v4.1.12（#6）：工单搜索框主题色——边框品牌色 + 聚焦光环，与主题色搜索按钮构成统一搜索控件（位于筛选行最左，不再两个搜索框/嵌套） */
.tk-search { border-color: var(--brand-600); }
.tk-search:focus { border-color: var(--brand-700); box-shadow: 0 0 0 3px var(--brand-100-focus); }
.tk-search-wrap .btn-primary { box-shadow: none; }
/* v4.1.15（P1-5）：搜索语法说明 ⓘ 图标按钮——紧贴输入框右侧，不挤占搜索区 */
.btn-icon.kw-help {
  flex: none; width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm);
  border-color: var(--border-1); background: var(--bg-card); color: var(--text-2); font-size: 15px; line-height: 1;
}
.btn-icon.kw-help:hover { background: var(--bg-hover); color: var(--brand-600); border-color: var(--brand-600); }
.help-pop p { margin: 0 0 8px; line-height: 1.6; }
.help-pop .help-list { margin: 0 0 10px; padding-left: 20px; }
.help-pop .help-list li { margin-bottom: 4px; line-height: 1.6; }
/* v3.8：登录输入框「只留一个边框」——去除 Chromium UA 默认 outline（2px 轮廓套在 1px 边框外呈双层框） */
.login-card .login-input:focus, .pwd-wrap .login-input:focus { outline: none; }
/* v3.8：登录图片验证码区（连续失败 3 次后显示） */
.login-captcha { display: flex; align-items: center; gap: 10px; }
.login-captcha-img { width: 132px; height: 44px; border: 1px solid var(--border-1); border-radius: var(--r-sm); cursor: pointer; background: var(--bg-card); flex: 0 0 auto; }
.login-captcha-img:hover { border-color: var(--brand-600); }
.login-captcha .login-input { flex: 1; min-width: 0; letter-spacing: 2px; text-transform: uppercase; }
.input::placeholder, textarea::placeholder { color: var(--text-3); }
.input.err, .field input.err, .field textarea.err, .form-input.err, .form-textarea.err { border-color: var(--c-danger); }
.field-err { font-size: 12px; color: var(--c-danger); margin-top: 4px; min-height: 0; }
select.form-select, .field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238A919C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.form-help { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ---- 标签 / 徽标 ---- */
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: var(--r-sm); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tag i { width: 6px; height: 6px; border-radius: var(--r-full); background: currentColor; flex: 0 0 6px; }
.tag.red { background: var(--t-red); color: var(--c-danger); }
.tag.orange { background: var(--t-orange); color: var(--c-warn); }
.tag.blue { background: var(--t-blue); color: var(--c-info); }
.tag.green { background: var(--t-green); color: var(--c-ok); }
.tag.purple { background: var(--t-purple); color: var(--c-purple); }
.tag.teal { background: var(--t-teal); color: var(--c-teal); }
.tag.amber { background: var(--t-amber); color: var(--c-amber); }
.tag.gray { background: var(--t-gray); color: var(--c-neutral); }

.pdot { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pdot i { width: 8px; height: 8px; border-radius: var(--r-full); flex: 0 0 8px; }
.pdot.p0 { color: var(--c-danger); } .pdot.p0 i { background: var(--c-danger); }
.pdot.p1 { color: var(--c-warn); } .pdot.p1 i { background: var(--c-warn); }
.pdot.p2 { color: var(--c-info); } .pdot.p2 i { background: var(--c-info); }
.pdot.p3 { color: var(--c-neutral); } .pdot.p3 i { background: var(--c-neutral); }
.pdot.p0.pulse i, .pdot.pulse i { animation: pdot-pulse 1.5s ease-in-out infinite; }
@keyframes pdot-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 59, 59, .4); } 50% { box-shadow: 0 0 0 4px rgba(226, 59, 59, 0); } }
@media (prefers-reduced-motion: reduce) { .pdot.pulse i, .sla.soon { animation: none !important; } }

/* SLA 徽标三态：over 红底白字 / soon 红字脉冲 / ok 灰 */
.sla {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px;
  border-radius: var(--r-full); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.sla.over { background: var(--c-danger); color: #fff; }
.sla.soon { background: var(--t-red); color: var(--c-danger); animation: sla-pulse 1.2s infinite; }
.sla.ok { background: var(--t-gray); color: var(--text-3); font-weight: 500; }
.sla .dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--c-danger); flex: 0 0 8px; animation: pdot-pulse 1.5s ease-in-out infinite; }
@keyframes sla-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 59, 59, .35); } 50% { box-shadow: 0 0 0 5px rgba(226, 59, 59, 0); } }

/* ---- 表格 ---- */
.tbl-card { background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-1); overflow: hidden; }
.tbl-scroll { overflow: auto; max-height: calc(100vh - 356px); min-height: 240px; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; z-index: 2; font-size: 12px; font-weight: 600; color: var(--text-2); text-align: left; padding: 0 12px; height: 40px; background: var(--bg-thead); border-bottom: 1px solid var(--border-2); white-space: nowrap; }
td { padding: 0 12px; height: 44px; border-bottom: 1px solid var(--border-2); white-space: nowrap; font-size: 13px; color: var(--text-2); }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--brand-50); }
tbody tr.sel { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand-600); }
tbody tr.over-row { box-shadow: inset 3px 0 0 var(--c-danger); }
tbody tr.over-row.sel { box-shadow: inset 3px 0 0 var(--brand-600); }
td .tt { color: var(--text-1); font-weight: 500; display: inline-block; vertical-align: middle; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
td .quick-accept { visibility: hidden; margin-left: 6px; }
tbody tr:hover td .quick-accept, tbody tr:focus-within td .quick-accept { visibility: visible; }

/* ---- 卡片 / 统计 ---- */
.panel { background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 16px 20px; }
.panel + .panel { margin-top: 16px; }
.statbar { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.stat { flex: 1; min-width: 140px; background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--r-md); padding: 12px 16px; box-shadow: var(--shadow-1); }
.stat b { display: block; font-size: 28px; line-height: 36px; font-weight: 600; }
.stat span { display: block; color: var(--text-3); font-size: 12px; }
.stat.danger b { color: var(--c-danger); }
.stat.warn b { color: var(--c-warn); }
.stat.brand b { color: var(--brand-600); }
/* v4.1.4：可点击状态概览卡片 */
.stat-click { cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s, background .15s; }
.stat-click:hover { border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-50); }
.stat-click.on { border-color: var(--brand-600); background: var(--brand-50); }
.stat-click .status-tag { margin-top: 4px; }

/* ---- 筛选 chips ---- */
.chips { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--border-1); background: var(--bg-card); color: var(--text-2); font-size: 13px; white-space: nowrap; }
.chip:hover { border-color: var(--brand-600); color: var(--brand-600); }
.chip.on { background: var(--t-blue); border-color: var(--brand-600); color: var(--brand-600); }
.chip .c { opacity: .7; margin-left: 4px; font-size: 12px; }

/* ---- 时间线 ---- */
.tl { position: relative; padding-left: 18px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border-2); }
.tl .item { position: relative; padding-bottom: 14px; }
.tl .item:last-child { padding-bottom: 2px; }
.tl .item::before { content: ""; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px; border-radius: var(--r-full); background: #fff; border: 2px solid var(--text-3); }
.tl .item.c-blue::before { border-color: var(--brand-600); }
.tl .item.c-teal::before { border-color: var(--c-teal); }
.tl .item.c-purple::before { border-color: var(--c-purple); }
.tl .item.c-orange::before { border-color: var(--c-warn); }
.tl .item.c-amber::before { border-color: var(--c-amber); }
.tl .item.c-green::before { border-color: var(--c-ok); }
.tl .item.c-red::before { border-color: var(--c-danger); }
.tl .item .t { font-size: 13px; font-weight: 500; color: var(--text-1); display: flex; align-items: center; gap: 6px; }
.tl .item .t .nico { font-size: 12px; color: var(--brand-600); }
.tl .item .d { font-size: 12px; color: var(--text-3); }

/* ---- 抽屉 Drawer ---- */
.drawer-mask { position: fixed; inset: 0; background: var(--mask); z-index: 210; animation: fade-in .15s ease-out; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 92vw; background: var(--bg-card); box-shadow: var(--shadow-3); z-index: 211; display: flex; flex-direction: column; animation: drawer-in .2s ease-out; }
.drawer.left { right: auto; left: 0; width: 260px; animation: drawer-in-left .2s ease-out; }
.drawer-hd { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border-2); }
.drawer-hd h3 { font-size: 16px; }
.drawer-hd .x { margin-left: auto; width: 32px; height: 32px; border-radius: var(--r-sm); color: var(--text-3); font-size: 18px; display: flex; align-items: center; justify-content: center; }
.drawer-hd .x:hover { background: var(--bg-hover); color: var(--text-1); }
.drawer-bd { flex: 1; overflow: auto; padding: 16px; }
.drawer-ft { padding: 12px 16px; border-top: 1px solid var(--border-2); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes drawer-in-left { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- 弹窗 Modal ---- */
.modal-mask { position: fixed; inset: 0; background: var(--mask); z-index: 220; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade-in .15s ease-out; }
.modal { background: var(--bg-card); border-radius: var(--r-md); width: min(560px, 90vw); max-height: 84vh; display: flex; flex-direction: column; box-shadow: var(--shadow-3); animation: modal-in .18s ease-out; }
.modal-lg { width: min(760px, 94vw); }
@keyframes modal-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-2); display: flex; align-items: center; }
.modal-header h3 { font-size: 16px; }
.modal-header .close { margin-left: auto; width: 32px; height: 32px; border-radius: var(--r-sm); color: var(--text-3); font-size: 20px; display: flex; align-items: center; justify-content: center; }
.modal-header .close:hover { background: var(--bg-hover); color: var(--text-1); }
.modal-body { padding: 20px; overflow: auto; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border-2); display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.modal-footer .btn { min-width: 76px; }
/* v4.1.9（#14）：弹窗内表单行——标签定宽、输入撑满且 min-width:0 防止子项溢出导致按钮框凸出/错位 */
.modal-body .form-row { align-items: flex-start; }
.modal-body .form-row > * { min-width: 0; }
.modal-body .form-row > label { flex: 0 0 88px; color: var(--text-2); padding-top: 7px; }
/* v4.1.6：列表预览改为居中浮窗——中和 detail-panel 在浮窗内的固定宽度/吸顶/边框样式，使其在 modal-body 内自然流式展示 */
.modal-body .detail-panel { flex: none; position: static; height: auto; width: auto; max-height: none; border: 0; box-shadow: none; background: transparent; }
.modal-body .detail-panel .hd { padding: 0 0 12px; border-bottom: 1px solid var(--border-2); }
.modal-body .detail-panel .bd { padding: 12px 0 0; }

/* ---- Toast（v4.1.15 P2-9：改右下角悬浮，避免遮挡顶部 page-desc 操作提示；最多叠 3 条） ---- */
#toast-host { position: fixed; bottom: 20px; right: 20px; left: auto; top: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: rgba(31, 35, 41, .9); color: #fff; padding: 9px 16px; border-radius: var(--r-sm); font-size: 13px; max-width: 80vw; box-shadow: var(--shadow-2); animation: toast-in .2s ease-out; transition: opacity .2s; }
.toast .ic { flex: 0 0 16px; text-align: center; }
.toast.success .ic { color: #6FE0A0; }
.toast.error .ic { color: #FF8E8E; }
.toast.warn .ic { color: #FFC069; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- 空状态 ---- */
.empty { padding: 48px 20px; text-align: center; }
.empty .e-ico { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--border-1); }
.empty .e-title { font-size: 14px; color: var(--text-2); font-weight: 500; }
.empty .e-desc { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.empty .e-act { margin-top: 16px; }

/* ---- 骨架屏 ---- */
.sk { position: relative; overflow: hidden; background: #EEF0F3; border-radius: var(--r-sm); }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-row { height: 44px; display: flex; align-items: center; gap: 16px; padding: 0 12px; border-bottom: 1px solid var(--border-2); }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }

/* ---- 内部备注警示条 / 提示条 ---- */
.note-warn { display: flex; align-items: center; gap: 8px; background: var(--t-orange); border: 1px solid #FFD591; color: #874D00; border-radius: var(--r-sm); padding: 8px 12px; font-size: 12px; font-weight: 500; }
/* v4.1.11：出入库扫描结果提示条（note-ok 此前被 warehouse.js 使用但缺样式定义，历史欠账一并补齐） */
.note-ok { display: flex; align-items: center; gap: 8px; background: var(--t-green); border: 1px solid #A9DFC0; color: #116B3D; border-radius: var(--r-sm); padding: 8px 12px; font-size: 12px; font-weight: 500; }
.note-err { display: flex; align-items: center; gap: 8px; background: var(--t-red); border: 1px solid #F5B5B5; color: var(--c-danger); border-radius: var(--r-sm); padding: 8px 12px; font-size: 12px; font-weight: 500; }
.hintbox { background: var(--brand-50); border: 1px solid #D6E2FF; border-radius: var(--r-sm); padding: 10px 12px; font-size: 12px; color: #2B4A9E; line-height: 18px; }
.errbar { display: flex; align-items: center; gap: 8px; background: var(--t-red); border: 1px solid #F5B5B5; color: var(--c-danger); border-radius: var(--r-sm); padding: 8px 12px; font-size: 13px; }

/* ---- 内部备注块 ---- */
.inote { background: #FFFBEA; border: 1px solid #FFE58F; border-radius: 6px; padding: 8px 10px; font-size: 12px; color: #614700; margin-bottom: 8px; line-height: 18px; }
.inote b { color: #874D00; }

/* ---- 工单回复（v3.7，客户可见）---- */
.reply-lock { font-size: 11px; font-weight: 500; color: var(--c-ok); background: var(--t-green); border: 1px solid #B7EB8F; border-radius: var(--r-sm); padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.reply-item { background: var(--bg-hover); border: 1px solid var(--border-2); border-radius: 6px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; line-height: 20px; }
.reply-item .r-by { font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.reply-item .r-text { white-space: pre-wrap; word-break: break-word; }
.reply-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* ---- 图片缩略 / lightbox ---- */
.img-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.img-grid .ph { width: 64px; height: 64px; border-radius: 6px; border: 1px solid var(--border-2); object-fit: cover; cursor: zoom-in; background: var(--bg-hover); }
.lightbox { position: fixed; inset: 0; background: rgba(31, 35, 41, .8); z-index: 240; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 90vw; max-height: 88vh; border-radius: var(--r-md); box-shadow: var(--shadow-3); }

/* ---- 头像 / 角色标签 ---- */
.av { width: 32px; height: 32px; border-radius: var(--r-full); background: var(--brand-600); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 32px; }
.role-tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; }
.role-customer { background: var(--t-blue); color: var(--c-info); }
.role-staff { background: var(--t-green); color: var(--c-ok); }
.role-admin { background: var(--t-orange); color: var(--c-warn); }
.role-warehouse { background: var(--t-purple, #efe7ff); color: var(--c-purple, #6a35d8); }

/* 工单分类徽标（v2.1）：B2B 蓝 / B2C 橙 */
.biz-tag { display: inline-block; padding: 0 6px; height: 18px; line-height: 18px; border-radius: var(--r-sm); font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; vertical-align: middle; }
.biz-tag.b2b { background: var(--t-blue); color: var(--c-info); }
.biz-tag.b2c { background: var(--t-orange); color: var(--c-warn); }

/* ---- 分页 ---- */
/* v4.1.4：整体左对齐（翻页 + 每页条数选择全部移到左下角），可换行避免拥挤 */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-start; flex-wrap: wrap; padding: 10px 12px; color: var(--text-3); font-size: 13px; }
.pager .pager-total { white-space: nowrap; }
.pager .pager-size-wrap { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pager .pager-size { width: auto; height: 28px; padding: 0 6px; font-size: 13px; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238A919C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
/* v4.1.9（#11）：跳至指定页码 */
.pager .pager-jump-wrap { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin-left: 6px; }
.pager .pager-jump { width: 56px; height: 28px; padding: 0 6px; font-size: 13px; border: 1px solid var(--border-1); border-radius: var(--r-sm); background: var(--bg-card); color: var(--text-1); }
.pager .pager-jump-wrap .btn { height: 28px; }
.pager button { min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid var(--border-1); border-radius: var(--r-sm); background: var(--bg-card); color: var(--text-2); }
.pager button:hover:not(:disabled) { border-color: var(--brand-600); color: var(--brand-600); }
.pager button.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---- KV / 分节标题 ---- */
.kv { display: flex; font-size: 13px; margin-bottom: 8px; gap: 8px; }
.kv .k { flex: 0 0 88px; color: var(--text-3); }
.kv .v { color: var(--text-1); font-weight: 500; word-break: break-all; }
.sec-t { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.sec-t::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }

/* ---- 评分星 ---- */
.rating { display: inline-flex; gap: 4px; }
.rating .star { font-size: 22px; line-height: 1; color: var(--border-1); cursor: pointer; }
.rating .star.active, .rating .star:hover { color: var(--c-amber); }

/* ---- 上传虚线框 ---- */
.upload { border: 1.5px dashed var(--border-1); border-radius: var(--r-md); padding: 18px; text-align: center; color: var(--text-3); font-size: 13px; background: var(--bg-hover); cursor: pointer; transition: border-color .15s, color .15s; }
.upload:hover { border-color: var(--brand-600); color: var(--brand-600); }

/* ---- 步骤条（建单页顶部） ---- */
.steps { display: flex; background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--r-md); padding: 14px 8px; box-shadow: var(--shadow-1); margin-bottom: 16px; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 16px; color: var(--text-3); font-size: 13px; min-width: 0; }
.step .n { width: 26px; height: 26px; border-radius: var(--r-full); border: 1px solid var(--border-1); display: flex; align-items: center; justify-content: center; font-size: 12px; background: var(--bg-card); flex: 0 0 26px; }
.step.on { color: var(--brand-600); font-weight: 600; }
.step.on .n { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.step.done { color: var(--text-2); cursor: pointer; }
.step.done .n { background: var(--c-ok); border-color: var(--c-ok); color: #fff; }

/* ---- 类型卡片 / 紧急度卡片 ---- */
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-card { border: 1px solid var(--border-1); border-radius: var(--r-md); padding: 14px; cursor: pointer; background: var(--bg-card); transition: border-color .15s, box-shadow .15s; }
.type-card:hover { border-color: var(--brand-600); }
.type-card .tc-ico { font-size: 20px; margin-bottom: 6px; }
.type-card b { display: block; font-size: 14px; margin-bottom: 4px; }
.type-card small { color: var(--text-3); font-size: 12px; line-height: 16px; display: block; }
.type-card .tc-photo { color: var(--c-warn); font-size: 11px; margin-top: 4px; display: block; }
.type-card.on { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand-600); }
.urgrow { display: flex; gap: 10px; }
.urg { flex: 1; border: 1px solid var(--border-1); border-radius: var(--r-sm); padding: 10px 8px; cursor: pointer; background: var(--bg-card); text-align: center; transition: border-color .15s; }
.urg:hover { border-color: var(--brand-600); }
.urg b { display: block; font-size: 13px; }
.urg small { font-size: 11px; color: var(--text-3); }
.urg .u-dot { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-full); margin-right: 5px; }
.urg.on { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand-600); }

/* ========== ④ 全局框架 ========== */
.frame { display: flex; min-height: 100vh; }
.side { width: var(--side-w); background: var(--bg-card); border-right: 1px solid var(--border-2); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 16px 20px; }
.side .logo .mark { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--brand-600); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 32px; }
.side .logo b { font-size: 15px; white-space: nowrap; }
/* v4.1.12（Owner 实测反馈 #1）：scrollbar-gutter: stable 始终预留滚动条宽度——
   二级菜单全部展开、内容超出视口时滚动条出现/消失不再挤压菜单背景（曾出现「展开后菜单色块被压窄」的视觉问题）；
   配细滚动条美化（6px 圆角 + 中性色 thumb，hover 加深），常驻不突兀 */
.side nav { flex: 1; padding: 4px 8px 8px; overflow-y: auto; scrollbar-gutter: stable; }
.side nav::-webkit-scrollbar { width: 6px; }
.side nav::-webkit-scrollbar-thumb { background: var(--border-1); border-radius: var(--r-full); }
.side nav::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
.side nav::-webkit-scrollbar-track { background: transparent; }
.side .grp { font-size: 12px; color: var(--text-3); padding: 18px 12px 4px; white-space: nowrap; }
.side a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 6px; color: var(--text-2); font-weight: 500; font-size: 14px; margin-bottom: 2px; position: relative; white-space: nowrap; }
.side a .ico { width: 18px; text-align: center; opacity: .75; flex: 0 0 18px; }
.side a:hover { background: var(--bg-hover); }
.side a.on { background: var(--brand-50); color: var(--brand-600); }
.side a.on::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--brand-600); }
.side a .n { margin-left: auto; background: var(--c-danger); color: #fff; font-size: 11px; border-radius: var(--r-full); padding: 0 6px; line-height: 16px; min-width: 16px; text-align: center; }
.side .me { border-top: 1px solid var(--border-2); padding: 12px 16px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.side .me:hover { background: var(--bg-hover); }
.side .me b { display: block; font-size: 13px; }
.side .me small { display: block; color: var(--text-3); font-size: 12px; }

/* v4.1.8：云仓管理侧边栏下拉分组（accordion） */
/* v4.1.10（Owner 实测反馈 #4）：二级菜单展开符号由实心小三角 ▾/▸ 改为全角 ＋/－
   （与「新建工单」等菜单的全角 ＋ 风格统一；固定宽度避免展开/收起时父标题文字抖动） */
.side a .sub-caret { margin-left: auto; background: none; border: none; color: var(--text-3); cursor: pointer; padding: 2px 6px; font-size: 13px; line-height: 1; font-weight: 600; min-width: 18px; text-align: center; }
.side a .sub-caret:hover { color: var(--brand-600); }
.side .wh-sub { margin: 0 0 0; }
/* v4.1.11（Owner 反馈「展开效果不理想、太生硬」）：二级菜单过渡动画——参考 CRM/博客站点侧边栏做法：
   收起态高度坍缩(max-height:0) + 透明 + 无背景；展开态渐显 + 品牌淡背景(--brand-50，全主题自适应)渐入，
   cubic-bezier 缓动让展开有「弹性落位」感；margin 同步过渡消除收起后的空隙抖动。
   注意：子菜单容器在 app.js 中常驻 DOM（不再随 open 增删节点），由 .open class 驱动过渡；
   route() 整页重建时按 _subOpen 终态直接呈现（无动画），仅用户点击展开/收起时播放。 */
.side .wh-sub, .drawer .wh-sub {
  max-height: 0; opacity: 0; overflow: hidden; background: transparent; border-radius: 8px;
  transition: max-height .32s cubic-bezier(.4,0,.2,1), opacity .26s ease, background-color .32s ease, margin .32s ease;
}
.side .wh-sub.open, .drawer .wh-sub.open { max-height: 560px; opacity: 1; background: var(--brand-50); margin: 2px 0 6px; }
.side .wh-sub .sub-grp { font-size: 11px; color: var(--text-3); padding: 8px 12px 2px 28px; white-space: nowrap; }
.side .wh-sub a { height: 32px; padding: 0 12px 0 34px; font-size: 13px; margin-bottom: 1px; }
.side .wh-sub a .ico { font-size: 13px; }
.side .wh-sub a:hover { background: var(--bg-hover); }
.side .wh-sub a.on { background: var(--brand-50); color: var(--brand-600); }
.side .wh-sub a.on::before { left: -8px; top: 6px; bottom: 6px; }
/* 父标题与 caret 的颜色过渡：展开时 caret 由灰渐变为品牌色，配合子菜单淡背景形成「过渡颜色区分」 */
.side a.sub-parent, .drawer nav a.sub-parent { transition: background-color .2s ease, color .2s ease; }
.side a .sub-caret, .drawer .sub-caret-txt { transition: color .25s ease; }
.side a.sub-open .sub-caret { color: var(--brand-600); }
.side a.sub-open:hover .sub-caret { color: var(--brand-700); }
/* 抽屉内（移动端）下拉分组复用同一结构 */
.drawer .wh-sub .sub-grp { font-size: 11px; color: var(--text-3); padding: 8px 12px 2px 28px; }
.drawer .wh-sub a { padding-left: 34px; font-size: 13px; height: 34px; }
.drawer .sub-caret-txt { margin-left: auto; color: var(--text-3); font-size: 13px; font-weight: 600; min-width: 18px; text-align: center; }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); background: var(--bg-card); border-bottom: 1px solid var(--border-2); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.hamburger { display: none; width: 36px; height: 36px; border-radius: 6px; font-size: 18px; align-items: center; justify-content: center; color: var(--text-2); }
.hamburger:hover { background: var(--bg-hover); }
/* .g-search 见文末主题系统区块（v3.5 重写：单层结构 + 大字号） */
.bell { position: relative; width: 36px; height: 36px; border-radius: 6px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-1); background: var(--bg-card); color: var(--text-2); font-size: 15px; }
.bell:hover { background: var(--bg-hover); }
.bell .dot { position: absolute; top: -7px; right: -7px; background: var(--c-danger); color: #fff; font-size: 11px; border-radius: var(--r-full); padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; cursor: pointer; position: relative; }
.topbar .who:hover { background: var(--bg-hover); }
.topbar .who .wname { font-size: 13px; color: var(--text-2); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-2); min-width: 140px; padding: 6px; z-index: 60; }
.who-menu a, .who-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: var(--text-2); }
.who-menu a:hover, .who-menu button:hover { background: var(--bg-hover); }
.who-menu .logout { color: var(--c-danger); }

/* 路由切换进度条 */
.route-progress { position: fixed; top: 0; left: var(--side-w); right: 0; height: 2px; z-index: 100; pointer-events: none; overflow: hidden; }
.route-progress .bar { height: 100%; width: 40%; background: var(--brand-600); border-radius: 2px; animation: progress-slide 1s ease-in-out infinite; }
@keyframes progress-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

.page { padding: 20px 24px 48px; flex: 1; }
.page-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-h h1 { font-size: 20px; }
.page-h .r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.page-desc { font-size: 12px; color: var(--text-3); }

/* 主从布局 */
.master-detail { display: flex; gap: 16px; align-items: flex-start; }
.master { flex: 1; min-width: 0; }
/* 预览宿主固定宽度：避免 .detail-panel 的 flex-basis 在块级父级失效导致宽度随内容 shrink-to-fit 变化 */
#tk-panel { flex: 0 0 380px; min-width: 0; }
#tk-panel .detail-panel { width: 100%; }
/* v4.1.3：固定高度（不再用 max-height 随内容伸缩，保证每个工单预览尺寸一致） */
.detail-panel { flex: 0 0 380px; position: sticky; top: calc(var(--topbar-h) + 20px); height: calc(100vh - var(--topbar-h) - 40px); overflow: auto; background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.detail-panel .hd { padding: 16px; border-bottom: 1px solid var(--border-2); }
.detail-panel .bd { padding: 16px; }
.detail-panel .ops { padding: 12px 16px; border-top: 1px solid var(--border-2); display: flex; gap: 8px; flex-wrap: wrap; background: var(--bg-thead); border-radius: 0 0 var(--r-md) var(--r-md); position: sticky; bottom: 0; }

/* ========== ⑤ 页面 ========== */
/* ---- 登录 ---- */
/* ── 登录页 v3.2：三图轮播（海运/中亚卡航/空运）+ 品牌深蓝纱罩 + 干净卡片右置 ── */
.login-page { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: flex-end; padding: 20px 7vw; overflow: hidden; background: #0D2440; }
.login-slides { position: absolute; inset: 0; }
.login-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0D2440; opacity: 0; transition: opacity 1.6s ease; will-change: opacity; }
.login-slide.on { opacity: 1; }
.login-veil { position: absolute; inset: 0; background: linear-gradient(97deg, rgba(13,36,68,.05) 0%, rgba(13,36,68,.22) 34%, rgba(13,36,68,.56) 60%, rgba(13,36,68,.74) 100%); }
.login-dots { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; }
.login-dots i { display: block; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.4); transition: width .3s ease, background .3s ease; }
.login-dots i.on { width: 18px; border-radius: 3px; background: #fff; }
.login-caption { position: absolute; left: 52px; bottom: 44px; color: #fff; text-shadow: 0 1px 10px rgba(8,24,48,.55); pointer-events: none; }
.login-caption .cap-t { font-size: 22px; font-weight: 600; letter-spacing: 1px; line-height: 30px; }
.login-caption .cap-s { font-size: 12px; line-height: 20px; opacity: .85; margin-top: 6px; letter-spacing: .5px; }
.login-card { position: relative; width: 408px; max-width: calc(100vw - 32px); background: var(--bg-card); border-radius: var(--r-md); box-shadow: 0 16px 48px rgba(8,22,44,.32), var(--shadow-1); padding: 34px 32px; }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.login-logo .mark { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--brand-600); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.login-tip { margin-top: 20px; font-size: 12px; color: var(--text-3); text-align: center; }
.login-hint { margin-top: 16px; background: var(--bg-hover); border-radius: var(--r-sm); padding: 10px 12px; font-size: 12px; color: var(--text-2); line-height: 20px; }

/* v3.6 登录表单增强：大输入框 + 忘记密码 + 协议同意 */
/* 注意：.field input 特异性为 (0,1,1)，高于单类选择器，故此处必须加 .login-card 提升到 (0,2,0) 才能覆盖 */
/* v3.6.1：卡片收窄至 408px、输入框 46px/15px，改扁平单边框（去圆角投影与聚焦光圈） */
.login-card .login-input { height: 46px; font-size: 15px; padding: 0 14px; border: 1px solid var(--border-1); border-radius: var(--r-sm); box-shadow: none; background: var(--bg-card); }
.login-card .login-input::placeholder { font-size: 14px; color: var(--text-3); }
.login-card .login-input:focus { border-color: var(--brand-600); box-shadow: none; }
/* 密码可见性眼睛按钮 */
.pwd-wrap { position: relative; }
.pwd-wrap .login-input { padding-right: 44px; width: 100%; }
.pwd-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: none; background: none; padding: 0; font-size: 15px; line-height: 1; cursor: pointer; color: var(--text-3); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.pwd-eye:hover { color: var(--text-1); background: var(--bg-hover); }
.pwd-eye.on { color: var(--brand-600); }
.login-formrow { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 14px; font-size: 12px; color: var(--text-3); }
.login-forgot { background: none; border: none; padding: 0; font-size: 13px; color: var(--brand-600); cursor: pointer; line-height: 1.4; }
.login-forgot:hover { color: var(--brand-700); text-decoration: underline; }
/* 协议同意区：强制单行不换行（agreeErr 已移出本容器，避免 flex-basis:100% 撑出第二行） */
.login-agree { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; margin-top: 16px; font-size: 12px; line-height: 18px; color: var(--text-2); white-space: nowrap; }
.login-agree input[type="checkbox"] { width: 15px; height: 15px; flex: none; accent-color: var(--brand-600); cursor: pointer; }
.login-agree label { cursor: pointer; white-space: nowrap; }
.login-agree a { color: var(--brand-600); text-decoration: none; }
.login-agree a:hover { text-decoration: underline; }
.login-agree-err { margin-top: 4px; }
.agree-doc p { margin: 0 0 10px; font-size: 13px; line-height: 22px; color: var(--text-2); }
.agree-doc p.lead { font-size: 15px; font-weight: 600; color: var(--text-1); }
@media (max-width: 860px) {
  .login-page { justify-content: center; padding: 20px; }
  .login-veil { background: linear-gradient(180deg, rgba(13,36,68,.10) 0%, rgba(13,36,68,.52) 55%, rgba(13,36,68,.76) 100%); }
  .login-caption { display: none; }
  .login-dots { bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) { .login-slide { animation: none; } }

/* ---- 列表：客户卡片 ---- */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tcard { background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 14px 16px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.tcard:hover { box-shadow: var(--shadow-2); }
.tcard .row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcard .no { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-3); }
.tcard .st { margin-left: auto; }
.tcard .title { font-weight: 500; margin: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-3); font-size: 12px; align-items: center; }

/* ---- 详情页 ---- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
/* v3.8：处理界面尺寸一致——主内容区限高在视口内、内部滚动，避免内容多少导致卡片区一会大一会小 */
.detail-main { min-width: 0; height: calc(100vh - var(--topbar-h) - 114px); max-height: calc(100vh - var(--topbar-h) - 114px); overflow-y: auto; overscroll-behavior: contain; }
.detail-side { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 16px; height: calc(100vh - var(--topbar-h) - 114px); max-height: calc(100vh - var(--topbar-h) - 114px); overflow-y: auto; overscroll-behavior: contain; }
.sla-card .sla-line { margin-bottom: 10px; }
.sla-card .sla-line .lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.sla-card .bar { height: 6px; border-radius: 3px; background: var(--t-gray); overflow: hidden; }
.sla-card .bar i { display: block; height: 100%; border-radius: 3px; background: var(--c-ok); }
.sla-card .bar i.warn { background: var(--c-warn); }
.sla-card .bar i.danger { background: var(--c-danger); }
.ops-panel .op-t { font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
.ops-panel .op-btns { display: flex; flex-direction: column; gap: 8px; }
.ops-panel .op-btns .btn { justify-content: center; }
.detail-ops-mobile { display: none; }

/* ---- 建单 ---- */
.create-wrap { max-width: 1080px; margin: 0 auto; }
.create-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.create-side { display: flex; flex-direction: column; gap: 12px; }
/* v4.1.15（P2-10）：form-foot 允许换行并垂直居中，容纳提交按钮旁的限流提示 */
.form-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 16px; }
.btn-hint { font-size: 12px; color: var(--text-3); line-height: 18px; max-width: 360px; }
.rate-tip { display: flex; align-items: center; gap: 8px; background: var(--t-gray); border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 8px 12px; font-size: 12px; color: var(--text-2); margin-top: 12px; }
.thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { position: relative; width: 72px; height: 72px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-2); }
.thumb .del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: var(--r-full); background: var(--c-danger); color: #fff; font-size: 12px; line-height: 20px; text-align: center; box-shadow: var(--shadow-1); }
.thumb .up-fail { position: absolute; inset: 0; border: 1.5px solid var(--c-danger); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--c-danger); font-size: 11px; background: rgba(255, 255, 255, .7); }

/* ---- 消息中心 ---- */
.msg-wrap { max-width: 880px; }
.msglist { background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.msg { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-2); align-items: flex-start; cursor: pointer; }
.msg:last-child { border-bottom: none; }
.msg:hover { background: var(--bg-hover); }
.msg .ic { width: 34px; height: 34px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 15px; flex: 0 0 34px; }
.msg .ic.blue { background: var(--t-blue); } .msg .ic.orange { background: var(--t-orange); } .msg .ic.green { background: var(--t-green); } .msg .ic.gray { background: var(--t-gray); }
.msg .tt { font-size: 14px; font-weight: 500; color: var(--text-1); }
.msg.read .tt { font-weight: 400; color: var(--text-2); }
.msg .dd { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.msg time { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.msg .unread { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--brand-600); margin-top: 8px; flex: 0 0 8px; }

/* ---- 审计 / 账号 ---- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filter-bar select, .filter-bar input { height: 32px; padding: 0 10px; border: 1px solid var(--border-1); border-radius: var(--r-sm); font-size: 13px; background: var(--bg-card); }
.filter-bar select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238A919C' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

/* ---- 个人资料 ---- */
.profile-wrap { max-width: 560px; margin: 0 auto; }
.profile-hd { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }

/* ---- 移动底部 tab ---- */
.bottom-tabs { display: none; }

/* ========== ⑥ 响应式 ========== */
/* Desktop-S 1200-1439：搜索框缩窄，主从保持；表格按宽度分级隐藏次要列以降密度（v4.1.15 P1-8） */
@media (min-width: 1200px) and (max-width: 1439px) {
  .g-search { flex-basis: 240px; }
  .col-cust, th.col-cust { display: none; }
}
/* 1200-1299：进一步隐藏负责人 / 更新时间，仅保留核心列（工单号/类型/标题/优先级/状态/SLA/操作） */
@media (min-width: 1200px) and (max-width: 1299px) {
  .col-owner, th.col-owner, .col-upd, th.col-upd { display: none; }
}

/* Tablet 768-1199：左栏 64px 图标栏，主从降级 */
@media (min-width: 768px) and (max-width: 1199px) {
  :root { --side-w: 64px; }
  .side .logo b, .side .grp, .side a .txt, .side a .n, .side .me .me-txt { display: none; }
  .side .logo { justify-content: center; padding: 16px 8px; }
  .side a { justify-content: center; padding: 0; }
  .side a.on::before { left: -8px; }
  .side .me { justify-content: center; padding: 12px 8px; }
  /* 图标栏模式：云仓下拉子菜单隐藏分组标题、子项仅显图标（父项 ＋/－ 仍可展开） */
  .side .wh-sub .sub-grp { display: none; }
  .side .wh-sub a { padding: 0; justify-content: center; }
  .side a .sub-caret { display: none; }
  .detail-panel { display: none; }
  .g-search { flex-basis: 200px; }
  .card-grid { grid-template-columns: 1fr; }
}

/* Mobile <768：汉堡抽屉 + 底部 tab */
@media (max-width: 767px) {
  .side { display: none; }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .g-search { display: none; }
  .page { padding: 16px 16px 76px; }
  .card-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  /* 移动端：单栏自然文档流，不做内部滚动（避免嵌套滚动） */
  .detail-main { height: auto; max-height: none; overflow-y: visible; }
  .detail-side { height: auto; max-height: none; overflow-y: visible; }
  .detail-ops-desktop { display: none; }
  .detail-ops-mobile { display: flex; position: sticky; bottom: 0; gap: 8px; padding: 10px 0 2px; background: var(--bg-card); overflow-x: auto; }
  .detail-ops-mobile .op-btns { display: contents; }
  .detail-ops-mobile .btn { flex: 1; white-space: nowrap; }
  .create-body { grid-template-columns: 1fr; }
  .steps { flex-wrap: wrap; gap: 8px; }
  .step { flex: 1 1 40%; padding: 0 8px; }
  .bottom-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg-card); border-top: 1px solid var(--border-2); z-index: 40; }
  .bottom-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; font-size: 11px; color: var(--text-3); }
  .bottom-tabs a.on { color: var(--brand-600); }
  .bottom-tabs a .ico { font-size: 17px; }
  .statbar { gap: 8px; }
  .stat { min-width: calc(50% - 8px); }
  .form-row { flex-direction: column; gap: 0; }
  .urgrow { flex-wrap: wrap; }
  .urg { flex: 1 1 45%; }
  .tbl-scroll { max-height: none; overflow-x: auto; }
  /* 表格在移动端横向滚动可用 */
  .tbl-scroll table { min-width: 720px; }
}

/* ===== v4.1.16（#7）回复附件：选择器 / 缩略 / 下载芯片 ===== */
.att-upload { padding: 14px; margin-bottom: 4px; }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 6px 10px; background: var(--bg-hover); border: 1px solid var(--border-1); border-radius: var(--r-sm); color: var(--text-2); font-size: 13px; text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.att-chip:hover { border-color: var(--brand-600); color: var(--brand-600); background: var(--brand-50); }
.att-chip .aic { flex: none; }
.att-chip .atx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb.file { flex-direction: column; gap: 2px; background: var(--bg-hover); border-color: var(--border-1); }
.thumb.file .fic { font-size: 22px; line-height: 1; }
.thumb.file .fnm { font-size: 10px; color: var(--text-2); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
/* v4.1.16（#5）消息中心「全部已读」工具条 */
.msg-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 8px 12px; background: var(--brand-50, rgba(22,93,255,.06)); border: 1px solid var(--brand-600); border-radius: var(--r-sm); }

/* ===== v4.1.16（#1）大屏等比适配 ===== */
/* 登录卡片与全局框架按视口宽度流体缩放，解决「笔记本/台式上按钮与布局固定死、不按比例」的问题 */
.login-card { width: clamp(340px, 26vw, 440px); }
.login-card .login-input { height: 48px; }
.login-card .btn-lg { height: 44px; font-size: 15px; }
@media (min-width: 1600px) {
  .login-card { width: 460px; padding: 40px 38px; }
  .login-card .login-input { height: 50px; font-size: 16px; }
  .login-card .btn-lg { height: 46px; font-size: 16px; }
  .login-caption .cap-t { font-size: 26px; }
  .login-caption .cap-s { font-size: 13px; }
  :root { --side-w: 240px; --topbar-h: 60px; }
  .btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
  .g-search { flex-basis: 460px; }
  .page { padding: 24px 32px 56px; }
}
@media (min-width: 2200px) {
  .login-card { width: 520px; padding: 48px 44px; }
  .login-card .login-input { height: 54px; font-size: 17px; }
  .login-card .btn-lg { height: 50px; font-size: 17px; }
  .login-caption .cap-t { font-size: 30px; }
  :root { --side-w: 264px; --topbar-h: 66px; }
  body { font-size: 15px; }
}

/* ===== 通知中心（v3.4）===== */
.notices-wrap { max-width: 920px; margin: 0 auto; }
.chip-badge { margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand-600); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.ann-list { display: flex; flex-direction: column; gap: 12px; }
.ann-bar { margin-bottom: 10px; }
.ann { background: var(--bg-card); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 14px 16px; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.ann:hover { box-shadow: 0 6px 18px rgba(20,30,60,.08); border-color: var(--border-1); }
.ann.unread { border-color: #cfe0ff; background: #f7fbff; }
.ann-hd { display: flex; align-items: center; gap: 8px; }
.ann-title { font-weight: 600; font-size: 15px; color: var(--text-1); }
.ann-pin { font-size: 12px; color: var(--brand-600); font-weight: 500; }
.ann-content { margin-top: 8px; color: var(--text-2); font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ann-ft { margin-top: 10px; display: flex; gap: 12px; align-items: center; color: var(--text-3); font-size: 12px; }
.ann-ft time { margin-left: auto; }
.ann-del { margin-left: 4px; border: none; background: transparent; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.ann-del:hover { color: #E23B3B; background: #fdeaea; }
.unread-dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--brand-600); flex: 0 0 8px; }
.lvl { font-size: 12px; padding: 1px 8px; border-radius: var(--r-full); font-weight: 500; }
.lvl-normal { color: #5F6368; background: #eef0f2; }
.lvl-important { color: #2F6BFF; background: #e7f0ff; }
.lvl-urgent { color: #E23B3B; background: #fdeaea; }
/* 受众标签（v3.4.1） */
.aud { font-size: 12px; padding: 1px 8px; border-radius: var(--r-full); font-weight: 500; }
.aud-all { color: #2F6BFF; background: #e7f0ff; }
.aud-staff { color: #00A3A3; background: #e0f5f5; }
.aud-customer { color: #FF8A00; background: #fff1e0; }
/* 发布表单 */
.inp { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border-1); border-radius: var(--r-sm); font-size: 14px; color: var(--text-1); background: var(--bg-card); outline: none; box-sizing: border-box; }
.inp:focus { border-color: var(--brand-600); }
textarea.inp { height: auto; padding: 10px 12px; line-height: 1.5; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 16px, calc(100% - 13px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.fld.chk { flex-direction: row; align-items: center; gap: 8px; }
.fld.chk input { width: 16px; height: 16px; }

/* ============================================================
   ⑦ 主题系统（v3.5）—— 全部走 CSS 变量，切换即换肤
   ============================================================ */

/* 护眼（米黄暖调，低蓝光浅色系） */
[data-theme="eye"] {
  --brand-600: #C8873A; --brand-700: #A96E2A; --brand-50: #F7EEDF; --brand-100-focus: rgba(200, 135, 58, .25);
  --text-1: #4A4234; --text-2: #7A7060; --text-3: #9C917E;
  --border-1: #E2D5BD; --border-2: #EDE3CF;
  --bg-page: #F6EFDF; --bg-card: #FDF8EC; --bg-hover: #F1E7D2; --bg-thead: #F3EAD5;
  --mask: rgba(74, 66, 52, .45);
  --c-neutral: #9C917E;
  --t-red: #F5DDD2; --t-orange: #F6E4C8; --t-blue: #DCE6F0; --t-green: #DFEBD8;
  --t-purple: #E7DEF0; --t-teal: #D8EBE7; --t-amber: #F7EBCB; --t-gray: #E8E2D4;
  --shadow-1: 0 1px 2px rgba(122, 96, 48, .10);
  --shadow-2: 0 4px 12px rgba(122, 96, 48, .14);
  --shadow-3: 0 8px 24px rgba(122, 96, 48, .18);
}
/* 暗夜（深蓝灰） */
[data-theme="dark"] {
  --brand-600: #4C7DFF; --brand-700: #3A66E8; --brand-50: #1B2440; --brand-100-focus: rgba(76, 125, 255, .28);
  --text-1: #E8EAED; --text-2: #B4BAC4; --text-3: #7C838F;
  --border-1: #333A46; --border-2: #262C36;
  --bg-page: #14181F; --bg-card: #1C212B; --bg-hover: #232935; --bg-thead: #202632;
  --mask: rgba(0, 0, 0, .6);
  --c-neutral: #7C838F;
  --t-red: #3A2126; --t-orange: #3A2A18; --t-blue: #1E2A44; --t-green: #1B3226;
  --t-purple: #262243; --t-teal: #16332F; --t-amber: #362B16; --t-gray: #262B33;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, .45);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, .55);
}
/* 深海（青蓝冷调） */
[data-theme="ocean"] {
  --brand-600: #00A3C4; --brand-700: #0086A3; --brand-50: #0E2A33; --brand-100-focus: rgba(0, 163, 196, .28);
  --text-1: #DFEFF3; --text-2: #A9C6CE; --text-3: #6F9099;
  --border-1: #234149; --border-2: #1A3239;
  --bg-page: #0B1A20; --bg-card: #11262E; --bg-hover: #173039; --bg-thead: #142B33;
  --mask: rgba(2, 18, 24, .6);
  --c-neutral: #6F9099;
  --t-red: #33222A; --t-orange: #332B1A; --t-blue: #10323F; --t-green: #12332C;
  --t-purple: #1E2A44; --t-teal: #0F3A3A; --t-amber: #332E17; --t-gray: #1C2C33;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, .45);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, .55);
}
/* 松林（墨绿护眼） */
[data-theme="forest"] {
  --brand-600: #2E9E5B; --brand-700: #23814A; --brand-50: #16301F; --brand-100-focus: rgba(46, 158, 91, .28);
  --text-1: #E2EEE4; --text-2: #AFC7B4; --text-3: #7A8F80;
  --border-1: #2C4433; --border-2: #213325;
  --bg-page: #101A13; --bg-card: #17241A; --bg-hover: #1E2E22; --bg-thead: #1A2A1E;
  --mask: rgba(4, 16, 9, .6);
  --c-neutral: #7A8F80;
  --t-red: #33222A; --t-orange: #332B1A; --t-blue: #16303A; --t-green: #17331F;
  --t-purple: #262A44; --t-teal: #13332C; --t-amber: #332E17; --t-gray: #1E2820;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, .45);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, .55);
}
/* 暗紫（优雅紫调） */
[data-theme="plum"] {
  --brand-600: #8B6CF0; --brand-700: #7454DC; --brand-50: #241B3D; --brand-100-focus: rgba(139, 108, 240, .28);
  --text-1: #EDE7F7; --text-2: #BDB2D6; --text-3: #877BA0;
  --border-1: #3A3050; --border-2: #2B2440;
  --bg-page: #14111E; --bg-card: #1D1830; --bg-hover: #251F3C; --bg-thead: #221C36;
  --mask: rgba(10, 6, 20, .6);
  --c-neutral: #877BA0;
  --t-red: #3A1F2C; --t-orange: #3A2C1A; --t-blue: #1B2444; --t-green: #16331F;
  --t-purple: #292048; --t-teal: #16332F; --t-amber: #332E17; --t-gray: #262033;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, .45);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, .55);
}

/* 主题按钮 */
.theme-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-1); border-radius: var(--r-full); background: var(--bg-card); color: var(--text-2); font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.theme-btn:hover { background: var(--bg-hover); border-color: var(--brand-600); color: var(--text-1); }
/* 主题面板 */
.theme-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-1); border-radius: var(--r-sm); background: var(--bg-card); color: var(--text-1); font-size: 14px; cursor: pointer; text-align: left; }
.theme-item:hover { border-color: var(--brand-600); background: var(--bg-hover); }
.theme-item.on { border-color: var(--brand-600); background: var(--brand-50); }
.ti-ico { font-size: 16px; color: var(--brand-600); }
.ti-name { flex: 1; }
.ti-ok { color: var(--brand-600); font-weight: 700; }

/* 优化后的全局搜索框：单层结构（外层即输入框本体，无内层二次描边），加大字号与点击区 */
/* 固定尺寸：flex 三项均为 0（不伸不缩），宽度恒定 420px，聚焦/失焦不再缩放 */
.g-search { flex: 0 0 420px; min-width: 260px; height: 44px; border: 1px solid var(--border-1); border-radius: var(--r-full); display: flex; align-items: center; gap: 10px; padding: 0 18px; background: var(--bg-card); transition: border-color .15s, box-shadow .15s, background .15s; }
.g-search:focus-within { border-color: var(--brand-600); background: var(--bg-card); box-shadow: 0 0 0 3px var(--brand-100-focus); }
.g-search .ico { color: var(--text-3); font-size: 15px; display: flex; align-items: center; }
.g-search input { flex: 1; width: 100%; border: none; outline: none; background: transparent; color: var(--text-1); font-size: 15px; line-height: 1.4; min-width: 0; }
.g-search input::placeholder { color: var(--text-3); }
.g-search input:focus { outline: none; box-shadow: none; }
/* 全局搜索按钮：与输入框一体，回车 / 点击均可触发检索 */
.g-search .g-search-btn {
  flex: none;
  height: 30px;
  padding: 0 16px;
  border: none;
  border-radius: var(--r-full);
  background: var(--brand-600);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .05s;
}
.g-search .g-search-btn:hover { background: var(--brand-700); }
.g-search .g-search-btn:active { background: var(--brand-800); transform: translateY(1px); }
.g-search .g-search-btn:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
/* v4.1.5：全局搜索清空按钮（×）——清空已输入内容并恢复全部展示 */
.g-search .g-search-clear {
  flex: none;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--r-full);
  background: var(--border-2, #e3e6ec);
  color: var(--text-2, #555);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.g-search .g-search-clear:hover { background: var(--border-1, #cfd4dc); }

/* 导出预览条 */
.export-preview { display: flex; align-items: baseline; gap: 6px; padding: 10px 14px; background: var(--brand-50); border-radius: var(--r-sm); font-size: 13px; color: var(--text-2); }
.export-preview b { font-size: 20px; color: var(--brand-600); }
.export-hint { margin-top: 2px; }

/* ── v3.9 注册功能（Owner 指令：登录框加注册，内容参考 A 项目）── */
/* 登录 / 注册 tab 切换 */
.login-tabs { display: flex; gap: 4px; background: var(--bg-hover); border-radius: var(--r-sm); padding: 3px; margin-bottom: 18px; }
.login-tab { flex: 1; text-align: center; padding: 8px 0; font-size: 14px; color: var(--text-2); border-radius: var(--r-sm); cursor: pointer; user-select: none; transition: all .15s; }
.login-tab:hover { color: var(--text-1); }
.login-tab.on { background: var(--bg-card); color: var(--brand-600); font-weight: 600; box-shadow: var(--shadow-1); }
/* 注册表单滚动区（表单较长，卡片限高内部滚动，避免超出视口） */
.reg-scroll { max-height: calc(100vh - 220px); overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; }
.reg-form .field { margin-bottom: 14px; }
.form-section { margin-bottom: 4px; }
.section-title { font-size: 12px; font-weight: 600; color: var(--brand-600); margin: 14px 0 10px; padding-left: 8px; border-left: 3px solid var(--brand-600); line-height: 1.2; }
.form-section:first-child .section-title { margin-top: 0; }
/* 资质照片上传器 */
.uploader { width: 100%; height: 96px; border: 1px dashed var(--border-1); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; background: var(--bg-hover); position: relative; }
.uploader:hover { border-color: var(--brand-600); }
.uploader-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-3); }
.uploader-plus { font-size: 22px; line-height: 1; color: var(--brand-600); }
.uploader-tip { font-size: 12px; }
.uploader-img { width: 100%; height: 100%; object-fit: cover; }
.uploader-re { position: absolute; right: 6px; bottom: 6px; font-size: 11px; color: #fff; background: rgba(8,22,44,.55); border-radius: var(--r-sm); padding: 2px 8px; }
.uploader-hint { font-size: 11px; color: var(--text-3); margin-top: 6px; line-height: 16px; }
/* 验证码行 + 发送按钮 */
.sms-row { display: flex; align-items: center; gap: 10px; }
.sms-row .login-input { flex: 1; min-width: 0; letter-spacing: 2px; }
.btn-sms { flex: none; height: 46px; padding: 0 14px; font-size: 13px; color: var(--brand-600); background: var(--bg-card); border: 1px solid var(--brand-600); border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; }
.btn-sms:hover { background: var(--brand-50, rgba(22,93,255,.06)); }
.btn-sms.disabled { color: var(--text-3); border-color: var(--border-1); cursor: not-allowed; }
/* 账号类型选择（B2B / B2C） */
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acct-cell { border: 1px solid var(--border-1); border-radius: var(--r-sm); padding: 10px; cursor: pointer; transition: all .15s; background: var(--bg-card); }
.acct-cell:hover { border-color: var(--brand-600); }
.acct-cell.active { border-color: var(--brand-600); background: var(--brand-50, rgba(22,93,255,.06)); box-shadow: 0 0 0 1px var(--brand-600); }
.acct-key { font-size: 14px; font-weight: 700; color: var(--text-1); }
.acct-cell.active .acct-key { color: var(--brand-600); }
.acct-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.acct-desc { font-size: 11px; color: var(--text-3); margin-top: 4px; line-height: 15px; }
.reg-tip { font-size: 11px; color: var(--text-3); margin-top: 8px; line-height: 16px; }

/* ── v4.1.3：注册独立卡片（横向扩展展示注册页，不再纵向嵌入登录卡）── */
.reg-card { width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain; }
.reg-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.reg-card-head h2 { font-size: 20px; margin: 0; }
.reg-back { color: var(--brand-600); font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.reg-back:hover { text-decoration: underline; }
.reg-submit { display: flex; justify-content: center; margin-top: 18px; }
.reg-submit .btn { min-width: 220px; }
@media (max-width: 860px) { .reg-card { max-height: calc(100vh - 24px); } }

/* ---- v4.0：设置与服务（退出服务申请 / 联系我们，口径对齐 A 端 v0.3.17 ⑧⑨）---- */
.profile-settings-row { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-settings-row .btn { flex: 1; min-width: 140px; }
.contact-wx-row { display: flex; align-items: center; gap: 10px; }
.contact-wx { flex: 1; padding: 10px 12px; background: var(--bg-card); border: 1px dashed var(--brand-600); border-radius: var(--r-sm); font-size: 15px; font-weight: 600; color: var(--brand-600); letter-spacing: 1px; }
.exit-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.exit-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--r-full); border: 1px solid var(--border-1); background: var(--bg-card); color: var(--text-2); font-size: 13px; cursor: pointer; transition: all .15s; user-select: none; }
.exit-chip:hover { border-color: var(--brand-600); color: var(--brand-600); }
.exit-chip.on { background: var(--t-blue); border-color: var(--brand-600); color: var(--brand-600); font-weight: 600; }

/* ===== v4.1.6 / v4.1.7 Owner 实测交互补充 ===== */
/* 顶栏搜索清空按钮改文字「清空搜索」（Owner：不要只做一个 ×） */
.g-search .g-search-clear-text {
  flex: none;
  width: auto;
  height: 26px;
  padding: 0 10px;
  border: none;
  border-radius: var(--r-full);
  background: var(--border-2, #e3e6ec);
  color: var(--text-2);
  font-size: 12px;
  line-height: 26px;
  cursor: pointer;
  white-space: nowrap;
}
.g-search .g-search-clear-text:hover { background: var(--brand-600); color: #fff; }
/* 平台通知已读/未读标签（点击后变已读） */
.ann-readtag { flex: none; font-size: 12px; padding: 1px 8px; border-radius: var(--r-full); font-weight: 500; }
.ann-readtag.un { color: #E23B3B; background: #fdeaea; }
.ann-readtag.read { color: #5F6368; background: #eef0f2; }
/* 账户设置面板定位高亮（头像下拉/侧栏「账户设置」跳转后滚动定位） */
.settings-focus { border-color: var(--brand-600); box-shadow: 0 0 0 2px rgba(22, 93, 255, .18); }
/* 工单池/待处理：批量认领工具条 */
.batch-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 12px; background: var(--brand-50, rgba(22, 93, 255, .06)); border: 1px solid var(--brand-600); border-radius: var(--r-sm); }
.batch-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-1); cursor: pointer; user-select: none; }
.batch-count { font-size: 13px; font-weight: 600; color: var(--brand-600); }
.col-sel { width: 36px; text-align: center; }
.col-sel input, .batch-all input { width: 15px; height: 15px; cursor: pointer; }

/* ===== v4.1.7 云仓打印页（备货单 / 货架标签）===== */
.print-page { min-height: 100vh; background: var(--bg-body, #f5f6f8); padding: 16px; }
.print-toolbar { display: flex; align-items: center; gap: 12px; max-width: 190mm; margin: 0 auto 14px; }
.print-toolbar-title { flex: 1; font-size: 15px; font-weight: 600; color: var(--text-1); }
.print-loading { padding: 60px; text-align: center; color: var(--text-3); }
.print-error { max-width: 190mm; margin: 40px auto; padding: 24px; background: var(--bg-card); border: 1px solid var(--border-1); border-radius: var(--r-md); text-align: center; color: var(--text-2); }
.print-error .btn { margin-top: 12px; }
.print-body { max-width: 190mm; margin: 0 auto; background: #fff; border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 10mm; box-shadow: var(--shadow-1); }

/* 备货单 */
.pack-head { text-align: center; margin-bottom: 6mm; }
.pack-company { font-size: 26px; font-weight: 800; letter-spacing: 6px; color: #111; }
.pack-doctitle { margin-top: 2mm; font-size: 18px; font-weight: 600; letter-spacing: 10px; color: #333; }
.pack-meta { display: flex; flex-wrap: wrap; gap: 4mm 8mm; padding: 3mm 4mm; border-top: 2px solid #111; border-bottom: 1px solid #999; margin-bottom: 4mm; }
.pack-meta-cell { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.pack-meta-cell .k { color: #666; white-space: nowrap; }
.pack-meta-cell .v { font-weight: 600; color: #111; }
.pack-panel { margin-bottom: 4mm; }
.pack-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pack-table th, .pack-table td { border: 1px solid #999; padding: 6px 8px; text-align: left; }
.pack-table th { background: #f2f3f5; font-weight: 600; }
.pack-table td:nth-child(1), .pack-table td:nth-child(5), .pack-table td:nth-child(6) { text-align: center; }
.pack-remark { font-size: 12px; color: #555; margin-bottom: 4mm; }
.pack-bc-title { font-size: 13px; font-weight: 600; color: #333; margin: 4mm 0 2mm; }
.pack-tip { margin-top: 5mm; padding-top: 2mm; border-top: 1px dashed #bbb; font-size: 11px; color: #888; text-align: center; }

/* 备货单条码网格：自动排列，3 列（A4 可打印宽度内单卡约 58mm） */
.bc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.bc-card { border: 1px dashed #999; border-radius: 4px; padding: 3mm 2mm; text-align: center; break-inside: avoid; }
.bc-sku { font-size: 13px; font-weight: 700; color: #111; letter-spacing: .5px; }
.bc-name { font-size: 11px; color: #555; margin: 1mm 0 2mm; min-height: 4mm; }
.bc-svg svg { width: 100%; height: auto; display: block; }
.bc-foot { margin-top: 2mm; font-size: 11px; color: #555; }

/* 货架标签 */
.shelf-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4mm; font-size: 13px; color: #555; }
.shelf-head b { font-size: 16px; color: #111; }
.shelf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4mm; }
.shelf-card { border: 1px dashed #666; border-radius: 4px; padding: 3mm; break-inside: avoid; }
.shelf-code { font-size: 22px; font-weight: 800; text-align: center; color: #111; letter-spacing: 2px; margin-bottom: 2mm; }
.shelf-bc svg { width: 100%; height: auto; display: block; }
.shelf-qr { text-align: center; margin-top: 2mm; }
.shelf-qr svg { width: 22mm; height: 22mm; }
.shelf-info { margin-top: 2mm; font-size: 12px; color: #333; text-align: center; line-height: 1.5; }

/* 打印规则：隐藏一切界面元素，仅保留单据本体 */
@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff !important; }
  .no-print, .print-toolbar, .toast-host { display: none !important; }
  .print-page { padding: 0; background: #fff; min-height: auto; }
  .print-body { max-width: none; border: none; border-radius: 0; box-shadow: none; padding: 0; }
  .bc-card, .shelf-card { break-inside: avoid; }
  .bc-svg svg, .shelf-bc svg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* v4.1.16：版本号角标（单一事实源 APP_VERSION，全站可见，根治「横幅/UI 版本脱节」） */
.version-badge {
  position: fixed;
  left: 10px;
  bottom: 8px;
  z-index: 900;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.4;
  color: #8a94a6;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-2, #e5e9f0);
  border-radius: 10px;
  user-select: none;
  pointer-events: none;
  letter-spacing: 0.3px;
}
@media (max-width: 768px) {
  .version-badge { font-size: 10px; left: 6px; bottom: 54px; /* 避开移动端 bottom-tabs */ }
}
@media print {
  .version-badge { display: none !important; }
}
