/* ==========================================================================
   YSE EXPRESS 管理后台样式（浅色专业风 · 中文）
   ========================================================================== */:root {
  --bg: #F3F5F8;
  --panel: #FFFFFF;
  --line: #E3E7ED;
  --line-2: #EDF0F4;
  --ink: #1A2230;
  --ink-2: #4A5568;
  --ink-3: #8B94A3;
  --brand: #0B0E12;
  --brand-2: #1D242F;
  --gold: #E8860C;
  --gold-soft: rgba(232, 134, 12, .12);
  --blue: #2D6CDF;
  --blue-soft: rgba(45, 108, 223, .1);
  --violet: #7C4DCC;
  --violet-soft: rgba(124, 77, 204, .1);
  --green: #1F9D63;
  --green-soft: rgba(31, 157, 99, .1);
  --amber: #C77E12;
  --amber-soft: rgba(199, 126, 18, .12);
  --red: #D64545;
  --red-soft: rgba(214, 69, 69, .1);
  --radius: 12px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 70px rgba(16, 24, 40, .22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink);
  font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.strong { font-weight: 600; }
.small { font-size: 12px; }
.flex-sp { flex: 1; }

/* ============ 按钮 / 表单 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent; transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.full { width: 100%; }
.btn-dark { background: var(--brand); color: #fff; }
.btn-dark:hover { background: var(--brand-2); }
.btn-outline { border-color: var(--line); background: #fff; color: var(--ink-2); }
.btn-outline:hover { border-color: #C6CEDA; color: var(--ink); }
.btn-ghost { color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: #EBEFF4; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #C03A3A; }
.btn-sm { height: 31px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

.ipt {
  width: 100%; height: 36px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.ipt:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45, 108, 223, .12); }
.ipt:disabled { background: var(--line-2); color: var(--ink-3); }
textarea.ipt { height: auto; min-height: 64px; padding: 8px 12px; resize: vertical; line-height: 1.55; }
select.ipt { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B94A3' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input.ipt[type="date"], input.ipt[type="datetime-local"] { font-family: var(--mono); }
input.ipt.file { height: auto; padding: 7px 10px; font-size: 12.5px; background: var(--line-2); }

.field { display: block; margin-bottom: 14px; }
.field-label { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.field-label em { font-style: normal; color: var(--ink-3); font-weight: 400; font-size: 11.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid > .field:only-child, .form-grid .full { grid-column: 1 / -1; }
.form-group { grid-column: 1 / -1; margin: 6px 0 2px; }
.form-group h4 { font-size: 13px; color: var(--brand); padding: 10px 12px; background: var(--line-2); border-radius: 8px; }
.form-tip { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); background: var(--gold-soft); border: 1px solid rgba(232, 134, 12, .25); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.ck { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.ck input { width: 16px; height: 16px; accent-color: var(--blue); }

/* ============ 登录页 ============ */
.login-view {
  min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  position: relative; overflow: hidden; background: var(--brand);
}
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 75% 15%, rgba(201, 162, 39, .18), transparent 60%),
    radial-gradient(50% 40% at 20% 85%, rgba(45, 108, 223, .12), transparent 60%),
    linear-gradient(160deg, #12161D, #0B0E12);
}
.login-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 40%, #000, transparent);
}
.login-card {
  position: relative; width: min(100%, 400px); background: #fff; border-radius: 18px;
  padding: 36px 32px 26px; box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-mark {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #EBD07A, var(--gold) 45%, #8C6E12);
  color: #120E00; font-weight: 800; font-size: 14px; font-family: Georgia, serif;
}
.login-brand strong { display: block; font-size: 16px; letter-spacing: .1em; }
.login-brand small { font-size: 11px; color: var(--ink-3); letter-spacing: .18em; }
.login-err { color: var(--red); font-size: 13px; min-height: 20px; margin-bottom: 6px; }
.login-card .btn { margin-top: 6px; height: 44px; font-size: 15px; }
.remember { margin: 4px 0 14px; }
.login-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; font-size: 11.5px; color: var(--ink-3); }

