* {
    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;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.title {
    font-size: 28px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.title:hover {
    opacity: 0.8;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.nav-actions {
    display: flex;
    gap: 10px;
}

/* 统计卡片 */
.stats-section {
    display: flex;
    gap: 20px;
    padding: 20px 40px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.stat-card {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-top: 5px;
}

.stat-card.stat-detail {
    flex: 1.5;
    text-align: left;
    padding: 15px 20px;
}

.stat-detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 13px;
    color: #4b5563;
}

.stat-detail-row span:last-child {
    margin-left: auto;
    font-weight: 600;
    color: #1f2937;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.reference { background: #3b82f6; }
.dot.conflict { background: #ef4444; }
.dot.correspond { background: #10b981; }
.dot.supplement { background: #f59e0b; }
.dot.replace { background: #8b5cf6; }

/* 按钮样式 */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-back {
    background: #f0f0f0;
    color: #333;
}

.btn-back:hover {
    background: #e0e0e0;
}

.btn-success {
    background: #10b981;
    color: white;
}

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

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

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-link {
    background: transparent;
    color: #667eea;
    padding: 4px 8px;
}

.btn-link:hover {
    text-decoration: underline;
}

/* 页面切换 */
.page {
    display: none;
    padding: 40px;
    animation: fadeIn 0.3s;
}

.page.active {
    display: block;
}

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

/* 搜索区域 */
.search-section {
    text-align: center;
    margin-bottom: 40px;
}

.search-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.search-box {
    display: flex;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box select {
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.search-box select:focus {
    outline: none;
    border-color: #667eea;
}

/* 标准列表 */
.standards-list {
    display: grid;
    gap: 16px;
}

.standard-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.standard-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.standard-code {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.standard-name {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.standard-meta {
    display: flex;
    gap: 20px;
    color: #6b7280;
    font-size: 14px;
    flex-wrap: wrap;
}

.standard-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.standard-tag {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.electric-tag {
    background: #fef3c7;
    color: #92400e;
}

/* 详情页 */
.detail-header {
    margin-bottom: 30px;
    position: relative;
}

.detail-actions {
    position: absolute;
    top: 0;
    right: 0;
}

.standard-info {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.standard-info h2 {
    color: #1f2937;
    margin-bottom: 12px;
}

.standard-info p {
    color: #4b5563;
    line-height: 1.6;
}

.standard-info .meta-row {
    display: flex;
    gap: 30px;
    margin-top: 15px;
    color: #6b7280;
    font-size: 14px;
    flex-wrap: wrap;
}

/* 条款区域 */
.clauses-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.page-search-box {
    margin-bottom: 20px;
}

.page-search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.page-search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.clauses-list {
    display: grid;
    gap: 6px;
}

/* 条款卡片 */
.clause-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

/* 条款层级样式 */
.clause-depth-0 {
    background: #f8fafc;
}

.clause-depth-1 {
    background: #ffffff;
    border-left: 3px solid #667eea;
}

.clause-depth-2 {
    background: #fefefe;
    border-left: 3px solid #a78bfa;
}

.clause-depth-3 {
    background: #fefefe;
    border-left: 3px solid #c4b5fd;
}

.clause-card.highlight {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.clause-card.hidden {
    display: none;
}

.clause-header {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.clause-header:hover {
    background: #f1f5f9;
}

.clause-number {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* 条款级别标签（是否强制） */
.clause-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.clause-level {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.clause-level.mandatory {
    background: #fee2e2;
    color: #991b1b;
}

.clause-level.optional {
    background: #dbeafe;
    color: #1e40af;
}

.clause-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-top: 4px;
}

.clause-content {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    margin-top: 4px;
}

.expand-icon {
    font-size: 20px;
    color: #9ca3af;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.clause-card.expanded .expand-icon {
    transform: rotate(180deg);
}

/* 条款详情区域 */
.clause-detail {
    display: none;
    padding: 0 16px 12px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.clause-card.expanded .clause-detail {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 2000px; }
}

/* 执行说明 */
.execution-note {
    margin-top: 10px;
    padding: 10px 12px;
    background: #fef3c7;
    border-radius: 6px;
    border-left: 4px solid #f59e0b;
}

.execution-note h4 {
    color: #92400e;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.execution-note p {
    color: #78350f;
    font-size: 14px;
    line-height: 1.6;
}

.execution-note textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

/* 关联关系 */
.relations-section {
    margin-top: 10px;
}

.relations-section h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.relation-item {
    padding: 8px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 6px;
}

.relation-item.incoming {
    background: #fdf4ff;
    border-color: #f5d0fe;
}

.relation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.relation-type {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.type-引用 { background: #dbeafe; color: #1e40af; }
.type-冲突 { background: #fee2e2; color: #991b1b; }
.type-对应 { background: #d1fae5; color: #065f46; }
.type-补充 { background: #fef3c7; color: #92400e; }
.type-替代 { background: #ede9fe; color: #5b21b6; }

.relation-direction {
    font-size: 12px;
    color: #6b7280;
}

.relation-actions {
    display: flex;
    gap: 6px;
}

.related-clause {
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
}

.related-clause:hover {
    color: #667eea;
    text-decoration: underline;
}

.related-clause-info {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.relation-description {
    font-size: 13px;
    color: #4b5563;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

/* 关联条款信息行 */
.related-clause-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
}

.related-clause-info-row:last-of-type {
    border-bottom: none;
}

.related-clause-info-row .info-label {
    color: #6b7280;
    min-width: 70px;
    flex-shrink: 0;
}

.related-clause-info-row .info-value {
    color: #111827;
    flex: 1;
}

.clause-path-link {
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
}

.clause-path-link:hover {
    color: #4f46e5;
}

/* 工程公司执行标准区域 */
.execution-standard-section {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.execution-standard-section h4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: #166534;
    font-size: 15px;
}

.execution-standard-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.execution-standard-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.execution-standard-row .label {
    color: #6b7280;
    min-width: 100px;
}

.execution-standard-row .value {
    color: #111827;
    font-weight: 500;
}

/* 是否高于国标的状态样式 */
.higher-yes {
    color: #dc2626 !important;
    font-weight: 600 !important;
}

.higher-no {
    color: #059669 !important;
    font-weight: 600 !important;
}

.higher-unknown {
    color: #9ca3af !important;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* 模态框 */
.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;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
    color: #1f2937;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #1f2937;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* 搜索结果 */
.search-results {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.search-result-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8fafc;
}

.search-result-item.selected {
    background: #ede9fe;
}

.result-code {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

.result-title {
    font-size: 14px;
    color: #1f2937;
    margin-top: 4px;
}

.result-content {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

/* 提示信息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    z-index: 2000;
    animation: slideInRight 0.3s;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

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

/* 响应式 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .title {
        font-size: 22px;
    }

    .page {
        padding: 20px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box select {
        min-width: auto;
        width: 100%;
    }

    .standard-meta {
        flex-direction: column;
        gap: 8px;
    }

    .stats-section {
        flex-wrap: wrap;
        padding: 15px;
    }

    .stat-card {
        min-width: calc(50% - 10px);
    }

    .stat-card.stat-detail {
        min-width: 100%;
    }
}

/* 关联条款显示样式 */
.related-clauses-section {
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.related-clauses-section h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: #374151;
    font-weight: 600;
}

.related-clauses-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.related-clause-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
}

.related-clause-item:last-child {
    margin-bottom: 0;
}

.related-std {
    font-weight: 600;
    color: #4f46e5;
}

.related-path {
    color: #6b7280;
}

.related-exec {
    color: #059669;
    font-size: 12px;
    margin-left: auto;
}

.sync-option {
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4f46e5;
}

.checkbox-label span {
    user-select: none;
}

/* 搜索结果项样式优化 */
.search-result-item {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.search-result-item:hover {
    border-color: #667eea;
    background: #f8fafc;
}

.search-result-item .result-header {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
}

.search-result-item .result-code {
    font-weight: 600;
    color: #4f46e5;
    font-size: 13px;
}

.search-result-item .result-path {
    color: #6b7280;
    font-size: 13px;
}

.search-result-item .result-content {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 已选条款内容显示 */
.selected-clause-content {
    margin-top: 12px;
    padding: 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
}

.selected-clause-label {
    font-size: 13px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 8px;
}

.selected-clause-text {
    font-size: 14px;
    color: #1f2937;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* 关键程度样式 */
.criticality-high {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.criticality-medium {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.criticality-low {
    background: #d1fae5;
    color: #065f46;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* 标准卡片头部行 */
.standard-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* 主标准标识 */
.primary-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* 标准卡片操作区域 */
.standard-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

/* 主标准按钮激活状态 */
.btn-primary-active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
}

.btn-primary-active:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* 轮廓按钮 */
.btn-outline {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #9ca3af;
}

/* 强制/推荐切换样式 - 简洁版 */
.mandatory-toggle {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.mandatory-toggle.is-mandatory {
    background: #fee2e2;
    color: #991b1b;
}

.mandatory-toggle.is-mandatory:hover {
    background: #fecaca;
}

.mandatory-toggle.is-optional {
    background: #dbeafe;
    color: #1e40af;
}

.mandatory-toggle.is-optional:hover {
    background: #bfdbfe;
}


/* 支持文本中的换行符显示为换行 */
.clause-content,
.related-clause-info-row .info-value,
.standard-remark,
.relation-description,
.execution-standard-content .value,
.result-content {
    white-space: pre-wrap;   /* 保留换行和空格，自动换行 */
    word-break: break-word;  /* 长单词/URL 自动换行 */
}
.edit-clause-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 6px;
    color: #6b7280;
}
.edit-clause-btn:hover {
    color: #3b82f6;
}

.sort-order-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 6px;
    background-color: #f59e0b;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}
.sort-order-button:hover {
    background-color: #d97706;
}

.higher-yes { background-color: #e6f7e6; color: #2e7d32; }
.higher-no { background-color: #fff3e0; color: #ef6c00; }
.higher-detail { background-color: #e3f2fd; color: #0d47a1; }
.higher-partial { background-color: #f3e5f5; color: #6a1b9a; }
.higher-not-apply { background-color: #fbe9e7; color: #bf360c; }
.higher-unknown { background-color: #f5f5f5; color: #616161; }

.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}
#search-mode {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
}
.analysis-content {
    padding: 20px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stats-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
}
.clause-list {
    list-style: none;
    padding: 0;
}
.clause-item {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0;
}
.clause-path {
    font-weight: 600;
    color: #2d3748;
}
.clause-content {
    color: #4a5568;
    font-size: 14px;
    margin-top: 4px;
}
/* 关联关系统计横向布局 */
.relation-stats-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-around;
    margin-top: 12px;
}

.relation-stat-item {
    flex: 1;
    min-width: 80px;
    text-align: center;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 8px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.relation-stat-item:hover {
    background: #eef2ff;
    transform: translateY(-2px);
}

.relation-type {
    display: block;
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 6px;
    font-weight: 500;
}

.relation-count {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

/* 响应式：小屏幕时自动换行 */
@media (max-width: 640px) {
    .relation-stat-item {
        min-width: 70px;
        padding: 8px 4px;
    }
    .relation-count {
        font-size: 20px;
    }
}

/* 权限控制：默认隐藏所有 admin-only 元素 */
.admin-only {
    display: none !important;
}

/* 管理员登录后，在 body 上加 user-admin 类，显示这些元素 */
body.user-admin .admin-only {
    display: inline-block !important;
}