/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --primary-dark: #e55a2b;
    --secondary-color: #ffd93d;
    --accent-color: #ff4757;
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --text-light: #ffffff;
    --text-muted: #b8b8b8;
    --card-bg: rgba(255, 255, 255, 0.1);
    --border-radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-light);
    overflow-x: hidden;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
    position: relative;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 20px 0;
    position: relative;
}

.title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: brightness(1); }
    to { filter: brightness(1.2); }
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 1rem;
    font-weight: 600;
}

.user-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

#chancesCount {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

/* 转盘容器 */
.wheel-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto 24px;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 
        0 0 0 8px rgba(255, 255, 255, 0.1),
        0 0 0 16px rgba(255, 107, 53, 0.2),
        var(--shadow);
}

/* 转盘指针 */
.wheel-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wheel-pointer:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.wheel-pointer.spinning {
    pointer-events: none;
}

.pointer-triangle {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 30px solid var(--accent-color);
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.pointer-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    box-shadow: 
        0 4px 15px rgba(255, 107, 53, 0.4),
        inset 0 -2px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

/* 抽奖按钮 */
.spin-btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 24px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.spin-btn:disabled {
    background: linear-gradient(135deg, #666, #888);
    cursor: not-allowed;
    box-shadow: none;
}

.spin-btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.spin-btn:hover:not(:disabled) .btn-glow {
    left: 100%;
}

/* 验证区域 */
.verify-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.verify-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--secondary-color);
}

.verify-form {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.verify-form input {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-light);
    outline: none;
    transition: border-color 0.3s ease;
}

.verify-form input::placeholder {
    color: var(--text-muted);
}

.verify-form input:focus {
    border-color: var(--primary-color);
}

.verify-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.verify-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.verify-tip {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #2d2d44, #1a1a2e);
    border-radius: 20px;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 20px 16px;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 71, 87, 0.2));
}

.modal-header h2 {
    font-size: 1.3rem;
    color: var(--secondary-color);
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.prize-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.prize-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.prize-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
}

.modal-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--text-light);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 兑换指引样式 */
.claim-content .modal-body {
    text-align: left;
}

.claim-steps {
    margin-bottom: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.step:last-child {
    margin-bottom: 0;
}

.step-num {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-text h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-light);
}

.step-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.claim-code {
    color: var(--secondary-color);
    font-weight: 700;
    font-family: monospace;
    font-size: 1rem;
}

.claim-notice {
    background: rgba(255, 107, 53, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
}

.claim-notice p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.claim-notice p:last-child {
    margin-bottom: 0;
}

/* 中奖记录 */
.records-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.records-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--secondary-color);
}

.records-list {
    max-height: 200px;
    overflow-y: auto;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
}

.record-item:last-child {
    margin-bottom: 0;
}

.record-icon {
    font-size: 1.5rem;
}

.record-info {
    flex: 1;
}

.record-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.record-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.record-status {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.record-status.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.record-status.claimed {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.no-records {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 20px;
}

/* 活动规则 */
.rules-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rules-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--secondary-color);
}

.rules-list {
    list-style: none;
}

.rules-list li {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-left: 20px;
    position: relative;
    margin-bottom: 10px;
    line-height: 1.5;
}

.rules-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 20px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-light);
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 0.95rem;
    z-index: 2000;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.toast.active {
    transform: translate(-50%, -50%) scale(1);
}

/* 响应式设计 */
@media (max-width: 380px) {
    .wheel-container {
        width: 280px;
        height: 280px;
    }
    
    #wheelCanvas {
        width: 280px;
        height: 280px;
    }
    
    .title {
        font-size: 1.7rem;
    }
    
    .pointer-circle {
        width: 70px;
        height: 70px;
        font-size: 0.7rem;
    }
}

@media (min-width: 481px) {
    .container {
        padding: 30px 24px;
    }
    
    .wheel-container {
        width: 360px;
        height: 360px;
    }
    
    #wheelCanvas {
        width: 360px;
        height: 360px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.5);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 53, 0.7);
}

/* 禁用文本选择 */
.wheel-pointer,
.spin-btn,
.verify-btn,
.modal-btn {
    user-select: none;
    -webkit-user-select: none;
}
