/* 表单模态框样式 */
.form-modal-content {
    max-width: 600px;
    width: 90%;
    padding: 0;
    border-radius: 15px;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.modal-header {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.close-btn {
    font-size: 1.8em;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

#formSaveSection, #formLoadSection {
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--secondary-color);
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.primary-btn:hover {
    background-color: #2980b9;
}

.form-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 15px;
}

.form-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.form-list li {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.form-list .form-name {
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 16px;
    color: #333;
}

.form-list .delete-btn {
    flex: 0 0 auto;
    margin-left: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 28px;
    max-height: 28px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: background 0.2s;
}
.form-list .delete-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    margin: auto;
    pointer-events: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}
.form-list .delete-btn:hover,
.form-list .delete-btn:active,
.form-list .delete-btn:focus {
    background: rgba(231, 76, 60, 0.13);
}

.form-list .delete-btn:active,
.form-list .delete-btn:focus {
    background: rgba(231, 76, 60, 0.08);
}

@media (max-width: 600px) {
    .form-list li {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 12px 8px;
    }
    .form-list .form-name {
        font-size: 15px;
        margin-bottom: 8px;
        text-align: left;
    }
    .form-list .delete-btn {
        align-self: flex-end;
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        max-width: 28px;
        max-height: 28px;
        margin: 0;
        border-radius: 8px;
        background: none;
        box-shadow: none;
        border: none;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        position: relative;
        overflow: hidden;
    }
    .form-list .delete-btn svg {
        width: 18px;
        height: 18px;
        display: block;
        margin: auto;
        pointer-events: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
    }
    .form-list .delete-btn:hover,
    .form-list .delete-btn:active,
    .form-list .delete-btn:focus {
        background: rgba(231, 76, 60, 0.13);
    }
}

.form-list li:last-child {
    border-bottom: none;
}

.form-list li:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

.form-list li.selected {
    background-color: rgba(52, 152, 219, 0.1);
    border-left: 4px solid var(--primary-color);
}

.form-list .form-name {
    flex-grow: 1;
    font-size: 1.1em;
    padding: 5px 0;
    color: var(--secondary-color);
}

.form-list .delete-btn {
    color: var(--error-color);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.form-list .delete-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.no-forms-message {
    text-align: center;
    padding: 20px;
    color: #777;
    font-style: italic;
    display: none;
}

.form-data-preview {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    font-family: monospace;
    font-size: 0.9em;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .form-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-list li {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-list .delete-btn {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
    }
}
