/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.container {
    text-align: center;
    padding: 20px;
    max-width: 800px;
    width: 100%;
}

/* 标题样式 */
.title {
    font-size: 3em;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.subtitle {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 转盘容器 */
.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto 40px;
}

/* 转盘主体 - SVG */
.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: #fff;
}

/* SVG转盘内的文字样式 */
.wheel text {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    user-select: none;
}

/* 转盘扇形悬停效果 */
.wheel-section path {
    transition: opacity 0.2s ease;
}

.wheel-section:hover path {
    opacity: 0.9;
}

/* 指针 */
.pointer {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #FFD700;
    z-index: 10;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
}

.pointer::after {
    content: '▼';
    position: absolute;
    top: -35px;
    left: -10px;
    color: #FFD700;
    font-size: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 中心按钮 */
.spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 4px solid white;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 5;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.spin-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.spin-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.spin-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* 旋转动画类 */
.spinning {
    animation: spin 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(var(--rotation));
    }
}

/* 结果显示区域 */
.result {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.5s ease;
}

.result.show {
    transform: scale(1);
    opacity: 1;
}

.result h2 {
    color: #764ba2;
    margin-bottom: 10px;
}

.result h2 span {
    color: #FF6B6B;
    font-size: 1.2em;
}

#resultDescription {
    color: #666;
    font-size: 1.1em;
    margin-top: 10px;
}

/* 历史记录 */
.history {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px;
    margin: 20px auto;
    max-width: 500px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history h3 {
    color: #764ba2;
    margin: 0;
}

.clear-history-btn {
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.clear-history-btn:hover {
    background: linear-gradient(135deg, #FF5252, #F44336);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.clear-history-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

#historyList {
    list-style: none;
    text-align: left;
}

#historyList li {
    padding: 5px 10px;
    margin: 5px 0;
    background: linear-gradient(90deg, rgba(118, 75, 162, 0.1), transparent);
    border-radius: 5px;
    color: #555;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .title {
        font-size: 2em;
    }
    
    .wheel-container {
        width: 300px;
        height: 300px;
    }
    
    .wheel text {
        font-size: 12px;
    }
    
    .spin-button {
        width: 80px;
        height: 80px;
        font-size: 16px;
    }
}

/* 动画效果 */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.result.show {
    animation: bounce 0.5s ease;
}