:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --light-bg: #f4f7f9;
    --white-bg: #fff;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    margin: 0;
    overflow-x: hidden;
}

/* ========== 页面头部 ========== */
.page-header {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid var(--border-color);
    height: 56px;
    font-size: 1.45rem;
    font-weight: 600;
    padding-left: 8px;
    letter-spacing: 0.4px;
    color: white;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.3s;
    display: inline-block;
    margin-right: 15px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.page-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

/* ========== 容器 ========== */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
}

.content {
    padding: 0 20px 20px 20px;
}

/* ========== 资产面板 ========== */
.assets-panel {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.asset-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 10px;
    border-radius: 8px;
    white-space: nowrap;
    /* 防止折行 */
}

.asset-item:hover {
    transform: translateY(-2px);
    background: rgba(102, 126, 234, 0.05);
}

.asset-icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
    /* 防止图标缩小 */
}

.asset-details {
    display: flex;
    align-items: baseline;
    /* 基线对齐 */
    gap: 4px;
    white-space: nowrap;
    /* 防止折行 */
}

.asset-details .value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.asset-details .unit {
    font-size: 1.5rem;
    color: #6c757d;
    line-height: 1;
}

/* ========== 奖品面板 ========== */
.prizes-panel {
    flex: 1;
}

.filter-bar {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 20px;
    /* 从 14px 改为 16px */
    font-weight: 600;
    /* 从 500 改为 600 */
    transition: all 0.3s;
    color: #333;
    white-space: nowrap;
    /* 防止折行 */
}

.filter-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.prize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.prize-card {
    background: white;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    border: 1px solid #f0f0f0;
}

.prize-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.prize-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.prize-name {
    font-weight: 600;
    font-size: 16px;
    /* 从 14px 改为 16px */
    color: #333;
    margin-bottom: 5px;
    line-height: 1.3;
    white-space: nowrap;
    /* 防止折行 */
    overflow: hidden;
    text-overflow: ellipsis;
    /* 超长显示省略号 */
}

.prize-quantity {
    font-size: 13px;
    color: #667eea;
    font-weight: bold;
}

.no-prizes {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* ========== 模态框通用样式 (Synced with index.css) ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2000;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--white-bg);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    /* var(--shadow-lg) */
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    margin: 0 0 20px;
    color: #333;
    /* var(--text-color) */
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-content p {
    margin: 15px 0;
    color: #666;
    line-height: 1.6;
}

.modal-content label {
    display: block;
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.modal-content input[type="number"] {
    width: 100px;
    font-size: 1.5rem;
    text-align: center;
    padding: 10px;
    margin: 1rem 0;
    border: 2px solid #e9ecef;
    /* var(--border-color) */
    border-radius: 8px;
    transition: border-color 0.3s;
}

.modal-content input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    /* var(--primary-color) */
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 数量选择器样式调整 */
.quantity-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.quantity-selector button {
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.quantity-selector button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.quantity-selector span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

/* 按钮区域 (Synced with index.css) */
.modal-buttons {
    display: flex !important;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    width: 100%;
    flex-flow: row nowrap !important;
    /* 强制不换行 */
}

.modal-btn {
    flex: 1 1 0;
    /* 允许收缩和扩展，基准为0 */
    padding: 10px 8px;
    /* 进一步减小内边距 */
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    /* 稍微减小字体 */
    font-weight: 600;
    transition: all 0.3s;
    min-width: 60px;
    /* 设置更小的最小宽度 */
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.confirm-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cancel-btn {
    background: #e9ecef;
    color: #333;
    /* var(--text-color) */
}

.cancel-btn:hover {
    background: #dee2e6;
}

/* ========== Toast 提示 ========== */
.toast-notification {
    position: fixed;
    top: 50%;
    /* 垂直居中 */
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #28a745, #20c997);
    /* 渐变绿 */
    color: white;
    padding: 16px 32px;
    border-radius: 30px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: 1.1rem;
    font-weight: 500;
    z-index: 9999;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    bottom: auto !important;
    right: auto !important;
}

.toast-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    /* 保持居中并缩放 */

}

.toast-notification.error {
    background: rgba(220, 53, 69, 0.9);
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .page-header {
        font-size: 1.16rem;
        height: 50px;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .content {
        padding: 0 10px 10px 10px;
    }

    .asset-icon {
        font-size: 2.5rem;
    }

    .asset-details .value {
        font-size: 1.6rem;
    }

    .assets-panel {
        padding: 15px 10px;
        gap: 10px;
    }

    .asset-item {
        gap: 10px;
        padding: 8px;
    }

    .filter-btn {
        padding: 4px 10px;
        font-size: 20px;
        /* 移动端稍小一点 */
    }


    .prize-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }

    .prize-card {
        padding: 15px 10px;
    }

    .prize-icon {
        font-size: 2.5rem;
    }

    .prize-name {
        font-size: 18px;
        /* 移动端稍小一点 */
    }

    .modal-content {
        padding: 25px 20px;
    }

    .modal-content h3 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0;
    }

    .filter-bar {
        gap: 8px;
    }

    .filter-btn {
        padding: 4px 10px;
        font-size: 18px;
    }

    .prize-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}

.prize-card {
    background: white;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    border: 1px solid #f0f0f0;
}

/* 数量角标 */
.prize-card .prize-quantity {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px; /* Increased from 12px */
    font-weight: bold;
    padding: 4px 10px; /* Increased padding */
    border-radius: 12px;
    min-width: 28px; /* Increased min-width */
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Added shadow */
}