/* 赞赏系统 - 默认模板样式 v2 */

/* ========== CSS变量 ========== */
:root {
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.10);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
    --transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========== 全局基础 ========== */
* { box-sizing: border-box; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #2d3748;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* 通用工具类 */
.text-accent { color: var(--accent-color, #ffc107); }
.bg-accent { background-color: var(--accent-color, #ffc107); }

/* 动画 */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.fade-in-up { animation: slideDown 0.4s ease-out; }
.fade-in { animation: fadeIn 0.3s ease-out; }

/* ========== 页面头部 ========== */
.site-header {
    padding: 1.75rem 1.5rem 1.25rem;
    text-align: center;
    background: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color) 100%);
    color: #fff;
    border-radius: var(--radius);
    margin: 1.25rem 0 1.5rem;
    position: relative;
    overflow: hidden;
}
.site-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.15) 100%);
    pointer-events: none;
}
.site-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    color: #fff;
    position: relative;
}
.site-header h2 {
    color: #fff;
    font-weight: 800;
    position: relative;
}
.site-header .subtitle {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.8);
    position: relative;
}
.site-header a {
    color: rgba(255,255,255,0.75) !important;
    font-size: 0.8125rem;
    transition: color 0.2s;
    position: relative;
}
.site-header a:hover {
    color: #fff !important;
}
.site-notice {
    max-width: 500px;
    margin: 0.75rem auto 0;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    border: none;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    padding: 0.5rem 0.875rem;
    backdrop-filter: blur(4px);
    position: relative;
}
.site-notice i { opacity: 0.8; }

/* ========== 卡片基础 ========== */
.card {
    border: 1px solid #eef0f4;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border-bottom: 1px solid #eef0f4;
}
.card-body { padding: 1.5rem; }

/* ========== 赞赏主卡片 ========== */
.donate-card {
    border: none;
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(0,0,0,0.03);
}
.donate-card:hover { box-shadow: var(--shadow-hover); }
.donate-card .card-body { padding: 2rem; }

/* 区块标题 */
.section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8892a4;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-title i { font-size: 1rem; opacity: 0.6; }

/* ========== 金额按钮网格 ========== */
.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 1rem;
}
@media (min-width: 576px) {
    .amount-grid { grid-template-columns: repeat(6, 1fr); }
}
.amount-btn {
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.0625rem;
    padding: 0.625rem 0.25rem 0.75rem;
    transition: var(--transition);
    border: 2px solid #e2e6ec;
    background: #fff;
    color: #4a5568;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    gap: 2px;
}
.amount-btn::before {
    content: '¥';
    font-size: 0.5625rem;
    font-weight: 600;
    opacity: 0.45;
    line-height: 1;
}
.amount-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13,110,253,0.12);
    background: rgba(13,110,253,0.03);
}
.amount-btn.active {
    background: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(13,110,253,0.25);
}
.amount-btn.active::before { opacity: 0.8; }

/* 自定义金额输入 */
.custom-amount-group {
    position: relative;
}
.custom-amount-group .form-control {
    border-radius: var(--radius-sm);
    padding-left: 2.5rem;
    border: 2px solid #e2e6ec;
    font-size: 0.9375rem;
    transition: var(--transition);
}
.custom-amount-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}
.custom-amount-group .input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: #a0aec0;
    font-size: 0.9375rem;
    z-index: 2;
}
.custom-amount-group .unit-label {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 0.8125rem;
}

