/* ===== 全局变量：清新马卡龙风（新卡片版） ===== */
:root {
    --bg-gradient: linear-gradient(145deg, #ffe9f4 0%, #e0f2fe 100%);
    --card-bg: #ffffff;
    --text-primary: #3b3b5c;
    --text-secondary: #5e5e7a;
    --text-muted: #8a8aa3;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.03), 0 5px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 20px 30px -8px rgba(255, 150, 200, 0.2), 0 10px 15px -5px rgba(150, 200, 255, 0.15);
    --border-light: rgba(0, 0, 0, 0.03);
    
    --primary-pink: #ff9eb5;
    --primary-blue: #7ab2ff;
    --pink-soft: #ffd9e4;
    --blue-soft: #c5e0ff;
    --gold: #ffd166;
    --silver: #c0c0c0;
    --bronze: #e9b282;
    
    --radius-card: 28px;
    --radius-btn: 40px;
    --transition: all 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px 12px;
    line-height: 1.4;
}

.app {
    max-width: 800px;
    margin: 0 auto;
}

/* ===== 顶部 ===== */
.header-section {
    text-align: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 2.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff89b3, #6aa9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
    text-shadow: 0 5px 15px rgba(255, 150, 200, 0.2);
}

.stat-bar {
    background: white;
    border-radius: 50px;
    padding: 10px 24px;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.stat-bar i {
    color: #ff89b3;
    margin-right: 6px;
}

.action-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 28px;
    border-radius: var(--radius-btn);
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-light);
    color: white;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-submit {
    background: linear-gradient(145deg, #ff9eb5, #ff89b3);
}

.btn-sponsor {
    background: linear-gradient(145deg, #7ab2ff, #6aa9ff);
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* ===== 赞助名单（新卡片风格） ===== */
.sponsor-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-item {
    background: var(--card-bg);
    border-radius: var(--radius-card);
    padding: 18px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    animation: floatIn 0.6s ease forwards;
    overflow: hidden;
}

.list-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(255, 150, 200, 0.3);
}

/* 前三名左侧彩色细条 */
.list-item.rank-1::before,
.list-item.rank-2::before,
.list-item.rank-3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 5px;
    border-radius: 0 5px 5px 0;
}
.list-item.rank-1::before {
    background: var(--gold);
}
.list-item.rank-2::before {
    background: var(--silver);
}
.list-item.rank-3::before {
    background: var(--bronze);
}

.item-rank {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.02);
    border: 2px solid white;
}
.rank-gold {
    color: var(--gold);
}
.rank-silver {
    color: var(--silver);
}
.rank-bronze {
    color: var(--bronze);
}
.rank-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
    background: #f5f5f5;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.item-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 8px 12px -6px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.info-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.info-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-pink);
    background: var(--pink-soft);
    padding: 4px 14px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid white;
}

.info-amount i {
    font-size: 0.9rem;
}

.info-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
    word-break: break-word;
    background: transparent;
    padding: 0;
}

.info-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: var(--radius-card);
    color: var(--text-muted);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.empty-state i {
    font-size: 3rem;
    background: linear-gradient(145deg, #ff9eb5, #7ab2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

/* ===== 分页 ===== */
.pagination-wrap {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}
.pagination {
    display: flex;
    gap: 8px;
    list-style: none;
    background: white;
    padding: 8px 18px;
    border-radius: 50px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}
.pagination a, .pagination span {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.95rem;
}
.pagination a:hover {
    background: var(--pink-soft);
    transform: scale(1.1);
}
.pagination .active {
    background: linear-gradient(145deg, #ff9eb5, #7ab2ff);
    color: white;
    border: 2px solid white;
}

/* ===== 弹窗 ===== */
.modal-content {
    background: white;
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 18px 24px;
}

.modal-title {
    font-weight: 700;
    background: linear-gradient(145deg, #ff89b3, #6aa9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    opacity: 0.6;
    transition: var(--transition);
    color: #ff89b3;
}
.btn-close:hover {
    opacity: 1;
    transform: rotate(180deg) scale(1.2);
}

.modal-body {
    padding: 24px;
}

/* 二维码网格 */
.qr-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}
.qr-item {
    text-align: center;
    width: 120px;
}
.qr-label {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    background: var(--pink-soft);
    padding: 3px 10px;
    border-radius: 30px;
    display: inline-block;
}
.qr-img {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 20px;
    background: white;
    padding: 8px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
}
.qr-img:hover {
    transform: scale(1.06) rotate(1deg);
    box-shadow: var(--shadow-hover);
}
.qr-placeholder {
    width: 100%;
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 20px;
    color: var(--text-muted);
    border: 1px dashed var(--border-light);
    font-size: 0.85rem;
}
.qr-hint {
    font-size: 0.75rem;
    color: #ff89b3;
    margin-top: 6px;
    display: block;
}
.qr-tip {
    background: var(--blue-soft);
    padding: 14px 18px;
    border-radius: 30px;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-align: center;
    border: 1px solid white;
    margin-top: 16px;
    font-weight: 500;
}

/* 表单 */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.form-group {
    flex: 1 1 200px;
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.required {
    color: #ff6b8b;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: #fafafa;
    border: 1px solid var(--border-light);
    border-radius: 30px;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: #ff9eb5;
    box-shadow: 0 0 0 3px rgba(255, 158, 181, 0.1);
}
.preview-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-top: 10px;
    border: 3px solid white;
    box-shadow: var(--shadow-soft);
    object-fit: cover;
    display: none; /* 默认隐藏 */
}
.preview-img {
    max-height: 100px;
    border-radius: 20px;
    margin-top: 10px;
    border: 1px solid var(--border-light);
    padding: 4px;
    background: white;
    box-shadow: var(--shadow-soft);
    display: none; /* 默认隐藏 */
}
.btn-submit-form {
    width: 100%;
    padding: 14px;
    background: linear-gradient(145deg, #ff9eb5, #7ab2ff);
    color: white;
    border: none;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid white;
}
.btn-submit-form:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.btn-submit-form:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== 二维码预览弹窗（图片强制居中） ===== */
#qrPreviewModal .modal-dialog {
    max-width: 340px;
}
#qrPreviewModal .modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
}
#qrPreviewModal .modal-body {
    padding: 0;
    border-radius: 28px;
    overflow: hidden;
    background: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: center;
}
#qrPreviewImg {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 100%;
    height: auto;
    border-radius: 28px 28px 0 0;
}

/* 右上角圆形关闭按钮 */
.close-preview-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #ff89b3;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    z-index: 10;
}
.close-preview-btn:hover {
    background: white;
    transform: scale(1.15) rotate(90deg);
}

/* ===== 轻提示样式 ===== */
.toast-box {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: white;
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 1rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    max-width: 90vw;
    white-space: normal;
    word-break: break-word;
    text-align: center;
}
.toast-box.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast-box i {
    margin-right: 6px;
}

/* 动画 */
@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 响应式 */
@media (max-width: 480px) {
    .page-title {
        font-size: 2rem;
    }
    .stat-bar {
        font-size: 1rem;
        padding: 8px 20px;
    }
    .btn {
        padding: 10px 24px;
        font-size: 1rem;
    }
    .list-item {
        flex-wrap: wrap;
        padding: 16px;
    }
    .item-rank {
        width: 44px;
        height: 44px;
    }
    .rank-badge {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }
    .rank-number {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    .item-avatar {
        width: 52px;
        height: 52px;
    }
    .info-name {
        font-size: 1.1rem;
    }
    .info-amount {
        font-size: 0.9rem;
        padding: 4px 12px;
    }
    .info-message {
        font-size: 0.9rem;
    }
}