/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 标签页样式 */
.tab-btn {
    color: #6B7280;
    border-color: transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #3B82F6;
}

.tab-btn.active {
    color: #3B82F6;
    border-color: #3B82F6;
}

.tab-content {
    animation: fadeIn 0.3s ease-in;
}

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

/* 子标签页样式 */
.sub-tab-btn {
    color: #6B7280;
    border-color: transparent;
    transition: all 0.3s;
}

.sub-tab-btn:hover {
    color: #3B82F6;
}

.sub-tab-btn.active {
    color: #3B82F6;
    border-color: #3B82F6;
}

/* 状态筛选标签 */
.status-filter {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #F3F4F6;
    color: #6B7280;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.status-filter:hover {
    background-color: #E5E7EB;
}

.status-filter.active {
    background-color: #3B82F6;
    color: white;
}

/* 状态徽章 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-negotiating {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.status-approved {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-rejected {
    background-color: #FEE2E2;
    color: #991B1B;
}

.status-timeout {
    background-color: #FEF3C7;
    color: #92400E;
}

/* 表格样式 */
table {
    border-collapse: separate;
    border-spacing: 0;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #F9FAFB;
}

/* 操作按钮 */
.action-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    margin-right: 0.5rem;
}

.action-btn-primary {
    background-color: #3B82F6;
    color: white;
}

.action-btn-primary:hover {
    background-color: #2563EB;
}

.action-btn-secondary {
    background-color: #10B981;
    color: white;
}

.action-btn-secondary:hover {
    background-color: #059669;
}

.action-btn-danger {
    background-color: #EF4444;
    color: white;
}

.action-btn-danger:hover {
    background-color: #DC2626;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    padding: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 70%;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
    margin: auto;
    font-size: 0.875rem;
    line-height: 1.4;
    position: relative;
    z-index: 1001;
    pointer-events: auto;
}

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

/* 分页样式 */
.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #E5E7EB;
    background-color: white;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #F3F4F6;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background-color: #3B82F6;
    color: white;
    border-color: #3B82F6;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3B82F6;
    animation: spin 1s ease-in-out infinite;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #9CA3AF;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal {
        padding: 0.75rem;
    }
    
    .modal.show {
        display: flex !important;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
        padding: 1rem;
        font-size: 0.8125rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8125rem;
    }

    th, td {
        padding: 0.375rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .modal-content {
        width: 85%;
        max-height: 80vh;
        padding: 1.25rem;
    }
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    background-color: #10B981;
    color: white;
}

.toast-error {
    background-color: #EF4444;
    color: white;
}

.toast-info {
    background-color: #3B82F6;
    color: white;
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Toggle Switch 样式 */
.toggle-switch {
    appearance: none;
    width: 48px;
    height: 24px;
    background-color: #D1D5DB;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch:checked {
    background-color: #3B82F6;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-switch:checked::before {
    transform: translateX(24px);
}

/* 订单选择弹窗样式 */
#order-select-modal .modal-content {
    /* 使用统一的弹窗样式，不再单独设置max-height */
}

#order-list-body tr {
    transition: background-color 0.2s;
}

#order-list-body tr:hover {
    background-color: #F9FAFB;
}

#order-list-body input[type="checkbox"]:checked {
    accent-color: #3B82F6;
}

/* 协商类型单选框样式 */
input[type="radio"] {
    accent-color: #3B82F6;
    width: 18px;
    height: 18px;
}

input[type="radio"]:checked + span,
input[type="radio"]:checked + div {
    color: #1E40AF;
}

/* 收货信息卡片样式 */
.address-info-card {
    background: linear-gradient(to bottom, #F9FAFB, #FFFFFF);
}

/* 协商场景按钮特殊样式 */
.scenario-btn {
    position: relative;
    overflow: hidden;
}

.scenario-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.scenario-btn:hover::before {
    left: 100%;
}

/* 表单标签增强样式 */
label.required::after {
    content: ' *';
    color: #EF4444;
}

/* 链接样式 */
a.link-primary {
    color: #3B82F6;
    text-decoration: none;
    transition: color 0.2s;
}

a.link-primary:hover {
    color: #2563EB;
    text-decoration: underline;
}

/* 信息提示框样式 */
.info-box {
    border-left: 4px solid;
    padding: 12px 16px;
    border-radius: 4px;
}

.info-box.info {
    background-color: #EFF6FF;
    border-color: #3B82F6;
    color: #1E40AF;
}

.info-box.warning {
    background-color: #FEF3C7;
    border-color: #F59E0B;
    color: #92400E;
}

.info-box.success {
    background-color: #D1FAE5;
    border-color: #10B981;
    color: #065F46;
}

/* 滚动条样式优化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* 订单商品图片样式 */
.order-product-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #E5E7EB;
}

/* 协商状态指示器 */
.negotiation-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.negotiation-status-indicator.pending {
    background-color: #F59E0B;
}

.negotiation-status-indicator.approved {
    background-color: #10B981;
}

.negotiation-status-indicator.rejected {
    background-color: #EF4444;
}

