/* 统一按钮样式系统 - 现代、大气、规范 */

/* ===== 基础按钮样式 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 2.75rem;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== 主要按钮类型 ===== */

/* 主要按钮 - 蓝色（用于主要操作） */
.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: #ffffff;
    border-color: #2563EB;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #60A5FA 0%, #2563EB 100%);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

/* 成功按钮 - 绿色（用于确认、提交） */
.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #ffffff;
    border-color: #059669;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #34D399 0%, #059669 100%);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.btn-success:active:not(:disabled) {
    transform: translateY(0);
}

/* 危险按钮 - 红色（用于删除、取消订单） */
.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: #ffffff;
    border-color: #DC2626;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #F87171 0%, #DC2626 100%);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}

.btn-danger:active:not(:disabled) {
    transform: translateY(0);
}

/* 警告按钮 - 橙色（用于警告操作） */
.btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #ffffff;
    border-color: #D97706;
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #FBBF24 0%, #B45309 100%);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.btn-warning:active:not(:disabled) {
    transform: translateY(0);
}

/* 次要按钮 - 灰色（用于次要操作） */
.btn-secondary {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    color: #ffffff;
    border-color: #4B5563;
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4B5563 0%, #374151 100%);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
    transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

/* 轮廓按钮 - 透明背景，带边框 */
.btn-outline {
    background: transparent;
    color: #3B82F6;
    border-color: #3B82F6;
    box-shadow: none;
}

.btn-outline:hover:not(:disabled) {
    background: #3B82F6;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.btn-outline-success {
    background: transparent;
    color: #10B981;
    border-color: #10B981;
    box-shadow: none;
}

.btn-outline-success:hover:not(:disabled) {
    background: #10B981;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.btn-outline-danger {
    background: transparent;
    color: #EF4444;
    border-color: #EF4444;
    box-shadow: none;
}

.btn-outline-danger:hover:not(:disabled) {
    background: #EF4444;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* ===== 按钮尺寸 ===== */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 2.25rem;
    border-radius: 0.375rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.0625rem;
    min-height: 3.25rem;
    border-radius: 0.625rem;
}

.btn-full {
    width: 100%;
}

.btn-round {
    border-radius: 9999px;
}

/* ===== 圆形小按钮（用于加减、删除等） ===== */
.btn-circle {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: bold;
    min-height: auto;
    flex-shrink: 0; /* 防止被压缩 */
    aspect-ratio: 1 / 1; /* 强制保持 1:1 比例 */
}

.btn-circle-sm {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

.btn-circle-lg {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

/* ===== 图标按钮 ===== */
.btn-icon {
    padding: 0.5rem;
    min-width: 2.75rem;
}

/* ===== 响应式调整 ===== */
@media (max-width: 640px) {
    .btn {
        padding: 0.5625rem 1rem;
        font-size: 0.875rem;
        min-height: 2.5rem;
    }
    
    .btn-sm {
        padding: 0.4375rem 0.875rem;
        font-size: 0.8125rem;
        min-height: 2rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 3rem;
    }
}

