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

:root {
    --primary-color: #007AFF;
    --primary-light: #5AC8FA;
    --success-color: #34C759;
    --danger-color: #FF3B30;
    --warning-color: #FF9500;
    --text-primary: #1C1C1E;
    --text-secondary: #8E8E93;
    --text-tertiary: #C7C7CC;
    --bg-primary: #F2F2F7;
    --bg-secondary: #FFFFFF;
    --border-color: #E5E5EA;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    padding-bottom: 70px;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

a {
    text-decoration: none;
    color: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-medium);
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #2db64d);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #ff453a);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-medium);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background-color: #ffe5e5;
    color: var(--danger-color);
    border: 1px solid #ffcdd2;
}

.alert-success {
    background-color: #e8f5e9;
    color: var(--success-color);
    border: 1px solid #c8e6c9;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
    color: white;
    padding: 40px 20px 30px;
    border-radius: 0 0 30px 30px;
    text-align: center;
    margin: 0 -16px 20px;
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 20px;
}

.balance-info {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-medium);
    padding: 12px 20px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

.balance-label {
    font-size: 14px;
    opacity: 0.8;
    margin-right: 8px;
}

.balance-amount {
    font-size: 18px;
    font-weight: 700;
}

.language-switch {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
}

.language-switch a {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s ease;
}

.language-switch a.active {
    background: white;
    color: var(--primary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.winners-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-light);
}

.winners-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) var(--bg-primary);
}

.winners-list::-webkit-scrollbar {
    width: 6px;
}

.winners-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 10px;
}

.winners-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

.winners-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.winner-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #fff9f0, #fff5e6);
    border-radius: var(--radius-medium);
    border: 0.5px solid #ffd7a0;
}

.winner-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.winner-info {
    flex: 1;
}

.winner-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.winner-product {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.winner-prize {
    background: linear-gradient(135deg, var(--success-color), #2db64d);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.winner-value {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
}

.products-section {
    margin-bottom: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.product-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    border: 0.5px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.15);
    border-color: var(--primary-light);
}

.product-card:active {
    transform: translateY(-2px) scale(0.98);
}

.product-image-container {
    position: relative;
    height: 140px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.05), transparent);
    pointer-events: none;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.image-placeholder i {
    font-size: 32px;
    margin-bottom: 6px;
    opacity: 0.6;
}

.image-placeholder span {
    font-size: 12px;
}

.image-placeholder.large {
    height: 200px;
}

.image-placeholder.large i {
    font-size: 48px;
}

