/* ============================================================
   中华建材公司管理网站（Company Management Site）
   ============================================================ */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #eef3f9;
  --ink: #0f1c2e;
  --ink-2: #51627a;
  --ink-3: #8695aa;
  --line: #e3e9f2;
  --line-2: #cfdae8;
  --brand: #0f4c81;
  --brand-2: #1668b3;
  --brand-soft: #e9f1fa;
  --accent: #0d9488;
  --accent-soft: #e4f5f2;
  --warn: #b3720f;
  --warn-soft: #fdf2e0;
  --danger: #c0392b;
  --danger-soft: #fdeceb;
  --ok: #0d7a5f;
  --ok-soft: #e6f5ef;
  --shadow-sm: 0 1px 2px rgba(15, 28, 46, .06);
  --shadow: 0 1px 2px rgba(15, 28, 46, .05), 0 10px 26px -16px rgba(15, 28, 46, .35);
  --shadow-lg: 0 24px 60px -24px rgba(15, 28, 46, .45);
  --r: 12px;
  --r-sm: 8px;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, dl, dd, ol, ul { margin: 0; }
ol, ul { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: #cfe3f7; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: .16s ease;
}
.btn:hover { border-color: #9db3cd; background: #fbfdff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #17609c, var(--brand));
  border-color: #0c4372; color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -10px rgba(15,76,129,.9);
}
.btn-primary:hover { background: linear-gradient(180deg, #1d6dae, #125490); border-color: #0c4372; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #f0cdc8; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: #e3aca4; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.icon { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; gap: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #dfeaf7, var(--bg) 70%);
}
.boot-inner { text-align: center; }
.boot-mark { width: 56px; height: 56px; border-radius: 15px; object-fit: cover; margin: 0 auto 14px; display: block; box-shadow: 0 10px 26px -12px rgba(170, 30, 20, .75); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }
.boot-text { color: var(--ink-2); font-size: 13.5px; }
.boot-text small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 4px; }

/* ---------- login ---------- */
.login-screen {
  min-height: 100vh;
  display: grid; grid-template-columns: 1.05fr .95fr;
  background: radial-gradient(900px 500px at 8% 0%, #e2edf9, transparent 60%), var(--bg);
}
.login-art { padding: 56px 60px; display: flex; flex-direction: column; justify-content: center; gap: 26px; }
.login-art .eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 600; letter-spacing: .12em; font-size: 11.5px; text-transform: uppercase; }
.login-art h1 { font-size: 34px; line-height: 1.25; letter-spacing: -.5px; font-weight: 700; }
.login-art h1 em { font-style: normal; color: var(--brand); }
/* 登录页只留一句内部告示：字放大、行距放松，占住左栏 */
.login-art .login-slogan { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.34; letter-spacing: .5px; }
.login-art .login-slogan em { display: inline-block; }
.login-art p { color: var(--ink-2); max-width: 40ch; font-size: 14.5px; }
.login-points { display: grid; gap: 12px; margin-top: 8px; }
.login-points li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-size: 13.5px; }
.login-points b { color: var(--ink); font-weight: 600; }
.dot-ic { width: 22px; height: 22px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; margin-top: 1px; }
.login-card {
  align-self: center; justify-self: center; width: min(420px, calc(100% - 40px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 30px 26px; box-shadow: var(--shadow-lg); margin: 40px 0;
}
.login-card h2 { font-size: 20px; letter-spacing: -.2px; }
.login-card .sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.seg { display: flex; gap: 4px; background: var(--surface-3); padding: 4px; border-radius: 10px; margin: 20px 0 18px; }
.seg-btn { flex: 1; height: 32px; border: 0; background: transparent; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; transition: .15s; }
.seg-btn.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface);
  outline: none; transition: .15s; font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(22,104,179,.12); }
.input::placeholder, .textarea::placeholder { color: #a9b6c7; }
.textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 10px; line-height: 1.6; }
.hint-contact { margin-top: 6px; color: var(--brand); font-weight: 600; }
/* 登录页退回提示：未开通 / 登录被拦，放在页签上方 */
.login-notice {
  margin: 14px 0 -2px; padding: 10px 12px;
  background: var(--danger-soft); border: 1px solid #f3cdc7; border-radius: 9px;
  color: #9c2b20; font-size: 12.5px; line-height: 1.65;
}
.login-notice[hidden] { display: none !important; }

