/* ============================================
   通用组件样式
   ============================================ */

/* 自定义弹窗 */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.custom-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 450px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.custom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.custom-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.custom-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.custom-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.custom-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
}

.custom-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 自定义选择框 */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.custom-select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #1e293b;
    transition: all 0.2s ease;
}

.custom-select-display:hover {
    border-color: #94a3b8;
}

.custom-select-display.active {
    border-color: #1a365d;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.custom-select-arrow {
    color: #94a3b8;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.custom-select-display.active .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.custom-select-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

.custom-select-option {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #475569;
    transition: all 0.15s ease;
}

.custom-select-option:hover {
    background: #f1f5f9;
    color: #1a365d;
}

.custom-select-option.selected {
    background: #eff6ff;
    color: #1a365d;
    font-weight: 600;
}

/* 通用卡片 */
.card-std {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 14px;
}

.card-std-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-std-title i {
    color: #1a365d;
}

/* 通用表单 */
.form-group-std {
    margin-bottom: 16px;
}

.form-label-std {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.form-label-std .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-input-std {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #1e293b;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input-std:focus {
    outline: none;
    border-color: #1a365d;
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.form-input-std::placeholder {
    color: #94a3b8;
}

/* 通用按钮 */
.btn-group-std {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-std {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-std:active {
    transform: scale(0.98);
}

.btn-std-primary {
    background: linear-gradient(135deg, #1a365d, #2d5aa0);
    color: #fff;
}

.btn-std-primary:hover {
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
}

.btn-std-secondary {
    background: #f1f5f9;
    color: #64748b;
}

.btn-std-secondary:hover {
    background: #e2e8f0;
}

.btn-std-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
}

.btn-std-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
}

.btn-std-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 移动端适配 */
@media (max-width: 600px) {
    .custom-modal {
        border-radius: 14px;
    }
    
    .custom-modal-header {
        padding: 16px;
    }
    
    .custom-modal-body {
        padding: 16px;
    }
    
    .custom-modal-footer {
        padding: 14px 16px;
    }
    
    .card-std {
        padding: 14px;
        border-radius: 12px;
    }
    
    .btn-group-std {
        flex-direction: column;
    }
}
