
:root {
  --bg: #f5f7f9;
  --paper: #ffffff;
  --ink: #1c2526;
  --muted: #667174;
  --line: #dde5e7;
  --soft: #edf3f4;
  --accent: #1d6f68;
  --accent-2: #8b5e34;
  --danger: #b94738;
  --warn: #a76a1f;
  --ok: #2c7554;
  --info: #315f8f;
  --shadow: 0 18px 42px rgba(25, 40, 45, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; }
.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #182528;
  color: #eef6f4;
  border-right: 1px solid rgba(255,255,255,.08);
}
.brand { display: block; text-decoration: none; padding: 8px 6px 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand strong { display: block; font-size: 18px; letter-spacing: 0; }
.brand span { display: block; color: rgba(238,246,244,.68); font-size: 12px; margin-top: 4px; }
.side-nav nav { display: grid; gap: 6px; padding: 18px 0; }
.nav-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: rgba(238,246,244,.78);
  font-size: 13px;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.1); color: #fff; }
.source-note {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: rgba(238,246,244,.72);
  font-size: 12px;
}
.source-note b { display: block; color: #fff; margin-bottom: 4px; }
.main { min-width: 0; padding: 26px 28px 46px; }
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.page-head h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: 0; }
.page-head p { max-width: 760px; margin: 8px 0 0; color: var(--muted); }
.head-meta {
  min-width: 136px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.head-meta span { display: block; color: var(--muted); font-size: 12px; }
.head-meta strong { display: block; font-size: 15px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.chain-metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  padding: 15px;
  box-shadow: var(--shadow);
}
.metric-card.danger { border-top-color: var(--danger); }
.metric-card.warn { border-top-color: var(--warn); }
.metric-card.ok { border-top-color: var(--ok); }
.metric-card.info { border-top-color: var(--info); }
.metric-card span { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin-top: 5px; font-size: 24px; line-height: 1.15; letter-spacing: 0; }
.metric-card small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.panel {
  margin-top: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.section-title { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-title h2 { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: 0; }
.section-title p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.subsection-title {
  margin: 16px 0 8px;
  color: #334144;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: 0;
}
.section-action, .primary-button, .secondary-button, .icon-button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.section-action, .primary-button {
  min-height: 34px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  border-color: rgba(29,111,104,.2);
}
.section-action { flex: 0 0 auto; align-self: flex-start; }
.secondary-section-action {
  background: #fff;
  color: var(--accent);
  border-color: rgba(29,111,104,.28);
}
.secondary-button {
  min-height: 34px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}
.icon-button {
  width: 34px;
  height: 34px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 25, 28, .42);
}
.modal-backdrop[hidden] { display: none; }
.modal-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid rgba(221,229,231,.9);
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(10, 20, 24, .28);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: 0; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.detail-modal-panel { width: min(1180px, 100%); }
.detail-modal-body {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}
.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.detail-tabs button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.detail-tabs button.active {
  border-color: rgba(29,111,104,.3);
  background: #e7f2f0;
  color: var(--accent);
}
.detail-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.detail-filter-grid label { display: grid; gap: 5px; }
.detail-filter-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.detail-filter-grid input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #fbfcfc;
  font: inherit;
  font-size: 13px;
}
.detail-summary {
  min-height: 22px;
  color: var(--muted);
  font-size: 12px;
}
.detail-table-wrap { max-height: min(58vh, 560px); }
#yunbiaoDetailTable { min-width: 1460px; }
.invoice-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 18px;
}
.invoice-form-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 4px;
}
.invoice-form label { display: grid; gap: 6px; }
.invoice-form label span { color: var(--muted); font-size: 12px; font-weight: 700; }
.invoice-form input, .invoice-form select, .invoice-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: #fbfcfc;
}
.invoice-form textarea { resize: vertical; }
.period-field { width: min(220px, 100%); }
.invoice-entry-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.invoice-entry-summary b { color: var(--accent); font-size: 20px; line-height: 1; }
.invoice-entry-list {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.invoice-entry-header, .invoice-entry-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.05fr) minmax(160px, .65fr) minmax(220px, 1.2fr);
  gap: 10px;
  align-items: center;
  min-width: 680px;
}
.invoice-entry-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px;
  background: var(--soft);
  color: #334144;
  font-size: 12px;
  font-weight: 750;
}
.invoice-entry-row {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.invoice-entry-row:hover { background: #fafcfc; }
.entry-entity strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}
.entry-entity span {
  display: inline-block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.entry-amount span, .entry-note span { display: none; }
.form-wide, .form-message, .modal-actions { grid-column: 1 / -1; }
.form-message { min-height: 20px; margin: 0; color: var(--accent); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.route-grid, .status-grid, .rule-grid, .lane-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.route-card, .status-grid > div, .rule-grid > div, .lane-grid > article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.route-card { min-height: 146px; border-top: 4px solid var(--accent); box-shadow: var(--shadow); }
.route-card.danger { border-top-color: var(--danger); }
.route-card.warn { border-top-color: var(--warn); }
.route-card.ok { border-top-color: var(--ok); }
.route-card.info { border-top-color: var(--info); }
.route-card h3, .lane-grid h3 { margin: 0; font-size: 16px; }
.route-card p, .lane-grid p { margin: 8px 0 0; color: var(--muted); }
.route-card a, .download {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.status-grid, .rule-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.status-grid b, .rule-grid b { display: block; margin-bottom: 5px; }
.status-grid span, .rule-grid span { color: var(--muted); }
.lane-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.table-tools { display: flex; justify-content: flex-end; margin: 6px 0 10px; }
.table-tools input {
  width: min(360px, 100%);
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
  background: #fbfcfc;
}
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; min-width: 980px; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; line-height: 1.3; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: var(--soft); color: #334144; font-weight: 700; white-space: nowrap; }
tr:hover td { background: #fafcfc; }
tr.summary-row td {
  background: #eef4f3;
  font-weight: 750;
  border-top: 2px solid rgba(29,111,104,.22);
}
tr.summary-row:hover td { background: #e8f1ef; }
#quotaPlanTable { min-width: 1780px; }
#quotaPlanTable th:nth-child(1), #quotaPlanTable td:nth-child(1) { min-width: 118px; width: 118px; }
#quotaPlanTable th:nth-child(2), #quotaPlanTable td:nth-child(2) { min-width: 60px; width: 60px; }
#pressureTable { min-width: 1480px; }
#pressureTable th:nth-child(1), #pressureTable td:nth-child(1) { min-width: 132px; width: 132px; }
#pressureTable th:nth-child(2), #pressureTable td:nth-child(2) { min-width: 92px; width: 92px; }
#pressureTable th:nth-child(3), #pressureTable td:nth-child(3),
#pressureTable th:nth-child(4), #pressureTable td:nth-child(4) { min-width: 76px; width: 76px; }
#topPressure th:nth-child(1), #topPressure td:nth-child(1) { min-width: 142px; width: 142px; }
#topPressure th:nth-child(2), #topPressure td:nth-child(2),
#topPressure th:nth-child(3), #topPressure td:nth-child(3) { min-width: 76px; width: 76px; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: none;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8faf9;
  color: #415052;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.65);
}
.badge.danger { border-color: rgba(185,71,56,.22); background: #fff5f3; color: #a63f34; }
.badge.warn { border-color: rgba(167,106,31,.24); background: #fff8ed; color: #8f5819; }
.badge.ok { border-color: rgba(44,117,84,.24); background: #f1faf5; color: #27684b; }
.badge.info { border-color: rgba(49,95,143,.22); background: #f0f7ff; color: #2e5a86; }
.release-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.release-chip.high { border-color: rgba(44,117,84,.28); background: #edf8f2; color: #27684b; }
.release-chip.low { border-color: rgba(167,106,31,.28); background: #fff6e6; color: #8f5819; }
.release-chip.none { border-color: rgba(185,71,56,.22); background: #fff4f1; color: #a63f34; }
.release-chip.muted { border-color: rgba(95,108,112,.18); background: #f6f8f8; color: #748084; }
.release-chip.total { border-color: rgba(29,111,104,.28); background: #e7f2f0; color: var(--accent); }
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid rgba(49,95,143,.35);
  color: var(--info);
  background: #f0f7ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}
.tip-bubble {
  position: fixed;
  z-index: 9999;
  max-width: min(360px, calc(100vw - 24px));
  padding: 9px 11px;
  border: 1px solid rgba(36,49,51,.18);
  border-radius: 8px;
  background: #fff;
  color: #243133;
  box-shadow: 0 10px 24px rgba(16,24,28,.16);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  pointer-events: none;
}
.download { margin-top: 12px; }
@media (max-width: 1180px) {
  .chain-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-nav { position: static; height: auto; }
  .side-nav nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 20px 14px 34px; }
  .page-head { display: block; }
  .head-meta { margin-top: 14px; }
  .metric-grid, .route-grid, .lane-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chain-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-grid, .rule-grid { grid-template-columns: 1fr; }
  .detail-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-title { display: block; }
  .section-action { margin-top: 10px; }
}
@media (max-width: 620px) {
  .metric-grid, .route-grid, .lane-grid { grid-template-columns: 1fr; }
  .side-nav { padding: 18px 14px; }
  .side-nav nav { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 0; }
  .source-note { margin-top: 10px; padding: 10px; }
  .page-head h1 { font-size: 23px; }
  .detail-filter-grid { grid-template-columns: 1fr; }
  .invoice-form-toolbar { display: block; }
  .invoice-entry-summary { margin-top: 10px; }
  .modal-actions { justify-content: stretch; }
  .modal-actions button { flex: 1; }
}
