/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* 容器 */
.container {
    max-width: 900px;
    margin: 0 auto;
}

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    margin-bottom: 8px;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 场景管理 */
.scene-section {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.scene-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.scene-actions {
    display: flex;
    gap: 10px;
}

.scene-tab-wrapper {
    position: relative;
    display: inline-block;
}

.scene-tab {
    padding: 8px 28px 8px 16px;
    border: none;
    background: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.scene-tab:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.scene-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.scene-delete-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border: none;
    background: #ff6b6b;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.scene-delete-btn:hover {
    background: #ee5a5a;
    transform: scale(1.1);
}

/* 按钮通用样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-add-scene {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    white-space: nowrap;
}

.btn-add-scene:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-clear-cache {
    background: #f0f0f0;
    color: #666;
    white-space: nowrap;
}

.btn-clear-cache:hover {
    background: #ff6b6b;
    color: #fff;
    transform: translateY(-2px);
}

/* 输入区域 */
.input-section {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-add {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.options-summary {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 0.95rem;
}

/* 轮盘区域 */
.wheel-section {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.wheel-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

/* 指针 */
.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #e74c3c;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

/* 轮盘 */
.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 
        0 0 0 12px #fff,
        0 0 0 14px #e0e0e0,
        0 0 40px rgba(0,0,0,0.2);
    background: #fff;
}

.wheel-sectors path {
    stroke: #fff;
    stroke-width: 3;
}

.wheel-sectors text {
    font-size: 24px;
    font-weight: bold;
    fill: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    dominant-baseline: middle;
    pointer-events: none;
}

/* 中心按钮 */
.spin-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.4),
        inset 0 2px 10px rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    z-index: 5;
}

.spin-btn:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.6),
        inset 0 2px 10px rgba(255,255,255,0.2);
}

.spin-btn:active:not(:disabled) {
    transform: translate(-50%, -50%) scale(0.95);
}

.spin-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 结果展示 */
.result-section {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.result-display {
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-winner {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: bounceIn 0.6s ease;
}

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

/* 选项列表 */
.options-section {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

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

.option-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.option-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.option-color {
    width: 12px;
    height: 40px;
    border-radius: 6px;
}

.option-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.option-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.option-name-input:focus {
    outline: none;
    border-color: #667eea;
}

.option-weight {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.option-weight input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
}

.option-weight input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.option-weight .weight-value {
    min-width: 45px;
    text-align: right;
    font-weight: 500;
    color: #667eea;
}

.option-actions {
    display: flex;
    gap: 8px;
}

.btn-edit, .btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #e0e0e0;
    color: #666;
}

.btn-edit:hover {
    background: #d0d0d0;
}

.btn-delete {
    background: #ff6b6b;
    color: #fff;
}

.btn-delete:hover {
    background: #ee5a5a;
}

/* 响应式适配 - 平板 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .scene-section {
        flex-wrap: wrap;
    }
    
    .scene-tabs {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .scene-actions {
        width: 100%;
        justify-content: center;
    }
    
    .wheel-container {
        width: 340px;
        height: 340px;
    }
    
    .wheel-sectors text {
        font-size: 20px;
    }
    
    .spin-btn {
        width: 90px;
        height: 90px;
        font-size: 1.1rem;
    }
}

/* 响应式适配 - 手机 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .main-content {
        gap: 15px;
    }
    
    .scene-section {
        flex-direction: column;
        padding: 12px 15px;
    }
    
    .scene-tabs {
        justify-content: center;
    }
    
    .scene-tab {
        padding: 6px 20px 6px 12px;
        font-size: 0.85rem;
    }
    
    .scene-delete-btn {
        width: 18px;
        height: 18px;
        font-size: 12px;
    }
    
    .scene-actions {
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .input-section {
        padding: 15px;
    }
    
    .input-group input {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    .wheel-section {
        padding: 20px;
    }
    
    .wheel-container {
        width: 280px;
        height: 280px;
    }
    
    .pointer {
        border-left-width: 14px;
        border-right-width: 14px;
        border-top-width: 28px;
        top: -12px;
    }
    
    .spin-btn {
        width: 70px;
        height: 70px;
        font-size: 0.95rem;
    }
    
    .wheel-sectors text {
        font-size: 16px;
    }
    
    .options-section {
        padding: 15px;
    }
    
    .option-item {
        flex-wrap: wrap;
        padding: 10px 12px;
    }
    
    .option-color {
        width: 8px;
        height: 30px;
    }
    
    .option-name {
        flex: 1;
        min-width: 60px;
    }
    
    .option-weight {
        width: 100%;
        min-width: unset;
        margin-top: 8px;
    }
    
    .option-weight input[type="range"] {
        flex: 1;
    }
    
    .option-actions {
        margin-left: auto;
    }
    
    .btn-edit, .btn-delete {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
}

/* 响应式适配 - 小屏手机 */
@media (max-width: 400px) {
    body {
        padding: 8px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .wheel-container {
        width: 240px;
        height: 240px;
    }
    
    .pointer {
        border-left-width: 12px;
        border-right-width: 12px;
        border-top-width: 24px;
    }
    
    .spin-btn {
        width: 60px;
        height: 60px;
        font-size: 0.85rem;
    }
    
    .wheel-sectors text {
        font-size: 14px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .option-item {
        gap: 10px;
    }
    
    .option-actions {
        flex-direction: column;
        gap: 4px;
    }
}

/* 横屏模式适配 */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
    }
    
    .header {
        margin-bottom: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        display: none;
    }
    
    .main-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .scene-section,
    .input-section,
    .options-section {
        flex: 1;
        min-width: 250px;
    }
    
    .wheel-section {
        flex: 0 0 auto;
    }
    
    .wheel-container {
        width: 200px;
        height: 200px;
    }
    
    .spin-btn {
        width: 50px;
        height: 50px;
        font-size: 0.75rem;
    }
    
    .pointer {
        border-left-width: 10px;
        border-right-width: 10px;
        border-top-width: 20px;
        top: -8px;
    }
}