/* ========== 支付方式 ========== */
.pay-type-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.pay-type-btn {
    border: 2px solid #e2e6ec;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    background: #fff;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.pay-type-btn i { font-size: 1.125rem; }
.pay-type-btn.wechat i { color: #07c160; }
.pay-type-btn.alipay i { color: #1677ff; }
.pay-type-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.pay-type-btn.active.wechat {
    border-color: #07c160;
    background: rgba(7,193,96,0.06);
    color: #07c160;
}
.pay-type-btn.active.alipay {
    border-color: #1677ff;
    background: rgba(22,119,255,0.06);
    color: #1677ff;
}

/* ========== 表单输入 ========== */
.form-control {
    border-radius: var(--radius-sm);
    border: 2px solid #e2e6ec;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: var(--transition);
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13,110,253,0.1);
}
.form-control::placeholder { color: #b8c2d0; }
textarea.form-control { resize: vertical; min-height: 60px; }

/* ========== 提交按钮 ========== */
.submit-btn {
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.875rem;
    border: none;
    letter-spacing: 0.02em;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13,110,253,0.3);
}
.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(13,110,253,0.2);
}
.submit-btn:disabled {
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

/* ========== 排行榜卡片 ========== */
.rank-card {
    border: none;
    box-shadow: var(--shadow-card);
}
.rank-card .card-header {
    font-weight: 700;
    font-size: 0.9375rem;
    padding: 0.875rem 1.25rem;
}
.rank-list-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f2f4f7;
    gap: 10px;
}
.rank-list-item:last-child { border-bottom: none; }
.rank-list-item:hover { background: #f8f9fb; }
.rank-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    background: #f0f2f5;
    color: #8892a4;
}
.rank-num.top1 { background: linear-gradient(135deg, #ffd700, #ffb800); color: #fff; }
.rank-num.top2 { background: linear-gradient(135deg, #e0e0e0, #c0c0c0); color: #fff; }
.rank-num.top3 { background: linear-gradient(135deg, #e8a87c, #cd7f32); color: #fff; }
.rank-info { flex: 1; min-width: 0; }
.rank-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-level {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    color: #fff;
    margin-left: 4px;
    vertical-align: middle;
}
.rank-lifespan {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--accent-color);
    white-space: nowrap;
}

/* Top3 领奖台 */
.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}
.podium-item {
    flex: 1;
    max-width: 160px;
    text-align: center;
}
.podium-card {
    border-radius: var(--radius);
    padding: 1.25rem 0.75rem;
    background: #fff;
    border: 1px solid #eef0f4;
    transition: var(--transition);
}
.podium-card:hover { box-shadow: var(--shadow-hover); }
.podium-item.gold .podium-card {
    border-top: 3px solid #ffd700;
    box-shadow: 0 4px 20px rgba(255,215,0,0.15);
    transform: scale(1.04);
}
.podium-item.silver .podium-card { border-top: 3px solid #c0c0c0; }
.podium-item.bronze .podium-card { border-top: 3px solid #cd7f32; }
.podium-medal { font-size: 2rem; margin-bottom: 0.25rem; }
.podium-name { font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.25rem; }
.podium-lifespan { font-weight: 700; color: var(--accent-color); font-size: 0.875rem; }

/* 排行Tab */
.rank-tabs .btn {
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.375rem 1.125rem;
    border: 2px solid transparent;
}
.rank-tabs .btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.rank-tabs .btn-primary {
    background: var(--primary-color);
}

/* ========== 支付页 ========== */
.pay-card {
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.pay-card .pay-header {
    padding: 1.25rem;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
}
.pay-card .pay-body { padding: 2rem; text-align: center; }
.pay-amount {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.pay-meta {
    font-size: 0.8125rem;
    color: #8892a4;
}
.pay-meta strong { color: #2d3748; }

/* ========== 成功页 ========== */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2.5rem;
}
.success-icon.paid {
    background: rgba(25,135,84,0.08);
    color: #198754;
}
.success-icon.pending {
    background: rgba(108,117,125,0.08);
    color: #6c757d;
}
.success-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.25rem 0;
}
.success-stat { text-align: center; }
.success-stat .value {
    font-size: 1.25rem;
    font-weight: 800;
}
.success-stat .label {
    font-size: 0.75rem;
    color: #8892a4;
    margin-top: 2px;
}

/* ========== Toast提示 ========== */
.toast-wrap {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}
.custom-toast {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: fadeInUp 0.3s ease-out;
    margin-bottom: 0.5rem;
    border-left: 3px solid #10b981;
}
.custom-toast.error { border-left-color: #ef4444; }
.custom-toast i { font-size: 1.125rem; }
.custom-toast.success i { color: #10b981; }
.custom-toast.error i { color: #ef4444; }

/* ========== 加载更多 ========== */
.load-more-btn {
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.5rem 1.5rem;
}

/* ========== 底部 ========== */
.site-footer {
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.8125rem;
    color: #a0aec0;
}

/* ========== 弹窗美化 ========== */
.modal-content { border-radius: var(--radius); border: none; box-shadow: var(--shadow-hover); }
.modal-header { border-bottom: 1px solid #f2f4f7; }
.modal-footer { border-top: 1px solid #f2f4f7; }

/* ========== 未配置提示 ========== */
.pay-unconfigured {
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: #b45309;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.pay-unconfigured i { font-size: 1.125rem; flex-shrink: 0; margin-top: 1px; }

/* ========== 响应式 ========== */
@media (max-width: 575.98px) {
    .site-header h1 { font-size: 1.375rem; }
    .donate-card .card-body { padding: 1.25rem; }
    .amount-grid { gap: 8px; }
    .amount-btn { padding: 0.625rem 0.25rem; font-size: 0.875rem; }
    .podium { gap: 8px; }
    .podium-card { padding: 1rem 0.5rem; }
    .success-stats { gap: 1.25rem; }
}
