/* ==================================================================
   国际运输与尾程看板 · 样式表（深海青蓝主题）
   ------------------------------------------------------------------
   版式、组件与交互习惯沿用「墨西哥业绩看板」：白卡片 + 浅色底、
   顶栏 + 分区导航 + hero 指标带 + 各类卡片；
   仅主色调换为深海青蓝（顶栏 #0F6F8C→#0B4F66，页面底 #EFF6F8，强调 #0E8FA8）。
   维护时机：调整主题色改 :root 变量；新增模块在对应分区追加类即可。
   ================================================================== */
:root {
  --bg: #EFF6F8;         /* 页面底色：浅青灰 */
  --card: #ffffff;
  --ink: #16323E;        /* 主文字 */
  --ink-2: #40606E;      /* 次级文字 */
  --ink-3: #6D8A97;      /* 弱化文字 */
  --line: #E1ECF0;
  --brand: #0F6F8C;      /* 顶栏渐变起点 */
  --brand-deep: #0B4F66; /* 顶栏渐变终点 */
  --accent: #0E8FA8;     /* 主强调色 */
  --accent-soft: #E6F3F7;/* 强调色浅底 */
  --teal: #16A394;       /* 次强调（正/已完成类） */
  --navy: #0B3A4A;       /* 深标题色 */
  --amber: #F59E0B;      /* 提醒（停留/灰清/超期） */
  --rose: #E5484D;       /* 突出数字 / 警示 */
  --radius: 14px;
  --shadow: 0 2px 4px rgba(11,58,74,.04), 0 10px 28px rgba(11,58,74,.07);
  color-scheme: light;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 152px; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #0E8FA8; outline-offset: 3px; }
.chart-scroll:focus-visible, .table-wrap:focus-visible { outline-offset: -3px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px; line-height: 1.55; min-width: 0;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(11,58,74,.2); border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(14,143,168,.18); color: #0B4F66; }

/* ---------- 顶栏（深海青蓝渐变） ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: linear-gradient(120deg, #0F6F8C 0%, #0B4F66 100%); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.16); box-shadow: 0 3px 16px rgba(11,79,102,.3);
}
.topbar-inner {
  max-width: min(1880px, 100%); min-height: 76px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 44px; height: 44px; flex: none; border-radius: 11px;
  background: #ffffff; border: 1px solid rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #0F6F8C;
}
.brand h1 { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: #fff; }
.brand-sub { font-size: 11px; color: #CDE9F0; margin-top: 2px; letter-spacing: .6px; }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; min-width: 0; }
.badge {
  padding: 6px 12px; border-radius: 6px; font-size: 12px; overflow-wrap: anywhere;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.26); color: #E6F4F8;
}
.badge-date { font-weight: 600; color: #fff; }

/* ---------- 分区导航 ---------- */
.secnav {
  position: sticky; top: var(--topbar-height, 76px); z-index: 55;
  background: #fff; border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(11,58,74,.05);
}
.secnav-inner {
  max-width: min(1880px, 100%); min-height: 58px; margin: 0 auto; padding: 8px 28px;
  display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: thin;
}
.nav-pill {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 9px 16px; border-radius: 7px; font-size: 13px; white-space: nowrap;
  color: var(--ink-2); text-decoration: none; background: transparent;
  border: 1px solid transparent; transition: background .15s, color .15s;
}
.nav-index { font-size: 11px; font-weight: 700; opacity: .65; }
.nav-pill:hover { color: var(--accent); background: #F0F8FA; }
.nav-pill.active { color: #0E7D95; background: var(--accent-soft); border-color: #C7E4EC; font-weight: 700; }
.nav-pill:focus-visible { outline-offset: -3px; }
/* 导航右缘渐隐：胶囊横向溢出且未滑到末尾时提示右侧还有分区 */
.secnav::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 34px; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff 80%);
  opacity: 0; transition: opacity .15s;
}
.secnav.can-scroll-r::after { opacity: 1; }

/* ---------- 页面骨架 ---------- */
.page { max-width: min(1880px, 100%); min-width: 0; margin: 0 auto; padding: 26px 28px 48px; }
.section { margin-top: 36px; min-width: 0; }
.sec-title { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; padding-top: 4px; }
.sec-title h2, .hero-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 22px; font-weight: 700; letter-spacing: .4px; color: var(--navy);
}
.section-index {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 32px; border-radius: 8px; background: #E1F1F5;
  color: #0E7D95; font-size: 14px; font-weight: 700; letter-spacing: 1px;
}
.sec-desc { color: var(--ink-2); font-size: 13px; padding-left: 46px; line-height: 1.7; overflow-wrap: anywhere; }
.sec-en { font-size: 10px; font-weight: 600; letter-spacing: 2px; color: var(--ink-3); text-transform: uppercase; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); min-width: 0; max-width: 100%;
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; border: 1px solid var(--line);
}
.card + .card, .grid-4 + .card { margin-top: 18px; }
.card-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 8px 24px; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid #ECF4F6;
}
.card-head h3 {
  flex: 0 1 auto; max-width: 100%; font-size: 16px; line-height: 1.65;
  font-weight: 700; color: var(--navy); overflow-wrap: anywhere;
}
.card-note { flex: 0 1 auto; min-width: 0; max-width: 100%; color: var(--ink-3); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.card-note b { color: var(--accent); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.grid-4 > * { min-width: 0; }

/* ---------- KPI hero ---------- */
.hero {
  position: relative; min-width: 0; border-radius: 16px; color: var(--ink);
  background: #F5FBFC; border: 1px solid #CFE6EC; border-top: 3px solid var(--accent);
  padding: 24px; box-shadow: var(--shadow);
}
.hero-inner { position: relative; min-width: 0; }
.hero-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 24px; flex-wrap: wrap; margin-bottom: 22px;
}
.hero-en { font-size: 10px; font-weight: 600; letter-spacing: 2px; color: var(--ink-3); }
.hero-subtitle { margin-top: 7px; padding-left: 46px; font-size: 13px; color: var(--ink-2); }
.hero-date { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.hero-date b { color: var(--accent); font-weight: 700; }
.kpi-main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi-hero {
  position: relative; min-width: 0; border-radius: 12px; padding: 20px 20px 16px;
  background: #fff; border: 1px solid #D5E7EC; border-top: 3px solid var(--accent);
  box-shadow: 0 2px 5px rgba(11,58,74,.05);
}
.kpi-hero:nth-child(2) { border-top-color: var(--teal); }
.kpi-hero:nth-child(3) { border-top-color: #6D8BD8; }
.kpi-hero .kpi-label { color: var(--ink-2); font-size: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.kpi-tag {
  background: #F1F8FA; border: 1px solid #D5E7EC; color: #0E7D95;
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 5px;
}
.kpi-hero .kpi-value {
  color: var(--rose); font-size: clamp(28px, 2.7vw, 40px); font-weight: 700; letter-spacing: -.7px;
  margin-top: 12px; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.kpi-hero .kpi-value .unit { display: inline-block; font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.kpi-hero .kpi-gm .unit { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.kpi-hero .kpi-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid #ECF4F6;
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 4px 10px;
}
.kpi-gm { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.kpi-gm i { font-style: normal; font-size: 12px; color: var(--ink-2); }
.kpi-gm b {
  font-size: clamp(19px, 2vw, 25px); font-weight: 800; letter-spacing: -.4px;
  color: var(--rose); font-variant-numeric: tabular-nums;
}
.kpi-gp { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }

/* ---------- 总览：结论条 ---------- */
.conclusion {
  display: grid; gap: 9px; margin-bottom: 14px; padding: 14px 18px;
  background: #fff; border: 1px solid #D5E7EC; border-left: 4px solid var(--accent);
  border-radius: 12px; box-shadow: 0 2px 5px rgba(11,58,74,.05);
}
.cn-row { display: flex; align-items: flex-start; gap: 10px; }
.cn-row p { margin: 0; min-width: 0; font-size: 13.5px; line-height: 1.75; color: var(--ink); }
.cn-row b { color: var(--navy); font-variant-numeric: tabular-nums; }
.cn-tag {
  flex: none; min-width: 54px; margin-top: 3px; text-align: center;
  font-size: 12px; font-weight: 700; color: #0E7D95;
  background: var(--accent-soft); border: 1px solid #D5E7EC; border-radius: 6px; padding: 1px 8px;
}
.cn-tag.teal { color: #0F7F73; background: #E4F5F2; border-color: #CBEAE4; }
.cn-tag.amber { color: #96690F; background: #FCF1DD; border-color: #F3E1BE; }
.cn-chip {
  display: inline-block; margin: 0 6px 2px 0; padding: 0 10px 0 8px;
  font-size: 12.5px; color: var(--ink-2); background: #F4F9FB;
  border: 1px solid #E1EEF2; border-radius: 999px; white-space: nowrap;
}
.cn-chip::before {
  content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px;
  border-radius: 50%; background: var(--accent); vertical-align: middle;
}
.cn-chip.c2::before { background: #2FA6BE; }
.cn-chip.c3::before { background: var(--amber); }
.cn-chip.c4::before { background: #6D8BD8; }
.cn-chip b { color: var(--navy); }

/* ---------- 卡片「读图结论」 ---------- */
.card-insight {
  display: flex; align-items: flex-start; gap: 9px; margin: 0 0 14px;
  padding: 9px 13px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  background: var(--accent-soft); font-size: 13px; line-height: 1.75; color: var(--ink);
}
.card + .card-insight { margin-top: 18px; }
.card-insight .ins-tag {
  flex: none; margin-top: 3px; padding: 1px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 700; color: #0E7D95; background: #D9EDF3;
}
.card-insight b { color: #0B4F66; font-variant-numeric: tabular-nums; }

/* ---------- 港口与城市分布 / 清关类型构成 ---------- */
.port-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 26px; }
#qcGrid, #alarmGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.port-col { min-width: 0; }
.port-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid #E7F0F3;
}
.port-head b { font-size: 14px; color: var(--navy); }
.port-head span { font-size: 12px; color: var(--ink-3); }
.port-item + .port-item { margin-top: 9px; }
.port-line { display: flex; align-items: baseline; gap: 7px; }
.port-line .p-cn { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.port-line .p-en {
  font-size: 11.5px; color: var(--ink-3); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.port-line .p-v { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.port-line .p-v i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.port-track { margin-top: 4px; height: 6px; border-radius: 4px; background: #E6F3F7; overflow: hidden; }
.port-track span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #35B3C6); }
.port-item.qc-sub { margin-top: 7px; }
.port-item.qc-sub .p-cn { font-weight: 600; color: var(--ink-2); }
.port-item.qc-sub .port-line, .port-item.qc-sub .port-track { margin-left: 14px; }
.port-item.qc-sub .port-track span { background: linear-gradient(90deg, #35B3C6, #8FD6E2); }
.port-item.qc-gray .p-v { color: #B45309; }
.port-item.qc-gray .port-track span { background: linear-gradient(90deg, var(--amber), #F7C978); }
.qc-note { margin-top: 10px; font-size: 12px; color: var(--ink-3); }

/* 口径说明折叠面板 */
.quality-panel { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: 9px; overflow-wrap: anywhere; }
.quality-panel summary { padding: 11px 14px; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.quality-panel summary::marker { color: var(--accent); }
.quality-panel[open] summary { border-bottom: 1px solid #E7F0F3; color: #0E7D95; }
#caliberContent { padding: 12px 16px; color: var(--ink-2); font-size: 13px; line-height: 1.9; }

/* ---------- 四阶段卡片 ---------- */
.stage-card {
  min-width: 0; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: 12px; padding: 16px 18px 14px; box-shadow: 0 2px 5px rgba(11,58,74,.05);
}
.stage-card:nth-child(2) { border-top-color: #2FA6BE; }
.stage-card:nth-child(3) { border-top-color: var(--amber); }
.stage-card:nth-child(4) { border-top-color: #6D8BD8; }
.st-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.st-no {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: #0E7D95;
  font-size: 12px; font-weight: 700;
}
.st-val { margin-top: 10px; font-size: clamp(26px, 2.4vw, 34px); font-weight: 800; letter-spacing: -.6px; color: var(--rose); font-variant-numeric: tabular-nums; }
.st-val .unit { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 5px; letter-spacing: 0; }
.st-note { margin-top: 6px; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.st-foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #ECF4F6;
  font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere;
}
.st-foot b { color: var(--navy); font-variant-numeric: tabular-nums; }

/* ---------- 清关异常：四档状态卡 + 报警徽章 ---------- */
.alarm-card {
  min-width: 0; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: 12px; padding: 16px 18px 14px; box-shadow: 0 2px 5px rgba(11,58,74,.05);
}
.alarm-card.al-ok { border-top-color: var(--teal); }
.alarm-card.al-y { border-top-color: var(--amber); }
.alarm-card.al-r { border-top-color: var(--rose); }
.alarm-card.al-q { border-top-color: #7A4CB0; }
.alarm-card.al-ok .st-val { color: #0F8474; }
.alarm-card.al-y .st-val { color: #B45309; }
.alarm-card.al-r .st-val { color: #B42318; }
.alarm-card.al-q .st-val { color: #6B3FA0; }
.al-badge-ok { background: #E4F5F2; color: #0F8474; }
.al-badge-y { background: #FCF1DD; color: #96690F; }
.al-badge-r { background: #FDE7E8; color: #B42318; }
.al-badge-q { background: #F0E9FB; color: #6B3FA0; }
.alarm-sub { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; }
.alarm-sub span {
  padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  color: var(--ink-2); background: #F3F8FA; border: 1px solid #E1ECF0; white-space: nowrap;
}
.alarm-sub b { color: var(--navy); font-variant-numeric: tabular-nums; }
.al-sub { margin-left: 6px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.port-col.span2 { grid-column: 1 / -1; }
.sub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 30px; }
.sub-grid .port-item { margin-top: 0; }

/* ---------- 船公司维度 ---------- */
#devGrid, #routeDevGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.carrier-tbl { min-width: 760px; }
.rt-en, .dim-med { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.dev-tbl { min-width: 520px; }
.carrier-n { min-width: 118px; }
.cv { font-size: 14px; font-weight: 800; color: var(--accent); }
.cpct { margin-left: 6px; font-size: 11.5px; color: var(--ink-3); }
.ct-bar { display: block; margin-top: 5px; height: 5px; min-width: 64px; border-radius: 3px; background: #E6F3F7; overflow: hidden; }
.ct-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #35B3C6); }
.tbl .cell-good { color: #0F8474; font-weight: 700; }
.sm-tag {
  display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 4px;
  font-size: 11px; font-weight: 600; color: var(--ink-3); background: #EFF5F7; border: 1px solid #E1ECF0;
}
.ins-sub { color: var(--ink-3); }

/* ---------- 图表 ---------- */
.chart { width: 100%; }
.chart-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; border-radius: 6px; }
#chFunnel { min-width: 720px; }
#chMonthly { min-width: 820px; }
.chart-scroll::after { content: "窄屏可横向滚动查看完整图表"; display: none; position: sticky; left: 0; width: fit-content; max-width: 100%; padding-top: 8px; font-size: 12px; line-height: 1.7; color: #6D8A97; }
.chart.h-300 { height: 340px; }
.chart.h-380 { height: 430px; }

/* ---------- 在途货柜筛选与表格 ---------- */
.pipe-filter {
  display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(5, minmax(112px, 1fr));
  align-items: end; gap: 12px; padding: 16px; background: #F2F9FB; border: 1px solid #DCEBF0; border-radius: 10px;
}
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pipe-filter input[type="search"], .pipe-filter select {
  width: 100%; max-width: 100%; min-width: 0; height: 40px; padding: 8px 10px; font-size: 13px; color: var(--ink);
  border: 1px solid #C3D9E0; border-radius: 6px; background: #fff;
}
.pipe-filter select { cursor: pointer; }
.pipe-filter input[type="search"]:focus, .pipe-filter select:focus { border-color: #3AA6BC; box-shadow: 0 0 0 3px rgba(14,143,168,.14); }
.filter-actions { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.filter-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.filter-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.btn-reset {
  min-height: 38px; padding: 7px 15px; border: 1px solid #C3D9E0; border-radius: 6px;
  background: #fff; color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 600;
}
.btn-reset:hover { background: var(--accent-soft); border-color: #9CCFDB; color: #0E7D95; }
.pipe-count { font-size: 13px; font-weight: 600; color: #0E7D95; margin-left: auto; }
.filter-note { margin: 10px 0 0; font-size: 12px; line-height: 1.8; color: var(--ink-3); overflow-wrap: anywhere; }

.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; background: #fff; }
.table-detail { margin-top: 14px; max-height: 640px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  text-align: left; color: #40606E; font-weight: 600; font-size: 12.5px;
  padding: 12px 10px; background: #E8F3F6; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 3;
}
.tbl td { padding: 8.5px 10px; border-bottom: 1px solid #EFF5F7; white-space: nowrap; font-variant-numeric: tabular-nums; background: inherit; }
.tbl tbody tr:nth-child(even) { background: #F8FCFD; }
.tbl tbody tr:hover { background: #E9F4F7; }
.pipe-tbl, .alarm-tbl { min-width: 1400px; }
/* 首列冻结：背景须为不透明色，否则横向滚动时被后方单元格文字穿透 */
.pipe-tbl tbody td:first-child, .alarm-tbl tbody td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 #E1ECF0; font-weight: 700; color: var(--navy); }
.tbl tbody tr:nth-child(even) td:first-child { background: #F8FCFD; }
.tbl tbody tr:hover td:first-child { background: #E9F4F7; }
.pipe-tbl th:first-child, .alarm-tbl th:first-child { left: 0; z-index: 4; box-shadow: 1px 0 0 #C9DEE5; }
.tbl .num { text-align: right; }
.tbl th.num { text-align: right; }
.tbl th.th-sort { cursor: pointer; user-select: none; }
.tbl th.th-sort:hover { background: #DCEAF0; color: #0E7D95; }
.tbl .cell-warn-a { color: #B45309; font-weight: 700; }
.tbl .cell-warn-r { color: #B42318; font-weight: 700; }
.tbl .muted { color: var(--ink-3); }
.tbl .ell { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }

/* 阶段徽章 / 清关类型 / 异常标注 */
.st-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-在装 { background: #E8EDFB; color: #4C63B6; }
.st-在途 { background: #E1F2F6; color: #0E7D95; }
.st-清关中 { background: #FCF1DD; color: #96690F; }
.st-清关完毕待入库 { background: #F6E9FB; color: #7A4CB0; }
.ac-正 { background: #E3F5F1; color: #0F8474; }
.ac-灰 { background: #FCF1DD; color: #96690F; }
.ab-warn { background: #FCF1DD; color: #96690F; }
.ab-bad { background: #FDE7E8; color: #B42318; }
/* 跨年遗留角标：装柜年份早于统计年度、至今未入库的柜 */
.yr-tag {
  display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 4px;
  font-size: 11px; font-weight: 700; color: #96690F; background: #FCF1DD; border: 1px solid #F3E1BE;
}

/* ---------- 提示框内的小圆点（月度图 tooltip 系列标识） ---------- */
.tt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

/* ---------- 加载遮罩 ---------- */.loading-mask {
  position: fixed; inset: 0; z-index: 99; display: flex; align-items: center; justify-content: center;
  background: rgba(239,246,248,.9);
}
.loading-box { text-align: center; color: var(--ink-2); font-size: 13.5px; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid rgba(14,143,168,.2); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 公网加密锁屏（带钥匙的链接会直接解密，无钥匙时显示） ---------- */
.lock-mask {
  position: fixed; inset: 0; z-index: 110; display: flex; align-items: center; justify-content: center;
  background: rgba(239,246,248,.92);
}
.lock-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(11,79,102,.14);
  padding: 34px 40px; text-align: center; width: min(380px, calc(100vw - 48px));
}
.lock-card h2 { margin: 0 0 6px; font-size: 20px; color: var(--ink); }
.lock-card p { color: var(--ink-3); font-size: 13px; margin: 0 0 18px; }
.lock-card input {
  width: 100%; border: 1px solid #CFE0E6; border-radius: 10px; padding: 10px 14px;
  font-size: 14px; margin-bottom: 12px; outline-color: var(--accent);
  background: #fff; color: var(--ink);
}
.btn-primary {
  cursor: pointer; border: none; border-radius: 8px; padding: 10px; width: 100%;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 3px 10px rgba(14,143,168,.25); transition: filter .15s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.lock-err { color: var(--rose); font-size: 12.5px; margin-top: 10px; min-height: 18px; }

/* ================= 响应式（置于文件末尾） ================= */
@media (min-width: 1920px) {
  body { font-size: 15px; }
  .card { padding: 22px 24px; }
  .chart.h-300 { height: 380px; }
  .chart.h-380 { height: 480px; }
  .tbl, table.tbl { font-size: 14px; }
}
@media (min-width: 2560px) {
  body { font-size: 16px; }
  .page, .topbar-inner, .secnav-inner { max-width: 2400px; }
  .chart.h-300 { height: 420px; }
  .chart.h-380 { height: 540px; }
  .kpi-hero .kpi-value { font-size: 44px; }
}
@media (max-width: 1919px) {
  .chart-scroll::after { display: block; }
}
/* ---------- 平板 ---------- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .port-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .kpi-main { gap: 10px; }
  .kpi-hero { padding: 16px 14px; }
  .port-grid, #qcGrid, #alarmGrid, #devGrid, #routeDevGrid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  html { scroll-padding-top: 80px; }
  .topbar { position: static; }
  .topbar-inner { padding: 12px 14px; flex-wrap: wrap; gap: 12px; }
  .brand-logo { width: 38px; height: 38px; font-size: 19px; }
  .brand h1 { font-size: 18px; }
  .topbar-right { width: 100%; justify-content: flex-start; }
  .badge { padding: 5px 8px; font-size: 11px; }
  .secnav { top: 0; }
  .secnav-inner { min-height: 54px; padding: 7px 12px; }
  .nav-pill { padding: 8px 12px; font-size: 13px; }
  .page { padding: 16px 12px 32px; }
  .section { margin-top: 28px; }
  .sec-title { gap: 7px; margin-bottom: 14px; }
  .sec-title h2, .hero-title { font-size: 19px; gap: 8px; }
  .section-index { width: 30px; height: 28px; font-size: 12px; }
  .sec-desc, .hero-subtitle { padding-left: 0; font-size: 12px; }
  .sec-en, .hero-en { font-size: 9px; letter-spacing: 1px; }
  .card { padding: 16px 12px; border-radius: 11px; }
  .card-head { gap: 7px; margin-bottom: 14px; padding-bottom: 11px; }
  .card-head h3 { flex-basis: 100%; font-size: 15px; }
  .hero { padding: 18px 14px; border-radius: 12px; }
  .hero-head { margin-bottom: 16px; }
  .kpi-main { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .kpi-hero { padding: 16px; }
  .kpi-hero .kpi-value { font-size: 34px; }
  .kpi-gm b { font-size: 22px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .stage-card { padding: 14px; }
  .pipe-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .pipe-filter input[type="search"], .pipe-filter select { font-size: 16px; min-height: 42px; }
  .tbl, table.tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 7px; }
  .sub-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .table-detail { max-height: 520px; }
}
