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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: #f6f2ea;
}

.navbar {
    background: linear-gradient(90deg, #1f2933 0%, #3b2c20 40%, #7c4b12 100%);
    color: #fdf7e3;
    padding: 14px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px;
}

.nav-container h2 {
    font-size: 20px;
}

.nav-menu {
    display: flex;
    justify-content: center;
    width: 100%;
}

.nav-main {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    align-items: center;
}

.nav-main-item {
    position: relative;
}

.nav-main-link {
    color: #fdf7e3;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}

.nav-main-link:hover {
    background: rgba(253, 215, 99, 0.18);
    box-shadow: 0 0 0 1px rgba(253, 215, 99, 0.8);
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(24, 28, 36, 0.98);
    padding: 8px 0;
    border-radius: 4px;
    min-width: 130px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 1000;
}

.nav-dropdown a {
    display: block;
    color: #fdf7e3;
    text-decoration: none;
    padding: 6px 14px;
    font-size: 13px;
    white-space: nowrap;
}

.nav-dropdown a:hover {
    background: rgba(253,215,99,0.16);
}

.nav-main-item:hover .nav-dropdown {
    display: block;
}

.nav-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.nav-title .title {
    font-size: 24px;
    font-weight: bold;
}

.nav-title .subtitle {
    font-size: 12px;
    color: #b0c4de;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e63946;
    color: #fffaf0;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 22px auto;
    padding: 0 20px 30px;
    box-sizing: border-box;
}

.alert {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.alert-success {
    background: #f2fbf1;
    color: #1b5e20;
    border: 1px solid #c5e1a5;
}

.alert-error {
    background: #fff2f1;
    color: #b71c1c;
    border: 1px solid #ffcdd2;
}

.alert-warning {
    background: #fff8e1;
    color: #e65100;
    border: 2px solid #ffb74d;
    font-weight: 500;
    padding: 14px 16px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #f6c453, #f4a261);
    color: #3c2100;
    box-shadow: 0 2px 6px rgba(244, 162, 97, 0.55);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ffd56b, #f4a261);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.table-container {
    background: #fffdf7;
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    border: 1px solid rgba(253, 215, 99, 0.35);
    width: 100%;
}

/* 通用分块卡片（首页“业务范围/合作方概览/代理条款”等使用） */
.section-card {
    background: #fffdf7;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(253, 215, 99, 0.45);
}

.section-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #1f2937;
}

.section-card .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.section-card .stat-card {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fffaf0;
}

.section-card .stat-card .label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.section-card .stat-card .value {
    font-size: 20px;
    font-weight: 600;
}

.section-card .stat-card .accent-primary {
    color: #2563eb;
}

.section-card .stat-card .accent-warning {
    color: #d97706;
}

.section-card .stat-card .accent-danger {
    color: #dc2626;
}

/* 确保操作列在滚动时保持可见 */
.table-container table th:last-child,
.table-container table td:last-child {
    position: sticky;
    right: 0;
    background: #fffdf7;
    z-index: 10;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
}

.table-container table thead th:last-child {
    background: #f8f9fa;
    z-index: 11;
}

table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

th, td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

th {
    white-space: nowrap;
}

td {
    white-space: normal;
    word-wrap: break-word;
}

/* ===== 业务列表列宽（保留原有设置） ===== */
th:nth-child(1), td:nth-child(1) { width: 60px; min-width: 60px; } /* 序号 */
th:nth-child(2), td:nth-child(2) { width: 180px; min-width: 180px; max-width: 220px; } /* 企业名称 */
th:nth-child(3), td:nth-child(3) { width: 90px; min-width: 90px; } /* 注册日期 */
th:nth-child(4), td:nth-child(4) { width: 80px; min-width: 80px; } /* 服务价格 */
th:nth-child(5), td:nth-child(5) { width: 70px; min-width: 70px; } /* 收款周期 */
th:nth-child(6), td:nth-child(6) { width: 90px; min-width: 90px; } /* 起始 */
th:nth-child(7), td:nth-child(7) { width: 90px; min-width: 90px; } /* 结束 */
th:nth-child(8), td:nth-child(8) { width: 100px; min-width: 100px; max-width: 150px; } /* 服务项目 */
th:nth-child(9), td:nth-child(9) { width: 70px; min-width: 70px; } /* 状态 */
th:nth-child(10), td:nth-child(10) { width: 70px; min-width: 70px; } /* 收款状态 */
th:nth-child(11), td:nth-child(11) { width: 80px; min-width: 80px; } /* 负责人 */
th:nth-child(12), td:nth-child(12) { width: 100px; min-width: 100px; max-width: 150px; } /* 中介 */
th:nth-child(13), td:nth-child(13) { width: 80px; min-width: 80px; } /* 业务员 */
th:nth-child(14), td:nth-child(14) { width: auto; min-width: 280px; white-space: nowrap; position: sticky; right: 0; background: white; z-index: 10; } /* 操作 - 固定在右侧 */

/* ===== 用户管理列表列宽（按 .user-table 区分，避免影响其它表） ===== */
.user-table th:nth-child(1),
.user-table td:nth-child(1) { width: 55px; min-width: 55px; } /* ID */
.user-table th:nth-child(2),
.user-table td:nth-child(2) { width: 120px; min-width: 100px; max-width: 160px; } /* 用户名 */
.user-table th:nth-child(3),
.user-table td:nth-child(3) { width: 90px; min-width: 80px; } /* 角色 */
.user-table th:nth-child(4),
.user-table td:nth-child(4) { width: 200px; min-width: 140px; max-width: 260px; } /* 邮箱 */
.user-table th:nth-child(5),
.user-table td:nth-child(5) { width: 120px; min-width: 90px; } /* 手机 */
.user-table th:nth-child(6),
.user-table td:nth-child(6) { width: 200px; min-width: 160px; max-width: 260px; } /* 地区 */
.user-table th:nth-child(7),
.user-table td:nth-child(7) { width: 160px; min-width: 130px; max-width: 220px; } /* 职业/公司 */
.user-table th:nth-child(8),
.user-table td:nth-child(8) { width: 100px; min-width: 90px; } /* 状态 */
.user-table th:nth-child(9),
.user-table td:nth-child(9) { width: 140px; min-width: 120px; max-width: 200px; } /* 关联中介 */
.user-table th:nth-child(10),
.user-table td:nth-child(10) { width: 150px; min-width: 130px; } /* 创建时间 */
.user-table th:nth-child(11),
.user-table td:nth-child(11) { width: 210px; min-width: 190px; white-space: nowrap; } /* 操作 */

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

tr:hover {
    background: #f8f9fa;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

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

.status-将到期 {
    background: #fff3cd;
    color: #856404;
}

.status-逾期 {
    background: #f8d7da;
    color: #721c24;
}

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

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    gap: 5px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background: white;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination .current {
    background: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: bold;
}

.pagination .disabled {
    color: #999;
    cursor: not-allowed;
    background: #f5f5f5;
}

.pagination .disabled:hover {
    background: #f5f5f5;
    color: #999;
    border-color: #ddd;
}

.pagination-info {
    margin: 0 10px;
    color: #666;
    font-size: 14px;
}

/* ===== OCR 固定框裁剪弹层（PC/H5 共用） ===== */
.ocr-cropper-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.ocr-cropper-panel {
    width: min(920px, 96vw);
    height: min(720px, 92vh);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
}

.ocr-cropper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
}

.ocr-cropper-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.ocr-cropper-x {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    background: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.ocr-cropper-canvas-wrap {
    position: relative;
    flex: 1 1 auto;
    background: #111;
}

.ocr-cropper-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.ocr-cropper-hint {
    position: absolute;
    left: 10px;
    bottom: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
}

.ocr-cropper-controls,
.ocr-cropper-actions {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.ocr-btn {
    border: 1px solid #ddd;
    background: #fff;
}

/* ===== 法律协议页面布局（参照腾讯电子签风格） ===== */
.legal-page {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0;
    max-width: 1200px;
    margin: 10px auto 30px;
    background: transparent;
}

.legal-sidebar {
    background: #ffffff;
    border-radius: 8px 0 0 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    border-right: none;
    padding: 18px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.legal-sidebar-header {
    border-bottom: 1px solid #f1f1f1;
    padding-bottom: 10px;
}

.legal-product-name {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.legal-doc-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.legal-meta {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legal-meta-item .label {
    color: #9ca3af;
}

.legal-meta-item .value {
    color: #374151;
}

.legal-nav {
    margin-top: 8px;
}

.legal-nav-title {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.legal-nav-link {
    display: block;
    font-size: 13px;
    color: #374151;
    padding: 6px 8px;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 2px;
}

.legal-nav-link:hover {
    background: #f3f4f6;
}

.legal-nav-link.active {
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}

.legal-content {
    background: #ffffff;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    padding: 18px 22px 24px;
}

.legal-content-inner {
    height: calc(100vh - 160px);
    min-height: 460px;
    display: flex;
    flex-direction: column;
}

.legal-breadcrumb {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.legal-breadcrumb .crumb-main {
    color: #4b5563;
}

.legal-breadcrumb .crumb-current {
    color: #111827;
}

.legal-breadcrumb .crumb-sep {
    margin: 0 4px;
}

.legal-content-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 6px 0 14px;
}

.legal-content-body {
    flex: 1 1 auto;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
    overflow-y: auto;
}

.legal-markdown {
    margin: 0;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-size: 13px;
    line-height: 1.7;
    color: #374151;
}

.legal-markdown h1,
.legal-markdown h2,
.legal-markdown h3,
.legal-markdown h4 {
    margin: 12px 0 6px;
    font-weight: 600;
    color: #111827;
}

.legal-markdown p {
    margin: 6px 0;
}

.legal-markdown ul,
.legal-markdown ol {
    padding-left: 20px;
    margin: 6px 0;
}

.legal-markdown strong {
    font-weight: 600;
}

@media (max-width: 900px) {
    .legal-page {
        grid-template-columns: 1fr;
    }
    .legal-sidebar {
        border-radius: 8px 8px 0 0;
        border-right: 1px solid #e5e7eb;
    }
    .legal-content {
        border-radius: 0 0 8px 8px;
        border-top: none;
    }
    .legal-content-inner {
        height: auto;
        min-height: 0;
    }
}