.err { color: var(--danger); font-size: 12.5px; margin-top: 10px; min-height: 18px; }
.alert { background: var(--danger-soft); color: #9c2b20; border: 1px solid #f3cdc7; border-radius: 8px; padding: 9px 11px; font-size: 12.5px; margin-bottom: 12px; }
.alert.warn { background: var(--warn-soft); color: #7d5108; border-color: #f0dcbc; }

/* ---------- topbar ---------- */
.topbar {
  height: 60px; display: flex; align-items: center; gap: 18px;
  padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: block; object-fit: cover; background: #d8261c; box-shadow: 0 4px 12px -6px rgba(160, 26, 18, .9); }
.brand-text strong { display: block; font-size: 14.5px; letter-spacing: -.1px; }
.brand-text span { display: block; font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }
.search-wrap { position: relative; flex: 1; max-width: 380px; }
.search-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-wrap input { width: 100%; height: 36px; padding: 0 12px 0 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; outline: none; }
.search-wrap input:focus { background: #fff; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(22,104,179,.1); }
.stats { display: flex; gap: 8px; margin-left: auto; }
.stat { display: flex; align-items: baseline; gap: 5px; padding: 5px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.stat b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat.is-warn b { color: var(--warn); }
.stat.is-ok b { color: var(--ok); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.user-chip span { font-size: 12.5px; color: var(--ink-2); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip:hover { background: var(--surface-2); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 336px minmax(0, 1fr); height: calc(100vh - 60px); }
.sidebar { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.side-head > span:first-child { font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .04em; }
.count { font-size: 11.5px; color: var(--ink-3); background: var(--surface-3); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; padding: 2px 12px 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 27px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12.5px; white-space: nowrap; transition: .15s; }
.chip:hover { border-color: var(--line-2); background: var(--surface-2); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.order-list { flex: 1; overflow-y: auto; padding: 2px 10px 24px; }
.order-list::-webkit-scrollbar { width: 8px; }
.order-list::-webkit-scrollbar-thumb { background: #d7e0ec; border-radius: 8px; border: 2px solid var(--surface); }

.order-card {
  width: 100%; text-align: left; display: block;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 11px; padding: 11px 12px 10px; margin-bottom: 8px;
  transition: .15s; position: relative;
}
.order-card:hover { border-color: #b9cde3; box-shadow: var(--shadow-sm); }
.order-card.is-on { border-color: var(--brand); background: linear-gradient(180deg, #f7fbff, #fff); box-shadow: 0 0 0 1px var(--brand) inset, var(--shadow); }
.order-card.is-on::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--brand); }
.oc-top { display: flex; align-items: center; gap: 8px; }
.oc-name { font-size: 13.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-cn { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); letter-spacing: .3px; margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.oc-cn .pend { font-family: inherit; font-size: 11.5px; color: var(--warn); background: var(--warn-soft); border: 1px dashed #e6c99a; padding: 0 6px; border-radius: 5px; letter-spacing: 0; }
.oc-route { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.oc-route .arrow { color: var(--ink-3); }
.oc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; gap: 8px; }
.oc-next { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-track { display: flex; gap: 3px; flex: none; }
.mini-track i { width: 12px; height: 3px; border-radius: 2px; background: #dfe7f1; display: block; }
.mini-track i.on { background: var(--brand); }

.pill { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-brand { color: #12548c; background: var(--brand-soft); border-color: #d5e5f5; }
.pill-warn { color: #8a5a08; background: var(--warn-soft); border-color: #f0dcbb; }
.pill-ok { color: #0a6a52; background: var(--ok-soft); border-color: #cbe9dd; }
.pill-neutral { color: var(--ink-2); background: var(--surface-3); border-color: var(--line); }
.pill-danger { color: #a32a1d; background: var(--danger-soft); border-color: #f2cdc7; }
.pill-plain::before { display: none; }

/* ---------- main / empty ---------- */
.main { overflow-y: auto; padding: 22px 26px 60px; min-width: 0; }
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: #d7e0ec; border-radius: 8px; border: 3px solid var(--bg); }
.empty { display: grid; place-items: center; height: 100%; text-align: center; padding: 40px; }
.empty-inner { max-width: 420px; }
.empty-art { width: 220px; height: 150px; margin: 0 auto 18px; color: var(--brand); opacity: .9; }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--ink-2); font-size: 13.5px; margin-bottom: 18px; }

/* ---------- detail ---------- */
.detail { max-width: 1100px; margin: 0 auto; }
.detail-head { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.kicker { font-size: 12px; color: var(--ink-3); letter-spacing: .04em; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kicker .sep { color: var(--line-2); }
.cn-no { font-family: var(--mono); font-size: 27px; font-weight: 600; letter-spacing: 1px; line-height: 1.2; margin-top: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cn-no.is-pending { font-family: inherit; font-size: 22px; color: var(--warn); letter-spacing: 0; }
.copy-btn { height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-size: 11.5px; font-family: inherit; letter-spacing: 0; }
.copy-btn:hover { color: var(--brand); border-color: #b9cde3; }
.detail-meta { color: var(--ink-2); font-size: 13px; margin-top: 8px; display: flex; gap: 16px; flex-wrap: wrap; }
.detail-meta b { color: var(--ink); font-weight: 500; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.band { margin-top: 16px; display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; flex-wrap: wrap; }
.band-cell { background: var(--surface); padding: 11px 15px; flex: 1 1 130px; min-width: 0; }
.band-cell .k { font-size: 11.5px; color: var(--ink-3); display: block; margin-bottom: 2px; }
.band-cell .v { font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.band-cell .v.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .2px; }
.band-cell .v.muted { color: var(--ink-3); font-weight: 400; }

/* timeline */
.tl-wrap { margin: 20px 0 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px 14px; box-shadow: var(--shadow-sm); }
.tl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tl-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.tl-plan { margin-left: auto; display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.tl-plan b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.tl-plan .lbl { color: var(--ink-3); }
.tl { display: flex; align-items: flex-start; padding: 0 0 2px; }
.tl-node { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.tl-node::before { content: ""; position: absolute; top: 13px; left: 0; right: 50%; height: 2px; background: #e2e9f2; }
.tl-node::after { content: ""; position: absolute; top: 13px; left: 50%; right: 0; height: 2px; background: #e2e9f2; }
.tl-node:first-child::before, .tl-node:last-child::after { display: none; }
.tl-node.is-done::before, .tl-node.is-done::after { background: var(--brand); }
.tl-node.is-done.is-last::after { display: none; }
.tl-dot {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #dbe4ef; background: var(--surface);
  display: grid; place-items: center; position: relative; z-index: 1; color: var(--ink-3);
  font-size: 11px; font-weight: 600; padding: 0; transition: .16s;
}
.tl-dot:hover { border-color: var(--brand-2); color: var(--brand); transform: scale(1.08); }
.tl-node.is-done .tl-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.tl-node.is-current .tl-dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px rgba(22,104,179,.14); }
.tl-node.is-next .tl-dot { border-style: dashed; }
.tl-label { font-size: 12.5px; font-weight: 500; margin-top: 8px; color: var(--ink); }
.tl-node:not(.is-done) .tl-label { color: var(--ink-3); font-weight: 400; }
.tl-date { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.tl-date.none { color: #b6c2d2; font-family: inherit; }
/* 填了将来日期、还没真正发生（例如预计 10-30 到港）：点线 + 浅色，不显示成已完成 */
.tl-node.is-plan .tl-dot { border-style: dashed; color: var(--ink-3); border-color: var(--line-2); }
.tl-node.is-plan .tl-date { color: var(--ink-3); }

/* card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-top: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fcfdff, #fff); }
.card-title { font-size: 13.5px; font-weight: 600; }
.card-title small { color: var(--ink-3); font-weight: 400; margin-left: 6px; font-size: 12px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 12px 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin-top: 16px; }

.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 18px; }
.kv .k { font-size: 11.5px; color: var(--ink-3); display: block; margin-bottom: 1px; }
.kv .v { font-size: 13.5px; color: var(--ink); word-break: break-word; }
.kv .v.mono { font-family: var(--mono); font-size: 13px; }
.kv .v.muted { color: #b6c2d2; }

/* items */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.item-media { display: flex; gap: 2px; background: var(--surface-3); align-items: stretch; min-height: 150px; }
.item-media .ph { flex: 1; display: grid; place-items: center; color: #b8c5d5; font-size: 11.5px; min-height: 150px; }
.thumb-btn { flex: 1; padding: 0; border: 0; background: #eef3f9; position: relative; overflow: hidden; min-height: 150px; display: block; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; transition: transform .3s; }
.thumb-btn:hover img { transform: scale(1.04); }
.item-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item-name { font-size: 14px; font-weight: 600; }
.item-spec { font-size: 12.5px; color: var(--ink-2); }
.item-facts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.item-facts div { font-size: 12px; color: var(--ink-3); }
.item-facts b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.item-remark { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 6px; padding: 5px 8px; }
.item-thumbs { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.mini-thumb { width: 34px; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); padding: 0; background: var(--surface-3); }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.notes-box { white-space: pre-wrap; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.exc { display: inline-flex; align-items: center; gap: 6px; background: var(--danger-soft); border: 1px solid #f2cdc7; color: #963024; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; margin-top: 10px; }

/* gallery grid for all images */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gal-item { position: relative; aspect-ratio: 4/3; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); }
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-item .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(9,20,34,.72)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-item button { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgba(9,20,34,.6); color: #fff; display: grid; place-items: center; opacity: 0; transition: .15s; }
.gal-item:hover button { opacity: 1; }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12, 24, 40, .46); backdrop-filter: blur(2px); }
.modal {
  position: relative; width: min(940px, 100%); max-height: calc(100vh - 48px);
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop .2s ease-out;
}
.modal.sm { width: min(460px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99) } to { opacity: 1; transform: none } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; letter-spacing: -.1px; }
.modal-head .sub { font-size: 12.5px; color: var(--ink-3); }
.modal-head .x { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.modal-head .x:hover { background: var(--surface-3); color: var(--ink); }
.modal-body { padding: 18px 20px 8px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-foot .right { margin-left: auto; display: flex; gap: 8px; }

.form-section { margin-bottom: 20px; }
.form-section > h4 { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.form-section > h4::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-3 { grid-column: span 3; }
.form-grid .col-4 { grid-column: span 4; }
.fld { min-width: 0; }
.fld > label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 5px; }
.fld .input, .fld .select { height: 36px; font-size: 13.5px; }
.fld .input[type="datetime-local"] { font-family: var(--mono); font-size: 12.5px; padding: 0 8px; }
.fld .hintline { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

/* item editor */
.ie-list { display: grid; gap: 10px; }
.ie-row { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--surface-2); position: relative; }
.ie-row:hover { border-color: var(--line-2); }
.ie-grid { display: grid; grid-template-columns: 1.4fr 1.4fr .9fr .7fr .7fr .8fr 1.2fr; gap: 8px; }
.ie-grid2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.ie-row .input, .ie-row .select { height: 32px; font-size: 12.5px; background: #fff; }
.ie-row .rm { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; color: var(--ink-3); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.ie-row .rm:hover { color: var(--danger); border-color: #e3aca4; }
.ie-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; align-items: center; }
.ie-thumb { width: 42px; height: 42px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line-2); position: relative; background: #fff; }
.ie-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ie-thumb .del { position: absolute; top: 0; right: 0; width: 15px; height: 15px; border-radius: 0 0 0 5px; border: 0; background: rgba(12,24,40,.62); color: #fff; font-size: 10px; line-height: 1; display: grid; place-items: center; }
.upload-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px dashed var(--line-2); border-radius: 7px; color: var(--ink-2); font-size: 12px; background: #fff; }
.upload-btn:hover { border-color: var(--brand-2); color: var(--brand); }
.upload-btn input { display: none; }
.upload-btn.is-busy { opacity: .6; pointer-events: none; }

/* collect panel */
.collect { border: 1px solid #d9e6f5; background: linear-gradient(180deg, #f7fbff, #fdfeff); border-radius: 12px; padding: 14px; margin-bottom: 20px; }
.collect-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.collect-head b { font-size: 13px; }
.collect-head .tag { font-size: 10.5px; color: var(--brand); background: var(--brand-soft); border-radius: 4px; padding: 1px 5px; letter-spacing: .03em; }
.collect-head .sub { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.collect-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.collect-row .select { width: auto; min-width: 158px; height: 32px; font-size: 12.5px; }
.collect-row .input { height: 32px; font-size: 12.5px; width: 190px; font-family: var(--mono); }
.collect textarea { min-height: 74px; font-size: 12.5px; }
.parse-list { margin-top: 10px; display: grid; gap: 6px; }
.pr-group { display: grid; gap: 6px; }
.pr-group + .pr-group { margin-top: 11px; }
.pr-group-head { display: flex; align-items: baseline; gap: 8px; padding: 0 2px; }
.pr-group-head b { font-size: 12.5px; color: var(--ink); font-weight: 700; }
.pr-group-head span { font-size: 11px; color: var(--ink-3); }
.pr-actions { display: flex; align-items: center; gap: 10px; margin-top: 11px; }
.pr-count { font-size: 11.5px; color: var(--ink-3); }
.pr-row { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; }
.pr-row.is-note { background: #fbfcfe; }
.pr-row.is-note .d { font-family: inherit; color: var(--ink-2); }
.pr-row input[type="checkbox"] { accent-color: var(--brand); width: 14px; height: 14px; }
.pr-row .f { font-weight: 600; min-width: 62px; white-space: nowrap; }
.pr-row .d { font-family: var(--mono); color: var(--brand); font-size: 12px; }
.pr-row .ev { color: var(--ink-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.collect-status { font-size: 12px; margin-top: 9px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.spinner { width: 13px; height: 13px; border: 2px solid #cfe0f2; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg) } }

/* link menu */
.menu { position: absolute; z-index: 70; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 250px; max-height: 380px; overflow-y: auto; }
.menu a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: 13px; }
.menu a:hover { background: var(--brand-soft); color: var(--brand); }
.menu a small { display: block; color: var(--ink-3); font-size: 11.5px; }
.menu .grp { font-size: 10.5px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; padding: 7px 10px 3px; }
.menu-vessel a.menu-featured { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.menu-vessel a.menu-featured small { color: var(--brand); opacity: .78; }
.menu-vessel .menu-empty { padding: 8px 10px 12px; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(8,16,28,.9); display: grid; place-items: center; padding: 30px; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 8px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); background: #fff; }
.lb-bar { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; color: #dce6f2; font-size: 12.5px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); padding: 7px 14px; border-radius: 999px; backdrop-filter: blur(6px); }
.lb-bar button { background: none; border: 0; color: #fff; font-size: 15px; padding: 0 4px; }
.lb-close { position: absolute; top: 18px; right: 22px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; font-size: 18px; }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; justify-items: end; }
.toast { background: #10202f; color: #eaf1f8; padding: 9px 14px; border-radius: 9px; font-size: 13px; box-shadow: var(--shadow-lg); animation: slide .22s ease-out; max-width: 380px; }
.toast.err { background: #7f2318; }
.toast.ok { background: #0c5844; }
@keyframes slide { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

.skel { background: linear-gradient(90deg, #eef2f7 25%, #f7fafd 37%, #eef2f7 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 290px minmax(0, 1fr); }
  .main { padding: 18px 18px 50px; }
  .stats .stat:nth-child(3) { display: none; }
  .ie-grid { grid-template-columns: 1fr 1fr 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .col-4 { grid-column: span 2; }
}
@media (max-width: 860px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { padding: 34px 26px 6px; }
  .login-art h1 { font-size: 26px; }
  .login-card { margin: 20px auto 40px; }
  .search-wrap { display: none; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 42vh; }
  .main { height: auto; }
  .grid-2 { grid-template-columns: 1fr; }
  .tl-plan { margin-left: 0; width: 100%; }
  .band-cell { flex-basis: 100px; }
  .ie-grid { grid-template-columns: 1fr 1fr; }
  .cn-no { font-size: 22px; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .topbar, .sidebar, .detail-actions, .modal-root, .toasts, .lightbox, .copy-btn, .chips { display: none !important; }
  .layout { display: block; height: auto; }
  .main { overflow: visible; padding: 0; }
  .card, .tl-wrap, .band { box-shadow: none; break-inside: avoid; }
  .print-only { display: block !important; }
  .gal-item button, .mini-thumb { display: none; }
  @page { margin: 14mm; }
}
.print-only { display: none; }

/* ---------- 预览模式提示条 ---------- */
.preview-bar {
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 18px;
  background: #fff8ea; border-bottom: 1px solid #f3e0b8;
  color: #8a5a08; font-size: 12.5px; letter-spacing: .01em;
}
.preview-bar[hidden] { display: none; }
.preview-bar .pb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn, #d99a1f); flex: none; box-shadow: 0 0 0 3px rgba(217,154,31,.16); }
.preview-bar .pb-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-bar b { font-weight: 700; }
#app.has-preview .layout { height: calc(100vh - 94px); }
.user-chip.is-preview { border-color: #f3e0b8; background: #fff8ea; }
.user-chip.is-preview .avatar { background: #f7e3b8; color: #8a5a08; }
.user-chip.is-preview span { color: #8a5a08; font-weight: 600; }
@media (max-width: 860px) {
  #app.has-preview .layout { height: auto; }
  .preview-bar { height: auto; padding: 8px 14px; align-items: flex-start; line-height: 1.5; }
  .preview-bar .pb-text { white-space: normal; }
}
@media print { .preview-bar { display: none !important; } }

/* ---------- 表单校验高亮（箱号/承运人未填时定位提示） ---------- */
.is-alert {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(200, 62, 48, .14) !important;
  animation: fieldPulse .5s ease-out 2;
}
@keyframes fieldPulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 62, 48, .28); }
  100% { box-shadow: 0 0 0 8px rgba(200, 62, 48, 0); }
}
.collect-status.is-err { color: var(--danger); }
.collect-status.is-err span:last-child { font-weight: 500; }
.collect-status.is-ok { color: var(--ok); }

/* ---------- 侧栏「隐藏已完成」开关 ---------- */
.side-tools {
  display: flex; align-items: center; gap: 9px;
  padding: 0 14px 10px; margin-top: -4px;
}
.switch-btn {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  border: 0; background: none; padding: 0;
  color: var(--ink-3); font-size: 12.5px; line-height: 1;
  transition: color .15s;
}
.switch-btn:hover { color: var(--ink-2); }
.switch-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 999px; }
.sw-track {
  position: relative; flex: none;
  width: 30px; height: 17px; border-radius: 999px;
  background: #e2e9f3; border: 1px solid #d2dce9;
  transition: background .18s, border-color .18s;
}
.sw-knob {
  position: absolute; top: 1px; left: 1px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(16, 32, 52, .24);
  transition: transform .18s;
}
.switch-btn.is-on { color: var(--brand); font-weight: 600; }
.switch-btn.is-on .sw-track { background: var(--brand); border-color: var(--brand); }
.switch-btn.is-on .sw-knob { transform: translateX(13px); }
.sw-hint { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sw-hint.is-on { color: var(--brand); }

/* ---------- 品牌 / 保密（2026-10-21） ---------- */
.login-logo {
  width: 66px; height: 66px; border-radius: 17px; object-fit: cover;
  display: block; background: #d8261c;
  box-shadow: 0 12px 28px -14px rgba(170, 30, 20, .8);
}
/* 图标右侧：中华建材 / ZHONGHUA JIANCAI */
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand-txt { min-width: 0; }
.login-brand-txt b {
  display: block; font-size: 22px; font-weight: 700; line-height: 1.2;
  color: var(--ink); letter-spacing: 1.5px;
}
.login-brand-txt span {
  display: block; margin-top: 5px; font-size: 10px; font-weight: 600;
  letter-spacing: .14em; color: var(--ink-3); white-space: nowrap;
}

/* 顶栏「保密」徽章 */
.conf-chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 30px; padding: 0 10px; border-radius: 8px;
  border: 1px solid #f0cec7; background: #fdf4f2; color: #b23a28;
  font-size: 12px; font-weight: 600; letter-spacing: .02em; transition: .15s;
}
.conf-chip:hover { background: #fbe9e4; border-color: #e6b7ad; }
.conf-chip:focus-visible { outline: 2px solid #d8261c; outline-offset: 2px; }
.conf-chip .icon { width: 13px; height: 13px; stroke-width: 1.9; }

/* 主区域容器 + 保密水印 */
.main-wrap { position: relative; display: flex; min-width: 0; min-height: 0; overflow: hidden; }
.main-wrap > .main { flex: 1; }
.conf-wm {
  position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background-image: url(assets/watermark.svg);
  background-repeat: repeat; background-size: 230px 160px;
  opacity: .85;
}

/* 保密须知弹窗 */
.conf-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.conf-list li { display: flex; gap: 8px; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.conf-list li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #d8261c; flex: none; margin-top: 8px; opacity: .75; }
.conf-note { margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: #fdf4f2; border: 1px solid #f3d9d3; color: #96321f; font-size: 12.5px; line-height: 1.65; }

/* 打印：显示保密抬头/页脚 */
@media print {
  .main-wrap { display: block; overflow: visible; min-height: 0; }
  .conf-wm { display: none; }
  .conf-print-head {
    display: flex !important; justify-content: space-between; align-items: baseline;
    border-bottom: 1px solid #d8261c; padding-bottom: 5px; margin-bottom: 12px;
    font-size: 11.5px; color: #8c2b1c;
  }
  .conf-print-head b { font-size: 13px; letter-spacing: .06em; }
  .conf-print-foot {
    display: block !important; margin-top: 18px; padding-top: 8px;
    border-top: 1px dashed #d9b9b3; font-size: 10.5px; color: #8c2b1c; line-height: 1.6;
  }
}

@media (max-width: 860px) {
  .main-wrap { display: block; overflow: visible; }
  .conf-wm { background-size: 190px 132px; }
  .conf-chip { height: 28px; padding: 0 8px; font-size: 11.5px; }
  .login-logo { width: 56px; height: 56px; border-radius: 14px; }
  .login-brand { gap: 12px; }
  .login-brand-txt b { font-size: 19px; letter-spacing: 1px; }
  .login-brand-txt span { font-size: 9px; letter-spacing: .1em; }
}

/* 保密清单：避免 flex 把文字拆成多个匿名项目 */
.conf-list li > span { flex: 1; min-width: 0; }
.conf-list li b { color: #96321f; font-weight: 600; }

/* 窄屏顶栏：优先保留品牌、新建与保密入口 */
@media (max-width: 620px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .stats { display: none; }
  .user-chip { display: none; }
  .conf-chip { height: 30px; padding: 0 9px; }
}
@media (max-width: 380px) {
  .conf-chip .conf-label { display: none; }
  .conf-chip { padding: 0 8px; }
}

/* ---------- 采集助手：维运网识别结果条 ---------- */
.wy-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 8px; padding: 8px 10px;
  border-radius: 9px; border: 1px solid #cfe3f7; background: #f2f8fe;
  font-size: 12.5px; color: var(--ink-2);
}
.wy-bar[hidden] { display: none; }
.wy-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 6px; background: var(--brand); color: #fff;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.wy-box {
  font-family: var(--mono); letter-spacing: .04em; color: var(--ink);
  font-size: 12px;
}
.wy-link {
  margin-left: auto; color: var(--brand); font-size: 12.5px; font-weight: 600;
  text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px;
  white-space: nowrap;
}
.wy-link:hover { opacity: .78; }
.wy-copy {
  flex: none; border: 1px solid #cfe3f7; background: #fff; color: var(--brand);
  height: 24px; padding: 0 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.wy-copy:hover { background: #eaf4ff; }

/* 判定依据 + 其他候选（可点击切换） */
.wy-basis {
  font-size: 11px; color: #6b7f95; background: #e7f0fa;
  border-radius: 5px; padding: 2px 6px; white-space: nowrap;
}
.wy-basis.is-clickable { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.wy-basis.is-clickable:hover { background: #d8e8f8; color: #2c4f74; }
.wy-alt {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; color: #8592a3;
}
.wy-alt-btn {
  border: 1px dashed #b9d3ec; background: #fff; color: var(--brand);
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.wy-alt-btn:hover { background: #eaf4ff; border-style: solid; }
.wy-alt-btn:active { transform: translateY(1px); }
@media (max-width: 620px) {
  .wy-link { margin-left: 0; }
  .wy-alt { width: 100%; }
}

/* ============================================================
   权限与成员（登录门禁 + 管理员成员管理）
   ============================================================ */

/* ---- 门禁页：待审核 / 已停用 ---- */
.gate-screen {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 460px at 50% -12%, #dceaf9 0%, transparent 62%),
    var(--bg);
}
.gate-screen[hidden] { display: none; }
.gate-card {
  width: 100%; max-width: 388px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.gate-mark { width: 40px; height: 40px; object-fit: contain; margin-bottom: 12px; }
.gate-ico {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 50%; display: grid; place-items: center;
}
.gate-ico svg { width: 26px; height: 26px; }
.gate-ico.is-pending { background: var(--warn-soft); color: var(--warn); }
.gate-ico.is-suspended, .gate-ico.is-blocked { background: var(--danger-soft); color: var(--danger); }
.gate-ico.is-error { background: var(--surface-3); color: var(--ink-2); }
.gate-card h2 { font-size: 18px; letter-spacing: -.2px; margin: 0 0 8px; }
.gate-card p { font-size: 13px; line-height: 1.75; color: var(--ink-2); margin: 0 0 14px; }
.gate-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.gate-meta span {
  font-size: 12px; color: var(--ink-3);
  background: var(--surface-2); border-radius: 6px; padding: 5px 8px;
  word-break: break-all;
}
.gate-acts { display: flex; flex-direction: column; gap: 8px; }
.gate-acts .btn { justify-content: center; height: 38px; }
.gate-foot { margin-top: 18px; font-size: 11.5px; color: var(--ink-3); }

/* ---- 顶栏「成员」入口 ---- */
.mem-btn { position: relative; height: 34px; padding: 0 10px; gap: 6px; font-size: 12.5px; }
.mem-btn .icon { width: 16px; height: 16px; }
.mem-dot {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.user-chip.is-admin .avatar { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1.5px #bcd6ef; }
.user-chip { cursor: pointer; }

/* ---- 成员管理弹窗 ---- */
.mem-body { display: flex; flex-direction: column; gap: 12px; }
.mem-loading { padding: 26px 0; text-align: center; font-size: 13px; color: var(--ink-3); }
.mem-loading.is-err { color: var(--danger); }
.mem-tabs { display: flex; gap: 6px; background: var(--surface-3); padding: 4px; border-radius: 10px; }
.mem-tab {
  flex: 1; height: 32px; border: 0; background: transparent; border-radius: 7px;
  color: var(--ink-2); font-size: 13px; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.mem-tab b {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  background: var(--surface); border-radius: 999px; padding: 1px 6px; min-width: 18px;
}
.mem-tab.is-on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.mem-tab.is-on b { color: var(--brand); background: var(--brand-soft); }
.mem-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; }
.mem-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: var(--surface);
}
.mem-ava {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2);
  font-size: 13px; font-weight: 700;
}
.mem-ava.is-admin { background: var(--brand-soft); color: var(--brand); }
.mem-main { flex: 1; min-width: 0; }
.mem-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; }
.mem-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; word-break: break-all; }
.mem-sub.is-dim { color: var(--ink-3); }
.mem-badge { font-size: 10.5px; font-weight: 600; border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.mem-badge.is-admin { background: var(--brand-soft); color: var(--brand); }
.mem-badge.is-member { background: var(--surface-3); color: var(--ink-2); }
.mem-badge.is-me { background: var(--accent-soft); color: var(--accent); }
.mem-badge.is-off { background: var(--danger-soft); color: var(--danger); }
.mem-badge.is-wait { background: var(--warn-soft); color: var(--warn); }
.mem-acts { display: flex; gap: 6px; flex: none; }
.mem-self { font-size: 11.5px; color: var(--ink-3); }
.mem-empty { padding: 26px 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.mem-tip { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.mem-claim {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--warn); background: var(--warn-soft);
  border-radius: 8px; padding: 9px 11px;
}
.mem-claim span { flex: 1; min-width: 160px; }
.mem-foot-hint { font-size: 11.5px; color: var(--ink-3); }

/* ---- 小按钮 ---- */
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn-danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: transparent; }
.btn-xs.is-armed { background: var(--danger-soft); border-color: #e3aca4; color: var(--danger); font-weight: 600; }

/* ---- 账号弹窗 ---- */
.acct-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.acct-ava {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
  font-size: 18px; font-weight: 700;
}
.acct-name { font-size: 15px; font-weight: 600; word-break: break-word; }
.acct-role { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.acct-id { flex: 1; min-width: 0; }
.acct-rename { flex: none; }
.acct-edit {
  margin: -4px 0 14px; padding: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.acct-edit[hidden] { display: none; }
.acct-input {
  width: 100%; height: 34px; padding: 0 10px;
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2, var(--line));
  border-radius: 8px; outline: none;
}
.acct-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.acct-input.is-bad { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.acct-edit-acts { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.acct-edit-acts .btn:last-child { margin-left: 0; }
.acct-counter { margin-right: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.acct-counter.is-over { color: var(--warn); font-weight: 600; }
.acct-err { margin-top: 8px; font-size: 11.5px; color: var(--danger); font-weight: 500; }
.acct-err[hidden] { display: none; }
.acct-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.acct-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); padding: 9px 12px; font-size: 12.5px; }
.acct-list span { color: var(--ink-3); flex: none; }
.acct-list b { font-weight: 600; word-break: break-all; text-align: right; }
.acct-note { margin-top: 12px; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

@media (max-width: 620px) {
  .mem-btn .mem-btn-text { display: none; }
  .mem-btn { padding: 0 8px; }
  .mem-row { flex-wrap: wrap; }
  .mem-acts { width: 100%; justify-content: flex-end; }
  .gate-card { padding: 22px 18px 16px; }
  /* 手机上必须留一个账号入口，否则没法退出登录 */
  .user-chip { display: flex; padding: 3px; }
  .user-chip #userName { display: none; }
}

/* ---- 成员列表行内改名 ---- */
.mem-row.is-editing { border-color: #bcd6ef; box-shadow: var(--shadow-sm); }
.mem-name-input {
  width: 100%; height: 32px; padding: 0 9px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 7px; outline: none;
}
.mem-name-input::placeholder { font-weight: 400; color: var(--ink-3); }
.mem-name-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.mem-name-input.is-bad { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.mem-err { margin-top: 5px; font-size: 11.5px; color: var(--danger); font-weight: 500; }
.mem-err[hidden] { display: none; }

/* ---- 成员弹窗：开通账号 ---- */
.mem-issue {
  border: 1px solid #bcd6ef; background: #f5f9fd; border-radius: 11px;
  padding: 12px 13px 11px;
}
.mem-issue-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.mem-issue-head b { font-size: 13px; }
.mem-issue-head span { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.mem-issue-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 10px; }
.mem-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mem-field > span { font-size: 11.5px; color: var(--ink-2); }
.mem-field .input { height: 34px; font-size: 13px; padding: 0 9px; }
.mem-issue-err { margin-top: 8px; font-size: 12px; color: var(--danger); }
.mem-issue-err[hidden] { display: none !important; }
.mem-issue-acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.mem-badge.is-issue { background: var(--accent-soft); color: var(--accent); }

/* ---- 登录：邮箱 + 密码 ---- */
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 58px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--ink-3);
  font-size: 12px; padding: 5px 8px; cursor: pointer; border-radius: 6px;
  line-height: 1;
}
.pwd-eye:hover { color: var(--brand); background: var(--brand-soft); }
.pwd-eye.is-on { color: var(--brand); }
.hint-login { margin: 10px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }

/* 首次改密页 */
.pwd-card { max-width: 380px; }
.pwd-form { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; text-align: left; }

/* 成员：刚生成的账号与初始密码（只显示一次） */
.mem-issued {
  border: 1px solid #cfe3f7; background: #f4f9ff; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 12px;
}
.mem-issued-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.mem-issued-head b { font-size: 13px; color: var(--brand); }
.mem-issued-head span { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.mem-issued-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; margin-top: 5px; }
.mem-issued-row > span { width: 34px; color: var(--ink-3); flex: none; }
.mem-issued-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fff; border: 1px solid #dbe8f5; border-radius: 6px;
  padding: 3px 8px; font-size: 13px; letter-spacing: .4px; color: var(--ink);
  word-break: break-all;
}
.mem-issued-acts { display: flex; gap: 6px; margin-top: 10px; }
@media (max-width: 620px) {
  .mem-issue-grid { grid-template-columns: 1fr; }
  /* 表单展开时把列表收紧，避免嵌套滚动把下面那半截藏得太深 */
  .mem-issue + .mem-tabs + .mem-list { max-height: 34vh; }
}

/* ---- 8 节点流程 & 表单提示（2026-10-22） ---- */
.form-section > h4 .h4-sub { font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.save-warn { border: 1px solid #f0c9a8; background: #fff8f1; color: #8a4b13; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.7; margin-bottom: 14px; }
.save-warn b { display: block; font-size: 13px; margin-bottom: 4px; }
.save-warn ul { margin: 0 0 4px; padding-left: 18px; }
.save-warn span { color: #a2683a; font-size: 12px; }
.pr-row.is-warn { border-color: #f0c9a8; background: #fffaf3; }
.pr-row.is-warn .ev { color: #b45309; }
.tl-node .tl-label { white-space: nowrap; }
@media (max-width: 720px) {
  .tl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tl { min-width: 540px; }
  .tl-plan { margin-left: 0; }
}
.pr-row.is-alert { align-items: flex-start; }
.pr-row.is-alert .f { color: #b45309; }
.pr-row.is-alert .d { font-family: inherit; color: #8a4b13; font-size: 12px; line-height: 1.6; white-space: normal; flex: 1; }

/* ---- 航行进度（2026-10-22）----
 * 该航线无公开 AIS 覆盖，位置按船期推算，视觉上刻意做得克制：
 * 浅色航线、品牌色进度、灰色说明，避免让人误以为是实测轨迹。 */
.sail-card .card-body { padding: 14px 16px 13px; }
.sail-badge {
  margin-left: auto; font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--brand-soft); color: var(--brand);
}
.sail-badge.is-waiting { background: var(--surface-3); color: var(--ink-2); }
.sail-badge.is-arrived { background: var(--ok-soft); color: var(--ok); }

.sail-ends { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; }
.sail-end { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sail-end.is-right { text-align: right; align-items: flex-end; }
.sail-end b { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.sail-end small { font-size: 11.5px; color: var(--ink-3); }

.sail-svg { display: block; width: 100%; height: auto; margin: 2px 0 4px; overflow: visible; }
.sail-track { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 4 5; stroke-linecap: round; }
.sail-track-done { fill: none; stroke: var(--brand-2); stroke-width: 2.6; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.sail-node { fill: var(--surface); stroke: var(--line-2); stroke-width: 2.4; }
.sail-boat-halo { fill: var(--brand-soft); }
.sail-boat { fill: var(--brand); }

.sail-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; padding-top: 4px; }
.sail-stat { display: flex; flex-direction: column; gap: 1px; min-width: 84px; }
.sail-stat span { font-size: 11.5px; color: var(--ink-3); }
.sail-stat b { font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.sail-stat b.mono { font-family: var(--mono); font-size: 13px; font-weight: 500; }

.sail-note {
  margin-top: 11px; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 11.5px; line-height: 1.65; color: var(--ink-3);
}
.sail-empty { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.sail-empty .icon { flex: none; margin-top: 2px; color: var(--warn); stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 720px) {
  .sail-ends { flex-direction: column; align-items: flex-start; gap: 6px; }
  .sail-end.is-right { text-align: left; align-items: flex-start; }
  .sail-end b { max-width: none; }
  .sail-stats { gap: 10px 20px; }
}

@media print {
  .sail-note { color: #666; }
  .sail-badge { border: 1px solid #ccc; }
}

/* ---- 实时船位（2026-11-09）
 * 数据由定时任务从 VesselFinder 公开 AIS 抓取后存入云库，前端只读。
 * 刻意与"推算"区分：实时块用实心点 + 品牌色，陈旧时整体降饱和。 */
.sail-live {
  margin-bottom: 13px; padding: 10px 12px 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.sail-live.is-stale { background: var(--surface-3); }
.sail-live-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.sail-live-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--ok); white-space: nowrap;
}
.sail-live-tag i {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 3px rgba(13, 122, 95, .13);
}
.sail-live.is-stale .sail-live-tag { color: var(--ink-3); }
.sail-live.is-stale .sail-live-tag i { box-shadow: none; }
.sail-live-age { font-size: 11.5px; color: var(--ink-3); }
.sail-live-right {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
.sail-live-imo {
  font-size: 11px; color: var(--ink-3);
  font-family: var(--mono); letter-spacing: .2px;
}
.sail-live-src {
  font-size: 11.5px; color: var(--brand);
  text-decoration: none; white-space: nowrap;
}
.sail-live-src:hover { text-decoration: underline; }

.sail-live-grid { display: flex; flex-wrap: wrap; gap: 9px 26px; }
.sail-live-grid > div { display: flex; flex-direction: column; gap: 1px; min-width: 76px; }
.sail-live-grid span { font-size: 11px; color: var(--ink-3); }
.sail-live-grid b {
  font-size: 13px; font-weight: 600; color: var(--ink);
  overflow-wrap: anywhere;
}
.sail-live-grid b .kn { color: var(--ink-2); font-weight: 500; }

@media (max-width: 720px) {
  .sail-live { padding: 10px 11px; }
  .sail-live-grid { gap: 8px 18px; }
  .sail-live-grid > div { min-width: 70px; }
  .sail-live-imo { display: none; }
}

@media print {
  .sail-live { border-color: #ccc; background: #fafafa; }
}

/* ---- 刷新船位（2026-11-17）---- */
.icon.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sail-check {
  margin-left: auto; flex: none;
  font-size: 11.5px; font-weight: 500; color: var(--brand);
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s;
}
.sail-check:hover { background: var(--brand-soft); border-color: var(--brand); }
.sail-card .card-head .sail-check + .sail-badge { margin-left: 0; }

@media print {
  .sail-check { display: none; }
}

/* ============================================================
 * 多语言（中文 / 泰文 / 缅文）
 * 泰文、缅文需要更宽的字符与更高的行高，字体按平台依次回落。
 * ============================================================ */
.lang-row { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
.lang-select {
  height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink-2); font-size: 12px; line-height: 1;
  cursor: pointer; outline: none; max-width: 100%;
}
.lang-select:hover, .lang-select:focus { border-color: var(--brand); color: var(--brand); }
.lang-select-top { margin: 0 8px 0 0; flex: none; }
.gate-card .lang-row { margin: -6px 0 6px; }

html[data-lang="th"] body,
html[data-lang="th"] button,
html[data-lang="th"] input,
html[data-lang="th"] select,
html[data-lang="th"] textarea {
  font-family: "Noto Sans Thai", "Leelawadee UI", "Thonburi", "Tahoma", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
html[data-lang="my"] body,
html[data-lang="my"] button,
html[data-lang="my"] input,
html[data-lang="my"] select,
html[data-lang="my"] textarea {
  font-family: "Noto Sans Myanmar", "Myanmar Text", "Padauk", "Myanmar3", "Tahoma", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
html[data-lang="th"] body { line-height: 1.6; }
html[data-lang="my"] body { line-height: 1.85; }
html[data-lang="my"] .btn, html[data-lang="my"] .seg-btn { line-height: 1.5; }
