/* ============================================================
   海外仓管理系统 · 科技蓝 UI（浅色主体 + 深色科技侧栏 + 蓝青渐变）
   仅样式，不改任何功能/类名
   ============================================================ */
:root {
  --bg: #eef2f9; --bg2: #f6f8fc; --card: #ffffff; --line: #e4e9f2; --line2: #eef1f7;
  --text: #16223a; --muted: #6b7891; --muted2: #93a0b5;
  --primary: #2563eb; --primary-d: #1d4ed8; --primary-l: #3b82f6; --cyan: #06b6d4;
  --green: #16a34a; --red: #e11d48; --amber: #d97706; --purple: #7c3aed;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20,30,60,.05), 0 8px 24px -16px rgba(20,30,60,.18);
  --shadow-lg: 0 20px 60px -20px rgba(20,30,60,.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
  color: var(--text); font-size: 13.5px; line-height: 1.6;
  background: radial-gradient(1200px 600px at 100% -5%, #e6edfb 0%, transparent 55%), var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
.hidden { display: none !important; }
::selection { background: rgba(37,99,235,.18); }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 218px; flex-shrink: 0; display: flex; flex-direction: column; color: #c4d0e6;
  background: linear-gradient(180deg, #0c1426 0%, #0f1b33 55%, #101d38 100%);
  border-right: 1px solid rgba(255,255,255,.06); position: relative;
}
.sidebar::after { content: ""; position: absolute; top: 0; right: 0; width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(59,130,246,.4), transparent); }
.sidebar .brand {
  padding: 20px 20px 16px; font-size: 17px; font-weight: 800; color: #fff; letter-spacing: .3px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar .brand small { display: block; font-size: 11px; color: #7e8db0; font-weight: 500; margin-top: 4px; letter-spacing: .5px; }
.nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.nav-group { padding: 12px 12px 5px; margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .6px;
  color: #7e8db0; text-transform: none; border-top: 1px solid rgba(255,255,255,.06); }
.nav-group:first-child { border-top: none; margin-top: 0; }
/* 只读模式：隐藏会修改数据的按钮（新增/保存/确认=primary/green，删除=red，PDA录入等） */
body.vo .content .btn.primary, body.vo .content .btn.green, body.vo .content .btn.red,
body.vo .content .btn-add, body.vo .content .btn-save { display: none !important; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 11px; margin: 2px 0; border-radius: 10px;
  color: #aeb9d4; font-size: 13.5px; cursor: pointer; position: relative; transition: all .15s ease;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active {
  color: #fff; background: linear-gradient(90deg, rgba(37,99,235,.38), rgba(6,182,212,.10));
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.25);
}
.nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary-l), var(--cyan)); box-shadow: 0 0 10px rgba(59,130,246,.7);
}
.nav a .badge { margin-left: auto; background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; border-radius: 20px; font-size: 11px; font-weight: 700; padding: 1px 7px; box-shadow: 0 2px 8px rgba(225,29,72,.4); }
.sidebar .foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: #8a97b5; }
.sidebar .foot a { color: #aeb9d4; }
.sidebar .foot a:hover { color: #fff; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: rgba(255,255,255,.85); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.topbar .sp { flex: 1; }
.content { padding: 16px 20px; overflow-y: auto; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card + .card { margin-top: 12px; }
.card .hd {
  padding: 12px 15px; border-bottom: 1px solid var(--line2); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 9px; background: linear-gradient(180deg, #fbfcff, #f7f9fe);
}
.card .hd .sp { flex: 1; }
/* 紧凑筛选条：状态下拉 + 搜索框，放在标题右侧、左对齐、不被拉伸 */
.card .hd .f-sel, .card .hd .f-search { flex: 0 0 auto; height: 34px; padding: 0 10px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text); }
.card .hd .f-sel { width: 122px; padding: 0 8px; }
.card .hd .f-search { width: 224px; }
.card .hd .f-sum { flex: 0 0 auto; font-weight: 400; font-size: 13px; color: var(--muted); }
@media (max-width: 680px) { .card .hd .f-search { width: 46vw; max-width: 220px; } .card .hd .f-sel { width: 104px; } }
.card .bd { padding: 13px 15px; }
.section-title { font-size: 14px; font-weight: 700; margin: 4px 0 10px; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px 12px; box-shadow: var(--shadow); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
  text-align: center;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(20,30,60,.05), 0 16px 34px -18px rgba(20,30,60,.3); }
.stat::before { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 4px; background: var(--primary); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(37,99,235,.10), transparent 70%); }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .2px; }
.stat .value { font-size: 23px; font-weight: 800; margin-top: 5px; letter-spacing: -.5px; color: #14203a; }
.stat .value small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat.blue::before { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.stat.blue::after { background: radial-gradient(circle, rgba(37,99,235,.12), transparent 70%); }
.stat.green::before { background: linear-gradient(180deg, #22c55e, #16a34a); }
.stat.green::after { background: radial-gradient(circle, rgba(22,163,74,.12), transparent 70%); }
.stat.amber::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.stat.amber::after { background: radial-gradient(circle, rgba(217,119,6,.12), transparent 70%); }
.stat.purple::before { background: linear-gradient(180deg, #8b5cf6, #7c3aed); }
.stat.purple::after { background: radial-gradient(circle, rgba(124,58,237,.12), transparent 70%); }
.stat.red::before { background: linear-gradient(180deg, #fb7185, #e11d48); }
.stat.red::after { background: radial-gradient(circle, rgba(225,29,72,.12), transparent 70%); }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 11px; text-align: center; border-bottom: 1px solid var(--line2); white-space: nowrap; }
th {
  background: #f3f6fc; color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .3px;
  position: sticky; top: 0; z-index: 1;
}
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #f2f7ff; }
tbody tr:last-child td { border-bottom: none; }
td .muted { color: var(--muted); }
td b { color: #17233d; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field label .req { color: var(--red); }
input, select, textarea {
  font-family: inherit; font-size: 13.5px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-l); box-shadow: 0 0 0 3.5px rgba(37,99,235,.14); }
textarea { resize: vertical; min-height: 62px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* 表格里的「操作」列：按钮居中，和居中的表头「操作」对齐 */
td.row-actions { justify-content: center; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text);
  cursor: pointer; font-size: 13.5px; font-family: inherit; font-weight: 600; transition: all .15s ease; white-space: nowrap;
}
.btn:hover { background: #f4f7fd; border-color: #d5deee; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--primary-l), var(--primary-d)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(37,99,235,.7); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.green { background: linear-gradient(135deg, #22c55e, var(--green)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(22,163,74,.7); }
.btn.red { background: linear-gradient(135deg, #fb7185, var(--red)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(225,29,72,.6); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: .2px; }
.tag.gray { background: #eef1f6; color: #64748b; }
.tag.blue { background: #dbeafe; color: #1d4ed8; }
.tag.green { background: #dcfce7; color: #15803d; }
.tag.amber { background: #fef3c7; color: #b45309; }
.tag.red { background: #ffe4e6; color: #be123c; }
.tag.purple { background: #ede9fe; color: #6d28d9; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(12,20,38,.5); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 44px 16px; z-index: 100; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s ease; }
.modal.wide { max-width: 880px; }
@keyframes pop { from { transform: translateY(-8px) scale(.98); opacity: 0; } }
.modal .m-hd { padding: 14px 18px; border-bottom: 1px solid var(--line2); font-weight: 700; font-size: 15px; display: flex; align-items: center; background: linear-gradient(180deg, #fbfcff, #f6f9fe); }
.modal .m-hd .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; transition: color .15s; }
.modal .m-hd .x:hover { color: var(--red); }
.modal .m-bd { padding: 20px; }
.modal .m-ft { padding: 14px 20px; border-top: 1px solid var(--line2); display: flex; justify-content: flex-end; gap: 10px; background: #fbfcfe; }

/* 工具条 */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 130px; }
.toolbar .sp { flex: 1; }

/* 语言切换按钮 */
.lang-btn { font-weight: 700; min-width: 44px; }

/* 分页标签（系统设置内） */
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.subtab { padding: 10px 18px; border: none; background: transparent; color: var(--muted); cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 700; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* toast */
#toast { position: fixed; top: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 12px 18px; border-radius: 11px; box-shadow: 0 10px 30px rgba(0,0,0,.28); font-size: 14px; font-weight: 500; animation: sl .25s ease; }
.toast.ok { background: linear-gradient(135deg, #16a34a, #15803d); } .toast.err { background: linear-gradient(135deg, #e11d48, #be123c); }
@keyframes sl { from { transform: translateX(30px); opacity: 0; } }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 500px at 80% -10%, #3b82f6 0%, transparent 55%), linear-gradient(135deg, #0b1226, #17337a 55%, #2563eb); padding: 20px; }
.login-card { background: rgba(255,255,255,.98); border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); width: 100%; max-width: 410px; padding: 38px 34px; border: 1px solid rgba(255,255,255,.5); }
.login-card h1 { font-size: 23px; text-align: center; margin-bottom: 4px; font-weight: 800; }
.login-card p.sub { text-align: center; color: var(--muted); margin-bottom: 26px; font-size: 13px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn.primary { width: 100%; padding: 12px; font-size: 15px; }
.login-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.login-tabs button { flex: 1; padding: 10px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600; }
.login-tabs button.active { background: linear-gradient(135deg, var(--primary-l), var(--primary-d)); color: #fff; border-color: transparent; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; font-size: 13.5px; }

/* PDA */
.pda body, body.pda { background: linear-gradient(180deg, #0c1426, #0f1b33); }
.pda-wrap { max-width: 520px; margin: 0 auto; padding: 16px; }
.pda-wrap .card { margin-bottom: 14px; }
.pda-big input { font-size: 20px; padding: 14px; }
.pda-big label { font-size: 15px; }
.pda-scan { font-size: 22px; padding: 16px; text-align: center; letter-spacing: 1px; }

@media (max-width: 820px) {
  .sidebar { position: fixed; left: -230px; top: 0; bottom: 0; z-index: 50; transition: left .2s; box-shadow: 20px 0 60px rgba(0,0,0,.3); }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex !important; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px 14px; }
}
.menu-toggle { display: none; }

/* 开放接口文档 & 代码块 */
.box { border: 1px solid var(--line); background: #f8fafc; border-radius: 10px; padding: 11px 13px; font-size: 13px; }
code { background: #eef2f9; color: #334155; padding: 1px 6px; border-radius: 5px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 13px 15px; border-radius: 10px; overflow-x: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; white-space: pre; margin: 0; }
pre.code + .muted, .muted + pre.code { margin-top: 6px; }

/* ===== 中转箱明细：一箱一行的横向卡片 ===== */
.bxlist { display: flex; flex-direction: column; gap: 10px; }
.bxr { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: box-shadow .15s, border-color .15s; }
.bxr:hover { box-shadow: 0 3px 12px rgba(30, 50, 90, .08); }
.bxr.req { background: #fffbeb; border-color: #fcd34d; }
.bxr .bx-check { flex: 0 0 auto; }
.bxr .bx-id { flex: 0 0 auto; min-width: 132px; }
.bxr .bx-no { font-weight: 700; font-size: 15px; line-height: 1.2; }
.bxr .bx-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: #334155; margin-top: 3px; letter-spacing: .3px; }
.bxr .bx-mani { flex: 1 1 220px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 180px; }
.bxr .bx-dim { flex: 1 1 240px; color: #475569; font-size: 13px; min-width: 200px; }
.bxr .bx-status { flex: 0 0 auto; margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.sku-pill { background: #eef2f9; color: #334155; border-radius: 7px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.fwd-check { display: inline-flex; align-items: center; gap: 7px; background: #eaf1ff; color: #2563eb; border: 1px solid #cfe0ff; border-radius: 9px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none; }
.fwd-check:hover { background: #dceafe; }
.fwd-check input { width: 17px; height: 17px; accent-color: #2563eb; cursor: pointer; }
.bx-state-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 9px; white-space: nowrap; }
.bx-state-dot.pending { background: #fef3c7; color: #92400e; }
.bx-state-dot.forwarded { background: #dcfce7; color: #166534; }
.bx-state-dot.not_received { background: #fee2e2; color: #b91c1c; }
.bxr .tbi { width: 62px; padding: 6px 7px; }
.bxr .tbi.sf { width: 88px; }
@media (max-width: 640px) {
  .bxr .bx-status { margin-left: 0; align-items: flex-start; text-align: left; width: 100%; }
  .bxr .bx-dim { flex-basis: 100%; }
}

/* 中转列表 SKU 紧凑列 */
.sku-cell { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: flex-start; }
.sku-more { font-size: 12px; color: #2563eb; text-decoration: none; background: #eaf1ff; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.sku-more:hover { background: #dceafe; }

/* ===== 出库单页 · 清爽卡片风格（页面专属，不影响其它页） ===== */
.ord-clean .card { border: 1px solid #e7ebf2; border-radius: 10px; box-shadow: none; }
.ord-clean .card + .card { margin-top: 12px; }
.ord-clean .card .hd { background: #fff; border-bottom: 1px solid #eef1f6; font-weight: 600; font-size: 14px; color: #1f2a44; padding: 12px 16px; gap: 8px; }
.ord-clean .card .hd .muted { font-weight: 400; font-size: 12px; }
.ord-clean .card .bd { padding: 14px 16px; }
.ord-clean th { background: #fafbfd; }
.ord-clean .ord-head { padding: 2px 2px 12px; }
.ord-clean .ord-title { font-size: 17px; font-weight: 700; color: #16223a; }
.ord-clean .ord-sub { color: #6b7891; font-size: 13px; margin-top: 3px; }
.ord-clean .ord-box { border: 1px solid #eef1f6; border-radius: 10px; padding: 13px; margin-bottom: 10px; background: #fff; transition: border-color .15s; }
.ord-clean .ord-box:hover { border-color: #dbe2ee; }
.ord-clean .ord-remain { font-size: 14px; padding: 9px 12px; border-radius: 9px; margin-bottom: 10px; }
.ord-clean .ord-progress table { font-size: 12.5px; }
.ord-clean .ord-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* 列表勾选：表头全选框「序号」+ 每行复选框（默认全选） */
.sel-hdr { width: 1%; white-space: nowrap; text-align: left; }
.sel-lab { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 4px; font-weight: inherit; }
td.sel-cell { text-align: left; width: 1%; white-space: nowrap; }
td.sel-cell input.sel-row, .sel-lab input.sel-all { cursor: pointer; width: 15px; height: 15px; vertical-align: middle; margin: 0; }
tr:has(> td.sel-cell input.sel-row:checked) > td { background: #fbfdff; }
