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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(-45deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    color: #333;
    padding-bottom: 20px;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Demo标识 */
.demo-banner {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 750px;
    margin: 0 auto;
    padding: 10px;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    color: white;
    position: relative;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateX(-3px);
}

.back-btn:active {
    transform: translateX(-1px);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 15px;
    text-align: center;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 12px 15px;
    backdrop-filter: blur(10px);
}

.ticket-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticket-count .label {
    font-size: 14px;
    opacity: 0.9;
}

.ticket-count .count {
    font-size: 28px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.ticket-count .unit {
    font-size: 14px;
    opacity: 0.9;
}

.claim-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    transition: all 0.3s;
}

.claim-btn:hover {
    transform: scale(1.05);
}

.claim-btn:active {
    transform: scale(0.95);
}

.claim-btn:disabled {
    background: linear-gradient(135deg, #ccc, #999);
    cursor: not-allowed;
    box-shadow: none;
}

/* 信息卡片 */
.info-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-item {
    padding: 8px 0;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item strong {
    color: #667eea;
    font-weight: 600;
}

/* 标签页 */
.tabs-container {
    margin-bottom: 15px;
}

.tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab {
    flex: 1;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

.tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.tab.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 100%);
}

.tab-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 5px;
}

.tab-name {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-time {
    font-size: 12px;
    color: #f5576c;
    font-weight: 600;
}

.tab-progress {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* 商品卡片 */
.product-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.product-badge {
    position: absolute;
    top: 15px;
    right: -30px;
    background: linear-gradient(135deg, #ff6b6b, #f5576c);
    color: white;
    padding: 5px 40px;
    font-size: 12px;
    font-weight: bold;
    transform: rotate(45deg);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.5);
}

.product-image {
    text-align: center;
    padding: 20px 0;
}

.iphone-mockup,
.product-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
}

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

.product-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.product-value {
    font-size: 16px;
    color: #f5576c;
    font-weight: 600;
}

/* 进度条 */
.progress-section {
    margin: 20px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.progress-text {
    font-weight: bold;
    color: #667eea;
}

.progress-bar {
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-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-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}

.time-left {
    color: #f5576c;
    font-weight: 600;
}

/* 我的参与信息 */
.my-participation {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe7d9 100%);
    border: 2px solid #ffd591;
    border-radius: 10px;
    padding: 12px;
    margin: 15px 0;
}

.participation-info {
    display: flex;
    justify-content: space-around;
    font-size: 13px;
    color: #d48806;
}

.participation-info strong {
    color: #f5576c;
    font-size: 16px;
}

/* 收货地址 */
.address-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e6f7ff 100%);
    border: 2px solid #91d5ff;
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
}

.address-tip {
    font-size: 13px;
    color: #1890ff;
    text-align: center;
    padding: 8px;
    background: rgba(24, 144, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: 500;
}

.address-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.address-input {
    padding: 12px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.address-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.address-textarea {
    padding: 12px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.address-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.save-address-btn,
.edit-address-btn {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.save-address-btn:hover,
.edit-address-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.save-address-btn:active,
.edit-address-btn:active {
    transform: translateY(0);
}

.address-info {
    padding: 12px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.address-saved {
    position: relative;
}

.address-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.address-detail {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.address-detail strong {
    color: #667eea;
    margin-right: 10px;
}

.edit-address-btn {
    width: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #666;
    box-shadow: none;
}

/* 操作区域 */
.action-section {
    margin-top: 20px;
}

.ticket-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.ticket-option {
    padding: 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.ticket-option:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.ticket-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.custom-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 10px;
    outline: none;
    transition: all 0.3s;
}

.custom-input:focus {
    border-color: #667eea;
}

.participate-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
}

.participate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.participate-btn:active {
    transform: translateY(0);
}

.participate-btn:disabled {
    background: linear-gradient(135deg, #ccc, #999);
    cursor: not-allowed;
    box-shadow: none;
}

/* 记录区域 */
.records-section {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.records-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

.records-list, .my-records-list {
    max-height: 250px;
    overflow-y: auto;
}

.record-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 只给实时参与的记录添加动画 */
.record-item.live {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.record-item.me {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe7d9 100%);
    border: 1px solid #ffd591;
}

.record-user {
    font-size: 13px;
    color: #666;
}

.record-user.me {
    color: #d48806;
    font-weight: 600;
}

.record-amount {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.record-time {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* 往期记录 */
.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #667eea;
}

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

.history-period {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.history-time {
    font-size: 11px;
    color: #999;
}

.history-winner {
    font-size: 13px;
    color: #667eea;
    margin-bottom: 5px;
}

.history-winner .icon {
    margin-right: 5px;
}

.history-detail {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.empty-tip {
    text-align: center;
    padding: 30px 0;
    color: #ccc;
    font-size: 13px;
}

/* 开奖弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.draw-animation {
    text-align: center;
    padding: 40px 0;
}

.rolling-numbers {
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    font-family: 'Courier New', monospace;
    letter-spacing: 5px;
}

.draw-result {
    text-align: center;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 15px;
    animation: bounce 0.5s ease;
}

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

.result-text {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.result-text.win {
    color: #52c41a;
}

.result-text.lose {
    color: #999;
}

.result-detail {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.close-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:active {
    transform: scale(0.95);
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 2000;
    display: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.toast.show {
    display: block;
    animation: fadeInOut 2s;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    10%, 90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #f093fb);
}

