/* 合同管理系统样式表 */
/* 白色为主，黑色为辅，优雅简约大方的风格 */

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

body {
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #333333;
    line-height: 1.6;
    font-size: 14px;
}

/* 容器布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* 合同列表专用容器 - 利用更多屏幕空间但保持适当间距 */
.container-wide {
    max-width: 90%;
    margin: 0 auto;
    padding: 0 30px;
}

/* 头部导航 */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #333333;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: #333333;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: #f8f9fa;
    color: #000000;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: #666666;
    font-size: 14px;
}

.logout-btn {
    background-color: #333333;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background-color: #000000;
}

/* 主要内容区域 */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 80px);
}

.page-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.page-title {
    font-size: 28px;
    font-weight: 300;
    color: #333333;
    margin-bottom: 10px;
}

.page-subtitle {
    color: #666666;
    font-size: 16px;
}

/* 卡片样式 */
.card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.card-title {
    font-size: 18px;
    font-weight: 500;
    color: #333333;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #333333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background-color: #ffffff;
}

.form-control:focus {
    outline: none;
    border-color: #333333;
    box-shadow: 0 0 0 2px rgba(51,51,51,0.1);
}

.form-control.error {
    border-color: #dc3545;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-col {
    flex: 1;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.btn-primary {
    background-color: #333333;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #000000;
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #333333;
    border: 1px solid #ddd;
}

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

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

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: #ffffff;
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: fixed;
}

.table th,
.table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #333333;
    font-size: 13px;
}

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

/* 表格响应式容器 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 表格文本省略 */
.table-ellipsis {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 合同列表专用样式 */
.contracts-table {
    font-size: 12px;
    width: 100%;
}

.contracts-table th {
    font-size: 13px;
    padding: 10px 8px;
    font-weight: 600;
}

.contracts-table td {
    padding: 8px 6px;
    font-size: 12px;
    vertical-align: middle;
}

/* 延期状态样式 */
.delay-status {
    font-weight: bold;
}

.delay-status.overdue {
    color: #dc3545;
}

.delay-status.remaining {
    color: #28a745;
}

/* 合同类型标签页样式 */
.contract-type-tabs {
    background-color: #fff;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.contract-type-tabs .tab-link {
    transition: all 0.3s ease;
    position: relative;
}

.contract-type-tabs .tab-link:hover {
    background-color: #f8f9fa;
    color: #333 !important;
}

.contract-type-tabs .tab-link.active {
    background-color: #fff;
    color: #333 !important;
    font-weight: 600 !important;
}

.contract-type-tabs .tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #007bff;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.status-draft { background-color: #f8f9fa; color: #6c757d; }
.status-pending { background-color: #fff3cd; color: #856404; }
.status-active { background-color: #d4edda; color: #155724; }
.status-completed { background-color: #cce5ff; color: #004085; }
.status-terminated { background-color: #f8d7da; color: #721c24; }
.status-expired { background-color: #e2e3e5; color: #383d41; }

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    color: #333333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #f8f9fa;
}

.pagination .current {
    background-color: #333333;
    color: #ffffff;
    border-color: #333333;
}

/* 搜索和筛选 */
.search-filters {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: end;
}

.filter-group {
    flex: 1;
}

/* 消息提示 */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #cce5ff;
    border-color: #b3d7ff;
    color: #004085;
}

/* 响应式设计 */
@media (min-width: 1600px) {
    .container-wide {
        max-width: 92%;
        padding: 0 40px;
    }

    .contracts-table th {
        font-size: 14px;
        padding: 12px 10px;
    }

    .contracts-table td {
        font-size: 13px;
        padding: 10px 8px;
    }
}

@media (min-width: 1400px) and (max-width: 1599px) {
    .container-wide {
        max-width: 90%;
        padding: 0 35px;
    }
}

@media (max-width: 1200px) {
    .container-wide {
        max-width: 92%;
        padding: 0 25px;
    }
}

@media (max-width: 768px) {
    .container, .container-wide {
        padding: 0 15px;
        max-width: 95%;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        gap: 15px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .filter-row {
        flex-direction: column;
        gap: 15px;
    }

    .contracts-table {
        font-size: 10px;
    }

    .contracts-table th {
        font-size: 11px;
        padding: 6px 4px;
    }

    .contracts-table td {
        padding: 4px 2px;
        font-size: 10px;
    }

    .btn-sm {
        font-size: 9px !important;
        padding: 2px 4px !important;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 文本对齐 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 间距工具类 */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.ml-10 { margin-left: 10px; }
.mr-10 { margin-right: 10px; }
