/* 帖子打赏面板 —— 按妖火 RewardPanel 1:1 复刻，配色改用本站主题变量 */
.rw-panel {
  display: block; box-sizing: border-box; margin: 0;
  padding: 14px 16px 18px;
  color: var(--c-text); font-family: inherit; font-size: 15px; line-height: 1.5; text-align: left;
  --rw-accent: var(--c-primary);
  --rw-muted: var(--c-text-3);
  --rw-line: var(--c-border);
  --rw-tile-bg: var(--c-surface);
  --rw-disabled: var(--c-text-3);
}
.popup-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); padding: 16px;
}
.popup-overlay.active { display: flex; }
.popup-container {
  width: min(420px, 100%); max-height: 90vh; overflow: auto;
  background: var(--c-surface); color: var(--c-text);
  border-radius: var(--radius); box-shadow: var(--shadow-pop);
  transform: translateY(8px); opacity: 0; transition: transform .18s ease, opacity .18s ease;
}
.popup-container.active { transform: translateY(0); opacity: 1; }
.popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--c-border);
  font-size: 16px; font-weight: 600;
}
.popup-close-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 4px;
  border: none; background: transparent; color: var(--c-text-3); cursor: pointer;
}
.popup-close-btn:hover { color: var(--c-text); }
.popup-content-area { padding: 0; }

.rw-alert {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 10px 12px;
  border: 1px solid transparent; border-radius: 8px; font-size: 14px;
}
.rw-alert b { font-weight: 600; }
.rw-alert--err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.rw-alert--warn { background: #fff7ed; border-color: #fed7aa; color: #b45309; }
.rw-alert--ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
html[data-theme="dark"] .rw-alert--err { background: #2b1d1d; border-color: #5c3434; color: #d78d8d; }
html[data-theme="dark"] .rw-alert--warn { background: #2b2318; border-color: #5b4927; color: #d0ad67; }
html[data-theme="dark"] .rw-alert--ok { background: #1b2a23; border-color: #355845; color: #8fc5a5; }

.rw-balance { margin: 0 0 12px; color: var(--c-text-3); font-size: 13px; text-align: center; }
.rw-balance b { color: var(--c-text-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.rw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rw-radio { position: absolute; width: 0; height: 0; margin: 0; opacity: 0; }
.rw-tile {
  display: flex; align-items: center; justify-content: center; min-width: 0; height: 62px;
  border: 1px solid var(--rw-accent); border-radius: 8px;
  background: var(--rw-tile-bg); color: var(--rw-accent);
  font-size: clamp(19px, 6.8vw, 25px); font-weight: 500;
  white-space: nowrap; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
}
.rw-radio:checked + .rw-tile {
  background: var(--rw-accent); border-color: var(--rw-accent); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.rw-radio:focus-visible + .rw-tile { outline: 2px solid var(--rw-accent); outline-offset: 2px; }
.rw-radio:disabled + .rw-tile {
  border-color: var(--c-border); background: transparent; color: var(--rw-disabled); cursor: not-allowed;
}
.rw-locked { opacity: .45; pointer-events: none; }
.rw-fee { min-height: 19px; margin: 12px 0 10px; color: var(--c-text-3); font-size: 12.5px; text-align: center; }
.rw-cta {
  display: block; width: 100%; padding: 12px;
  border: 0; border-radius: 8px; background: var(--c-primary); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.rw-cta:hover { filter: brightness(.94); }
.rw-cta:disabled { background: var(--rw-disabled); cursor: not-allowed; }
.rw-amt { margin: 0 2px; font-variant-numeric: tabular-nums; }


/* 自定义金额（后台开关控制显隐） */
.rw-custom {
  display: flex; gap: 8px; margin: 4px 0 2px;
}
.rw-custom input {
  flex: 1; min-width: 0; height: 38px; padding: 0 10px;
  border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-bg); color: var(--c-text); font-family: inherit; font-size: 14px;
}
.rw-custom input:focus { outline: none; border-color: var(--c-primary); }
.rw-custom.is-active input { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary-weak); }
.rw-custom-ok {
  flex: none; padding: 0 14px; height: 38px;
  border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-surface); color: var(--c-text); font-family: inherit; font-size: 14px; cursor: pointer;
}
.rw-custom-ok:hover { border-color: var(--c-primary); color: var(--c-primary); }

.rw-toast {
  position: fixed; bottom: 48px; left: 50%; z-index: 9000;
  display: inline-flex; align-items: center; gap: 8px;
  max-width: calc(100vw - 24px); padding: 12px 18px;
  border-radius: 10px; background: rgba(30,30,30,.92);
  box-shadow: 0 6px 20px rgba(0,0,0,.25); color: #fff;
  font-size: 15px; font-weight: 600;
  transform: translateX(-50%); opacity: 1; transition: opacity .2s ease;
  animation: rw-toast-in .2s ease;
}
.rw-toast--err { background: rgba(120,30,30,.95); }
.rw-toast.is-hiding { opacity: 0; }
@keyframes rw-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 获赏徽章 */
.post-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px; border-radius: 10px;
  background: #fff3e0; color: #b26a00; border: 1px solid #ffd28a;
  font-size: 12px; font-weight: 600;
}
html[data-theme="dark"] .post-badge { background: #3a2b14; color: #f0b65a; border-color: #5b4420; }
.post-badge.animated-stamp { animation: rw-stamp .35s ease; }
@keyframes rw-stamp { from { transform: scale(1.5) rotate(-8deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }

@media (max-width: 360px) {
  .rw-panel { padding-left: 12px; padding-right: 12px; }
  .rw-grid { gap: 6px; }
  .rw-tile { height: 56px; }
}
