/* 基础样式 */
* {
    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(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* 区域通用样式 */
.input-section,
.wheel-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
}

/* 按钮样式 */
.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.action-btn.primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.action-btn.secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
}

.action-btn.secondary:hover {
    background: #e9ecef;
    color: #333;
}

/* 输入区域样式 */
.input-actions {
    display: flex;
    gap: 0;
}

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

.options-input {
    position: relative;
}

#optionsInput {
    width: 100%;
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 220px;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    line-height: 1.6;
}

#optionsInput:hover {
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

#optionsInput:focus {
    outline: none;
    border-color: #667eea;
    background: linear-gradient(145deg, #ffffff 0%, #f0f4ff 100%);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15), 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

#optionsInput::placeholder {
    color: #9ca3af;
    font-style: italic;
    line-height: 1.8;
}

.options-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.count-text {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* 转盘区域样式 */
.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.wheel-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
}

.wheel-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 指针样式 */
.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    color: #ff6b6b;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.pointer svg {
    width: 100%;
    height: 100%;
}

/* 转盘样式 */
.wheel {
    width: 400px;
    height: 400px;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    border: 6px solid #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    background: white;
}

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

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.wheel-center-text {
    font-size: 1.5rem;
}

/* 结果显示 */
.result-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: slideInFromRight 0.5s ease;
    min-width: 250px;
    max-width: 300px;
}

.result-content h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.result-text {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

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

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 提示信息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.warning {
    background: #ffc107;
    color: #333;
}

/* 错误信息 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #f5c6cb;
}

/* Footer居中样式 */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .input-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .wheel-wrapper {
        width: 250px;
        height: 250px;
    }
    
    .wheel {
        width: 250px;
        height: 250px;
    }
    
    .container {
        padding: 15px;
    }
    
    .wheel-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .result-container {
        animation: fadeInUp 0.5s ease;
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wheel-wrapper {
        width: 200px;
        height: 200px;
    }
    
    .wheel {
        width: 200px;
        height: 200px;
    }
    
    .wheel-segment {
        font-size: 0.8rem;
    }
    
    .wheel-segment-text {
        max-width: 60px;
    }
    
    .action-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 弹窗模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 40px 24px;
    text-align: center;
}

.modal-body .result-text {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.modal-footer {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    border-top: 1px solid #f0f0f0;
}

.modal-footer .action-btn {
    min-width: 100px;
}

/* 添加选项弹窗样式 */
.add-option-modal {
    max-width: 400px;
}

.input-group {
    margin: 20px 0;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.option-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    outline: none;
}

.option-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    transform: translateY(-1px);
}

.option-input:hover {
    border-color: #c1c9d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.option-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.input-hint {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #6b7280;
    text-align: right;
}

/* 响应式弹窗 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body .result-text {
        font-size: 2rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .action-btn {
        width: 100%;
    }
    
    .add-option-modal {
        max-width: none;
        width: 95%;
    }
}