/* 全局变量 */
:root {
    --primary-color: #1890ff;
    --text-color: #333;
    --border-color: #e8e8e8;
    --header-height: 64px;
    --sidebar-width: 200px;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #f0f2f5;
    padding-top: var(--header-height);
}

/* 导航头部样式 */
.nav-header {
    background: white;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-header h1 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #666;
    white-space: nowrap;
}

.logout-btn {
    padding: 4px 12px;
    color: #666;
    text-decoration: none;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    transition: all 0.3s;
    display: inline-block;
    line-height: 1.5;
}

.logout-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: #e6f7ff;
}

/* 主内容区域 */
.main-content {
    padding: 24px 48px;
    min-height: calc(100vh - var(--header-height));
    max-width: 1200px;
    margin: 0 0 0 100px;
}

/* 数据列表样式 */
.data-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

/* 头部样式 */
.header {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    flex: 1;
    min-width: 300px;
}

.header-right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 搜索框样式 */
.search-form {
    display: flex;
    gap: 12px;
    max-width: 600px;
}

.search-form input {
    flex: 1;
    min-width: 300px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
    outline: none;
}

.search-form button,
.search-form .reset-btn {
    padding: 8px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.search-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.search-form button:hover {
    background-color: #40a9ff;
}

.search-form .reset-btn {
    background-color: #fff;
    color: #666;
    border: 1px solid #d9d9d9;
}

.search-form .reset-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: #f5f5f5;
}

/* 按钮样式 */
.add-btn, .upload-btn, .download-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    border: 1px solid transparent;
}

.add-btn {
    background-color: var(--primary-color);
    color: white;
}

.add-btn:hover {
    background-color: #40a9ff;
}

.upload-btn {
    background-color: #52c41a;
    color: white;
}

.upload-btn:hover {
    background-color: #73d13d;
}

.download-btn {
    background-color: #fff;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.download-btn:hover {
    background-color: #e6f7ff;
}

/* 列表控制区域 */
.list-controls {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    flex-wrap: wrap;
    gap: 12px;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.per-page-selector select {
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.total-count {
    color: #666;
    font-size: 14px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 1rem;
}

th, td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

tr:hover {
    background-color: #f8f9fa;
}

/* 设置各列的宽度 */
th:nth-child(1), td:nth-child(1) { width: 40px; }  /* 复选框列 */
th:nth-child(2), td:nth-child(2) { width: 50px; }  /* 序号列 */
th:nth-child(3), td:nth-child(3) { width: 180px; } /* SN列 */
th:nth-child(4), td:nth-child(4) { width: 200px; } /* 企业名称列 */
th:nth-child(5), td:nth-child(5) { width: 100px; } /* 法定代表人列 */
th:nth-child(6), td:nth-child(6) { width: 100px; } /* 成立日期列 */
th:nth-child(7), td:nth-child(7) { width: 120px; } /* 行业类型列 */
th:nth-child(8), td:nth-child(8) { width: 160px; } /* 纳税人识别号列 */
th:nth-child(9), td:nth-child(9) { width: 140px; } /* 更新时间列 */
th:nth-child(10), td:nth-child(10) { width: 180px; } /* 操作列 */

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 4px;
}

.btn {
    padding: 2px 6px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    color: #000;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-secondary {
    background-color: #28a745;
    color: white;
}

.btn-success {
    background-color: #6c757d;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn:hover {
    opacity: 0.9;
}

/* 复选框样式 */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 表格样式优化 */
table th:first-child,
table td:first-child {
    width: 40px;
    text-align: center;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pagination-info {
    color: #666;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.page-link {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.page-link:hover {
    background-color: #f5f5f5;
}

.page-link.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.per-page-selector {
    margin-left: 20px;
}

.per-page-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
}

.per-page-selector select:hover {
    border-color: #007bff;
}

.per-page-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* 详情页样式 */
.detail-page {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-top: 24px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.detail-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
}

.back-btn {
    padding: 8px 16px;
    color: var(--primary-color);
    text-decoration: none;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #e6f7ff;
}

.detail-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.detail-section {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
}

.detail-section h3 {
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--text-color);
}

.detail-item {
    margin-bottom: 12px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.detail-value {
    color: var(--text-color);
    font-size: 14px;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .nav-header {
        padding: 0 16px;
    }

    .user-info {
        gap: 8px;
    }

    .logout-btn {
        padding: 4px 8px;
        font-size: 13px;
    }

    .main-content {
        padding: 16px 24px;
        margin: 0;
    }

    .data-list-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .header-actions {
        flex-direction: column;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .search-btn {
        width: 100%;
    }

    .list-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .per-page-selector {
        justify-content: space-between;
    }

    .total-count {
        text-align: center;
    }

    .detail-content {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 100px auto;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

.modal-content h2 {
    margin: 0 0 24px 0;
    color: var(--text-color);
    font-size: 20px;
}

.close {
    position: absolute;
    right: 24px;
    top: 24px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close:hover {
    background-color: #f5f5f5;
    color: #666;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.modal-content button[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.modal-content button[type="submit"]:hover {
    background-color: #40a9ff;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 编辑页面样式 */
.edit-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.edit-header h2 {
    margin: 0;
    color: #333;
}

.back-btn {
    padding: 8px 16px;
    background-color: #f5f5f5;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.back-btn:hover {
    background-color: #e0e0e0;
}

.edit-form {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.edit-form .form-group {
    margin-bottom: 20px;
}

.edit-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.edit-form input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.edit-form input:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-actions {
    margin-top: 32px;
    text-align: right;
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
    padding: 8px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #357abd;
}

/* 模态框操作按钮样式 */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.modal-actions .btn {
    padding: 6px 12px;
    font-size: 14px;
}

.delete-btn {
    background-color: #ff4d4f;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-btn:hover {
    background-color: #ff7875;
}