/* 更新模态框样式，确保宽度足够 */
.modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 1000px;
    /* 增加最大宽度 */
}

.modal-body {
    padding: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 添加左右布局容器 */
.character-form-container {
    display: flex;
    height: 100%;
    min-height: 500px;
}

/* 左侧机器人区域 */
.character-section {
    flex: 0 0 40%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.character-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
}

.character-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 40px;
}

.character-body {
    position: absolute;
    width: 120px;
    height: 140px;
    background: white;
    border-radius: 60px 60px 20px 20px;
    top: 40px;
    left: 30px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.character-sensors {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.character-sensor {
    width: 20px;
    height: 20px;
    background: #4f46e5;
    border-radius: 50%;
    border: 2px solid white;
}

.character-head {
    position: absolute;
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    top: 0;
    left: 40px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.character-face {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
}

.character-eyes {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.character-eye {
    width: 20px;
    height: 20px;
    background: #4f46e5;
    border-radius: 50%;
}

.character-mouth {
    width: 40px;
    height: 8px;
    background: #4f46e5;
    border-radius: 4px;
    margin: 0 auto;
}

.character-arm {
    position: absolute;
    width: 30px;
    height: 80px;
    background: white;
    border-radius: 15px;
    top: 70px;
}

.character-arm.left {
    left: 0;
    transform: rotate(-30deg);
}

.character-arm.right {
    right: 0;
    transform: rotate(30deg);
}

.character-accessory {
    position: absolute;
    font-size: 30px;
    top: 20px;
    right: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.character-details {
    text-align: center;
    width: 100%;
    z-index: 1;
}

.character-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.character-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.character-stat {
    text-align: center;
}

.character-stat .stat-value {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
    color: #fbbf24;
}

.character-stat .stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 右侧表单区域 */
.form-section {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

/* 步骤指示器样式优化 */
.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    right: 0;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
    transform: translateX(50%);
}

.step.active:not(:last-child)::after,
.step.completed:not(:last-child)::after {
    background: #667eea;
}

.step-number {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: scale(1.1);
}

.step.completed .step-number {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.step-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.step.active .step-label {
    color: #667eea;
    font-weight: 600;
}

/* 步骤内容样式 */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-content h3 span {
    font-size: 28px;
}

.step-content>p {
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 属性卡片样式 */
.attribute-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.attribute-card {
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.attribute-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.attribute-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.attribute-icon {
    font-size: 32px;
    margin-bottom: 15px;
}

.attribute-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1f2937;
}

.attribute-desc {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* 战略选项样式 */
.frequency-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.frequency-option {
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
}

.frequency-option:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.frequency-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
}

.frequency-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.frequency-icon {
    font-size: 32px;
}

.frequency-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.frequency-right {
    flex: 1;
}

.frequency-desc {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.frequency-desc strong {
    color: #374151;
}

/* 规则容器样式 */
.risk-rule-container,
.profit-rule-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

.risk-rule-item,
.profit-rule-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: #f9fafb;
}

.risk-rule-header,
.profit-rule-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.risk-rule-number,
.profit-rule-number {
    width: 28px;
    height: 28px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.risk-rule-title,
.profit-rule-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-col {
    flex: 1;
}

/* 模态框底部样式 */
.modal-footer {
    padding: 20px 40px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.progress-text {
    font-size: 14px;
    color: #6b7280;
}

.progress-text span {
    font-weight: 600;
    color: #667eea;
}

/* 按钮样式 */
.btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .character-form-container {
        flex-direction: column;
    }

    .character-section {
        flex: 0 0 auto;
        padding: 30px 20px;
    }

    .character-container {
        width: 140px;
        height: 140px;
        margin-bottom: 30px;
    }

    .character-body {
        width: 100px;
        height: 120px;
        top: 30px;
        left: 20px;
    }

    .character-head {
        width: 80px;
        height: 80px;
        left: 30px;
    }

    .character-name {
        font-size: 20px;
    }

    .character-stat .stat-value {
        font-size: 24px;
    }

    .form-section {
        padding: 30px 20px;
    }

    .attribute-cards {
        grid-template-columns: 1fr;
    }

    .frequency-option {
        flex-direction: column;
        gap: 15px;
    }

    .frequency-left {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .modal {
        width: 95%;
    }
}