* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f8; color: #222; font-size: 14px;
}
header {
  background: #1f6f43; color: #fff; padding: 12px 20px;
  display: flex; align-items: baseline; gap: 12px;
}
#user-area { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#user-area .ghost { background: rgba(255,255,255,.15); color: #fff; }
#user-info { font-size: 13px; }
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.overlay[hidden] { display: none; }
.overlay-card {
  background: #fff; border-radius: 10px; padding: 24px; width: 320px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25); max-height: 85vh; overflow: auto;
}
.overlay-card h2 { font-size: 16px; margin-bottom: 14px; color: #1f6f43; }
.overlay-form { display: flex; flex-direction: column; gap: 10px; }
.error-msg { color: #c0392b; font-size: 12px; min-height: 14px; }
header h1 { font-size: 18px; }
header span { font-size: 12px; opacity: .8; }
main { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.panel {
  background: #fff; border-radius: 8px; padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
#panel-cargo { width: 560px; flex-shrink: 0; }
#panel-right { flex: 1; min-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 {
  font-size: 15px; margin-bottom: 10px; color: #1f6f43;
  display: flex; justify-content: space-between; align-items: center;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 4px; border-bottom: 1px solid #eee; text-align: left; white-space: nowrap; }
th { font-size: 12px; color: #888; font-weight: normal; }
td.qty input { width: 60px; }
input, select {
  padding: 5px 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px;
}
input:disabled { background: #f5f5f5; }
button {
  padding: 6px 14px; border: none; border-radius: 4px; cursor: pointer;
  background: #1f6f43; color: #fff; font-size: 13px;
}
button.ghost { background: #eee; color: #333; }
button.danger { background: #c0392b; }
button.small { padding: 2px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.form-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #ddd; }
.form-grid[hidden] { display: none; }
.form-grid input, .form-grid select { width: 100px; }
.form-grid input[name=name], .form-grid input[name=vname] { width: 150px; }
.form-grid label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #555; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.hint { font-size: 12px; color: #999; }
#vehicle-info { font-size: 12px; color: #555; }
#btn-calc { font-size: 15px; padding: 10px 28px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 110px; background: #f0f7f2; border-radius: 6px;
  padding: 10px; text-align: center;
}
.stat .num { font-size: 20px; font-weight: 600; color: #1f6f43; }
.stat .lbl { font-size: 12px; color: #777; margin-top: 2px; }
.stat.warn .num { color: #c0392b; }
#unfit-list { margin-top: 8px; font-size: 13px; color: #c0392b; }
#canvas-wrap { position: relative; height: 480px; background: #263238; border-radius: 6px; overflow: hidden; }
#canvas-wrap canvas { display: block; }
#canvas-msg {
  position: absolute; top: 8px; left: 10px; color: #b0bec5;
  font-size: 12px; pointer-events: none;
}
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.section { margin-bottom: 14px; }
.section h3 { font-size: 13px; color: #555; margin-bottom: 6px; }
