/* 模态窗口样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.modal-header {
    padding: 40px 40px 30px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #1976D2;
    background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.modal-content {
    padding: 30px 40px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-form-group {
    margin: 0;
}

.modal-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.modal-form-group input,
.modal-form-group select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: #fff;
}

.modal-form-group input:focus,
.modal-form-group select:focus {
    outline: none;
    border-color: #42A5F5;
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.2);
}

.modal-input-group {
    position: relative;
}

.modal-input-group input {
    padding-left: 50px !important;
}

.modal-input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #666;
}

.modal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-btn {
    padding: 18px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: block;
}

.modal-btn-primary {
    background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(66, 165, 245, 0.4);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(66, 165, 245, 0.6);
}

.modal-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.modal-btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.modal-footer {
    padding: 20px 40px 40px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-footer p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.modal-footer a {
    color: #1976D2;
    text-decoration: none;
    font-weight: 600;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* 切换按钮 */
.modal-tabs {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    background: #f5f5f5;
}

.modal-tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-tab.active {
    background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
    color: white;
}

/* 错误提示 */
.modal-error {
    padding: 12px 20px;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    color: #c62828;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-success {
    padding: 12px 20px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    color: #2e7d32;
    font-size: 14px;
    margin-bottom: 20px;
}

/* 加载状态 */
.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.modal-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1976D2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-width: 95%;
    }

    .modal-header,
    .modal-content,
    .modal-footer {
        padding: 25px 20px;
    }

    .modal-header h2 {
        font-size: 24px;
    }

    .modal-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-form-group input,
    .modal-form-group select {
        padding: 14px 16px;
        font-size: 15px;
    }

    .modal-btn {
        padding: 16px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .modal-container {
        border-radius: 16px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-form-group input,
    .modal-form-group select {
        padding: 12px 14px;
        font-size: 14px;
    }
}