/* ========== 基础样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 50%, #FFD93D 100%);
    min-height: 100vh;
    color: #333;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 15px;
    min-height: 100vh;
}

/* ========== 错误提示 ========== */
.error-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: #FF4444;
    color: #fff;
    text-align: center;
    padding: 12px;
    z-index: 9999;
    font-size: 14px;
}

/* ========== 头部 ========== */
.header {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.campaign-name { font-size: 18px; font-weight: bold; color: #FF6B6B; }
.user-info { margin-top: 8px; font-size: 13px; color: #666; }
.user-info strong { color: #333; }

.divider {
    margin: 0 8px;
    color: #ddd;
}

/* ========== 转盘 ========== */
.wheel-section {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.wheel-container {
    position: relative;
    width: 320px;
    height: 320px;
}

.wheel-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0,0,0,0.2), 0 0 0 8px #fff, 0 0 0 12px #FFD93D;
    overflow: hidden;
    background: #fff;
}

#wheel-canvas { display: block; width: 100%; height: 100%; }

.wheel-pointer {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    color: #FF4444;
    font-size: 44px;
    z-index: 100;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
    line-height: 1;
    pointer-events: none;
}

/* ========== 状态栏 ========== */
.status-bar {
    display: flex;
    justify-content: space-around;
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.status-item { text-align: center; }
.status-item .label {
    display: block; font-size: 12px; color: #999; margin-bottom: 4px;
}
.status-item .value {
    display: block; font-size: 24px; font-weight: bold; color: #FF6B6B;
}

/* ========== 抽奖按钮 ========== */
.draw-button {
    display: block; width: 100%; padding: 16px;
    font-size: 20px; font-weight: bold; color: #fff;
    background: linear-gradient(135deg, #FF4444, #FF6B6B);
    border: none; border-radius: 50px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,68,68,0.4);
    transition: all .3s; margin-bottom: 15px;
}
.draw-button:active { transform: scale(.96); }
.draw-button:disabled { background: #ccc; cursor: not-allowed; box-shadow: none; transform: none; }
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255,68,68,0.3);
}

.draw-button:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    color: #999;
}

/* ========== 我的奖品入口 ========== */
.my-prizes-link {
    display: block;
    text-align: center;
    color: #fff;
    font-size: 16px;
    text-decoration: none;
    padding: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

/* ========== 弹窗 ========== */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 30px 25px;
    width: 100%;
    max-width: 360px;
    position: relative;
    text-align: center;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.prize-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.prize-result h2 {
    font-size: 22px;
    color: #FF6B6B;
    margin-bottom: 8px;
}

.prize-name-display {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
    font-weight: bold;
}

.prize-sub {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

.claim-tip {
    font-size: 13px;
    color: #FF8C42;
    margin-bottom: 15px;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 12px;
}

.form-group input[type="tel"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    outline: none;
}

.form-group input:focus {
    border-color: #FF6B6B;
}

.code-row {
    display: flex;
    gap: 10px;
}

.code-row input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    outline: none;
}

.btn-code {
    padding: 12px 16px;
    background: #FFD93D;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
}

.btn-code:disabled {
    background: #eee;
    color: #999;
    cursor: not-allowed;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #FF4444, #FF6B6B);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.btn-primary:active {
    transform: scale(0.97);
}

.lock-tip {
    font-size: 12px;
    color: #FF8C42;
    margin-top: 15px;
}

/* ========== 领取结果 ========== */
.result-info {
    background: #FFF8F0;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
    font-size: 14px;
    line-height: 2;
}

.claim-code {
    display: inline-block;
    background: #FFD93D;
    color: #333;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 2px;
}

/* ========== 加载动画 ========== */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: autoHide 4s forwards;
}

@keyframes autoHide {
    0%, 90% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #FF6B6B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #999;
    font-size: 14px;
}
