/**
 * 按钮组件样式文件
 * 
 * @file buttons.css
 * @description 统一管理系统中所有按钮样式，包括主要按钮、次要按钮、操作按钮等
 * @author CodeBuddy
 * @created 2025-01-12
 * @version 1.0.0
 * 
 * 功能模块：
 * - 基础按钮样式系统
 * - 主题色按钮变体
 * - 操作按钮组件
 * - 分页按钮样式
 * - 表格操作按钮
 * - 模态框按钮
 * - 移动端按钮优化
 * - 特殊功能按钮
 */

/* ========================================
   CSS变量定义 - 按钮主题色彩系统
   ======================================== */
:root {
    /* 主要颜色 */
    --btn-primary: #ff9900;        /* 主按钮色 - 橙色 */
    --btn-primary-hover: #ff7700;  /* 主按钮悬停色 - 深橙色 */
    --btn-primary-active: #ff6600; /* 主按钮激活色 */
    
    /* 状态颜色 */
    --btn-success: #28a745;        /* 成功按钮 - 绿色 */
    --btn-warning: #ffc107;        /* 警告按钮 - 黄色 */
    --btn-danger: #dc3545;         /* 危险按钮 - 红色 */
    --btn-info: #17a2b8;          /* 信息按钮 - 蓝色 */
    
    /* 中性颜色 */
    --btn-light: #f8f9fa;         /* 浅色按钮 */
    --btn-dark: #343a40;          /* 深色按钮 */
    --btn-secondary: #6c757d;     /* 次要按钮 */
    
    /* 透明度和阴影 */
    --btn-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
    --btn-shadow-hover: 0 6px 20px rgba(255, 153, 0, 0.4);
    --btn-shadow-active: 0 2px 8px rgba(255, 153, 0, 0.2);
}

/* ========================================
   基础按钮样式 - 所有按钮的通用样式
   ======================================== */
.btn {
    /* 基础布局 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    
    /* 尺寸和间距 */
    padding: 12px 25px;
    min-width: 80px;
    min-height: 40px;
    
    /* 外观样式 */
    border: none;
    border-radius: 10px;
    background: transparent;
    
    /* 文字样式 */
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    line-height: 1;
    
    /* 交互样式 */
    cursor: pointer;
    user-select: none;
    outline: none;
    
    /* 动画效果 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 防止文本选择 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 按钮禁用状态 */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
    box-shadow: none !important;
}

/* 按钮聚焦状态 */
.btn:focus {
    outline: 2px solid rgba(255, 153, 0, 0.3);
    outline-offset: 2px;
}

/* ========================================
   主要按钮样式 - 主题色按钮  新增按钮, 取消， 確定
   ======================================== */
.btn-primary,.cancel-modal,.btn-outline {
    background: var(--btn-primary);
    color: #000000 !important;
    box-shadow: var(--btn-shadow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--btn-shadow-hover);
}