/* ============ 主布局 ============ */
.app { display: flex; min-height: 100dvh; }
.sidebar {
  width: 232px; flex: none; background: var(--brand); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand strong { display: block; font-size: 14.5px; letter-spacing: .1em; }
.side-brand small { font-size: 11px; color: rgba(255,255,255,.4); letter-spacing: .2em; }
.side-menu { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
  color: rgba(255,255,255,.62); font-size: 13.5px; text-align: left; transition: background .15s, color .15s;
}
.side-item svg { width: 17px; height: 17px; flex: none; }
.side-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-item.active { background: var(--gold); color: #161100; font-weight: 600; }
.side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { padding: 0 4px 10px; }
.side-user strong { display: block; font-size: 13.5px; }
.side-user small { font-size: 11px; color: rgba(255,255,255,.45); }
.side-act {
  display: block; width: 100%; text-align: center; padding: 8px; margin-top: 6px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 8px; font-size: 12.5px; color: rgba(255,255,255,.75);
}
.side-act:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-act.danger:hover { border-color: rgba(255, 120, 120, .5); color: #FF9C9C; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 26px; background: rgba(255,255,255,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.burger2 { display: none; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); }
.burger2 span { display: block; width: 15px; height: 1.6px; background: var(--ink-2); margin: 3.2px auto; }
.page-title { font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-tip { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.pages { padding: 24px 26px 60px; max-width: 1640px; width: 100%; margin: 0 auto; }
.page[hidden] { display: none !important; }
[hidden] { display: none !important; }
.loading { padding: 60px 0; text-align: center; color: var(--ink-3); }
.empty { padding: 60px 0; text-align: center; color: var(--ink-3); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ============ 统计卡片 ============ */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-label { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; display: block; }
.stat-value.amber { color: var(--amber); }
.stat-value.blue { color: var(--blue); }
.stat-value.violet { color: var(--violet); }
.stat-value.green { color: var(--green); }
.stat-sub { display: block; margin-top: 5px; font-size: 11.5px; color: var(--ink-3); }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel-grid.two { align-items: start; }
.panel-grid + .panel-grid { margin-top: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { font-size: 14.5px; }
.link-btn { color: var(--blue); font-size: 12.5px; }
.link-btn:hover { text-decoration: underline; }

/* 图表 */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-col i { width: 100%; max-width: 30px; background: linear-gradient(180deg, var(--gold), #A58314); border-radius: 4px 4px 2px 2px; transition: height .4s; }
.bar-col span { font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.channel-rows { display: grid; gap: 12px; }
.ch-row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 12px; }
.ch-name { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.ch-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #6D9BEA); border-radius: 99px; }
.ch-num { font-size: 12.5px; text-align: right; font-weight: 600; }

/* ============ 表格 ============ */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3);
  background: #FAFBFC; padding: 11px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover { background: #FAFBFD; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .ops { white-space: nowrap; text-align: right; }
.tbl .w40 { width: 36px; }
.detail-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.tag-amber { background: var(--amber-soft); color: var(--amber); }
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-violet { background: var(--violet-soft); color: var(--violet); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-gray { background: #EEF0F3; color: var(--ink-3); }
.tag-purple { background: var(--violet-soft); color: var(--violet); }
/* 触发内容节点预览：已选节点（蓝色高亮）与未选择（灰色占位）状态区分明确 */
.trig-preview { margin-top: 6px; }
.trig-node-on {
  display: flex; flex-direction: column; gap: 2px; padding: 7px 9px;
  background: var(--blue-soft); border-left: 3px solid var(--blue); border-radius: 6px;
  font-size: 12.5px; line-height: 1.5;
}
.trig-node-on strong { font-size: 13px; color: var(--ink); }
.trig-node-on small { font-size: 11.5px; }
.trig-node-on .trig-node-detail { margin: 2px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.trig-node-off { color: var(--ink-3); font-size: 12px; }

.op-btn {
  font-size: 12px; padding: 4px 9px; border-radius: 7px; color: var(--ink-2);
  border: 1px solid var(--line); background: #fff; margin-left: 4px;
}
.op-btn:hover { border-color: var(--blue); color: var(--blue); }
.op-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* ============ 工具栏 / 选项卡 ============ */
.toolbar { margin-bottom: 14px; }
.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar .ipt { width: auto; }
.toolbar .search { min-width: 230px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tab {
  padding: 8px 14px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2);
  background: var(--panel); border: 1px solid var(--line);
}
.tab:hover { border-color: #C6CEDA; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.tab-n { font-style: normal; font-size: 11px; opacity: .65; margin-left: 2px; }

.bulk-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: var(--brand); color: #fff; border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 14px;
}
.bulk-bar .btn { border-color: rgba(255,255,255,.25); color: #fff; background: rgba(255,255,255,.08); }
.bulk-bar .btn-dark { background: var(--gold); color: #161100; border-color: transparent; }
.bulk-bar strong { color: var(--gold); }

.pager { display: flex; align-items: center; gap: 12px; padding: 14px 2px; }
.pager .pg {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12.5px;
}
.pager .pg:hover { border-color: var(--blue); color: var(--blue); }

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; z-index: 90; background: rgba(10, 14, 20, .5);
  display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px 16px;
  backdrop-filter: blur(3px); overflow-y: auto;
}
.modal.open { display: flex; }
.modal-card {
  width: min(100%, 560px); background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .8, .3, 1.1); max-height: 90vh; display: flex; flex-direction: column;
}
.modal-card.wide { width: min(100%, 960px); }
.wb-form { max-width: 100%; }
.wb-form .form-grid.two-col { grid-template-columns: 1fr 1fr; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h3 { font-size: 16px; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; color: var(--ink-3); font-size: 14px; }
.modal-close:hover { background: var(--line-2); color: var(--ink); }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-foot { padding: 4px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-foot-inner { display: flex; gap: 10px; }
.confirm-msg { font-size: 14px; padding: 6px 0 10px; }

.detail-wrap { min-width: 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.detail-row { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.detail-row span { color: var(--ink-3); }
.detail-row strong { font-weight: 500; word-break: break-all; }
.detail-sub { font-size: 13.5px; margin: 18px 0 10px; color: var(--ink-2); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; }
.timeline li::before {
  content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue);
}
.timeline li:first-child::before { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.timeline li::after { content: ""; position: absolute; left: 7.5px; top: 17px; bottom: 2px; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.future { opacity: .55; }
.timeline li.future::before { background: var(--violet); }
.timeline .t-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.timeline .ev-del { margin-left: auto; flex: none; padding: 1px 8px; font-size: 12px; opacity: .55; }
.timeline li:hover .ev-del { opacity: 1; }
.timeline strong { font-size: 13.5px; }
.timeline .loc { color: var(--blue); font-size: 12.5px; }
.timeline time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.timeline p { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* 内容编辑 */
.lang-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.lang-tab {
  padding: 8px 16px; border-radius: 9px; font-size: 13.5px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2);
}
.lang-tab.active { background: var(--gold); border-color: var(--gold); color: #161100; font-weight: 600; }
.content-sec { margin-bottom: 16px; }
.content-sec .form-grid { grid-template-columns: 1fr; }
.items-editor textarea { margin-bottom: 8px; }

.logo-row { display: flex; align-items: center; gap: 16px; }
.logo-row img { width: 58px; height: 58px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.logo-row div { flex: 1; }

.save-bar {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-top: 18px;
  box-shadow: var(--shadow);
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px);
  background: var(--brand); color: #fff; padding: 11px 20px; border-radius: 99px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: all .28s; z-index: 120; max-width: calc(100% - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

/* ============ 响应式 ============ */
@media (max-width: 1080px) {
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; z-index: 80; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .burger2 { display: block; }
  .pages { padding: 16px 14px 50px; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .topbar-tip { display: none; }
}
@media (max-width: 640px) {
  .toolbar .search { min-width: 0; flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .ch-row { grid-template-columns: 90px 1fr 36px; }
}

/* ---------- 美化对齐：焦点/选中/滚动条 ---------- */
::selection { background: rgba(232, 134, 12, .25); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C6CDD8; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #AEB7C4; }
::-webkit-scrollbar-track { background: transparent; }
table tbody tr { transition: background .15s; }
table tbody tr:hover { background: rgba(232, 134, 12, .05); }

/* ==========================================================================
   运输流程管理 / 收发地址管理（新增模块）
   ========================================================================== */

/* ---------- 流程页面布局：主区 + 侧栏 ---------- */
.split-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.side-panel { position: sticky; top: 76px; }
.tbl.compact { min-width: 0; font-size: 12.5px; }
.tbl.compact th, .tbl.compact td { padding: 9px 10px; }
.tbl.compact th { position: static; }

/* ---------- 流程卡片 ---------- */
.flow-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 14px 16px 10px; margin-bottom: 12px; transition: border-color .15s, box-shadow .15s;
}
.flow-card:hover { border-color: #CFD7E2; box-shadow: var(--shadow); }
.flow-card-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; }
.flow-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flow-card-title strong { font-size: 14.5px; }
.flow-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); align-items: center; }
.flow-card-meta .mono { background: var(--line-2); padding: 1px 7px; border-radius: 6px; }

/* 流程轨迹（节点序号链） */
.flow-track { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; padding: 0; }
.flow-track li {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px 6px 6px;
  background: var(--line-2); border-radius: 8px; font-size: 12px; max-width: 100%;
}
.flow-track li i {
  width: 18px; height: 18px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--ink-2); font-style: normal; font-size: 10.5px; font-weight: 600;
  border: 1px solid var(--line);
}
.flow-track li strong { font-size: 12.5px; font-weight: 600; }
.flow-track li small { display: block; color: var(--ink-3); font-size: 11px; }
.flow-track li em { font-style: normal; color: var(--ink-3); font-size: 11px; margin-left: 2px; }
.flow-track li.warn { background: var(--gold-soft); }
.flow-track li.warn i { background: var(--gold); border-color: var(--gold); color: #161100; }
.flow-remark { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }
.flow-card-ops { display: flex; justify-content: flex-end; gap: 2px; border-top: 1px dashed var(--line-2); margin-top: 10px; padding-top: 8px; }

/* ---------- 录单表单内：流程节点预览 ---------- */
.flow-preview { grid-column: 1 / -1; }
.flow-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2);
  background: var(--line-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px 3px 3px;
}
.flow-chip i {
  width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 600; color: var(--ink-3);
}
.flow-chip em { font-style: normal; color: var(--ink-3); }

/* ---------- 轨迹表单内：节点选择 ---------- */
.flow-steps { display: flex; flex-wrap: wrap; gap: 7px; }
.flow-step {
  display: inline-flex; align-items: center; gap: 6px; text-align: left;
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 6px 10px 6px 6px;
  font-size: 12.5px; color: var(--ink-2); transition: all .15s;
}
.flow-step:hover { border-color: #C6CEDA; }
.flow-step i {
  width: 18px; height: 18px; border-radius: 50%; background: var(--line-2); color: var(--ink-2);
  display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 600; flex: none;
}
.flow-step em { font-style: normal; color: var(--ink-3); font-size: 11.5px; }
.flow-step small { color: var(--ink-3); font-size: 11px; }
.flow-step.active { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.flow-step.active i { background: var(--gold); color: #161100; }
.flow-progress { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* ---------- 流程编辑器（弹窗内） ---------- */
.flow-editor .form-grid { margin-bottom: 4px; }
.flow-pick { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 4px; }
.flow-pick-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.flow-pick-head h4 { font-size: 13px; color: var(--ink-2); }
.chip-pool { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.node-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 99px;
  border: 1px dashed #C6CEDA; background: #fff; font-size: 12.5px; color: var(--ink-2);
}
.node-chip:hover { border-style: solid; border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.node-chip small { color: var(--ink-3); font-size: 11px; }
.step-list { display: grid; gap: 6px; }
.step-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #FAFBFC;
}
.step-seq {
  width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 600;
}
.step-main { flex: 1; min-width: 0; }
.step-main strong { display: block; font-size: 13px; }
.step-main small { color: var(--ink-3); font-size: 11.5px; }
.step-acts { display: flex; gap: 4px; }
.step-acts button {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: #fff;
  font-size: 12px; color: var(--ink-2);
}
.step-acts button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.step-acts button:disabled { opacity: .35; cursor: not-allowed; }
.step-acts button.danger:hover { border-color: var(--red); color: var(--red); }
.small-empty { padding: 24px 0; font-size: 12.5px; }

/* ---------- 地址统计与表格 ---------- */
.addr-sum { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.addr-sum-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 18px; box-shadow: var(--shadow); min-width: 130px;
}
.addr-sum-card span { display: block; font-size: 11.5px; color: var(--ink-3); }
.addr-sum-card strong { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.addr-tbl td { vertical-align: top; }
.addr-tbl .detail-cell { max-width: 280px; }

/* 运单列表中的流程标签 */
.flow-cell .flow-tag {
  display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--blue-soft); color: var(--blue);
  vertical-align: middle;
}

@media (max-width: 1180px) {
  .split-grid { grid-template-columns: 1fr; }
  .side-panel { position: static; }
}
@media (max-width: 640px) {
  .flow-track li { font-size: 11.5px; }
  .step-main small { display: none; }
  .addr-sum-card { flex: 1; min-width: 0; padding: 10px 12px; }
}

/* ==========================================================================
   视觉统一层：深墨蓝 + 暖金（与会员中心一致的高端国际化系统）
   ========================================================================== */
:root {
  --bg: #F2F4F8;
  --brand: #0C1A2B;
  --brand-2: #13263D;
  --gold: #C8A45C;
  --gold-soft: rgba(200, 164, 92, .14);
  --ink: #16202E;
  --blue: #2E6BC4;
  --shadow: 0 1px 2px rgba(12, 26, 43, .05), 0 2px 6px rgba(12, 26, 43, .05);
  --shadow-lg: 0 24px 70px rgba(12, 26, 43, .25);
}

/* 侧栏：深墨蓝渐变 + 金色描边 */
.sidebar { background: linear-gradient(175deg, #0E1E33 0%, #0C1A2B 55%, #0A1626 100%); }
.sidebar::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, rgba(200, 164, 92, .5), rgba(200, 164, 92, .06) 40%, transparent);
  pointer-events: none;
}
.side-item { position: relative; }
.side-item.active { background: linear-gradient(135deg, #D9B878, var(--gold) 60%, #AE8A45); color: #171102; }
.side-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--gold);
}
/* 登录页：深墨蓝底 + 暖金光晕（与会员端 auth 对齐） */
.login-bg {
  background:
    radial-gradient(55% 45% at 78% 12%, rgba(200, 164, 92, .22), transparent 60%),
    radial-gradient(45% 40% at 15% 88%, rgba(46, 107, 196, .16), transparent 62%),
    linear-gradient(160deg, #10233B, #0C1A2B 60%, #081220);
}
.login-mark { background: linear-gradient(145deg, #EBD49A, var(--gold) 45%, #96762F); }
.login-view { background: var(--brand); }

/* 顶栏 / 卡片质感 */
.topbar { background: rgba(248, 249, 252, .88); }
.btn-dark { background: var(--brand); }
.btn-dark:hover { background: var(--brand-2); }
.panel, .stat-card, .card { box-shadow: var(--shadow); }
.stat-value { font-variant-numeric: tabular-nums; }
.tbl th { background: #F7F8FB; letter-spacing: .02em; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: #CFD7E2; box-shadow: var(--shadow-lg); transform: translateY(-1px); }

/* 大屏：统计卡自动铺满；面板网格在超宽时允许三列 */
@media (min-width: 1500px) {
  .stat-cards { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .panel-grid.thirds { grid-template-columns: repeat(3, 1fr); }
}
/* 移动端安全：禁止横向溢出 */
@media (max-width: 960px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}


/* ==========================================================================
   运单模板 · 可视化设计器（studio.js）
   ========================================================================== */

/* ---------- 模板列表 ---------- */
.tpl-grid {
  display: grid; gap: 16px; margin-top: 4px;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}
.tpl-card {
  display: flex; flex-direction: column; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tpl-card:hover { border-color: #C6CEDA; box-shadow: 0 6px 22px rgba(16, 24, 40, .09); transform: translateY(-1px); }
/* 隐藏式运单卡片：用紫色描边与普通模板区分，提示其为后台专用系统模板 */
.tpl-card-hidden { border-color: rgba(124, 77, 204, .45); box-shadow: 0 0 0 1px rgba(124, 77, 204, .14); }
.tpl-card-hidden:hover { border-color: var(--violet); box-shadow: 0 6px 22px rgba(124, 77, 204, .16); }
.tpl-hidden-note { color: var(--violet); background: var(--violet-soft); padding: 6px 8px; border-radius: 6px; line-height: 1.5; }
.ck.disabled { cursor: not-allowed; color: var(--ink-3); }
.ck.disabled input { cursor: not-allowed; }
.tpl-thumb {
  position: relative; height: 232px; display: grid; place-items: center; padding: 14px;
  background:
    linear-gradient(135deg, #F7F8FA 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(225deg, #F7F8FA 25%, transparent 25%) -8px 0/16px 16px,
    #FCFCFD;
  border-bottom: 1px solid var(--line-2);
}
.tpl-thumb-inner {
  position: relative; background: #fff; box-shadow: 0 3px 14px rgba(16, 24, 40, .12);
  overflow: hidden;
}
.tpl-thumb-scale { position: absolute; inset: 0; transform-origin: top left; }
.tpl-card-body { padding: 12px 14px 10px; flex: 1; }
.tpl-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tpl-card-title strong { font-size: 13.5px; font-weight: 600; }
.tpl-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--ink-3); }
.tpl-remark { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.tpl-card-ops {
  display: flex; gap: 2px; padding: 8px 10px; border-top: 1px solid var(--line-2); background: #FCFCFD;
}

/* ---------- 设计器外框 ---------- */
.studio-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.studio-name { width: 268px; height: 34px; font-weight: 600; }
.studio-paper { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.studio-dirty {
  font-size: 11.5px; padding: 1px 9px; border-radius: 99px;
  background: var(--amber-soft); color: var(--amber); font-weight: 500;
}
.zoom-ctl {
  display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; background: #fff;
}
.zoom-ctl button { width: 30px; height: 100%; font-size: 13px; color: var(--ink-2); }
.zoom-ctl button:last-child { width: auto; padding: 0 10px; font-size: 12px; border-left: 1px solid var(--line); }
.zoom-ctl button:hover { background: var(--line-2); color: var(--ink); }
.zoom-ctl span {
  min-width: 46px; text-align: center; font-size: 12px; font-family: var(--mono);
  color: var(--ink-2); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  line-height: 30px;
}

.studio {
  display: grid; grid-template-columns: 214px minmax(0, 1fr) 268px; gap: 14px;
  align-items: start;
}
.studio-side, .studio-props {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; position: sticky; top: 14px;
  max-height: calc(100dvh - 130px); overflow-y: auto;
}
.studio-sec + .studio-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.studio-sec h4 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); margin-bottom: 9px; font-weight: 600;
}
.el-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.palette-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 7px; border: 1px solid var(--line); border-radius: 9px;
  background: #FCFCFD; font-size: 11.5px; color: var(--ink-2); transition: all .14s;
}
.palette-btn i {
  font-style: normal; font-family: var(--mono); font-size: 14px; line-height: 1;
  color: var(--ink-3); font-weight: 600;
}
.palette-btn:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.palette-btn:hover i { color: var(--gold); }

.layer-list { display: grid; gap: 3px; }
.layer-row {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 6px 8px; border-radius: 7px; border: 1px solid transparent;
  font-size: 12.5px; color: var(--ink-2);
}
.layer-row i {
  font-style: normal; font-family: var(--mono); font-size: 11px; width: 16px;
  text-align: center; color: var(--ink-3); flex: none;
}
.layer-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-row:hover { background: var(--line-2); }
.layer-row.active { background: var(--blue-soft); border-color: rgba(45, 108, 223, .25); color: var(--blue); font-weight: 500; }
.layer-row.active i { color: var(--blue); }
.two-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.studio-side .field, .studio-props .field { margin-bottom: 8px; }
.studio-side .ck, .studio-props .ck { font-size: 12.5px; }

/* ---------- 画布 ---------- */
.studio-canvas-wrap {
  background: #E8EBF0; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; align-items: center;
  overflow: auto; min-height: 460px;
  background-image: radial-gradient(rgba(26, 34, 48, .07) 1px, transparent 1px);
  background-size: 16px 16px;
}
.canvas-scaler { position: relative; flex: none; }
.tpl-canvas {
  position: relative; background: #fff; box-shadow: 0 8px 30px rgba(16, 24, 40, .18);
  overflow: hidden; user-select: none;
}
.tpl-canvas.with-grid {
  background-image:
    linear-gradient(to right, rgba(45, 108, 223, .12) 0.2mm, transparent 0.2mm),
    linear-gradient(to bottom, rgba(45, 108, 223, .12) 0.2mm, transparent 0.2mm);
  background-size: 5mm 5mm;
}
/* 元素层：只管显示，不吃鼠标事件（命中测试由画布根节点统一处理） */
.tpl-layer { position: absolute; inset: 0; }
.tpl-el { pointer-events: none; }
.tpl-el.selected { outline: 0.35mm dashed var(--blue); outline-offset: 0; }

/* 交互层：铺满画布，透明；选中框与缩放手柄都挂在这里，永不被重建 */
.tpl-overlay { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
/* 命中层：只有元素热区吃事件，空白处事件穿透到画布根节点（用于取消选中） */
.tpl-hits { position: absolute; inset: 0; pointer-events: none; }
.tpl-hit { position: absolute; pointer-events: auto; cursor: move; }
.tpl-hit:hover { background: rgba(45, 108, 223, .07); outline: 0.25mm dashed rgba(45, 108, 223, .5); }
.tpl-grip { pointer-events: auto; }
.tpl-selbox, .tpl-helper { pointer-events: none; }
.tpl-selbox {
  position: absolute; pointer-events: none;
  outline: 0.35mm solid var(--blue); outline-offset: 0.5mm;
  background: rgba(45, 108, 223, .04); border-radius: 0.3mm;
}
.tpl-selbox[hidden] { display: none; }
.tpl-grip {
  position: absolute; width: 9px; height: 9px; z-index: 50; margin: 0;
  background: #fff; border: 1.5px solid var(--blue); border-radius: 2px;
  cursor: nwse-resize; box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
}
.tpl-grip[hidden] { display: none; }
.tpl-helper {
  position: absolute; z-index: 60; pointer-events: none;
  transform: translate(8px, 8px); white-space: nowrap;
  background: rgba(17, 24, 39, .92); color: #fff; font-size: 11px;
  font-family: var(--mono); padding: 2px 7px; border-radius: 5px;
}
.tpl-helper[hidden] { display: none; }

/* 吸附参考线 */
.snap-line { position: absolute; z-index: 35; pointer-events: none; background: rgba(232, 134, 12, .9); }
.snap-line[hidden] { display: none; }
.snap-v { top: 0; bottom: 0; width: 0.5mm; margin-left: -0.25mm; }
.snap-h { left: 0; right: 0; height: 0.5mm; margin-top: -0.25mm; }

/* 拖拽中：画布内所有元素禁止 hover 抖动，光标统一为 move */
body.studio-dragging .tpl-canvas { cursor: move; }
body.studio-dragging * { user-select: none !important; }
.canvas-tip { margin-top: 16px; font-size: 11.5px; color: var(--ink-3); text-align: center; }
body.studio-dragging { cursor: move; }
body.studio-dragging .tpl-handle:hover { outline-color: var(--blue); }

/* ---------- 属性面板 ---------- */
.props-empty { padding: 10px 0 16px; text-align: center; }
.props-empty p { font-size: 13px; color: var(--ink-2); margin-bottom: 3px; }
.props-empty small { font-size: 11.5px; color: var(--ink-3); }
.props-block + .props-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.props-block h4 { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; display: flex; justify-content: space-between; }
.props-block h4 em { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.props-head { display: flex; align-items: center; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.props-head .op-btn { margin-left: auto; }
.props-head .op-btn + .op-btn { margin-left: 0; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-quick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-top: 4px; }
.pos-quick button, .layer-ops button {
  padding: 5px 2px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
  font-size: 11.5px; color: var(--ink-2);
}
.pos-quick button:hover, .layer-ops button:hover { border-color: var(--blue); color: var(--blue); }
.layer-ops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.color-ipt { height: 34px; padding: 2px; cursor: pointer; }
.props-block .ipt { height: 34px; font-size: 13px; }

/* ---------- 线路表格的双行单元格 ---------- */
.link-cell div { font-size: 13px; }
.link-cell small { display: block; font-size: 11.5px; margin-top: 1px; }

@media (max-width: 1180px) {
  .studio { grid-template-columns: 190px minmax(0, 1fr); }
  .studio-props { grid-column: 1 / -1; position: static; max-height: none; }
  .studio-props .grid4, .studio-props .grid2 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
  .studio-side { position: static; max-height: none; }
  .el-palette { grid-template-columns: repeat(4, 1fr); }
  .studio-canvas-wrap { padding: 14px; min-height: 340px; }
  .studio-bar .studio-name { width: 100%; }
}
@media (max-width: 640px) {
  .tpl-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tpl-thumb { height: 168px; padding: 8px; }
  .tpl-card-ops { flex-wrap: wrap; }
  .el-palette { grid-template-columns: 1fr 1fr; }
  .studio-props .grid4, .studio-props .grid2 { grid-template-columns: 1fr 1fr; }
}

/* 单条发货按钮（待发货列表） */
.op-btn.dark { border-color: var(--brand); color: var(--brand); }
.op-btn.dark:hover { background: var(--brand); color: #fff; }

/* ============ 国家与线路页 ============ */
.ccl { grid-template-columns: minmax(340px, 2fr) minmax(440px, 3fr); }
.ccl .table-wrap { border: 0; box-shadow: none; border-radius: 0; max-height: 560px; }
.ccl-tbl { min-width: 0; font-size: 12.5px; }
.ccl-tbl th { padding: 10px 12px; font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; background: #F7F8FA; position: sticky; top: 0; z-index: 1; }
.ccl-tbl td { padding: 10px 12px; }
.ccl-tbl .num { text-align: right; }
.count-chip { margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--line-2); color: var(--ink-3); font-size: 11px; font-weight: 500; vertical-align: 1px; }
.code-chip { display: inline-block; min-width: 30px; text-align: center; padding: 2px 7px; border-radius: 5px; background: #F1F3F6; border: 1px solid var(--line-2); font-family: ui-monospace, monospace; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.tag-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 5px; }
.empty-cell { text-align: center; color: var(--ink-3); padding: 26px 12px !important; }

/* 顶部统计条 */
.ccl-stats { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 110px; box-shadow: var(--shadow); }
.stat-item b { font-size: 19px; line-height: 1.2; }
.stat-item span { font-size: 11.5px; color: var(--ink-3); }

/* 窄屏降级：两栏变单栏 + 横向滚动 */
@media (max-width: 1180px) { .ccl { grid-template-columns: 1fr; } }

/* 批次号（可能含中文）：不用等宽字体，长名称不换行溢出 */
.batch-no { font-weight: 600; letter-spacing: .01em; white-space: nowrap; }

/* 运单列表「内部备注」列：单行截断 + 悬停提示展示全文 */
.note-cell { max-width: 180px; }
.note-text { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: var(--ink-2); }

/* ============ 运单列表行内快速编辑（物品/件数/重量、内部备注） ============ */
.qe-cell { position: relative; cursor: pointer; }
.qe-cell:hover { background: var(--gold-soft); }
.qe-cell .qe-main { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-cell .qe-btn {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 22px; height: 22px; padding: 0; border: 1px solid rgba(232, 134, 12, .35);
  border-radius: 6px; background: #fff; color: var(--gold); font-size: 12px; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .15s;
}
.qe-cell:hover .qe-btn, .qe-cell .qe-btn:focus-visible { opacity: 1; }
.qe-cell .qe-btn:hover { background: var(--gold); color: #fff; }
.qe-form { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.qe-form .qe-ipt {
  width: 100%; box-sizing: border-box; padding: 5px 8px; font-size: 12.5px;
  border: 1px solid #D5DBE4; border-radius: 6px; outline: none; background: #fff; color: var(--ink);
}
.qe-form .qe-ipt:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.qe-form .qe-ta {
  width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 12.5px; line-height: 1.5;
  border: 1px solid #D5DBE4; border-radius: 6px; outline: none; resize: vertical; background: #fff; color: var(--ink);
}
.qe-form .qe-ta:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.qe-form .qe-acts { display: flex; align-items: center; gap: 6px; }
.qe-form .qe-hint { flex: 1; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.qe-form .qe-save, .qe-form .qe-cancel {
  padding: 3px 10px; font-size: 11.5px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.qe-form .qe-save { border: none; background: var(--gold); color: #fff; font-weight: 600; }
.qe-form .qe-save:hover { filter: brightness(1.08); }
.qe-form .qe-save:disabled { opacity: .6; cursor: wait; }
.qe-form .qe-cancel { border: 1px solid #D5DBE4; background: #fff; color: var(--ink-2); }
.qe-form .qe-cancel:hover { border-color: var(--ink-3); }
.qe-form-note { min-width: 200px; }

/* 运单列表「最新轨迹」列：两行（节点·位置 / 时间），单行截断 */
.track-cell { max-width: 200px; }
.track-cell .track-main { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-cell small { display: block; margin-top: 1px; }

/* 运单列表「序号」「昵称」列 */
.tbl .num-col { width: 52px; text-align: center; color: var(--ink-3); font-size: 12px; }
.nick-cell { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 可搜索地址选择器 + 录单布局 ============ */
.apicker { position: relative; }
.apicker .ap-input { width: 100%; }
.ap-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.ap-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.ap-item:last-child { border-bottom: 0; }
.ap-item:hover, .ap-item.on { background: #F5F8FD; }
.ap-item.on { box-shadow: inset 3px 0 0 var(--blue, #2563eb); }
.ap-item strong { display: block; font-size: 12.5px; }
.ap-item small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.form-grid .grid3 > .field { min-width: 0; }
.form-grid .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .full textarea { width: 100%; }
.save-addr { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); padding: 4px 0; cursor: pointer; }
/* ===== 申报价值汇总行（代客录单弹窗：申报信息分组内） ===== */
.declare-sum { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: -2px 0 12px; padding: 10px 14px; background: var(--line-2); border: 1px dashed var(--line); border-radius: 10px; }
.declare-sum span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.declare-sum strong { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.declare-sum em { font-style: normal; margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 640px) { .declare-sum em { margin-left: 0; flex-basis: 100%; } }

@media (max-width: 640px) {
  .form-grid .grid3 { grid-template-columns: 1fr; }
}

/* ============ 数据看板：最新运单 + 操作日志 ============ */
/* 看板为半宽面板，表格不能用全局 720px 最小宽度；窄屏时容器内横向滚动 */
.dash-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.dash-tbl { min-width: 0; table-layout: auto; }
.dash-tbl th { padding: 9px 10px; }
.dash-tbl td { padding: 9px 10px; font-size: 12.5px; }
.dash-tbl .mono { white-space: nowrap; font-size: 12.5px; }
.dash-tbl .cell-clip { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tbl .t-time { white-space: nowrap; font-size: 12px; }

/* 操作日志：三列网格（用户 / 动作 / 时间），动作超长省略，悬停看全文 */
.log-list { display: grid; }
.log-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 9px 6px; border-bottom: 1px solid var(--line-2); border-radius: 8px;
}
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: #FAFBFD; }
.log-user {
  flex-shrink: 0; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: #F1F4F9; border-radius: 99px; padding: 2px 9px; white-space: nowrap;
}
.log-act { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.log-time { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .log-row { grid-template-columns: auto 1fr; }
  .log-time { grid-column: 2; justify-self: end; }
}

/* ==========================================================================
   官网模板选择页（模板卡片墙）
   ========================================================================== */
.tpl-current {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 16px; margin-bottom: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13px; color: var(--ink-2);
}
.tpl-current strong { color: var(--ink); font-weight: 600; }
.tpl-current em { color: var(--ink-3); font-style: normal; font-size: 12px; }
.tpl-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft); flex-shrink: 0;
}

.tpl-wall {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.tpl-card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; transition: border-color .16s, box-shadow .16s, transform .16s;
}
.tpl-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.tpl-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-soft); }

/* 缩略预览：用 tone 变量画出该模板的「首屏意象」 */
.tpl-preview { position: relative; background: var(--p-bg); padding: 0; }
.tpl-pv-bar { display: flex; gap: 4px; padding: 8px 10px; background: var(--p-panel); }
.tpl-pv-bar i { width: 5px; height: 5px; border-radius: 50%; background: var(--p-ink); opacity: .28; }
.tpl-pv-body { padding: 14px 12px 16px; }
.tpl-pv-nav { display: flex; align-items: center; gap: 7px; margin-bottom: 16px; }
.tpl-pv-nav span {
  font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--p-ink); font-weight: 700; margin-right: auto;
}
.tpl-pv-nav b { width: 15px; height: 2px; background: var(--p-ink); opacity: .3; border-radius: 2px; }
.tpl-pv-hero h4 {
  font-size: 17px; line-height: 1.15; color: var(--p-ink);
  letter-spacing: -.01em; margin-bottom: 9px;
}
.tpl-pv-hero em { display: block; height: 3px; width: 74%; background: var(--p-ink); opacity: .16; border-radius: 2px; margin-bottom: 5px; }
.tpl-pv-hero em:last-of-type { width: 52%; }
.tpl-pv-hero u {
  display: inline-block; margin-top: 9px; width: 44px; height: 13px;
  background: var(--p-accent); border-radius: 3px; text-decoration: none;
}
.tpl-pv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 16px; }
.tpl-pv-grid i { height: 22px; background: var(--p-panel); border-radius: 3px; }
.tpl-pv-grid i:first-child { background: var(--p-accent); opacity: .85; }

.tpl-flag {
  position: absolute; top: 9px; right: 9px;
  background: var(--gold); color: #fff; font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px; letter-spacing: .02em;
}

/* 文案区 */
.tpl-meta { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.tpl-name { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.tpl-name h3 { font-size: 14.5px; }
.tpl-en { font-size: 11px; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }
.tpl-style { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.tpl-style em { font-style: normal; color: var(--ink-3); font-weight: 400; font-size: 11.5px; }
.tpl-scene { font-size: 12px; color: var(--ink-3); line-height: 1.55; }
.tpl-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tpl-tag {
  font-size: 11px; color: var(--ink-2); background: #F2F5F9;
  border-radius: 5px; padding: 1px 7px;
}
.tpl-swatch { display: flex; gap: 5px; margin-top: 2px; }
.tpl-swatch i {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1px solid rgba(16, 24, 40, .1);
}
.tpl-apply { margin-top: 4px; width: 100%; }

@media (max-width: 1360px) {
  .tpl-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tpl-wall { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   二次美化：深墨蓝 + 暖金（高端国际化视觉层）
   在既有结构上做令牌升级与质感叠加，不改动任何 DOM / 类名
   ========================================================================== */
:root {
  /* 品牌色由近黑升级为深墨蓝，金色由橙金调整为更克制的暖金 */
  --bg: #F2F4F8;
  --brand: #0C1A2B;
  --brand-2: #13263D;
  --gold: #C8A45C;
  --gold-soft: rgba(200, 164, 92, .14);
  --ink: #16202E;
  --blue: #2E6BC4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(12, 26, 43, .05), 0 2px 6px rgba(12, 26, 43, .05);
  --shadow-lg: 0 24px 70px rgba(12, 26, 43, .25);
}

/* ---- 侧栏：深墨蓝渐变 + 金色描边细节 ---- */
.sidebar {
  background: linear-gradient(175deg, #0E1E33 0%, #0C1A2B 55%, #0A1626 100%);
}
.sidebar::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, rgba(200,164,92,.5), rgba(200,164,92,.06) 40%, transparent);
  pointer-events: none;
}
.side-brand strong { letter-spacing: .14em; }
.side-item { position: relative; }
.side-item.active {
  background: linear-gradient(135deg, #D9B878, var(--gold) 60%, #AE8A45);
  color: #171102;
}
.side-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--gold);
}

/* ---- 登录页：深墨蓝底 + 暖金光晕 ---- */
.login-bg {
  background:
    radial-gradient(55% 45% at 78% 12%, rgba(200, 164, 92, .22), transparent 60%),
    radial-gradient(45% 40% at 15% 88%, rgba(46, 107, 196, .16), transparent 62%),
    linear-gradient(160deg, #10233B, #0C1A2B 60%, #081220);
}
.login-mark {
  background: linear-gradient(145deg, #EBD49A, var(--gold) 45%, #96762F);
}

/* ---- 顶栏与页面容器 ---- */
.topbar { background: rgba(248, 249, 252, .88); }
.page-title { letter-spacing: .01em; }

/* ---- 面板与卡片：更挺括的圆角与描边 ---- */
.panel, .stat-card, .table-wrap { box-shadow: var(--shadow); }
.panel { border-radius: var(--radius); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--gold), transparent 85%);
  opacity: 0; transition: opacity .18s;
}
.stat-card:hover::before { opacity: 1; }
.stat-value { font-variant-numeric: tabular-nums; }

/* ---- 主按钮：暖金实心 ---- */
.btn-dark { background: var(--brand); }
.btn-dark:hover { background: var(--brand-2); }
.tab.active { background: var(--brand); border-color: var(--brand); }
.bulk-bar { background: linear-gradient(120deg, #0E1E33, #0C1A2B); }
.bulk-bar .btn-dark { background: var(--gold); color: #171102; }

/* ---- 表头微调 ---- */
.tbl th { background: #F7F8FB; letter-spacing: .02em; }

/* ---- 滚动条与选区对齐暖金 ---- */
::-webkit-scrollbar-thumb { background: #C2CAD6; }
.toast { background: var(--brand); }

/* ==========================================================================
   联系二维码管理
   ========================================================================== */
.qr-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.qr-admin-card {
  display: grid; grid-template-columns: 84px 1fr; gap: 14px 16px; align-items: start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
  transition: border-color .16s, box-shadow .16s;
}
.qr-admin-card:hover { border-color: #CFD7E2; }
.qr-admin-card.off { opacity: .62; }
.qr-admin-thumb {
  width: 84px; height: 84px; border-radius: 10px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); display: grid; place-items: center;
}
.qr-admin-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.qr-admin-main { min-width: 0; }
.qr-admin-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.qr-admin-title h3 { font-size: 14px; }
.qr-admin-val { margin-top: 5px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); word-break: break-all; }
.qr-admin-hint { margin-top: 5px; font-size: 12px; line-height: 1.5; }
.qr-admin-langs { display: flex; align-items: center; gap: 5px; margin-top: 9px; }
.qr-admin-langs span {
  font-size: 10px; letter-spacing: .05em; color: var(--ink-3);
  background: #F1F4F9; border-radius: 4px; padding: 1px 5px;
}
.qr-admin-langs span.on { background: var(--gold-soft); color: #8A6E30; font-weight: 600; }
.qr-admin-langs em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--ink-3); }
.qr-admin-ops {
  grid-column: 1 / -1; display: flex; gap: 4px; justify-content: flex-end;
  border-top: 1px dashed var(--line-2); padding-top: 10px;
}

/* 弹窗内：上传区 */
.qr-upload { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; margin-bottom: 18px; }
.qr-upload-preview {
  width: 132px; height: 132px; border-radius: 12px; overflow: hidden;
  border: 1px dashed var(--line); background: #FAFBFD; display: grid; place-items: center;
  transition: border-color .15s, background .15s;
}
.qr-upload-preview:hover { border-color: var(--gold); background: var(--gold-soft); }
.qr-upload-preview img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.qr-upload-empty { font-size: 12px; color: var(--ink-3); }
.qr-upload-side { min-width: 0; }
.qr-upload-tip { margin-top: 8px; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.qr-lang-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.qr-form .detail-sub { margin: 14px 0 8px; }
@media (max-width: 640px) {
  .qr-upload { grid-template-columns: 1fr; }
  .qr-lang-fields { grid-template-columns: 1fr; }
  .qr-admin-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------
   打印模板选择配置卡片（运单模板页顶部）
   ------------------------------------------------------------------ */
.print-tpl-cfg { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 0 16px 16px; }
.print-tpl-cfg .field { flex: 1 1 260px; max-width: 380px; margin: 0; }
.print-tpl-cfg .btn { flex: 0 0 auto; height: 38px; }

/* ------------------------------------------------------------------
   国家可搜索选择器（下单 / 代客录单 / 线路关联）
   选项格式：CODE 中文名 English Name；输入关键字按 代码/中文/英文 过滤
   ------------------------------------------------------------------ */
.cpick { position: relative; }
.cpick-box {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 38px; padding: 6px 12px; border: 1px solid #d7dce6; border-radius: 8px;
  background: #fff; cursor: pointer; user-select: none; box-sizing: border-box;
}
.cpick-box:hover { border-color: #9fb2d8; }
.cpick-box .cpick-ph { color: #98a2b8; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-box .cpick-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-box .cpick-val b { font-weight: 600; margin-right: 6px; }
.cpick-box .cpick-val small { color: #8792a8; margin-left: 6px; }
.cpick-box .cpick-arrow { color: #98a2b8; font-size: 10px; transition: transform .15s; }
.cpick.open .cpick-arrow { transform: rotate(180deg); }
.cpick-menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 100%;
  min-width: 260px; max-height: 320px; display: flex; flex-direction: column;
  background: #fff; border: 1px solid #dfe4ee; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(23, 43, 77, .16); overflow: hidden;
}
.cpick-search { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #eef1f7; }
.cpick-search input {
  flex: 1; border: 1px solid #d7dce6; border-radius: 6px; padding: 6px 10px; font-size: 13px; outline: none; min-width: 0;
}
.cpick-search input:focus { border-color: #2f66d0; }
.cpick-search .cpick-mag { color: #98a2b8; font-size: 13px; }
.cpick-list { overflow-y: auto; max-height: 260px; }
.cpick-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px;
}
.cpick-item:hover, .cpick-item.hl { background: #eef4ff; }
.cpick-item.on { background: #2f66d0; color: #fff; }
.cpick-item .c-code { flex: 0 0 34px; font-weight: 600; font-size: 12px; }
.cpick-item .c-zh { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-item .c-en { color: #8792a8; font-size: 12px; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-item.on .c-en, .cpick-item.on .c-code { color: rgba(255,255,255,.85); }
.cpick-item .c-tag {
  flex: 0 0 auto; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 4px;
  background: #e8f3ee; color: #1d7a4f; font-weight: 600;
}
.cpick-empty { padding: 18px 12px; text-align: center; color: #98a2b8; font-size: 13px; }
/* 线路表单：多选国家 */
.cpick-multi { border: 1px solid #d7dce6; border-radius: 8px; background: #fff; }
.cpick-multi .cpick-selbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 2px; }
.cpick-multi .cpick-selbar:empty { display: none; }
.cpick-multi .chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 8px;
  background: #eef4ff; color: #2a4d8f; border-radius: 20px;
}
.cpick-multi .chip i { cursor: pointer; font-style: normal; color: #7d8db0; font-weight: 700; }
.cpick-multi .chip i:hover { color: #d34b4b; }
.cpick-multi .cpick-search { border-bottom: 1px solid #eef1f7; }
.cpick-multi .cpick-list { max-height: 220px; }
.cpick-multi .cpick-item .c-ck { flex: 0 0 auto; color: #2f66d0; font-weight: 700; width: 14px; }
.cpick-hint { font-size: 12px; color: #8792a8; margin-top: 4px; }
