* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-size: 13px;
}

.container {
    max-width: 98%;
    margin: 0 auto;
    padding: 15px;
}

header {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

header h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 12px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: #666;
    padding: 10px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 13px;
}

nav a:hover {
    background: #f0f0f0;
    color: #333;
}

nav a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

main {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    min-height: calc(100vh - 180px);
}
/* 红色文本 */
.text-red {
    color: #dc3545 !important;
    font-weight: 600;
}

/* 冲销关联单号红色 */
.reconcile-red {
    color: red !important;
    font-weight: bold;
}

/* 在详情模态框中，冲销关联单号显示红色 */
.detail-item .value.reconcile-red {
    color: red !important;
    font-weight: bold;
}
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.search-box form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    min-width: 180px;
    height: 36px;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-success, .btn-warning, .btn-info {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    height: 36px;
}
.btn-link {
    margin-left: 10px;
    color: #FF000;
    text-decoration: none;
    font-size: 0.9em;
}
.btn-link:hover {
    text-decoration: underline;
    color: #0056b3;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
    height: 28px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card {
    background: white;
    border-radius: 8px;
    padding: 0;
}

.card h2 {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4em;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-responsive {
    overflow-x: auto;
    padding: 0 20px;
    margin-bottom: 15px;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    table-layout: fixed;
}

.data-table th {
    background: #f8f9fa;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 12px;
    min-width: 100px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table th a {
    color: inherit;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table th a:hover {
    color: #667eea;
}

.data-table td {
    padding: 8px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 100px;
    max-width: 200px;
    position: relative;
}
.data-table td[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    white-space: normal;
    width: 300px;
    z-index: 1000;
    pointer-events: none;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    line-height: 1.4;
    text-align: left;
}
.data-table td[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
    z-index: 1001;
    margin-bottom: 0;
}
.data-table tr {
    height: 40px;
    transition: background-color 0.2s;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:nth-child(even) {
    background-color: #fafafa;
}

.data-table tr:nth-child(even):hover {
    background-color: #f5f5f5;
}

.badge {
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
}

.badge-primary {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-danger {
    background: #ffebee;
    color: #d32f2f;
}

.badge-warning {
    background: #fff3e0;
    color: #f57c00;
}

.badge-secondary {
    background: #f5f5f5;
    color: #666;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-partial {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.text-success {
    color: #28a745 !important;
    font-weight: 600;
}

.text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}

.text-center {
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 15px 20px;
    margin-top: 15px;
}

.pagination a {
    padding: 6px 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #667eea;
    transition: all 0.3s ease;
    font-size: 12px;
    min-width: 32px;
    text-align: center;
}

.pagination a:hover {
    background: #f0f0f0;
}

.pagination a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
    font-size: 13px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        max-width: 100%;
    }
    
    nav ul {
        flex-direction: column;
        gap: 5px;
    }
    
    nav a {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input {
        min-width: auto;
        width: 100%;
    }
    
    .actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary, .btn-success, .btn-warning, .btn-info {
        width: 100%;
        justify-content: center;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 5px;
        font-size: 11px;
        min-width: 80px;
        max-width: 150px;
    }
    
    .data-table td {
        height: 35px;
    }
        .data-table td[title]:hover::after {
        width: 200px;
        font-size: 11px;
        padding: 6px 10px;
    }
    /* 列宽调整 */
.data-table th, .data-table td {
    min-width: 80px;
    max-width: 300px;
}

/* 特定列宽 */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    min-width: 180px;
    max-width: 250px;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    min-width: 140px;
    max-width: 200px;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    min-width: 140px;
    max-width: 200px;
}
    .data-table tr {
        height: 35px;
    }
}

/* 详情对话框样式 */
.detail-modal .modal-content {
    max-width: 1000px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 15px 0;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 5px;
}

.detail-item {
    background: #f8f9fa;
    padding: 8px 10px;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    min-height: auto;
    margin-bottom: 0;
}

.detail-item label {
    font-weight: 600;
    color: #666;
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: 13px;
    color: #333;
    line-height: 1.3;
    word-break: break-word;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 表格列宽优化 */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 150px;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 120px;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 150px;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    width: 100px;
}

/* 操作按钮容器 */
.data-table td:last-child {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}
/* 在 style.css 中添加以下样式 */

/* 红色文本标记 */
.text-red {
    color: #dc3545 !important;
    font-weight: 600;
}

/* 冲销关联字段红色 */
.reconcile-red {
    color: #dc3545 !important;
    font-weight: bold;
    background-color: #ffe6e6 !important;
    padding: 2px 5px;
    border-radius: 3px;
}

/* 表格中冲销关联单号红色 */
.data-table td .reconcile-link {
    color: #dc3545 !important;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
}

.data-table td .reconcile-link:hover {
    color: #c82333 !important;
}

/* 详情页面红色标记 */
.detail-item .value.red {
    color: #dc3545 !important;
    font-weight: bold;
}

/* 状态标签样式增强 */
.status-badge.status-pending {
    background: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeaa7;
}

.status-badge.status-partial {
    background: #d1ecf1 !important;
    color: #0c5460 !important;
    border: 1px solid #bee5eb;
}

.status-badge.status-completed {
    background: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb;
}

.status-badge.status-warning {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb;
}

/* 表格行悬停效果增强 */
.data-table tr:hover {
    background-color: #f5f5f5 !important;
}

.data-table tr:nth-child(even):hover {
    background-color: #f0f0f0 !important;
}

/* 冲销相关记录高亮 */
.data-table tr.reconcile-related {
    background-color: #fff3cd !important;
}

.data-table tr.reconcile-related:hover {
    background-color: #ffeaa7 !important;
}

/* 负金额红色 */
.negative-amount {
    color: #dc3545 !important;
    font-weight: bold;
}

/* 冲销模态框样式 */
.reconcile-modal .modal-content {
    max-width: 700px;
}

.reconcile-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

.reconcile-info-item {
    display: flex;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.reconcile-info-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.reconcile-info-label {
    font-weight: 600;
    min-width: 120px;
    color: #666;
}

.reconcile-info-value {
    flex: 1;
    color: #333;
}

.reconcile-info-value.red {
    color: #dc3545;
    font-weight: bold;
}