/* 成功按钮 */
.btn-success {
    background: var(--btn-success);
    color: white !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* 警告按钮 */
.btn-warning {
    background: var(--btn-warning);
    color: #000000 !important;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

/* 危险按钮 */
.btn-danger {
    background: var(--btn-danger);
    color: white !important;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* 信息按钮 */
.btn-info {
    background: var(--btn-info);
    color: white !important;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-info:hover:not(:disabled) {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

/* 次要按钮 */
.btn-secondary {
    background: var(--btn-secondary);
    color: white !important;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* 浅色按钮 */
.btn-light {
    background: var(--btn-light);
    color: var(--btn-dark) !important;
    border: 1px solid rgba(0, 0, 0, 0.125);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-light:hover:not(:disabled) {
    background: #e2e6ea;
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 深色按钮 */
.btn-dark {
    background: var(--btn-dark);
    color: white !important;
    box-shadow: 0 4px 15px rgba(52, 58, 64, 0.3);
}

.btn-dark:hover:not(:disabled) {
    background: #23272b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 58, 64, 0.4);
}

/* ========================================
   按钮尺寸变体
   ======================================== */

/* 大按钮 */
.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
    min-height: 48px;
    border-radius: 12px;
}

/* 小按钮 */
.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 32px;
    border-radius: 8px;
    min-width: 60px;
}

/* 超小按钮 */
.btn-xs {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 28px;
    border-radius: 6px;
    min-width: 50px;
}

/* 搜索和重置按钮专用样式 - 更小尺寸 */
.btn-search,
.btn-reset {
    padding: 5px 12px !important;
    font-size: 15px !important;
    min-height: 40px !important;
    border-radius: 6px !important;
    min-width: 90px !important;
}

/* 块级按钮 */
.btn-block {
    display: flex;
    width: 100%;
}

/* 圆形按钮 */
.btn-circle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    min-width: auto;
}

.btn-circle.btn-lg {
    width: 56px;
    height: 56px;
}

.btn-circle.btn-sm {
    width: 32px;
    height: 32px;
}

/* ========================================
   操作按钮样式 - 表格和卡片中的小按钮
   ======================================== */

/* 操作按钮基础样式 */
.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.7);
    border: none;
    padding: 0;
    min-width: auto;
}

.action-btn:hover {
    background: rgba(255, 153, 0, 0.2);
    color: var(--btn-primary);
    transform: scale(1.1);
}

/* 禁用状态的操作按钮 */
.action-btn.disabled {
    background: rgba(0, 0, 0, 0.05) !important;
    color: rgba(0, 0, 0, 0.3) !important;
    cursor: not-allowed !important;
    opacity: 0.5;
}

.action-btn.disabled:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: rgba(0, 0, 0, 0.3) !important;
    transform: none !important;
}

/* 操作按钮容器 */
.action-cell {
    display: grid;
    grid-template-columns: repeat(2, 36px);
    grid-template-rows: repeat(2, 36px);
    gap: 6px;
    justify-content: start;
    align-items: start;
}

/* 操作按钮组 - 水平排列 */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

/* 图标按钮 */
.btn-icon {
    padding: 6px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
    min-width: auto;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #000;
    transform: scale(1.1);
}

/* 特定操作按钮的颜色 */
.view-po:hover,
.btn-icon.view:hover {
    color: #3498db !important;
    background-color: rgba(52, 152, 219, 0.1) !important;
}

.edit-po:hover,
.btn-icon.edit:hover {
    color: #f39c12 !important;
    background-color: rgba(243, 156, 18, 0.1) !important;
}

.delete-po:hover,
.btn-icon.delete:hover {
    color: #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.1) !important;
}

/* ========================================
   账号管理按钮样式
   ======================================== */

/* 账号操作按钮 */
.account-btn {
    background: var(--btn-primary);
    color: #000000 !important;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(255, 153, 0, 0.18);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.account-btn:hover {
    background: var(--btn-primary-hover);
    box-shadow: 0 6px 24px rgba(255, 153, 0, 0.28);
    transform: translateY(-1px);
}

/* 验证按钮特殊样式 */
.account-btn.check-btn {
    background-color: #4db6ac;
    color: white !important;
    padding: 6px 12px;
    font-size: 13px;
}

.account-btn.check-btn:hover {
    background-color: #26a69a;
}

/* 日志按钮样式 */
.account-btn.log-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white !important;
}

.account-btn.log-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
}

/* 账号删除按钮 */
.account-delete-btn {
    background: transparent;
    border: none;
    color: #e74c3c;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 4px;
}

.account-delete-btn:hover {
    color: #c0392b;
    transform: scale(1.1);
    background-color: rgba(231, 76, 60, 0.1);
}

/* ========================================
   分页按钮样式
   ======================================== */

/* 分页按钮基础样式 */
.pagination-btn,
.page-btn,
.pg-btn,
.pg-num {
    min-width: 32px;
    height: 32px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #ffffff;
    color: var(--dark, #212529);
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
}

/* 分页按钮悬停效果 */
.pagination-btn:hover:not(:disabled),
.page-btn:hover:not(.active):not(:disabled),
.pg-btn:hover:not(:disabled),
.pg-num:hover:not(.active):not(:disabled) {
    border-color: var(--btn-primary);
    color: var(--btn-primary);
    background: rgba(255, 153, 0, 0.1);
    transform: translateY(-1px);
}

/* 分页按钮禁用状态 */
.pagination-btn:disabled,
.page-btn:disabled,
.pg-btn:disabled,
.pg-num:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
    transform: none;
}

/* 当前页码激活状态 */
.page-btn.active,
.pg-num.active {
    background: var(--btn-primary);
    color: #000000;
    border-color: var(--btn-primary);
    font-weight: 600;
}

/* ========================================
   批量操作按钮样式
   ======================================== */

/* 批量删除按钮 */
.batch-delete-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white !important;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    margin: 5px;
}

