html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0c10;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  background: #0b0c10;
}

.fsr-data-error-modal {
  position: absolute;
  inset: 0;
  z-index: 980;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 10, 0.82);
  backdrop-filter: blur(4px);
}

.fsr-data-error-modal.is-visible {
  display: flex;
}

.fsr-data-error-card {
  width: min(560px, calc(100vw - 40px));
  padding: 22px 22px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, #121820 0%, #0f141b 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.fsr-data-error-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.14);
  color: #ffb3b3;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.fsr-data-error-title {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.3;
  color: #f4f7fb;
  font-weight: 700;
}

.fsr-data-error-meta {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #b8c4d0;
}

.fsr-data-error-message {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.7;
  color: #edf2f7;
  white-space: pre-wrap;
  word-break: break-word;
}

.fsr-data-error-detail-wrap {
  margin: 0 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.fsr-data-error-detail-summary {
  padding: 10px 12px;
  cursor: pointer;
  color: #d6e0ea;
  font-size: 13px;
  list-style: none;
}

.fsr-data-error-detail-summary::-webkit-details-marker {
  display: none;
}

.fsr-data-error-detail {
  margin: 0;
  padding: 0 12px 12px;
  color: #aebfd0;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}

.fsr-data-error-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.fsr-data-error-button {
  min-width: 98px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #202632;
  color: #f5f8fb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.fsr-data-error-button:hover {
  background: #283040;
}

.fsr-data-error-button.is-primary {
  background: #2f6fed;
  border-color: rgba(82, 135, 255, 0.8);
  color: #ffffff;
}

.fsr-data-error-button.is-primary:hover {
  background: #3a7aff;
}

.fsr-data-error-button.is-secondary {
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
  .fsr-data-error-modal {
    padding: 14px;
  }

  .fsr-data-error-card {
    width: min(100%, 100vw - 28px);
    padding: 18px 16px 16px;
  }

  .fsr-data-error-title {
    font-size: 18px;
  }

  .fsr-data-error-message {
    font-size: 14px;
  }

  .fsr-data-error-actions {
    justify-content: stretch;
  }

  .fsr-data-error-button {
    flex: 1 1 100%;
    width: 100%;
  }
}

.fsr-live-bootstrap-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 10, 14, 0.78);
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.fsr-live-bootstrap-mask.is-active {
  opacity: 1;
}

.fsr-live-bootstrap-mask.is-fading-out {
  opacity: 0;
}

.fsr-live-bootstrap-card {
  width: min(520px, calc(100vw - 28px));
  padding: 16px 16px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 20, 30, 0.9);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
}

.fsr-live-bootstrap-title {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.3;
  color: #e9edf2;
  letter-spacing: 0.2px;
}

.fsr-live-bootstrap-stage {
  margin-bottom: 8px;
  font-size: 12px;
  color: #c8d1db;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fsr-live-bootstrap-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.fsr-live-bootstrap-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fcf9f 0%, #46e0bd 100%);
  transition: width 180ms linear;
}

.fsr-live-bootstrap-meta {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 10px;
  row-gap: 4px;
}

.fsr-live-bootstrap-percent {
  min-width: 72px;
  font-size: 12px;
  color: #eef3f8;
  font-variant-numeric: tabular-nums;
}

.fsr-live-bootstrap-total-elapsed,
.fsr-live-bootstrap-estimate {
  font-size: 11px;
  color: #aeb9c4;
  font-variant-numeric: tabular-nums;
}

.fsr-live-bootstrap-timeline {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 8px;
}

.fsr-live-bootstrap-segment-row {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
}

.fsr-live-bootstrap-segment-row.is-active {
  border-color: rgba(70, 224, 189, 0.44);
  background: rgba(70, 224, 189, 0.1);
}

.fsr-live-bootstrap-segment-row.is-done {
  border-color: rgba(47, 207, 159, 0.45);
  background: rgba(47, 207, 159, 0.11);
}

.fsr-live-bootstrap-segment-head,
.fsr-live-bootstrap-segment-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fsr-live-bootstrap-segment-head {
  margin-bottom: 4px;
}

.fsr-live-bootstrap-segment-foot {
  margin-top: 4px;
}

.fsr-live-bootstrap-segment-label {
  font-size: 11px;
  color: #d8e1ea;
}

.fsr-live-bootstrap-segment-weight {
  font-size: 10px;
  color: #9aabb8;
  font-variant-numeric: tabular-nums;
}

.fsr-live-bootstrap-segment-progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.fsr-live-bootstrap-segment-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2fcf9f 0%, #46e0bd 100%);
  transition: width 160ms linear;
}

.fsr-live-bootstrap-segment-row.is-indeterminate .fsr-live-bootstrap-segment-progress-fill {
  background:
    linear-gradient(
      90deg,
      rgba(47, 207, 159, 0.18) 0%,
      rgba(47, 207, 159, 0.72) 40%,
      rgba(70, 224, 189, 0.92) 52%,
      rgba(47, 207, 159, 0.72) 64%,
      rgba(47, 207, 159, 0.18) 100%
    );
  background-size: 180px 100%;
  animation: fsr-live-bootstrap-indeterminate 1.1s linear infinite;
}

