:root {
  --primary: #e05a47;
  --primary-dark: #c94b39;
  --bg: #faf8f5;
  --card: #ffffff;
  --text: #333333;
  --muted: #777777;
  --border: #e6e2dd;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  --font: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 26px;
  color: #9a3412;
  font-size: 14px;
}

.notice:empty {
  display: none;
}

.hero {
  text-align: center;
  padding: 36px 20px;
}

.hero h1 {
  font-size: 32px;
  margin: 0 0 10px;
}

.hero p {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 15px;
}

.donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 18px 56px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(224, 90, 71, 0.28);
  transition: transform 0.15s ease, background 0.15s ease;
}

.donate-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.donate-btn:active {
  transform: translateY(0);
}

.stats-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.card .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

/* 平台捐赠统计（今日 / 本周 / 本月） */
.impact-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  padding: 18px 16px 14px;
  margin-bottom: 24px;
  box-shadow: 0 12px 30px rgba(224, 90, 71, 0.28);
  color: #fff;
  text-align: center;
}

.impact-item + .impact-item {
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.impact-label {
  font-size: 13px;
  opacity: 0.88;
  margin-bottom: 6px;
}

.impact-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.3px;
  word-break: break-all;
}

.impact-note {
  grid-column: 1 / -1;
  margin: 14px 0 0;
  font-size: 12px;
  opacity: 0.75;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clear-local {
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

.clear-local:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.donation-list {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.donation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.donation-item:last-child {
  border-bottom: none;
}

.donation-item .left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.donation-item .amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.donation-item .time {
  font-size: 12px;
  color: var(--muted);
}

.empty {
  text-align: center;
  padding: 34px;
  color: var(--muted);
  font-size: 14px;
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 18px;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.form-group small {
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.submit-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}

.submit-btn:hover {
  background: var(--primary-dark);
}

.submit-btn:disabled {
  background: #d1aaa3;
  cursor: not-allowed;
}

.error-msg {
  color: #c94b39;
  font-size: 13px;
  margin-top: 10px;
  min-height: 20px;
}

/* 捐赠榜单 */
.lb-more {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.lb-more:hover {
  color: var(--primary);
}

.leaderboard {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lb-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.lb-tab {
  flex: 1;
  position: relative;
  background: transparent;
  border: none;
  padding: 13px 0;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.lb-tab.active {
  color: var(--primary);
  font-weight: 700;
}

.lb-tab.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 36px;
  height: 3px;
  border-radius: 3px;
  background: var(--primary);
}

.lb-list {
  padding: 4px 0;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
}

.lb-row:last-child {
  border-bottom: none;
}

.lb-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f3efea;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lb-rank-top1 {
  background: #f7c948;
  color: #7a5200;
}

.lb-rank-top2 {
  background: #cfd8e3;
  color: #4a5a6a;
}

.lb-rank-top3 {
  background: #e8b07a;
  color: #7a4a12;
}

.lb-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-count {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.lb-amount {
  width: 96px;
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.lb-tip {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 14px 0 0;
}

/* 匿名捐赠复选框 */
.form-group.hidden {
  display: none;
}

.form-group label.lb-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
}

.lb-check input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.lb-check small {
  margin-left: 0;
}

@media (max-width: 520px) {
  .stats-cards {
    grid-template-columns: 1fr;
  }

  .impact-stats {
    gap: 8px;
    padding: 14px 10px 12px;
  }

  .impact-label {
    font-size: 12px;
  }

  .impact-value {
    font-size: 16px;
    letter-spacing: 0;
  }

  .impact-note {
    margin-top: 10px;
    font-size: 11px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .donate-btn {
    width: 100%;
  }

  .lb-count {
    display: none;
  }

  .lb-amount {
    width: 82px;
    font-size: 14px;
  }
}
