#pdd-fee-widget-root {
  position: relative;
  width: 100%;
  margin-top: 12px;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#pdd-fee-widget-root {
  color: #172033;
}

.pdd-fee-widget * {
  box-sizing: border-box;
}

.pdd-fee-widget__card {
  overflow: hidden;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(23, 32, 51, 0.05);
}

.pdd-fee-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 0;
}

.pdd-fee-widget__header-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pdd-fee-widget__header-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.pdd-fee-widget__brand {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 122, 89, 0.14), rgba(20, 184, 166, 0.14));
}

.pdd-fee-widget__brand-icon {
  width: 22px;
  height: 22px;
}

.pdd-fee-widget__heading {
  min-width: 0;
}

.pdd-fee-widget__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.pdd-fee-widget__subtitle {
  margin-top: 2px;
  color: #5f6c87;
  font-size: 12px;
  line-height: 1.4;
}

.pdd-fee-widget__header-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: rgba(64, 124, 255, 0.06);
  color: #2f5cff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.pdd-fee-widget__action-button,
.pdd-fee-widget__dialog-link,
.pdd-fee-source-panel__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.pdd-fee-widget__action-button--ghost,
.pdd-fee-widget__dialog-link {
  border-color: rgba(64, 124, 255, 0.18);
  background: rgba(64, 124, 255, 0.08);
  color: #2f5cff;
}

.pdd-fee-widget__action-button--primary,
.pdd-fee-source-panel__button {
  border-color: rgba(255, 122, 89, 0.18);
  background: linear-gradient(135deg, #ff7a59, #ff9369);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(255, 122, 89, 0.2);
}

.pdd-fee-widget__action-button:hover,
.pdd-fee-widget__dialog-link:hover,
.pdd-fee-source-panel__button:hover {
  transform: translateY(-1px);
}

.pdd-fee-widget__action-button:disabled,
.pdd-fee-source-panel__button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pdd-fee-widget__action-button:focus-visible,
.pdd-fee-widget__dialog-link:focus-visible,
.pdd-fee-source-panel__button:focus-visible,
.pdd-fee-widget__icon-button:focus-visible {
  outline: 2px solid rgba(64, 124, 255, 0.3);
  outline-offset: 2px;
}

.pdd-fee-widget__body {
  display: grid;
  gap: 10px;
  padding: 10px 14px 14px;
}

.pdd-fee-widget__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pdd-fee-widget__metric-card,
.pdd-fee-widget__panel {
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

.pdd-fee-widget__metric-card {
  min-height: 112px;
  padding: 12px;
}

.pdd-fee-widget__metric-label {
  color: #52617b;
  font-size: 12px;
  line-height: 1.4;
}

.pdd-fee-widget__metric-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.pdd-fee-widget__metric-secondary {
  margin-top: 6px;
  color: #5f6c87;
  font-size: 12px;
  line-height: 1.4;
}

.pdd-fee-widget__metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.pdd-fee-widget__metric-trend.is-up {
  background: rgba(209, 67, 67, 0.12);
  color: #c23737;
}

.pdd-fee-widget__metric-trend.is-down {
  background: rgba(17, 138, 69, 0.12);
  color: #0d7a3d;
}

.pdd-fee-widget__metric-trend.is-flat {
  background: rgba(95, 108, 135, 0.12);
  color: #516076;
}

.pdd-fee-widget__metric-trend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.pdd-fee-widget__metric-caption {
  margin-top: 8px;
  color: #6b7891;
  font-size: 11px;
  line-height: 1.45;
}

.pdd-fee-widget__panel {
  padding: 12px;
}

.pdd-fee-widget__panel--chart {
  padding: 12px;
  border-color: rgba(138, 164, 201, 0.14);
  background: #ffffff;
  box-shadow: none;
}

.pdd-fee-widget__panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.pdd-fee-widget__panel-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.pdd-fee-widget__panel-subtitle {
  margin-top: 2px;
  color: #66748f;
  font-size: 10px;
  line-height: 1.4;
}

.pdd-fee-widget__chart-shell {
  margin-top: 6px;
}

.pdd-fee-widget__chart-wrap {
  position: relative;
}

.pdd-fee-widget__chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.pdd-fee-widget__grid-line {
  stroke: rgba(95, 108, 135, 0.08);
  stroke-dasharray: 3 6;
}

.pdd-fee-widget__axis-label {
  fill: #7a869f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-anchor: middle;
}

.pdd-fee-widget__axis-label--left {
  text-anchor: end;
  fill: #8491aa;
}

.pdd-fee-widget__axis-label--bottom {
  fill: #76829b;
}

.pdd-fee-widget__axis-label--bottom.is-first {
  text-anchor: start;
}

.pdd-fee-widget__axis-label--bottom.is-last {
  text-anchor: end;
}

.pdd-fee-widget__line-glow {
  fill: none;
  stroke: rgba(255, 122, 89, 0.08);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#pdd-fee-line-glow);
}

.pdd-fee-widget__line {
  fill: none;
  stroke: url(#pdd-fee-line-gradient);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pdd-fee-widget__area {
  fill: url(#pdd-fee-area-gradient);
}

.pdd-fee-widget__dot {
  fill: #1db4a9;
  stroke: #ffffff;
  stroke-width: 1.2;
}

.pdd-fee-widget__dot-halo {
  fill: rgba(255, 110, 96, 0.08);
}

.pdd-fee-widget__dot.is-active {
  fill: #ff6d60;
  stroke-width: 1.5;
}

.pdd-fee-widget__chart-hoverline {
  position: absolute;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 122, 89, 0), rgba(255, 122, 89, 0.16), rgba(95, 168, 255, 0));
  pointer-events: none;
  transform: translateX(-0.5px);
}

.pdd-fee-widget__chart-hoverdot {
  position: absolute;
  width: 6px;
  height: 6px;
  border: 1.2px solid #ffffff;
  border-radius: 999px;
  background: #ff7a59;
  box-shadow: 0 3px 8px rgba(255, 122, 89, 0.12);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.pdd-fee-widget__chart-tooltip {
  position: absolute;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(23, 32, 51, 0.8);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 14px rgba(23, 32, 51, 0.1);
}

.pdd-fee-widget__empty {
  padding: 4px 0 0;
}

.pdd-fee-widget__empty-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.pdd-fee-widget__empty-text {
  margin-top: 4px;
  color: #66748f;
  font-size: 12px;
  line-height: 1.5;
}

.pdd-fee-widget__overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 18, 31, 0.36);
  backdrop-filter: blur(6px);
}

.pdd-fee-widget__dialog {
  width: min(640px, calc(100vw - 24px));
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 56px rgba(23, 32, 51, 0.18);
  overflow: hidden;
}

.pdd-fee-widget__dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(23, 32, 51, 0.08);
}

