/* 弹窗遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* 弹窗容器 */
.modal-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 950px;
    height: 450px;
    overflow-y: auto;
    position: relative;
}

/* 弹窗头部 */
.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 表单样式 */
.modal-form {
    padding: 24px;
}

/* 表单行布局 */
.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    /* align-items: flex-start; */
}

.form-row-top {
    margin-bottom: 20px;
}

.form-row-bottom {
    margin-bottom: 0;
}

/* 表单组 */
.form-group {
    flex: 1;
    position: relative;
}

.form-group-select {
    flex: .5;
}

.form-group-toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.form-group-content {
    margin-bottom: 20px;
}

.form-group-submit {
    flex: 0 0 auto;
}

/* 输入框样式 */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-input::placeholder {
    color: #999;
}

/* 选择框样式 */
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23999' d='M8 10L4 6h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-select::placeholder {
    color: #999;
}

/* 开关样式 */
.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: background-color 0.3s;
    margin-right: 8px;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-slider {
    background-color: #4CAF50;
}

.toggle-input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* 文本域样式 */
.form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-textarea::placeholder {
    color: #999;
}

/* 提交按钮样式 */
.submit-btn {
    background-color: #009688;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    white-space: nowrap;
    min-width: 100px;
}

.submit-btn:hover {
    background-color: #00796b;
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        margin: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .form-group-toggle {
        align-self: flex-start;
    }
    
    .form-group-submit {
        align-self: stretch;
    }
    
    .submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-form {
        padding: 16px;
    }
    
    .modal-header {
        padding: 16px 20px 12px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 12px;
        font-size: 16px; /* 防止iOS缩放 */
    }
}