.batch-delete-btn:hover {
    background: linear-gradient(135deg, #ff5722, #e65100);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

/* 确认删除按钮 */
.confirm-delete-btn {
    background: var(--btn-danger);
    color: white !important;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.confirm-delete-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* 取消按钮 */
.cancel-btn {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: var(--dark, #212529);
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 10px;
}

.cancel-btn:hover {
    border-color: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.05);
}

/* ========================================
   特殊功能按钮
   ======================================== */

/* 文件上传按钮 */
.file-upload-btn {
    padding: 11px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.12s ease;
    background: var(--btn-primary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #000000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.file-upload-btn:hover {
    background: var(--btn-primary-hover);
    border-color: rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}

/* 输入框内按钮 */
.input-btn {
    padding: 0 15px;
    background: var(--btn-primary);
    color: #000000;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
    height: 100%;
    min-width: auto;
}

.input-btn:hover {
    background: var(--btn-primary-hover);
}

/* 数字输入按钮 */
.number-btn {
    width: 40px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    min-width: auto;
}

.number-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.number-btn.decrease {
    border-radius: 4px 0 0 4px;
}

.number-btn.increase {
    border-radius: 0 4px 4px 0;
}

/* ISA按钮 */
.isa-btn {
    background: var(--btn-primary);
    color: white !important;
    border: none;
    border-radius: 12px;
    padding: 6px 18px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.12);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.isa-btn:hover {
    background: var(--btn-primary-hover);
}

/* ========================================
   模态框按钮样式
   ======================================== */



/* 模态框底部按钮 */
.modal-footer .btn {
    min-width: 80px;
    padding: 8px 16px;
    font-size: 14px;
}

/* ========================================
   按钮组样式
   ======================================== */

/* 按钮组容器 */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}

.btn-group .btn {
    position: relative;
    flex: 1 1 auto;
    border-radius: 0;
    margin-left: -1px;
}

.btn-group .btn:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    margin-left: 0;
}

.btn-group .btn:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.btn-group .btn:hover {
    z-index: 1;
}

/* ========================================
   响应式设计 - 移动端按钮优化
   ======================================== */

/* 小屏幕设备优化 */
@media (max-width: 480px) {
    /* 基础按钮移动端调整 */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 60px;
        min-height: 44px; /* iOS推荐的最小触摸目标 */
    }
    
    /* 在小屏幕下隐藏按钮文字，只显示图标 */
    .btn .btn-text,
    .actions .btn span:not(.fas):not(.far):not(.fab) {
        display: none;
    }
    
    /* 确保图标居中显示 */
    .btn {
        justify-content: center;
        min-width: 44px;
        padding: 8px;
    }
    
    /* 操作按钮移动端优化 */
    .account-btn {
        font-size: 12px;
        padding: 6px 10px;
        margin: 2px;
    }
    
    /* 分页按钮移动端优化 */
    .pagination-btn,
    .page-btn,
    .pg-btn,
    .pg-num {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
        margin: 2px;
    }
    
    /* 模态框按钮移动端优化 */
    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* 移除悬停效果，添加点击反馈 */
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* 中等屏幕设备优化 */
@media (min-width: 481px) and (max-width: 768px) {
    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .account-btn {
        font-size: 13px;
        padding: 7px 12px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大可点击区域 */
    .btn,
    .account-btn,
    .pagination-btn,
    .page-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 移除悬停效果 */
    .btn:hover,
    .account-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* 添加点击反馈 */
    .btn:active,
    .account-btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* ========================================
   可访问性优化
   ======================================== */

/* 减少动画效果 */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .account-btn,
    .action-btn,
    .pagination-btn {
        transition: none !important;
        animation: none !important;
    }
}



/* ========================================
   打印样式优化
   ======================================== */
@media print {
    .btn,
    .account-btn,
    .action-btn {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* ========================================
   加载状态按钮
   ======================================== */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: btn-spin 1s linear infinite;
}

@keyframes btn-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   按钮工具提示
   ======================================== */
.btn[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* ========================================
   模态框关闭按钮样式 - 与系统风格一致
   ======================================== */

/* 模态框头部关闭按钮样式（×符号） */
.modal-header .close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    min-width: auto;
}

/* 模态框底部取消按钮样式 */
.modal-footer .close-modal {
    /* 继承通用按钮样式，不使用绝对定位 */
    position: relative;
}

.modal-header .close-modal:hover {
    background: rgba(255, 153, 0, 0.2);
    color: var(--btn-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
}

.modal-header .close-modal:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.2);
}

.modal-header .close-modal:focus {
    outline: 2px solid rgba(255, 153, 0, 0.3);
    outline-offset: 2px;
}

/* 深色主题下的关闭按钮 */
.dark-theme .modal-header .close-modal {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.dark-theme .modal-header .close-modal:hover {
    background: rgba(255, 153, 0, 0.2);
    color: var(--btn-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-header .close-modal {
        width: 32px;
        height: 32px;
        font-size: 14px;
        top: 10px;
        right: 10px;
        border-radius: 8px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .modal-header .close-modal {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .modal-header .close-modal:hover {
        transform: none;
        box-shadow: none;
    }
    
    .modal-header .close-modal:active {
        transform: scale(0.95);
        background: rgba(255, 153, 0, 0.3);
        opacity: 0.8;
    }
}

/* ========================================
   ISA详情页面和shipment-actions修复样式
   ======================================== */

/* ISA详情页面标题颜色修复 */
.page-title,
.detail-title,
h1.isa-detail-title,
.isa-detail h1,
.isa-detail .title,
.isa-detail-header h1,
.isa-detail-header .title,
.isa-detail-modal .modal-header h2,
.isa-detail-modal h2,
#isaDetailModal h2,
#isaDetailModal .modal-header h2 {
    color: #000000 !important;
}


/* ISA详情模态窗口表头颜色修复 */
.isa-detail-modal .shipment-table th,
.isa-detail-modal .shipment-table thead th,
#isaDetailModal .shipment-table th,
#isaDetailModal .shipment-table thead th {
    color: #0056b3 !important;
    background: rgba(0, 123, 255, 0.10) !important;
}