.category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.category-image {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: linear-gradient(135deg, var(--success-color), #2db64d);
}

.product-content {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.round-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.round-badge {
    background: linear-gradient(135deg, var(--warning-color), #ff7a00);
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(255, 149, 0, 0.3);
}

.history-link {
    color: var(--primary-color);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.history-link:hover {
    color: var(--primary-light);
    transform: translateX(2px);
}

.product-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    text-align: center;
    min-height: 39px; /* 2行文字的高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
}

.progress-bar-container {
    flex: 1;
    height: 4px;
    background: #E5E5EA;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #34C759 0%, #30D158 50%, #2db64d 100%);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.4);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 12px;
    color: var(--success-color);
    white-space: nowrap;
    min-width: 40px;
    text-align: right;
    font-weight: 700;
}

.product-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 0;
}

.product-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 2px 0;
}

.product-price .price-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.product-price .unit {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.8;
}

.join-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    min-width: 90px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    border: none;
}

.join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.join-btn:active {
    transform: translateY(0) scale(0.95);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

.empty-state.small {
    padding: 30px 20px;
}

.empty-state.small i {
    font-size: 40px;
    margin-bottom: 12px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 12px;
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: var(--primary-color);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
    padding-bottom: 0;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-medium);
    position: relative;
    margin: 0 16px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.input-icon input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    font-size: 16px;
    transition: all 0.3s ease;
}

.input-icon input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.detail-page .back-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-light);
}

.back-btn i {
    font-size: 16px;
    color: var(--text-primary);
}

.product-image-section {
    margin-bottom: 16px;
}

.product-image-section .image-container {
    position: relative;
    border-radius: var(--radius-large);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecef 100%);
    min-height: 120px;
}

.product-image-section .product-image {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-info-section {
    margin-bottom: 16px;
}

.info-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    padding: 20px;
    box-shadow: var(--shadow-light);
}

.product-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.info-overview {
    margin-bottom: 16px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.overview-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    border-radius: var(--radius-medium);
    padding: 12px 8px;
    position: relative;
    overflow: hidden;
}

.overview-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    z-index: 0;
}

.overview-item:nth-child(1) {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.overview-item:nth-child(1) .item-value {
    color: #1565c0;
}

.overview-item:nth-child(2) {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
}

.overview-item:nth-child(2) .item-value {
    color: #7b1fa2;
}

.overview-item:nth-child(3) {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
}

.overview-item:nth-child(3) .item-value {
    color: #e65100;
}

.overview-item:nth-child(4) {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.overview-item:nth-child(4) .item-value {
    color: #2e7d32;
}

.overview-item:nth-child(5) {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
}

.overview-item:nth-child(5) .item-value {
    color: #f57f17;
}

.overview-item:nth-child(6) {
    background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
}

.overview-item:nth-child(6) .item-value {
    color: #00838f;
}

.overview-item .item-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    position: relative;
    z-index: 1;
}

.overview-item .item-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: block;
    text-align: center;
    position: relative;
    z-index: 1;
}

.reward-section {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, #f0f4ff, #e6f0ff);
    border-radius: var(--radius-medium);
    border: 1px solid #d0e0ff;
}

.reward-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.reward-header i {
    color: var(--warning-color);
    font-size: 18px;
}

.reward-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.reward-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reward-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-small);
    overflow: hidden;
    background: #f5f5f5;
}

.reward-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reward-image-placeholder {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-small);
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.reward-image-placeholder i {
    font-size: 32px;
}

.currency-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: var(--radius-small);
}

.currency-icon i {
    font-size: 32px;
    color: #fff;
}

.reward-info {
    flex: 1;
}

.reward-product-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.reward-product-count {
    font-size: 14px;
    margin: 0 0 4px 0;
    color: var(--text-secondary);
}

.reward-product-desc {
    font-size: 13px;
    margin: 0;
    color: var(--text-secondary);
}

.progress-section {
    margin-top: 16px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 14px;
    font-weight: 600;
}

.progress-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--success-color);
}

.progress-track {
    height: 8px;
    background: #E5E5EA;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #2db64d);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.purchase-section {
    margin-bottom: 16px;
}

.purchase-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    padding: 20px;
    box-shadow: var(--shadow-light);
}

.purchase-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.balance-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-medium);
    margin-bottom: 16px;
}

.balance-display .balance-label {
    font-weight: 600;
}

.balance-display .balance-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.max-purchase-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #fff3cd;
    border-radius: var(--radius-medium);
    margin-bottom: 16px;
    font-size: 13px;
    color: #856404;
}

.purchase-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-btn:active {
    background: var(--bg-primary);
}

.qty-input {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-medium);
    font-size: 18px;
    font-weight: 700;
}

.qty-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.cost-summary {
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-medium);
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cost-label {
    font-weight: 600;
}

.cost-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--danger-color);
}

.purchase-card.sold-out {
    text-align: center;
    padding: 40px 20px;
}

.purchase-card.sold-out i {
    font-size: 48px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.purchase-card.sold-out h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.purchase-card.sold-out p {
    color: var(--text-secondary);
}

.purchase-card.winner-card {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #fff9f0, #fff5e6);
    border: 2px solid #ffd700;
}

.winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.winner-badge i {
    font-size: 18px;
}

.winner-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.winner-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    border: 3px solid white;
}

.winner-details {
    text-align: left;
}

.winner-username {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.winner-username i {
    color: #ffa500;
}

.winner-ticket {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.winner-ticket i {
    color: #ffa500;
}

.winner-congrats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.winner-congrats i {
    font-size: 18px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.my-tickets-section {
    margin-bottom: 16px;
}

.tickets-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    padding: 20px;
    box-shadow: var(--shadow-light);
}

.tickets-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.tickets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ticket-item {
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-small);
    font-size: 13px;
    font-weight: 600;
}

.ticket-item i {
    color: var(--primary-color);
    margin-right: 6px;
}

.history-link-section {
    margin-bottom: 20px;
}

.order-confirm-page .back-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.order-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.order-header {
    background: linear-gradient(135deg, var(--success-color), #45a049);
    color: white;
    padding: 24px;
    text-align: center;
}

.order-header i {
    font-size: 32px;
    margin-bottom: 12px;
}

.order-header h4 {
    font-size: 20px;
    margin-bottom: 4px;
}

.order-header small {
    opacity: 0.9;
}

.order-summary {
    padding: 20px;
}

.summary-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 16px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item.total {
    border-bottom: none;
    padding-top: 16px;
}

.item-label {
    font-weight: 600;
}

.item-value {
    text-align: right;
}

.total-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--danger-color);
}

.ticket-count-display {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.balance-info-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-medium);
    margin: 16px 0;
}

.balance-sufficient {
    color: var(--success-color);
    font-weight: 700;
}

.balance-insufficient {
    color: var(--danger-color);
    font-weight: 700;
}

.warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--radius-medium);
    padding: 16px;
    margin: 16px 0;
}

.warning-box i {
    color: var(--warning-color);
    margin-right: 8px;
}

.warning-box p {
    margin-top: 8px;
    font-size: 13px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.error-state {
    text-align: center;
    padding: 40px 20px;
}

.error-state i {
    font-size: 48px;
    color: var(--warning-color);
    margin-bottom: 16px;
}

.error-state p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.success-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0;
}

.success-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-medium);
    max-width: 400px;
    width: 100%;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success-color), #2db64d);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.success-icon i {
    font-size: 40px;
    color: white;
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--success-color);
}

.success-info {
    margin-bottom: 24px;
}

.success-info .product-name {
    font-size: 18px;
    margin-bottom: 8px;
}

.success-info .purchase-count {
    color: var(--text-secondary);
}

.tickets-display {
    background: var(--bg-primary);
    border-radius: var(--radius-medium);
    padding: 16px;
    margin-bottom: 24px;
}

.tickets-display h3 {
    font-size: 14px;
    margin-bottom: 12px;
}

.ticket-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ticket-numbers .ticket-number {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-small);
    font-weight: 600;
    font-size: 14px;
}

.good-luck {
    font-size: 18px;
    font-weight: 600;
    color: var(--warning-color);
    margin-bottom: 24px;
}

.good-luck i {
    margin-right: 8px;
}

.profile-page .profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%);
    color: white;
    padding: 40px 20px 30px;
    border-radius: 0 0 30px 30px;
    text-align: center;
    margin: 0 -16px 20px;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.user-avatar i {
    font-size: 36px;
}

.profile-header .username {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.balance-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-medium);
    padding: 16px 24px;
    display: inline-block;
}

.balance-card .balance-label {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.balance-card .balance-value {
    font-size: 24px;
    font-weight: 700;
}

.section {
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-light);
}

.section .section-title {
    font-size: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section .section-title i {
    color: var(--primary-color);
}

.ticket-card {
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-medium);
    margin-bottom: 8px;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ticket-header .ticket-number {
    font-weight: 700;
    color: var(--primary-color);
}

.ticket-header .ticket-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.ticket-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-body .product-name {
    font-size: 14px;
}

.ticket-body .round-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.win-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #fff9f0, #fff5e6);
    border-radius: var(--radius-medium);
    margin-bottom: 8px;
    border: 0.5px solid #ffd7a0;
}

.win-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    display: flex;
    align-items: center;
    justify-content: center;
}

.win-icon i {
    font-size: 24px;
    color: white;
}

.win-info {
    flex: 1;
}

.win-info .product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.win-info .win-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 4px;
}

.win-info .win-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.win-card.claimed {
    opacity: 0.7;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border-color: #d0d0d0;
}

.claim-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--success-color), #2db64d);
    color: white;
    border-radius: var(--radius-medium);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
}

.claim-btn i {
    font-size: 16px;
}

.claimed-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-medium);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.claimed-badge i {
    color: var(--success-color);
    font-size: 16px;
}

.logout-section {
    margin-top: 20px;
}

.history-page .back-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-large);
    padding: 16px;
    box-shadow: var(--shadow-light);
}

.history-card.completed {
    border-left: 4px solid var(--success-color);
}

.history-card.active {
    border-left: 4px solid var(--primary-color);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-header .round-number {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.history-header .round-number i {
    color: var(--primary-color);
}

.history-body .info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.info-row .label {
    color: var(--text-secondary);
}

.info-row .value.ticket {
    font-weight: 700;
    color: var(--success-color);
}

@media (max-width: 320px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.wallet-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-medium);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 10px;
}

.wallet-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.wallet-card i {
    font-size: 28px;
}

.wallet-card span {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.category-filter {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.category-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-item[data-category]:not([data-category="all"]).active {
    background: var(--cat-color, var(--primary-color));
    border-color: var(--cat-color, var(--primary-color));
}

.product-card.hidden {
    display: none;
}
