/* 简化明亮的乐高风格模态框样式 */

/* 模态框背景 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* 模态框内容 - 简化明亮风格 */
.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 1002;
    margin: 0;
    padding: 0;
    
    /* 乐高积木纹理 */
    background-image: 
        radial-gradient(circle at 10px 10px, rgba(0, 0, 0, 0.1) 2px, transparent 3px),
        radial-gradient(circle at 30px 30px, rgba(0, 0, 0, 0.1) 2px, transparent 3px);
    background-size: 40px 40px;
}

/* 全屏模态框 */
.modal-content.fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
}

/* 模态框头部 */
.modal-header {
    padding: 25px 20px;
    text-align: center;
    background: #ffd43b;
    position: relative;
    border-bottom: 3px solid #333;
}

/* 乐高积木连接点 */
.modal-header::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 10px;
    background: #f8f8f8;
    border-radius: 5px;
    border: 2px solid #333;
}

.modal-header::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 10px;
    background: #f8f8f8;
    border-radius: 5px;
    border: 2px solid #333;
}

/* 模态框标题 */
.modal-title {
    font-size: 1.8rem;
    margin: 0;
    color: #333;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
}

/* 模态框副标题 */
.modal-subtitle {
    font-size: 1rem;
    color: #666;
    margin-top: 8px;
    font-weight: 500;
}

/* 模态框主体 */
.modal-body {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 25px;
    background: #ffffff;
}

/* 表单组 */
.form-group {
    margin-bottom: 20px;
    position: relative;
    border: 2px dashed #333;
    border-radius: 10px;
    padding: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: #f8f8f8;
    border: 2px solid #333;
    border-radius: 8px;
    color: #333;
    font-family: 'Arial', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #ff6b35;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

.form-control::placeholder {
    color: #999;
}

/* 提交按钮 - 乐高风格 */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: #ff6b35;
    color: white;
    border: 3px solid #333;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 1rem;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 0 #cc5522;
}

.submit-btn:hover {
    background: #ff8c5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #cc5522;
}

.submit-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #cc5522;
}

/* 关闭按钮 */
.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: #ff6b35;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #333;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 1004;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.close-btn:hover {
    background: #ff8c5a;
    transform: rotate(90deg);
}

/* 表单底部 */
.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
}

.toggle-form {
    color: #ff6b35;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.toggle-form:hover {
    text-shadow: 0 0 5px rgba(255, 107, 53, 0.5);
}

/* 错误和成功消息 */
.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 8px;
    display: none;
}

.success-message {
    color: #27ae60;
    font-size: 1rem;
    margin-top: 15px;
    text-align: center;
    display: none;
}

/* 乐高积木元素 */
.lego-stud {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff0000;
    border-radius: 50%;
    border: 1px solid #333;
    z-index: 3;
}

.lego-stud:nth-child(1) {
    top: 15px;
    left: 25%;
    background: #ff0000;
}

.lego-stud:nth-child(2) {
    top: 15px;
    left: 50%;
    background: #0000ff;
}

.lego-stud:nth-child(3) {
    top: 15px;
    left: 75%;
    background: #ffff00;
}

/* 种树花园乐高风格 */
.tree-modal .modal-content {
    background: #ffffff;
    border: 3px solid #333;
    border-radius: 15px;
    
    /* 乐高积木纹理 */
    background-image: 
        radial-gradient(circle at 10px 10px, rgba(0, 0, 0, 0.1) 2px, transparent 3px),
        radial-gradient(circle at 30px 30px, rgba(0, 0, 0, 0.1) 2px, transparent 3px);
    background-size: 40px 40px;
}

.tree-modal .modal-header {
    background: #90ee90;
    border-bottom: 3px solid #333;
    border-radius: 12px 12px 0 0;
}

.tree-modal .modal-title {
    color: #333;
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
    text-shadow: 2px 2px 0 #333;
}

.tree-modal .modal-subtitle {
    color: #666;
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
}

.tree-modal .points-section {
    border: 2px dashed #333;
    border-radius: 10px;
    background: #f8f8f8;
}

.tree-modal .tree-action-btn {
    background: #ff6b35;
    color: white;
    border: 3px solid #333;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 4px 0 #cc5522;
    transition: all 0.3s ease;
}

.tree-modal .tree-action-btn:hover {
    background: #ff8c5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #cc5522;
}

.tree-modal .tree-action-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #cc5522;
}

.tree-modal .tree-stat-value {
    font-weight: 700;
    color: #333;
    text-shadow: 1px 1px 0 #666;
}

/* 人物定制乐高风格 */
#character-modal .modal-content {
    background: #ffffff;
    border: 3px solid #333;
    border-radius: 15px;
    
    /* 乐高积木纹理 */
    background-image: 
        radial-gradient(circle at 10px 10px, rgba(0, 0, 0, 0.1) 2px, transparent 3px),
        radial-gradient(circle at 30px 30px, rgba(0, 0, 0, 0.1) 2px, transparent 3px);
    background-size: 40px 40px;
}

#character-modal .modal-header {
    background: #ffd43b;
    border-bottom: 3px solid #333;
    border-radius: 12px 12px 0 0;
}

#character-modal .modal-title {
    color: #333;
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
    text-shadow: 2px 2px 0 #333;
}

#character-modal .modal-subtitle {
    color: #666;
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
}

#character-modal .character-preview {
    border: 2px dashed #333;
    border-radius: 10px;
    background: #f8f8f8;
}

#character-modal .attribute-item {
    border: 2px dashed #333;
    border-radius: 10px;
    background: #f8f8f8;
}

#character-modal .upgrade-btn {
    background: #ff6b35;
    color: white;
    border: 3px solid #333;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 4px 0 #cc5522;
    transition: all 0.3s ease;
}

#character-modal .upgrade-btn:hover {
    background: #ff8c5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #cc5522;
}

#character-modal .upgrade-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #cc5522;
}

#character-modal .option-item {
    border: 2px dashed #333;
    border-radius: 10px;
    background: #f8f8f8;
    transition: all 0.3s ease;
}

#character-modal .option-item:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#character-modal .tab-btn {
    background: #ffd43b;
    color: #333;
    border: 3px solid #333;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 4px 0 #ccaa00;
    transition: all 0.3s ease;
}

#character-modal .tab-btn:hover {
    background: #ffeb99;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #ccaa00;
}

#character-modal .tab-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #ccaa00;
}

#character-modal .tab-btn.active {
    background: #ff6b35;
    color: white;
    box-shadow: 0 4px 0 #cc5522;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    
    .modal-header {
        padding: 20px 15px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 15px;
        max-height: calc(100vh - 120px);
    }
    
    .form-group {
        padding: 12px;
    }
    
    .submit-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
}