/* ============================================
   💎 优雅乞讨 - 现代玻璃拟态设计
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f0e8 !important;
    overflow-x: hidden;
    position: relative;
}
/* ---- 飘落金币 ---- */
.coins-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.falling-coin {
    position: absolute;
    top: -50px;
    animation: coinFall linear forwards;
    opacity: 0.5;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.3));
}

@keyframes coinFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
    70% { opacity: 0.5; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ---- 主容器 ---- */
.main-container {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

/* =============================================
   🏦 主卡片 - 玻璃拟态
   ============================================= */
.begging-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 32px 26px;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

/* 顶部装饰光晕 */
.begging-card::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.12), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ---- 头像区域 ---- */
.beggar-avatar-section {
    text-align: center;
    margin-bottom: 16px;
    position: relative;
}

.beggar-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin: 0 auto 12px;
    border: 4px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.2);
    position: relative;
    animation: float 3s ease-in-out infinite;
    background-size: cover !important;
    background-position: center !important;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 头像光晕环 */
.beggar-avatar::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #f6d365, #ff6b6b, #f6d365) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: spin 4s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 在线状态 */
.beggar-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px;
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.12), rgba(39, 174, 96, 0.06));
    border-radius: 20px;
    font-size: 13px;
    color: #27ae60;
    font-weight: 500;
    margin-bottom: 10px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #27ae60;
    border-radius: 50%;
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(39, 174, 96, 0); }
}

.beggar-name {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 1px;
}

