/* 漆膜仪旁路页 — 与 pro-detection 隔离 */

.view-paint-gauge {
  display: none;
  flex-direction: column;
  height: 100%;
  background: #f2f3f5;
  color: #1c1c1e;
}

.view-paint-gauge.active {
  display: flex;
}

.paint-gauge-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  padding-top: calc(8px + var(--safe-area-top, 0px));
  background: #fff;
  border-bottom: 1px solid #e5e5ea;
}

.paint-gauge-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paint-gauge-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(300px, 1fr);
  gap: 0;
  overflow: hidden;
}

.paint-gauge-left,
.paint-gauge-right {
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
}

.paint-gauge-left {
  border-right: 1px solid #e5e5ea;
  background: #fff;
}

.paint-gauge-bt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.paint-gauge-bt-pill {
  border: none;
  border-radius: 999px;
  background: #e8e8ed;
  color: #3a3a3c;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
}

.paint-gauge-bt-pill.is-connected {
  background: #d4edda;
  color: #1e7e34;
}

.paint-gauge-btn {
  border: 1px solid #c7c7cc;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  color: #007aff;
}

.paint-gauge-btn:active {
  opacity: 0.85;
}

.paint-gauge-btn.danger {
  color: #e74c3c;
}

.paint-gauge-legend {
  display: flex;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 8px;
}

.paint-gauge-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.paint-gauge-legend i {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.paint-gauge-legend .lg-normal { background: #2ecc71; }
.paint-gauge-legend .lg-paint { background: #f5a623; }
.paint-gauge-legend .lg-sheet { background: #e74c3c; }
.paint-gauge-legend .lg-replace { background: #3498db; }

.paint-gauge-rule {
  font-size: 11px;
  color: #636366;
  margin-bottom: 8px;
  line-height: 1.4;
}

.paint-gauge-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 4px;
}

.paint-gauge-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #e5e5ea;
  margin-bottom: 10px;
  overflow: hidden;
}

.paint-gauge-progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: #007aff;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.paint-gauge-current-card {
  background: #fff;
  border: 1px solid #e8eaef;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.paint-gauge-current-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.paint-gauge-current-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #636366;
  margin-bottom: 10px;
}

.paint-gauge-meta-row em {
  font-style: normal;
  color: #8e8e93;
  font-size: 12px;
}

.paint-gauge-current-meta strong {
  color: #1c1c1e;
  font-size: 18px;
  margin-left: 6px;
}

.paint-gauge-record-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.paint-gauge-reading-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.paint-gauge-reading-cell {
  padding: 8px 4px;
  border-radius: 6px;
  border: 1px solid #e5e5ea;
  background: #f2f3f5;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #c7c7cc;
}

.paint-gauge-reading-cell.is-filled {
  background: #fff;
  color: #1c1c1e;
  border-color: #c7c7cc;
}
.paint-gauge-reading-cell.is-filled.tone-normal {
  background: #d8f5e3;
  color: #147a38;
  border-color: #2ecc71;
}
.paint-gauge-reading-cell.is-filled.tone-paint {
  background: #fff0d6;
  color: #a66b00;
  border-color: #f5a623;
}
.paint-gauge-reading-cell.is-filled.tone-sheet {
  background: #fde0dc;
  color: #a5281b;
  border-color: #e74c3c;
}
#paintGaugeCurrentValue.tone-normal { color: #1a9f4a; }
#paintGaugeCurrentValue.tone-paint { color: #d68910; }
#paintGaugeCurrentValue.tone-sheet { color: #c0392b; }

.paint-gauge-reading-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #eee;
}

.paint-gauge-reading-empty {
  color: #8e8e93;
  padding: 8px 0;
}

.paint-gauge-manual-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.paint-gauge-manual-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #c7c7cc;
  border-radius: 8px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.paint-gauge-right-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.paint-gauge-right-head h3 {
  margin: 0;
  font-size: 14px;
}

.paint-gauge-part-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  cursor: pointer;
}

.paint-gauge-part-row.is-current {
  border-color: #007aff;
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.2);
}

.paint-gauge-part-main {
  flex: 1;
  min-width: 0;
}

.paint-gauge-part-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.paint-gauge-part-meta {
  font-size: 11px;
  color: #8e8e93;
  margin: -2px 0 4px;
}

.paint-gauge-part-name em {
  font-style: normal;
  font-weight: 700;
  margin-left: 4px;
}

.paint-gauge-mini-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.paint-gauge-mini-bar {
  height: 6px;
  background: #e5e5ea;
  border-radius: 3px;
  overflow: hidden;
}

.paint-gauge-mini-bar.empty {
  opacity: 0.45;
}

.paint-gauge-mini-bar span {
  display: block;
  height: 100%;
  background: #8e8e93;
  border-radius: 3px;
}

.paint-gauge-part-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  flex-shrink: 0;
  width: 132px;
}

.paint-gauge-status-btn {
  border: 1px solid #d1d1d6;
  background: #fff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 0;
  cursor: pointer;
  color: #3a3a3c;
}

.paint-gauge-status-btn.is-active.status-paint,
.paint-gauge-status-btn.status-paint.is-active {
  background: #f5a623;
  border-color: #f5a623;
  color: #fff;
}

.paint-gauge-status-btn.is-active.status-sheet {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #fff;
}

.paint-gauge-status-btn.is-active.status-replace {
  background: #3498db;
  border-color: #3498db;
  color: #fff;
}

.paint-gauge-status-btn.is-active:not(.status-paint):not(.status-sheet):not(.status-replace) {
  background: #34c759;
  border-color: #34c759;
  color: #fff;
}

.paint-gauge-foot {
  flex-shrink: 0;
  padding: 10px 16px;
  padding-bottom: calc(10px + var(--safe-area-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e5e5ea;
  display: flex;
  justify-content: center;
}

.paint-gauge-save {
  width: min(420px, 100%);
  height: 44px;
  border: none;
  border-radius: 10px;
  background: #007aff;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.paint-gauge-probe {
  margin-top: 10px;
  border: 1px dashed #c7c7cc;
  border-radius: 10px;
  padding: 8px;
  background: #fafafa;
}

.paint-gauge-probe h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: #636366;
}

.paint-gauge-probe-log {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  line-height: 1.35;
  max-height: 100px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  background: #1c1c1e;
  color: #d1f7c4;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 6px;
}

.paint-gauge-device-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}

.paint-gauge-device-item {
  text-align: left;
  border: 1px solid #d1d1d6;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #636366;
}

.paint-gauge-device-item strong {
  color: #1c1c1e;
  font-size: 13px;
}

.paint-gauge-device-empty {
  font-size: 12px;
  color: #8e8e93;
  padding: 6px 0;
}

@media (max-width: 760px), (orientation: portrait) {
  .paint-gauge-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .paint-gauge-left {
    border-right: none;
    border-bottom: 1px solid #e5e5ea;
    max-height: 48vh;
  }
}
