/* ==================== 按钮组件 ==================== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--accent-color);
}

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

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

/* 客户系统按钮 */
.customer-btn {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.customer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

/* ==================== 徽章组件 ==================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-primary {
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    color: #6366f1;
}

.badge-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
}

.badge-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
}

.badge-warning {
    background: linear-gradient(135deg, #fff3cd, #ffe69c);
    color: #856404;
}

.badge-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

/* ==================== 提示框组件 ==================== */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-color: #86efac;
    color: #065f46;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-color: #93c5fd;
    color: #1e40af;
}

.alert-warning {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border-color: #fb923c;
    color: #92400e;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-color: #fca5a5;
    color: #991b1b;
}

/* ==================== 加载动画 ==================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* ==================== 表单组件 ==================== */
.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: white;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: var(--text-primary);
    background-color: white;
    border-color: var(--accent-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.form-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1rem;
}

/* ==================== 分页组件 ==================== */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 0.25rem;
}

.page-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
}

.page-link:hover {
    background-color: var(--bg-light);
    border-color: var(--accent-color);
}

.page-link.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.page-link.disabled {
    color: var(--text-secondary);
    pointer-events: none;
    opacity: 0.5;
}

/* ==================== 模态框组件 ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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