/* ---- 乞讨故事 ---- */
.begging-story {
    background: linear-gradient(135deg, #fffbf0, #fff6e0);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 20px;
    border: 1px solid rgba(253, 203, 110, 0.3);
    position: relative;
}

.begging-story .story-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.begging-story p {
    color: #6b5b3e;
    font-size: 15px;
    line-height: 1.8;
}

/* ---- 筹款进度 ---- */
.fundraising-progress {
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    color: #999;
}

.progress-bar {
    height: 10px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #f6d365, #fda085, #f6d365);
    background-size: 200% 100%;
    animation: shimmer 2.5s ease-in-out infinite;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.total-donated {
    text-align: center;
}

.total-donated .amount {
    font-size: 38px;
    font-weight: 800;
    background: linear-gradient(135deg, #f6d365, #fda085, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

/* ---- 捐赠区域 ---- */
.donation-section {
    position: relative;
}

.donation-title {
    text-align: center;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #555;
    letter-spacing: 2px;
}

/* ============================================
   🎁 捐赠商品卡片网格
   ============================================ */
.donation-items {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.donation-item {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 18px;
    padding: 18px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

/* 选中光效 */
.donation-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    background: linear-gradient(135deg, rgba(246, 211, 101, 0.1), rgba(253, 160, 133, 0.1));
}

.donation-item:hover {
    border-color: #f6d365;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(246, 211, 101, 0.2);
}

.donation-item.active {
    border-color: #f6d365;
    background: linear-gradient(135deg, #fffbf0, #fff6e0);
    box-shadow: 0 8px 30px rgba(246, 211, 101, 0.3);
    transform: translateY(-3px);
}

.donation-item.active::after {
    opacity: 1;
}

.donation-item .item-icon {
    font-size: 34px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.donation-item .item-name {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.donation-item .item-price {
    font-size: 16px;
    font-weight: 700;
    color: #ff6b6b;
    position: relative;
    z-index: 1;
}

.item-custom {
    border-style: dashed;
    border-color: #ddd;
}

.item-custom .item-price {
    font-size: 11px;
    color: #aaa;
}

/* ---- 自定义金额按钮 ---- */
.custom-amount-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 22px;
    border: 1px solid #d0c8c0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: #fafafa;
    margin-bottom: 14px;
}

.custom-amount-btn:hover {
    border-color: #f6d365;
    background: rgba(246, 211, 101, 0.06);
    transform: translateY(-2px);
}

.custom-amount-btn.active {
    border-style: solid;
    border-color: #f6d365;
    background: linear-gradient(135deg, #fffbf0, #fff6e0);
    box-shadow: 0 4px 15px rgba(246, 211, 101, 0.2);
}

.custom-amount-btn .custom-btn-icon {
    font-size: 18px;
}

.custom-amount-btn .custom-btn-text {
    font-size: 14px;
    font-weight: 500;
    color: #888;
}

.custom-amount-btn.active .custom-btn-text {
    color: #d4a050;
}

/* ---- 自定义金额输入 ---- */
.custom-amount-wrapper {
    margin-bottom: 14px;
    animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- 选中金额显示 ---- */
.selected-amount-display {
    text-align: center;
    padding: 10px;
    margin-bottom: 14px;
    font-size: 18px;
    color: #ff6b6b;
    min-height: 40px;
}

/* ============================================
   📝 表单样式
   ============================================ */
.form-group {
    margin-bottom: 12px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.25s;
    outline: none;
    font-family: inherit;
    background: #fafafa;
}

.form-input:focus {
    border-color: #f6d365;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(246, 211, 101, 0.12);
}

.form-input::placeholder {
    color: #bbb;
}

.form-textarea {
    min-height: 70px;
    resize: vertical;
}

/* ---- 支付方式 ---- */
.payment-options {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.payment-option {
    flex: 1;
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.payment-label {
    display: block;
    padding: 12px;
    text-align: center;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s;
    background: #fafafa;
}

.payment-option input:checked + .payment-label {
    border-color: #f6d365;
    background: linear-gradient(135deg, #fffbf0, #fff6e0);
    box-shadow: 0 4px 15px rgba(246, 211, 101, 0.2);
}

/* ---- 支付方式不可用提示 ---- */
.no-payment-tip {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.06);
    border: 1px dashed #e74c3c;
    border-radius: 12px;
    font-weight: 500;
}

/* ---- 捐赠按钮 ---- */
.btn-donate {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 25px rgba(253, 160, 133, 0.35);
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.btn-donate::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-donate:hover:not(:disabled)::after {
    left: 100%;
}

.btn-donate:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(253, 160, 133, 0.45);
}

.btn-donate:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-donate:disabled {
    background: #ddd;
    cursor: not-allowed;
    box-shadow: none;
}

/* ============================================
   📜 施主芳名录
   ============================================ */
.donor-list-wrap {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 22px;
    margin-top: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.donor-list-title {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

/* ---- 标签切换 ---- */
.tab-bar {
    display: flex;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 18px;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
}

.tab-item.active {
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(253, 160, 133, 0.3);
}

/* ---- 捐赠卡片 ---- */
.donor-card {
    background: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f3f3f3;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.donor-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transform: translateX(3px);
}

.donor-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #fffbf0, #fff3cd);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.donor-info {
    flex-shrink: 0;
    min-width: 0;
    max-width: 170px;
}

.donor-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.donor-region {
    font-size: 11px;
    color: #aaa;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.donor-amount {
    font-size: 16px;
    font-weight: 700;
    color: #ff6b6b;
    white-space: nowrap;
    flex-shrink: 0;
}

.donor-time {
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
    flex-shrink: 0;
}

.donor-msg {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    flex-shrink: 1;
    min-width: 0;
}

/* ---- 榜单卡片 ---- */
.donor-rank {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.rank-num {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #999;
}

.donor-count {
    display: block;
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

/* ---- 空状态 ---- */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #bbb;
    font-size: 15px;
}

/* ============================================
   🎉 弹窗
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    max-width: 90%;
    width: 340px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(40px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-icon {
    font-size: 60px;
    margin-bottom: 16px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.modal-content h3 {
    font-size: 22px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.modal-content p {
    color: #999;
    margin-bottom: 24px;
}

.btn-modal-close {
    padding: 12px 36px;
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(253, 160, 133, 0.3);
}

.btn-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(253, 160, 133, 0.4);
}

/* ============================================
   ⚠️ 支付方式不可用提示（内嵌）
   ============================================ */
.pay-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #fff5f5, #fff0e0);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 12px;
    font-size: 15px;
    color: #e74c3c;
    font-weight: 500;
    animation: payTipIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes payTipIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.pay-tip-icon {
    font-size: 18px;
}

/* ============================================
   🎵 音乐播放器
   ============================================ */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.music-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #f6d365, #fda085);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(253, 160, 133, 0.4);
    transition: all 0.3s;
    animation: musicFloat 3s ease-in-out infinite;
}

@keyframes musicFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.music-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(253, 160, 133, 0.5);
}

/* ============================================
   📄 底部文字
   ============================================ */
.footer-text {
    text-align: center;
    margin-top: 30px;
    color: #333;
    font-size: 14px;
    line-height: 1.8;
}

/* ============================================
   📱 响应式适配
   ============================================ */
@media (max-width: 480px) {
    .music-player {
        top: 14px;
        right: 14px;
        bottom: auto;
    }

    .music-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .main-container {
        padding: 12px 10px 24px;
    }

    .begging-card {
        padding: 20px 14px;
        border-radius: 20px;
    }

    .beggar-avatar {
        width: 80px;
        height: 80px;
    }

    .beggar-name {
        font-size: 20px;
    }

    .total-donated .amount {
        font-size: 26px;
    }

    .progress-info {
        font-size: 12px;
    }

    .donation-items {
        gap: 8px;
        margin-bottom: 14px;
    }

    .donation-item {
        padding: 12px 4px;
        border-radius: 12px;
    }

    .donation-item .item-icon {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .donation-item .item-name {
        font-size: 11px;
    }

    .donation-item .item-price {
        font-size: 13px;
    }

    .donation-title {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .selected-amount-display {
        font-size: 15px;
        padding: 6px;
        min-height: 32px;
    }

    .form-input {
        padding: 11px 14px;
        font-size: 14px;
    }

    .btn-donate {
        padding: 14px;
        font-size: 16px;
        border-radius: 14px;
    }

    .custom-amount-btn {
        padding: 6px 18px;
    }

    .donor-list-wrap {
        padding: 16px 12px;
        border-radius: 18px;
    }

    .donor-list-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .tab-item {
        font-size: 13px;
        padding: 8px 0;
    }

    .donor-card {
        padding: 9px 12px;
        gap: 8px;
        border-radius: 12px;
    }

    .donor-icon {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .donor-name {
        font-size: 12px;
    }

    .donor-amount {
        font-size: 14px;
    }

    .donor-time {
        font-size: 10px;
    }

    .donor-msg {
        font-size: 10px;
    }

    .donor-rank {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .rank-num {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .empty-state {
        font-size: 13px;
        padding: 20px 16px;
    }

    .footer-text {
        font-size: 12px;
        margin-top: 20px;
    }

    .modal-content {
        padding: 28px 18px;
        width: 90%;
    }
}
