.earnings-page {
  display: grid;
  gap: 14px;
}

.earnings-page .page-head {
  margin-bottom: 0;
}

.earnings-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.earnings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 98px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.earnings-card span,
.earnings-section-title small,
.earnings-month-note,
.earnings-table th {
  color: var(--muted);
}

.earnings-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.1;
}

.earnings-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--brand-strong);
  background: #eaf1ff;
  font-weight: 700;
}

.earnings-panel {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.earnings-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.earnings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.earnings-section-title h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.earnings-section-title small {
  display: block;
  font-size: 12px;
}

.earnings-table-wrap {
  overflow-x: auto;
}

.earnings-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}

.earnings-table th,
.earnings-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  white-space: nowrap;
}

.earnings-table th:last-child,
.earnings-table td:last-child {
  text-align: right;
}

.earnings-table tr:last-child td {
  border-bottom: 0;
}

.earnings-profit {
  color: #138a46;
  font-weight: 700;
}

.earnings-loss {
  color: var(--danger);
  font-weight: 700;
}

.earnings-cycle-toggle {
  padding: 5px 8px;
  background: transparent;
  color: var(--brand-strong);
}

.earnings-cycle-projects td {
  padding-top: 0;
  background: #fafcff;
}

.earnings-project-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 2px;
}

.earnings-detail-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e6ebf3;
  border-radius: 8px;
  overflow: hidden;
}

.earnings-detail-table th,
.earnings-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  white-space: nowrap;
}

.earnings-detail-table th {
  color: var(--muted);
  background: #f7f9fd;
  font-weight: 700;
}

.earnings-detail-table th:nth-child(n+5),
.earnings-detail-table td:nth-child(n+5) {
  text-align: right;
}

.earnings-period-remark {
  width: 160px;
  min-width: 120px;
}

.earnings-address {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.earnings-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border: 1px solid #dce6f8;
  border-radius: 6px;
  background: #f3f7ff;
  color: #233557;
}

.earnings-month-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.earnings-month-tools input {
  width: 160px;
}

.earnings-month-tools button.secondary {
  width: 36px;
  padding: 9px 0;
}

.earnings-month-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}

.earnings-month-card {
  padding: 14px;
  border: 1px solid #e6ebf3;
  border-radius: 8px;
  background: #fbfcff;
}

.earnings-month-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.earnings-month-card strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
}

.earnings-project-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.earnings-logo-dot {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0b1220;
  color: #fff;
  font-size: 11px;
}

.earnings-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 18, 32, 0.38);
}

.earnings-share-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.24);
}

.earnings-share-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(220px, 1fr);
  gap: 16px;
  align-items: start;
}

.earnings-poster-preview {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #dce6f8;
  background: #071b3f;
}

.earnings-share-actions {
  display: grid;
  gap: 10px;
}

.earnings-share-actions button {
  width: 100%;
}

.earnings-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .earnings-overview,
  .earnings-two-col,
  .earnings-month-summary,
  .earnings-share-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .earnings-card {
    min-height: 86px;
  }

  .earnings-card strong {
    font-size: 22px;
  }

  .earnings-section-head {
    display: grid;
  }

  .earnings-month-tools input {
    flex: 1;
    min-width: 150px;
  }
}
