html,
body,
.olt-standalone {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
}

.olt-topbar {
  padding: 8px 10px 6px;
  background: #f7f8fa;
  border-bottom: 1px solid #d8dce3;
}

.olt-toolbar,
.olt-filterbar,
.olt-window-toolbar,
.olt-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.olt-window-toolbar {
  min-height: 30px;
  margin-bottom: 8px;
}

.autofind-grid {
  width: 100%;
  height: calc(100% - 40px);
}

.reference-window {
  overflow: hidden;
}

.reference-editor {
  box-sizing: border-box;
  padding: 10px 14px 8px;
  border-bottom: 1px solid #d8dce5;
  background: #fafafa;
}

.reference-editor-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  white-space: nowrap;
}

.reference-editor-row label {
  min-width: 52px;
  text-align: right;
  color: #333;
}

.reference-editor .ref-control + .textbox,
.reference-editor .ref-control + .combo,
.reference-editor .ref-control.textbox-f,
.reference-editor .ref-control.combo-f {
  width: 112px !important;
}

.reference-editor .ref-small-control + .textbox,
.reference-editor .ref-small-control + .combo,
.reference-editor .ref-small-control.textbox-f,
.reference-editor .ref-small-control.combo-f {
  width: 80px !important;
}

.reference-editor .ref-wide-control + .textbox,
.reference-editor .ref-wide-control + .combo,
.reference-editor .ref-wide-control.textbox-f,
.reference-editor .ref-wide-control.combo-f {
  width: 250px !important;
}

.reference-editor-last {
  padding-top: 1px;
}

.reference-actions {
  display: inline-flex;
  gap: 16px;
  align-items: center;
  margin-left: auto;
  padding: 0 12px;
}

.reference-actions a {
  color: #555;
  text-decoration: none;
}

.reference-actions a:hover {
  color: #1769aa;
  text-decoration: underline;
}

.reference-grid {
  width: 100%;
  height: calc(100% - 130px);
  border: 0;
}

.template-editor {
  overflow-x: auto;
}

.template-editor .reference-editor-row {
  min-width: 1040px;
}

.olt-device-editor .reference-editor-row {
  min-width: 1000px;
}
.olt-device-editor { overflow-x: auto; }

.olt-device-hint { padding: 3px 8px 6px; color: #5f6f88; font-size: 12px; line-height: 1.6; }
.olt-online { color: #138238; }
.olt-offline { color: #d32f2f; }

.olt-device-editor + .reference-grid {
  height: calc(100% - 165px);
}

.template-editor + .reference-grid {
  height: calc(100% - 132px);
}

.olt-toolbar {
  margin-bottom: 8px;
}

.olt-brand {
  font-size: 16px;
  font-weight: 700;
  color: #1f2d3d;
  margin-right: 12px;
}

.olt-east {
  padding: 10px;
  background: #fff;
}

#operationLog {
  height: 100%;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font: 12px/1.7 Consolas, Monaco, monospace;
}

#operationLog .ok {
  color: #25833a;
}

#operationLog .warn {
  color: #b46b00;
}

#operationLog .error {
  color: #c03030;
}

#onuToolbar { padding: 5px 4px; }
#ponSyncToolbar { padding: 3px 6px; }
.pon-picker-panel .pagination-info { display: none; }
.line-quality-result { padding: 6px 0 10px; font: 13px/1.8 "Microsoft YaHei", sans-serif; }
.line-quality-result .bip-count { color: #d60000; }
.line-quality-result .quality-source { color: #777; font-size: 12px; }
.lan-port-result { margin: 8px 0 12px; font: 13px/1.6 "Microsoft YaHei", sans-serif; color: #263238; }
.lan-result-title { margin-bottom: 5px; color: #1f4f82; font-weight: 700; }
.lan-port-card { padding: 5px 3px 7px; border-bottom: 1px solid #b8bec5; }
.lan-port-card:last-of-type { border-bottom: 0; }
.lan-port-name { color: #18212b; font-weight: 700; }
.lan-status-online, .lan-value-ok { color: #16813a; font-weight: 700; }
.lan-status-offline { color: #c23a2b; font-weight: 700; }
.lan-status-unknown, .lan-status-unsupported, .lan-value-muted { color: #727b84; }
.lan-mac-value { color: #1d5e9f; }
.lan-vlan-value { color: #795548; }
.lan-unsupported { background: #f7f8fa; color: #7b838a; }
.lan-unreported { background: #fbfbfc; color: #666f78; }
.lan-result-source { margin-top: 7px; color: #777; font-size: 12px; }

.olt-south {
  background: #fff;
}

.olt-form-grid {
  display: grid;
  grid-template-columns: 110px 1fr 110px 1fr;
  gap: 10px 12px;
  align-items: center;
  padding: 4px 0 8px;
}

.olt-form-grid label {
  text-align: right;
  color: #4b5563;
}

.olt-register-form {
  padding: 2px 0 0;
}

.olt-register-grid {
  display: grid;
  grid-template-columns: 110px 176px 110px 176px;
  gap: 6px 8px;
  align-items: center;
}

.olt-register-grid > label {
  text-align: right;
  color: #111;
  font-size: 14px;
}

.olt-register-grid .reg-control,
.olt-register-grid .reg-control + .combo,
.olt-register-grid .reg-control + .textbox {
  width: 176px !important;
}

.olt-register-grid .reg-short,
.olt-register-grid .reg-short + .combo {
  width: 100px !important;
}

.reg-span-3 {
  grid-column: span 3;
}

.reg-description,
.reg-description + .textbox {
  width: 470px !important;
}

.olt-register-divider {
  border-top: 1px solid #8b8b8b;
  margin: 10px -8px 8px;
}

.reg-bind-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.reg-bind-row .combo {
  width: 100px !important;
}

.reg-span-2 {
  grid-column: span 2;
}

.reg-inline-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.olt-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  margin-top: 4px;
}

.olt-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}

.detail-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #edf0f3;
}

.detail-item b {
  text-align: right;
  color: #4b5563;
}

.detail-item span {
  word-break: break-all;
}

@media (max-width: 900px) {
  .olt-form-grid {
    grid-template-columns: 1fr;
  }

  .olt-form-grid label {
    text-align: left;
  }
}
