* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #1f2937;
  background: #f4f6f8;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eef2ff, #f8fafc 50%, #ecfeff);
}

.login-panel {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, .08);
}

.login-title {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 700;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
}

.captcha-img {
  width: 120px;
  height: 44px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  cursor: pointer;
}

.app-shell {
  height: 100vh;
}

.side {
  color: #fff;
  background: #172033;
}

.brand {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.side .el-menu {
  border-right: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.content {
  height: calc(100vh - 56px);
  padding: 18px;
  overflow: auto;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.filter-panel {
  margin-bottom: 14px;
  padding: 14px 14px 2px;
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 0 12px;
  align-items: start;
}

.filter-grid .range-filter {
  grid-column: span 2;
}

.filter-grid .range-start {
  grid-column: 1 / span 2;
}

.filter-actions {
  display: flex;
  align-items: flex-start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.stat-label {
  color: #667085;
  font-size: 14px;
}

.stat-value {
  margin-top: 8px;
  font-size: 30px;
  font-weight: 700;
}

.panel {
  padding: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.monthly-panel {
  min-width: 0;
  max-width: 100%;
  padding: 28px 28px 20px;
  border-color: #e0e6ee;
  border-radius: 12px;
  color: #243248;
}

.monthly-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.monthly-panel-header h3 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 600;
}

.monthly-date-range {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.monthly-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
}

.monthly-legend-item,
.monthly-tooltip-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.monthly-swatch {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.monthly-chart-scroll {
  width: 100%;
  overflow-x: auto;
  margin-top: 18px;
  scrollbar-color: #bdcce0 #f3f6fa;
}

.monthly-chart {
  position: relative;
  min-width: 1040px;
}

.monthly-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.monthly-grid-line {
  stroke: #e9eef5;
  stroke-width: 1;
}

.monthly-baseline {
  stroke: #cad5e3;
  stroke-width: 1;
}

.monthly-axis-text {
  fill: #66758a;
  font-size: 13px;
}

.monthly-month-label {
  fill: #46566c;
  font-size: 13px;
}

.monthly-value-label {
  fill: #3a4a61;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.monthly-value-label.main {
  fill: #2e4f82;
  font-weight: 600;
}

.monthly-month-group {
  cursor: pointer;
  outline: none;
}

.monthly-month-highlight {
  fill: #f2f6fd;
  opacity: 0;
  transition: opacity 120ms ease;
}

.monthly-month-group:hover .monthly-month-highlight,
.monthly-month-group:focus .monthly-month-highlight,
.monthly-month-group.is-active .monthly-month-highlight {
  opacity: 1;
}

.monthly-month-group:focus-visible .monthly-month-highlight {
  stroke: #4d87e8;
  stroke-width: 1.5;
}

.monthly-tooltip {
  position: absolute;
  top: 32px;
  z-index: 2;
  padding: 16px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(30, 55, 87, .16);
  pointer-events: none;
  font-size: 14px;
}

.monthly-tooltip strong {
  display: block;
  margin-bottom: 14px;
  font-size: 15px;
}

.monthly-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.monthly-tooltip b {
  font-variant-numeric: tabular-nums;
}

.monthly-empty {
  margin: 0;
  padding: 80px 16px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.monthly-chart-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid #eef2f6;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.monthly-panel ::selection {
  background: #dbeafe;
  color: #173b71;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.full-line {
  grid-column: 1 / -1;
}

.important-name {
  color: #1677ff;
  font-weight: 600;
}

.nowrap-cell .cell {
  white-space: nowrap;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 12px;
}

.section-title-row h3 {
  margin: 0;
}

.customer-list-caption {
  color: #475569;
  font-size: 14px;
}

.customer-list-caption strong {
  color: #243248;
  font-variant-numeric: tabular-nums;
}

.customer-list-caption span {
  margin-left: 16px;
  color: #64748b;
  font-size: 13px;
}

.customer-table {
  --el-table-border-color: #e8edf3;
  --el-table-row-hover-bg-color: #f3f7fc;
  border: 1px solid #e0e6ee;
  border-radius: 8px;
  color: #475569;
}

.customer-table .el-table__header th {
  padding: 12px 0;
  background: #f3f6fa;
  color: #334155;
  font-weight: 600;
}

.customer-table .el-table__body td {
  padding: 14px 0;
}

.customer-table .cell {
  padding-right: 16px;
  padding-left: 16px;
}

.customer-table .customer-name-cell {
  color: #243248;
  font-weight: 600;
}

.customer-intro-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0;
  line-height: 22px;
  overflow-wrap: anywhere;
}

.customer-intro-link.el-button {
  min-height: 24px;
  margin-top: 4px;
  padding: 0;
  color: #2563b8;
  font-size: 13px;
}

.customer-empty-intro {
  color: #64748b;
  font-size: 13px;
}

.customer-row-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
}

.customer-row-actions .el-button + .el-button {
  margin-left: 0;
}

.customer-row-actions .el-button {
  min-height: 28px;
  padding: 4px;
}

.customer-table .el-button:focus-visible {
  outline: 2px solid #2563b8;
  outline-offset: 2px;
}

.customer-detail {
  max-width: calc(100vw - 32px);
}

.customer-detail .el-descriptions__label.el-descriptions__cell.is-bordered-label {
  width: 104px;
  white-space: nowrap;
}

.customer-detail-intro {
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 1200px) {
  .customer-list .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-list-caption span {
    display: none;
  }

  .customer-table .el-table__header-wrapper th.el-table-fixed-column--right,
  .customer-table .el-table__body-wrapper td.el-table-fixed-column--right {
    position: static !important;
  }

  .customer-table .el-table-fixed-column--right::before {
    display: none;
  }
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin: 14px 0;
}

@media (max-width: 900px) {
  .stats-grid,
  .form-grid,
  .filter-grid,
  .customer-list .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid .range-filter {
    grid-column: auto;
  }

}

@media (max-width: 760px) {
  .monthly-panel {
    padding: 20px 16px 16px;
  }

  .monthly-panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .monthly-legend {
    gap: 20px;
  }

  .monthly-chart-footer {
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .monthly-month-highlight {
    transition: none;
  }
}

.api-management { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; max-width: 100%; }
.api-management .panel { margin: 0; min-width: 0; }
.api-management h2, .api-management h3 { margin-top: 0; }
.api-overview { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.api-overview h2 { margin-bottom: 8px; }
.api-overview p { margin: 0; color: #64748b; }
.api-note { font-size: 13px; line-height: 1.7; color: #64748b; overflow-wrap: anywhere; }
.api-management code { overflow-wrap: anywhere; }
.api-management .el-form-item__content > .api-note { margin: 0 0 0 12px; }
.api-call-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 18px; }
.api-call-filters .el-form-item { margin-right: 0; }
.api-call-client { width: 220px; }
.api-call-outcome { width: 145px; }
.api-call-time { max-width: 100%; }
.api-call-time .el-form-item__content { min-width: 0; }
.api-call-time .el-date-editor { width: 400px; max-width: 100%; }
.api-call-key, .api-call-path { display: block; margin-top: 4px; color: #64748b; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.api-call-path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.api-call-error { margin-bottom: 16px; }
.api-call-pagination { margin-top: 18px; flex-wrap: wrap; row-gap: 12px; }
.api-client-dialog, .api-product-usage-dialog { max-width: calc(100vw - 32px); }
.api-client-dialog .el-form-item__content { min-width: 0; }
.api-enterprise-help { margin-left: 12px; color: #475569; font-size: 13px; line-height: 1.6; }
.api-product-editor { min-width: 0; margin-top: 24px; }
.api-product-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.api-product-heading h4 { margin: 0; color: #1e293b; font-size: 16px; }
.api-product-editor .api-note, .api-product-usage-dialog .api-note { margin: 10px 0 14px; color: #475569; }
.api-product-editor .el-input-number { width: 160px; }
.api-product-editor .el-table, .api-product-usage-table { max-width: 100%; font-variant-numeric: tabular-nums; }
.api-product-error { margin-top: 16px; }
@media (max-width: 640px) {
  .api-enterprise-help { flex-basis: 100%; margin: 8px 0 0; }
}