.pdd-fee-widget__dialog-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.pdd-fee-widget__dialog-subtitle {
  margin-top: 4px;
  color: #66748f;
  font-size: 12px;
  line-height: 1.5;
}

.pdd-fee-widget__icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: #ffffff;
  color: #516076;
  cursor: pointer;
}

.pdd-fee-widget__icon-button svg {
  width: 16px;
  height: 16px;
}

.pdd-fee-widget__dialog-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.pdd-fee-widget__dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pdd-fee-widget__dialog-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.88), #ffffff);
}

.pdd-fee-widget__dialog-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.pdd-fee-widget__dialog-card-text {
  margin-top: 4px;
  color: #66748f;
  font-size: 12px;
  line-height: 1.5;
}

.pdd-fee-widget__dialog-card-state {
  display: grid;
  gap: 4px;
  color: #5f6c87;
  font-size: 11px;
  line-height: 1.45;
}

.pdd-fee-widget__dialog-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.pdd-fee-widget__dialog-badge.is-ready {
  background: rgba(17, 138, 69, 0.12);
  color: #0d7a3d;
}

.pdd-fee-widget__dialog-badge.is-pending {
  background: rgba(95, 108, 135, 0.12);
  color: #516076;
}

.pdd-fee-widget__dialog-meta {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: rgba(248, 250, 255, 0.74);
}

.pdd-fee-widget__dialog-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #5f6c87;
  font-size: 12px;
  line-height: 1.4;
}

.pdd-fee-widget__dialog-meta-row strong {
  color: #172033;
  font-weight: 700;
}

.pdd-fee-widget__dialog-message,
.pdd-fee-source-panel__message {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.pdd-fee-widget__dialog-message.is-success,
.pdd-fee-source-panel__message.is-success {
  background: rgba(17, 138, 69, 0.1);
  color: #0d7a3d;
}

.pdd-fee-widget__dialog-message.is-error,
.pdd-fee-source-panel__message.is-error {
  background: rgba(209, 67, 67, 0.1);
  color: #c23737;
}

.pdd-fee-widget__dialog-message.is-neutral,
.pdd-fee-source-panel__message.is-neutral {
  background: rgba(95, 108, 135, 0.1);
  color: #516076;
}

.pdd-fee-widget__dialog-footer {
  display: flex;
  justify-content: flex-end;
}

.pdd-fee-widget__chart-empty {
  display: grid;
  min-height: 140px;
  place-items: center;
  border: 1px dashed rgba(95, 108, 135, 0.3);
  border-radius: 8px;
  color: #66748f;
  font-size: 12px;
}

#pdd-fee-source-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2600;
  width: min(320px, calc(100vw - 24px));
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 32px rgba(23, 32, 51, 0.14);
  backdrop-filter: blur(10px);
  color: #172033;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.pdd-fee-source-panel__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.pdd-fee-source-panel__hint {
  color: #66748f;
  font-size: 12px;
  line-height: 1.5;
}

.pdd-fee-source-panel__status-row {
  display: grid;
  gap: 3px;
}

.pdd-fee-source-panel__status {
  color: #172033;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.pdd-fee-source-panel__sync {
  color: #66748f;
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 1320px) {
  .pdd-fee-widget__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .pdd-fee-widget__metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #pdd-fee-widget-root {
    margin-top: 12px;
  }

  .pdd-fee-widget__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .pdd-fee-widget__header-side {
    width: 100%;
    justify-content: flex-start;
  }

  .pdd-fee-widget__metrics {
    grid-template-columns: 1fr;
  }

  .pdd-fee-widget__dialog-grid {
    grid-template-columns: 1fr;
  }

  .pdd-fee-widget__metric-value {
    font-size: 20px;
  }

  #pdd-fee-source-panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}