.fsr-live-bootstrap-segment-progress-text,
.fsr-live-bootstrap-segment-elapsed {
  font-size: 10px;
  color: #c0cbd6;
  font-variant-numeric: tabular-nums;
}

.fsr-live-bootstrap-segment-row.is-pending .fsr-live-bootstrap-segment-progress-text,
.fsr-live-bootstrap-segment-row.is-pending .fsr-live-bootstrap-segment-elapsed {
  color: #8998a5;
}

@keyframes fsr-live-bootstrap-indeterminate {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 180px 0;
  }
}

/* 设置弹窗加宽 */
.klinecharts-pro-modal .inner {
  width: 528px !important;
}

.fsr-setting-section {
  grid-column: 1 / -1;
  width: 100%;
  padding-top: 6px;
  padding-right: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.kline-data-start-setting-section {
  width: 100%;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.kline-data-start-setting-title {
  font-size: inherit;
  color: inherit;
  margin-bottom: 8px;
}

.kline-data-start-setting-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  margin-bottom: 8px;
}

.kline-data-start-setting-row:last-child {
  margin-bottom: 0;
}

.kline-data-start-setting-label {
  width: 108px;
  min-width: 108px;
  font-size: 12px;
  color: #cfd3d6;
}

.kline-data-start-setting-input {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(15, 20, 30, 0.92);
  color: #e9edf2;
  padding: 4px 8px;
  font-size: 12px;
}

.kline-data-start-setting-input.is-invalid {
  border-color: #ef5a5a;
  box-shadow: 0 0 0 1px rgba(239, 90, 90, 0.28);
}

.kline-data-start-setting-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  user-select: none;
}

.kline-data-start-setting-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.kline-data-start-setting-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition: background-color 160ms ease;
}

.kline-data-start-setting-switch-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.kline-data-start-setting-switch input:checked + .kline-data-start-setting-switch-slider {
  background: #2d7ef7;
}

.kline-data-start-setting-switch input:checked + .kline-data-start-setting-switch-slider::before {
  transform: translateX(20px);
}

.fsr-setting-title {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: #cfd3d6;
  line-height: 18px;
}

.fsr-setting-header {
  display: grid;
  grid-template-columns: 108px 36px;
  align-items: center;
  justify-content: start;
  column-gap: 8px;
  margin-bottom: 8px;
}

.fsr-setting-master-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 18px;
  border-radius: 9px;
  background-color: var(--klinecharts-pro-border-color, rgba(255, 255, 255, 0.2));
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  align-self: center;
}

.fsr-setting-master-toggle .thumb {
  display: inline-block;
  position: absolute;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  z-index: 10;
  background-color: #ffffff;
  transition: all 0.2s;
}

.fsr-setting-master-toggle.turn-off .thumb {
  left: 2px;
}

.fsr-setting-master-toggle.turn-on {
  background-color: var(--klinecharts-pro-primary-color, #2d7ef7);
}

.fsr-setting-master-toggle.turn-on .thumb {
  left: 20px;
}

.fsr-setting-master-toggle-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.fsr-setting-section.is-disabled .fsr-setting-row {
  opacity: 0.7;
}

.fsr-setting-row {
  display: grid;
  grid-template-columns: 12px 34px repeat(5, max-content);
  justify-content: start;
  column-gap: 10px;
  align-items: center;
  font-size: inherit;
  margin: 4px 0;
}

.klinecharts-pro-modal .button-container {
  padding: 18px 26px 22px 26px;
}

.fsr-setting-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.fsr-setting-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.fsr-setting-text {
  font-size: 12px;
  color: #cfd3d6;
}

.fsr-setting-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  justify-self: center;
}

.fsr-setting-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  justify-self: start;
}

/* 连接状态指示器 */
.fsr-conn-status {
  position: absolute;
  top: 6px;
  right: 12px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 20, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  user-select: none;
}

.fsr-conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555;
  flex-shrink: 0;
}

.fsr-conn-dot.is-ok {
  background: #2fcf9f;
  box-shadow: 0 0 4px rgba(47, 207, 159, 0.5);
}

.fsr-conn-dot.is-fallback {
  background: #f0c040;
  box-shadow: 0 0 4px rgba(240, 192, 64, 0.5);
}

.fsr-conn-dot.is-reconnecting {
  background: #e88434;
  animation: fsr-conn-blink 1s ease-in-out infinite;
}

.fsr-conn-dot.is-error {
  background: #ef5a5a;
}

@keyframes fsr-conn-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.fsr-conn-label {
  font-size: 11px;
  color: #b0bcc8;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* 警告 Toast */
.fsr-toast {
  position: absolute;
  top: 36px;
  right: 12px;
  z-index: 210;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(232, 132, 52, 0.16);
  border: 1px solid rgba(232, 132, 52, 0.4);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}

.fsr-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fsr-toast-text {
  font-size: 12px;
  color: #f0c080;
  white-space: nowrap;
}
