/* ============================================
   enci.space — Apple 极简风格
   ============================================ */

:root {
  --bg-primary: #f5f5f7;
  --bg-white: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #aeaeb2;
  --border-light: #d2d2d7;
  --border-subtle: #e5e5e7;

  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;

  --wx-green: #07c160;
  --wx-green-hover: #06ad56;
  --zfb-blue: #1677ff;
  --zfb-blue-hover: #1468e0;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-full: 980px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-modal: 0 12px 40px rgba(0, 0, 0, 0.12);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: ease-out;

  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-color: var(--bg-primary);
  font-family: var(--font-stack);
  color: var(--text-primary);
  padding: 24px;
  padding-top: 10vh;
  overflow-x: hidden;
}

/* ============================================
   主内容区
   ============================================ */
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  text-align: center;
  margin-bottom: 32px;
}

.hero-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.hero-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.25;
}

/* ============================================
   恩赐按钮
   ============================================ */
.donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 44px;
  padding: 12px 32px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--apple-blue);
  color: #fff;
  font-family: var(--font-stack);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.2s var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin-bottom: 32px;
}

.donate-btn:hover {
  background: var(--apple-blue-hover);
}

.donate-btn:active {
  background: #0060c0;
  transition: background 0.1s var(--ease-standard);
}

/* ============================================
   滚动记录
   ============================================ */
.scroll-box {
  width: 100%;
  height: 38px;
  overflow: hidden;
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.scroll-box::before,
.scroll-box::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  z-index: 2;
  pointer-events: none;
}

.scroll-box::before {
  left: 0;
  background: linear-gradient(to right, #ffffff 0%, rgba(255,255,255,0) 100%);
}

.scroll-box::after {
  right: 0;
  background: linear-gradient(to left, #ffffff 0%, rgba(255,255,255,0) 100%);
}

.scroll-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  height: 100%;
  padding: 0 44px;
  animation: scrollRoll 70s linear infinite;
}

@keyframes scrollRoll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.scroll-box:hover .scroll-list {
  animation-play-state: paused;
}

.scroll-item {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 20px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.scroll-sep {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--border-subtle);
  padding: 0 12px;
  user-select: none;
}

.scroll-item .name {
  color: var(--text-primary);
  font-weight: 500;
}

.scroll-item .amount {
  color: var(--text-primary);
  font-weight: 500;
}

.scroll-item .lotus {
  display: inline;
  color: var(--text-tertiary);
  margin-right: 2px;
}

.source-link {
  color: #0071e3;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

/* ============================================
   遮罩
   ============================================ */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out);
  padding: 24px;
}

.mask.show {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   弹窗
   ============================================ */
.modal {
  position: relative;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 40px 32px 32px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.98);
  transition: transform 0.3s var(--ease-out);
}

.mask.show .modal {
  transform: scale(1);
}

.modal-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 28px;
}

/* ============================================
   关闭按钮（圆形 X）
   ============================================ */
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* ============================================
   支付按钮组
   ============================================ */
.modal-btns {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  width: 100%;
}

.pay-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-stack);
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition:
    background 0.15s var(--ease-standard),
    opacity 0.2s var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.pay-btn:active {
  opacity: 0.85;
}

.wx-btn {
  background: var(--wx-green);
}

.wx-btn:hover {
  background: var(--wx-green-hover);
}

.zfb-btn {
  background: var(--zfb-blue);
}

.zfb-btn:hover {
  background: var(--zfb-blue-hover);
}

.pay-btn.inactive {
  opacity: 0.4;
  pointer-events: none;
}

/* ============================================
   二维码
   ============================================ */
.qrcode-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 260px;
  justify-content: center;
}

.qrcode-img {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  object-fit: contain;
  transition: opacity 0.25s var(--ease-standard);
  opacity: 0;
}

.qrcode-img.visible {
  opacity: 1;
}

.qrcode-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
  min-height: 20px;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 480px) {
  body {
    padding: 20px;
  }

  .hero {
    margin-bottom: 32px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .hero-title {
    font-size: 28px;
  }

  .donate-btn {
    min-width: 120px;
    height: 44px;
    font-size: 16px;
    margin-bottom: 36px;
  }

  .scroll-box {
    height: 36px;
    border-radius: var(--radius-sm);
  }

  .scroll-item {
    font-size: 12px;
    padding: 0 14px;
  }

  .scroll-sep {
    font-size: 12px;
    padding: 0 10px;
  }

  .modal {
    padding: 34px 20px 26px;
  }

  .modal-title {
    font-size: 19px;
    margin-bottom: 24px;
  }

  .modal-btns {
    gap: 10px;
  }

  .pay-btn {
    font-size: 14px;
    height: 40px;
  }

  .qrcode-img {
    width: 180px;
    height: 180px;
  }

  .qrcode-wrapper {
    min-height: 220px;
  }
}

@media (max-width: 360px) {
  .hero-title {
    font-size: 24px;
  }

  .donate-btn {
    min-width: 110px;
    height: 40px;
    font-size: 15px;
  }

  .scroll-box {
    height: 34px;
  }

  .scroll-item {
    font-size: 11px;
  }

  .scroll-sep {
    font-size: 11px;
    padding: 0 8px;
  }

  .modal {
    padding: 28px 16px 20px;
  }

  .modal-btns {
    flex-direction: column;
    gap: 8px;
  }

  .qrcode-img {
    width: 150px;
    height: 150px;
  }

  .qrcode-wrapper {
    min-height: 190px;
  }
}
