/* law_detail.css */
/* 内容容器样式 */
.content-container {
    width: 90%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: visible; /* 允许标签溢出 */
}

.content-container h1 {
    margin: 20px 20px;
    text-align: center;
    font-size: 40px;
    color: #2c2d41;
}

/* 顶部标题工具条 */
.law-title-bar { position: relative; }
.law-title-bar #top-edit-btn { padding:15px 20px; }

.content-container .regulation_number {
    font-size: 25px;
    color: #2c2d41;
    text-align: center;
}
/* 发布信息样式 */
.publication-info {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    align-items:center;
    gap:32px 48px;
    margin:40px 0;
    font-size:16px;
    color:#8d99af;
    text-align:center;
    max-width:100%;
}
.publication-info p { margin:0; }
.publication-info .pub-inline-edit {
    padding:10px 18px;
    font-size:14px; 
    border-radius:5px;
}

/* 【阶段2】法规标签展示样式 */
.law-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.law-tags-label {
    font-size: 16px;
    color: #8d99af;
    white-space: nowrap;
}

.law-tags-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.law-tag-chip {
    display: inline-block;
    padding: 4px 10px;
    font-size: 14px;
    color: #798095;
    background: rgba(121, 128, 149, 0.1);
    border: 1px solid rgba(121, 128, 149, 0.3);
    border-radius: 4px;
    cursor: default;
    transition: all 0.2s;
    white-space: nowrap;
}

.law-tag-chip:hover {
    background: rgba(121, 128, 149, 0.2);
    border-color: #798095;
}

.law-tag-more {
    cursor: pointer;
    background: rgba(121, 128, 149, 0.15);
    font-weight: 600;
}

.law-tag-more:hover {
    background: rgba(121, 128, 149, 0.25);
}

.law-tags-hidden {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
}

.no-tags {
    font-size: 14px;
    color: #9ca3af;
    font-style: italic;
}

/* 法规标签按钮样式 */
.publication-info .btn-law-tags {
    padding: 6px 14px;
    font-size: 14px;
    border-radius: 4px;
    /* background-color: #798095; */
    background-color: hsl(225, 12%, 53%, .8);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.2s;
    vertical-align: baseline;
}
.publication-info .btn-law-tags:hover {
    /* background-color: hsl(225, 12%, 53%, .8); */
    background-color: hsl(225, 12%, 45%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.publication-info .btn-law-tags:active {
    /* background-color: hsl(225, 12%, 45%); */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.publication-info .invalid-status {
    color: red !important;
    font-weight: bold !important;
}
.content-container .source-url a {
    color: #007BFF;
    text-decoration: none;
    transition: color 0.3s;
}

.content-container .source-url a:hover {
    color: #c81623;
}

.content-container .regulation-content {
    font-size: 20px;
    line-height: 3;
    color: #4a4a4a;
    padding: 20px 20px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    letter-spacing: 0.15em;
    overflow: visible; /* 允许标签溢出 */
}
.content-container .regulation-content img {
    max-width: 100%;
    height: auto;
}
.content-container .regulation-content img[style*="text-align: center"],
.content-container .regulation-content img[style*="text-align:center"] {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.content-container .regulation-content [data-block-id][style*="text-align: center"] img,
.content-container .regulation-content [data-block-id][style*="text-align:center"] img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.content-container .regulation-content i {
    font-size: 15px;
    font-style: italic;
}

/* 左侧浮动标签入口 */
/* 左侧浮动标签入口 - 渐变配色 + 方形圆角 */
/* 左侧浮动标签入口 - 深邃夜空 (Midnight) 配色 */
#tag-fab {
    position: fixed;
    left: 0;
    top: 60%;
    /* 默认收起，露出 5px 边缘 */
    transform: translateX(-45px);
    width: 50px;
    height: 50px;

    /* 形状：右侧圆角矩形，与关键词导航器一致 */
    border-radius: 0 10px 10px 0;

    /* 深邃夜空渐变：从深灰到纯黑 */
    background: linear-gradient(135deg, #434343 0%, #000000 100%);

    /* 默认阴影：黑色半透明 */
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.3);
    border: none;

    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;

    /* 建议换回贝塞尔曲线，滑出效果比 ease 更高级顺滑 */
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

/* 悬停或展开状态 */
#tag-fab:hover,
#tag-fab:not(.collapsed) {
    transform: translateX(0);
    /* 悬停阴影：修正为深黑色投影，增加立体感 */
    box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.6);
}

/* 内部文字样式 */
#tag-fab .tag-fab-face {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.2s;
    user-select: none;
    letter-spacing: 1px;
    /* 黑色背景下，稍微加一点字间距更好看 */
}

#tag-fab:hover .tag-fab-face {
    opacity: 1;
}

.action-buttons {
    margin-top: 30px;
    text-align: center;
}

.action-buttons button {
    margin: 0 10px;
    padding: 15px 20px;
    border-radius: 5px;
    font-size: 16px;
}
.action-buttons button:hover,.pub-inline-edit:hover{
    /* color: #798095; */
    color: #fff;
    background-color: hsl(225, 12%, 53%, .7);
    border-radius: 5px;
}


/* 编辑状态下让所有 publication-info 项垂直排列、整行显示 */
.publication-info.edit-layout {
    flex-direction:column !important;
    align-items:stretch !important;
    gap:20px;
    text-align:left;
    margin:40px 20px;
}

/* 多机构多选输入整合样式 */
.multi-select-tags { display:flex; flex-wrap:wrap; gap:8px; border:1px solid #c8ccd4;  padding:6px 10px; border-radius:6px; cursor:text; transition:border-color .25s, box-shadow .25s; position:relative; align-items:center; }
.multi-select-tags:focus-within { border-color:#3a6ff2; box-shadow:0 0 0 3px rgba(58,111,242,.2); background:#fff; }
.multi-select-tags .tags { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.multi-select-tags .agency-tag { background:#e8f0ff; border:1px solid #6d95f7; color:#2457d3; padding:4px 8px 4px 10px; border-radius:14px; font-size:14px; line-height:1.2; display:inline-flex; align-items:center; gap:6px; animation:fadeIn .25s ease; }
.multi-select-tags .agency-tag i.x { font-style:normal; cursor:pointer; color:#2457d3; opacity:.75; transition:opacity .2s, transform .2s; }
.multi-select-tags .agency-tag i.x:hover { opacity:1; transform:scale(1.15); }
.multi-select-tags input#agency_input { flex:1; min-width:120px; border:none; background:transparent; outline:none; font-size:14px; padding:4px 2px; height:28px; display:flex; align-items:center; margin:0; }
.multi-select-tags #agency_dropdown { position:absolute; left:0; top:100%; margin-top:4px; background:#fff; border:1px solid #d0d7e2; border-radius:6px; width:100%; max-height:220px; overflow:auto; box-shadow:0 4px 14px rgba(0,0,0,.12); z-index:30; }
.multi-select-tags #agency_dropdown .opt { padding:8px 12px; font-size:14px; cursor:pointer; display:block; color:#2c3e55; transition:background .15s, color .15s; }
.multi-select-tags #agency_dropdown .opt:hover, .multi-select-tags #agency_dropdown .opt.active { background:#eef4ff; color:#1a4fbf; }
.multi-select-tags #agency_dropdown mark { background:#ffe58f; padding:0 2px; border-radius:2px; }

@keyframes fadeIn { from { opacity:0; transform:scale(.95);} to { opacity:1; transform:scale(1);} }

/* 统一所有输入框的样式 */
.publication-info.edit-layout input,
.publication-info.edit-layout select {
    display: inline;
    width: 100%;
    max-width: 500px;
    padding: 10px 14px;
    margin-top: 6px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    /* background-color: #f9f9f9; */
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}
.publication-info.edit-layout input:focus,
.publication-info.edit-layout select:focus {
    border-color: #007BFF;
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.3);
    outline: none;
}

/* p 标签也换成块级展示，保持整齐 */
.publication-info.edit-layout p { width:100%; max-width:900px; }

/* 编辑模式下 - 发布机关行内布局 (label + 多选) */
/* 目标：让 field-label 与 .multi-select-tags 同一行，右侧区域自适应；可通过下面几个变量/属性快速调宽度 */
/* 编辑模式下 - 发布机关行内布局 (纯文本 label + 多选) */
.publication-info.edit-layout #issuing_agency {
    display:flex;
    align-items:center; /* 垂直居中 label 与多选框 */
    width:100%;
    flex-wrap:nowrap;
}
/* 纯文本 label 现在直接在 #issuing_agency 里，利用 ::before 无需内联 span (可选) */
/* 若想统一左侧最小宽度，可给文本包一层 span 再设宽，这里保持简洁 */
/* 多选容器设定最大宽度与其他输入保持一致（500px），超出时换行内部 tag */
.publication-info.edit-layout #issuing_agency .multi-select-tags {
    width:auto;
    flex:0 1 500px; /* 目标宽度 500，可根据需要调整 */
    max-width:500px;
    min-height:44px;
}
.publication-info.edit-layout #issuing_agency .multi-select-tags .tags { margin-right:2px; }
.publication-info.edit-layout #issuing_agency .multi-select-tags input#agency_input { min-width:60px; }
/* 如果需要整体最大宽度限制，可取消注释： */
/* .publication-info.edit-layout #issuing_agency { max-width:900px; } */
.multi-select-tags { flex:1; }
.multi-select-tags .agency-tag { white-space:nowrap; }
.multi-select-tags { align-items:center; }
.multi-select-tags .tags { align-items:center; }
.multi-select-tags { row-gap:6px; }

/* 编辑器容器 - 法规板块特定样式 */
#editor-container {
    margin: 20px 0;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    min-height: 400px;
    /* 移除 overflow: hidden，让工具栏可以正确进行粘性定位 */
    /* 注意：移除 overflow 后，容器内的内容可能会溢出圆角边界 */
}

/* 移除内层 wrapper 的边框，并修复 overflow 以支持工具栏粘性定位 */
#editor-container .content-editor-wrapper {
    border: none !important;
    border-radius: 8px !important; /* 继承外层容器的圆角 */
    overflow: visible !important; /* 关键修复：让工具栏可以粘性定位 */
}

/* 工具栏样式 */
#editor-container .content-editor-toolbar {
    position: sticky;
    top: 100px; /* header高度 */
    z-index: 99;
    background-color: #fff;
    border-bottom: 1px solid #ccc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* 确保工具栏紧贴容器顶部，没有额外空白 */
    margin: 0 !important;
    /* 保持与容器顶部圆角一致 */
    border-radius: 8px 8px 0 0;
    /* 当粘性定位时的过渡效果 */
    transition: box-shadow 0.2s ease, border-radius 0.2s ease;
}

/* 法规内容样式定制 - 大字号、宽行距、宽字距 */
#editor-container .content-editor-editable,
#editor-container .content-editor-content {
    font-size: 20px;
    line-height: 3;
    letter-spacing: 0.15em;
    padding: 20px;
    min-height: 300px;
}

/* 移除编辑区域的高度限制，让法规内容自然展开 */
#editor-container .content-editor-content {
    max-height: none !important;
    overflow-y: visible !important;
    /* 底部圆角 */
    border-radius: 0 0 8px 8px;
}

/* 阅读模式下的注释按钮样式 */
.regulation-content [data-block-id] {
    position: relative;
}

.regulation-content [data-block-id]:hover .block-comment-btn {
    display: inline-block;
}

.block-comment-btn {
    display: none;
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.block-comment-btn:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

/* ========================================
   搜索关键词高亮样式
   ======================================== */

/* 关键词文字高亮 - 基础样式 */
mark {
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700; /* 加粗显示 */
    cursor: pointer; /* 鼠标悬浮显示可点击 */
    transition: all 0.2s ease;
    user-select: none; /* 禁止文本选择 */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE/Edge */
}

/* 鼠标悬浯效果 */
mark:hover {
    opacity: 0.85;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* 关键词1：黄色 */
mark.keyword-1 {
    background-color: #ffeb3b !important;
    box-shadow: 0 1px 2px rgba(255, 235, 59, 0.3);
}

/* 关键词2：淡蓝色 */
mark.keyword-2 {
    background-color: #90caf9 !important;
    box-shadow: 0 1px 2px rgba(33, 150, 243, 0.3);
}

/* 关键词3：淡绿色 */
mark.keyword-3 {
    background-color: #a5d6a7 !important;
    box-shadow: 0 1px 2px rgba(76, 175, 80, 0.3);
}

/* 关键词4+：淡紫色 */
mark.keyword-4 {
    background-color: #ce93d8 !important;
    box-shadow: 0 1px 2px rgba(156, 39, 176, 0.3);
}

/* ========================================
   关键词 Minimap（代码地图式导航条）
   ======================================== */

#keyword-minimap {
    position: fixed;
    top: 100px; /* header 高度 */
    right: 0;
    width: 12px;
    height: calc(100vh - 100px);
    background: rgba(240, 240, 240, 0.5);
    border-left: 1px solid #e0e0e0;
    z-index: 900;
    pointer-events: all;
    transition: width 0.2s ease, background 0.2s ease;
}

#keyword-minimap:hover {
    width: 16px;
    background: rgba(240, 240, 240, 0.8);
}

/* Minimap 内的标记点 */
.minimap-marker {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.85;
}

.minimap-marker:hover {
    height: 6px;
    opacity: 1;
    z-index: 10;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

/* 标记点颜色（与关键词文字高亮对应） */
.minimap-marker.keyword-1 {
    background-color: #ffeb3b;
    border-left: 2px solid #f9a825;
}

.minimap-marker.keyword-2 {
    background-color: #90caf9;
    border-left: 2px solid #1976d2;
}

.minimap-marker.keyword-3 {
    background-color: #a5d6a7;
    border-left: 2px solid #388e3c;
}

.minimap-marker.keyword-4 {
    background-color: #ce93d8;
    border-left: 2px solid #7b1fa2;
}

/* 当前激活的标记点 */
.minimap-marker.active {
    height: 8px;
    opacity: 1;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

/* Minimap 工具提示 */
.minimap-marker::after {
    content: attr(data-keyword);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.minimap-marker:hover::after {
    opacity: 1;
}



/* ========================================
   搜索导航器 & 面板（左侧居中圆形设计）
   ======================================== */

   #search-control-panel {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: bottom 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s ease;
    font-size: 14px;
}

/* 缩起状态（无关键词时） */
#search-control-panel.collapsed {
    transform: translateY(-50%) translateX(-45px); /* 只露出5px边缘 */
}

/* 悬浮或钉住时完全显示 */
#search-control-panel.hovered,
#search-control-panel:not(.collapsed) {
    transform: translateY(-50%) translateX(0);
}
/* 无关键词时关键词导航器压缩样式 */
#search-control-panel.mini .nav-circle-up,
#search-control-panel.mini .nav-circle-down {
    display: none;
}

#search-control-panel.mini .panel-navigator {
    border-radius: 0 12px 12px 0;
}

#search-control-panel.mini .nav-center-count {
    width: 50px;
    height: 50px;
    padding: 0;
}

#search-control-panel.mini.collapsed {
    transform: translateY(-50%) translateX(-45px);
}

#search-control-panel.mini:hover {
    transform: translateY(-50%) translateX(0);
}

/* ========== 方形导航器（默认状态） ========== */
.panel-navigator {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: 2px solid #e0e0e0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    box-shadow: 3px 0 15px rgba(0, 0, 0, 0.12);
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 上方按钮（正方形） */
.nav-circle-up {
    width: 50px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 0 6px 0 0;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    border-bottom: 1px solid #e8e8e8;
}

.nav-circle-up::before {
    content: '↑';
    font-size: 20px;
    font-weight: bold;
    color: #555;
    transition: all 0.25s ease;
}

.nav-circle-up:hover {
    background: linear-gradient(180deg, #f0f0f0 0%, #f8f9fa 100%);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-circle-up:hover::before {
    color: #666;
    transform: translateY(-2px);
}

.nav-circle-up:active {
    transform: scale(1.02);
}

/* 中心计数区域 */
.nav-center-count {
    width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    border-radius: 0;
}

.nav-center-count .count-text {
    font-size: 11px;
    font-weight: 700;
    color: #333;
    text-align: center;
    line-height: 1.2;
    transition: all 0.25s ease;
}

/* 关键词文本默认隐藏 */
.nav-center-count .keyword-text {
    position: absolute;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.25s ease;
    pointer-events: none;
}

/* hover 时切换显示 */
.nav-center-count:hover .count-text {
    opacity: 0;
    transform: scale(0.8);
}

.nav-center-count:hover .keyword-text {
    opacity: 1;
    transform: scale(1);
}

.nav-center-count:hover {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-center-count:active {
    transform: scale(1.02);
}

/* 下方按钮（正方形） */
.nav-circle-down {
    width: 50px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(0deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 0 0 6px 0;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    border-top: 1px solid #e8e8e8;
}

.nav-circle-down::before {
    content: '↓';
    font-size: 20px;
    font-weight: bold;
    color: #555;
    transition: all 0.25s ease;
}

.nav-circle-down:hover {
    background: linear-gradient(0deg, #f0f0f0 0%, #f8f9fa 100%);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-circle-down:hover::before {
    color: #666;
    transform: translateY(2px);
}

.nav-circle-down:active {
    transform: scale(1.02);
}

/* ========== 展开面板（精简版 - 仅关键词） ========== */
.panel-main {
    width: 0;
    height: auto;
    overflow: hidden;
    background: white;
    border: 2px solid #e0e0e0;
    border-left: none;
    border-radius: 0 12px 12px 0;
    box-shadow: 3px 0 20px rgba(0, 0, 0, 0.15);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

/* 展开状态 */
#search-control-panel.expanded .panel-navigator {
    border-radius: 0;
    border-right: none;
    box-shadow: none;
}

#search-control-panel.expanded .panel-main {
    width: 140px;
    opacity: 1;
}

/* 面板内容区（精简） */
.panel-content {
    padding: 12px;
}

/* 关键词区域 */
.panel-keywords {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.keyword-tags {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.keyword-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    overflow: hidden;
}

/* 选中状态样式 */
.keyword-tag.active {
    transform: translateX(3px) scale(1.04);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    border: 0.5px solid rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

.keyword-tag .keyword-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* margin-right: 6px; */
}

.keyword-tag:hover {
    transform: translateX(3px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* 选中状态下的 hover 效果 */
.keyword-tag.active:hover {
    transform: translateX(6px) scale(1.1);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.4);
}

.keyword-tag:active {
    transform: translateX(2px);
}

/* 关键词标签颜色 */
.keyword-tag.keyword-1 {
    background: linear-gradient(135deg, #ffeb3b 0%, #fdd835 100%) !important;
}

.keyword-tag.keyword-2 {
    background: linear-gradient(135deg, #90caf9 0%, #64b5f6 100%) !important;
}

.keyword-tag.keyword-3 {
    background: linear-gradient(135deg, #a5d6a7 0%, #81c784 100%) !important;
}

.keyword-tag.keyword-4 {
    background: linear-gradient(135deg, #ce93d8 0%, #ba68c8 100%) !important;
}

.remove-keyword {
    cursor: pointer;
    font-style: normal;
    opacity: 0.7;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1;
    font-weight: bold;
    flex-shrink: 0;
}

.remove-keyword:hover {
    opacity: 1;
    transform: scale(1.2) rotate(90deg);
    color: #d32f2f;
}

/* 添加关键词按钮 */
.add-keyword-btn {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px dashed #ccc;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.add-keyword-btn::before {
    content: '➕';
    font-size: 10px;
    color: #888;
}

.add-keyword-btn:hover {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border-color: #999;
    color: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.add-keyword-btn:active {
    transform: translateY(0);
}

.add-keyword-input-group {
    display: flex;
    gap: 4px;
    animation: slideDown 0.3s ease;
}

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

.add-keyword-input {
    flex: 1;
    padding: 6px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    min-width: 0;
}

.add-keyword-input:focus {
    border-color: #888;
    box-shadow: 0 0 0 2px rgba(136, 136, 136, 0.15);
}

.confirm-add-btn {
    padding: 6px 10px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
    flex-shrink: 0;
}

.confirm-add-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.4);
}

.confirm-add-btn:active {
    transform: translateY(0);
}

/* 清空关键词按钮 */
.clear-keywords-btn {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #ffebee 100%);
    color: #d32f2f;
    border: 2px solid #ffcdd2;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.clear-keywords-btn::before {
    content: '🗑️';
    font-size: 12px;
}

.clear-keywords-btn:hover {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-color: #f44336;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}
 
.clear-keywords-btn:active {
    transform: translateY(0);
}

/* 应用聚焦按钮容器 */
.panel-focus-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
}

/* 应用聚焦按钮 */
.apply-focus-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.apply-focus-btn::before {
    content: '🔍';
    font-size: 14px;
}

.apply-focus-btn:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.5);
}

.apply-focus-btn:active {
    transform: translateY(0);
}

.apply-focus-btn.active {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.apply-focus-btn.active::before {
    content: '✓';
}

.apply-focus-btn.active:hover {
    background: linear-gradient(135deg, #388E3C 0%, #2E7D32 100%);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

/* 面包屑中的关键词样式（与高亮样式一致） */
.breadcrumb-keyword {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.breadcrumb-keyword-text {
    flex: 1;
}

.breadcrumb-keyword-remove {
    cursor: pointer;
    font-style: normal;
    font-weight: bold;
    opacity: 0.7;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    color: #000; /* X按钮黑色 */
}

.breadcrumb-keyword-remove:hover {
    opacity: 1;
    transform: scale(1.3);
}

/* 关键词颜色应用到面包屑（与mark高亮样式一致） */
.breadcrumb-keyword.keyword-1 {
    background-color: #ffeb3b;
    color: #000;
}

.breadcrumb-keyword.keyword-2 {
    background-color: #90caf9;
    color: #000;
}

.breadcrumb-keyword.keyword-3 {
    background-color: #a5d6a7;
    color: #000;
}

.breadcrumb-keyword.keyword-4 {
    background-color: #ce93d8;
    color: #000;
}


/* ==================== 多关联编辑器样式 ==================== */
.law-relationships-editor-multi {
    width: 100%;
}

.relationships-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

/* 单个关联项 */
.relationship-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.relationship-item:hover {
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

/* 关联项头部 */
.relationship-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.relationship-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c2d41;
}

.btn-remove-relationship {
    padding: 6px 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-remove-relationship:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.4);
}

/* 关联项主体 */
.relationship-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.relationship-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #555;
}

.relationship-field select,
.relationship-field input,
.relationship-field textarea {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.relationship-field select:focus,
.relationship-field input:focus,
.relationship-field textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.relationship-field textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

/* 添加关联按钮 */
.btn-add-relationship {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-add-relationship:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-add-relationship:active {
    transform: translateY(0);
}

/* 法规名称显示 */
.target-law-name-display {
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    display: inline-block;
    min-width: 200px;
}

.target-law-name-display.empty {
    color: #999;
    font-style: italic;
}

.target-law-name-display.loading {
    color: #2196f3;
    animation: pulse 1.5s ease-in-out infinite;
}

.target-law-name-display.valid {
    color: #4CAF50;
    font-weight: 500;
}

.target-law-name-display.error {
    color: #f44336;
    font-weight: 500;
}

.mobile-options-panel{
    display: none;
}

mark.active-highlight {
    background-color: #ff5722 !important; /* 深橙色，醒目 */
    color: #fff !important;
    border: 1px solid #e64a19;
    box-shadow: 0 0 8px rgba(255, 87, 34, 0.6);
    z-index: 10;
    position: relative;
    border-radius: 4px;
    animation: mark-pulse 0.5s ease-in-out; /* 呼吸动画 */
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes mark-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ========================================
   【移动端适配】沉浸式阅读模式 + 胶囊导航
   说明：针对屏幕宽度 < 768px 的设备（手机）
   ======================================== */
@media screen and (max-width: 768px) {
    /* 1. 容器重构：去卡片化，全屏显示 */
    .content-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 15px 16px !important;
        background-color: #fff !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        box-sizing: border-box;
    }

    /* 2. 隐藏干扰元素 */
    /* 注意：已移除 #search-control-panel，因为要显示导航器 */
    #keyword-minimap,              /* 右侧代码地图 */
    #tag-fab,                      /* 左侧悬浮标签入口 */
    .law-lineage-toggle-inline,    /* 历史沿革开关 */
    #law-lineage-panel,            /* 历史沿革面板 */
    #top-edit-btn,                 /* 顶部编辑按钮 */
    .action-buttons,               /* 底部大按钮组 */
    .law-tags-row,                 /* 管理员标签行 */
    #relationships-editor-inline,  /* 关联编辑器 */
    .block-comment-btn             /* 鼠标悬停显示的段落评论按钮 */
    {
        display: none !important;
    }

    /* 3. 标题优化 */
    .content-container h1 {
        font-size: 22px !important;
        line-height: 1.4 !important;
        margin: 10px 0 8px 0 !important;
        font-weight: 700;
        text-align: center !important;
        hyphens: auto;
    }

    .content-container .regulation_number {
        font-size: 14px !important;
        margin-bottom: 15px !important;
        color: #666;
        text-align: center !important;
    }

    /* 4. 元信息区域：水平流式布局 */
    .publication-info {
        display: flex !important;
        flex-direction: row !important;         /* 保持水平 */
        flex-wrap: wrap !important;             /* 允许换行 */
        align-items: center !important;
        gap: 8px 16px !important;
        margin: 0 0 20px 0 !important;
        padding-bottom: 15px;
        border-bottom: 1px dashed #eee;
        width: 100%;
    }

    .publication-info p {
        font-size: 13px !important;
        color: #999;
        margin: 0 !important;
        line-height: 1.5;
        width: auto !important;
        white-space: normal !important; /* 允许换行 */
    }
    


    
    .publication-info .status {
        display: none; /* 按照之前的设置隐藏部分不重要信息，如需显示可删掉此行 */
    }

    /* 5. 正文核心体验 */
    .content-container .regulation-content {
        font-size: 16px !important;       /* 稍微加大一点点，15px略小，推荐16-17px */
        line-height: 1.8 !important;      /* 2倍行距略大，1.8更紧凑舒适 */
        letter-spacing: 0.02em !important;
        padding: 10px 0 60px 0 !important; /* 底部增加 padding，防止文字被导航胶囊遮挡 */
        border: none !important;
        text-align: justify;
        color: #333;
    }

    .content-container .regulation-content img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 4px;
        margin: 10px 0;
    }

    .content-container .regulation-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 15px 0;
    }

    /* ========================================
       6. 移动端专属：右下角胶囊导航器
       ======================================== */
    
    /* 容器定位：固定在右下角 */
    #search-control-panel,
    #search-control-panel.collapsed,
    #search-control-panel.mini,
    #search-control-panel.mini.collapsed {
        display: flex !important;
        top: auto !important;
        left: auto !important;
        transform: none !important; 
        
        /* 定位 */
        bottom: 40px ;
        right: 20px !important;
        z-index: 2000 !important;
        
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* 导航器主体：水平胶囊 */
    #search-control-panel .panel-navigator {
        flex-direction: row !important;
        width: auto !important;
        height: 40px !important;
        
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(5px);
        border: 1px solid #ddd !important;
        border-radius: 20px !important; /* 胶囊圆角 */
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        overflow: hidden;
    }

    /* 按钮：强制显示上/下箭头 */
    #search-control-panel .nav-circle-up,
    #search-control-panel .nav-circle-down {
        display: flex !important;
        width: 40px !important;
        height: 100% !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        align-items: center;
        justify-content: center;
    }

    /* 调整箭头大小 */
    #search-control-panel .nav-circle-up::before,
    #search-control-panel .nav-circle-down::before {
        font-size: 16px !important;
        color: #333 !important;
        transform: none !important;
    }

    /* 中间计数区 */
    #search-control-panel .nav-center-count {
        width: 50px !important;
        height: 100% !important;
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }
    
    #search-control-panel .count-text {
        font-size: 12px !important;
        opacity: 1 !important;
        transform: none !important;
        color: #666;
    }

    /* 隐藏不需要的文字和面板 */
    #search-control-panel .keyword-text,
    #search-control-panel .panel-main {
        display: none !important;
    }

    .mobile-options-panel {
        position: fixed;
        bottom: 0; 
        left: 0;
        right: 0;
        
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid #ddd;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        padding: 20px 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        
        /* 关键修改：层级要高，但比导航器低 */
        z-index: 1999;
        
        display: flex;
        flex-direction: column;
        gap: 12px;
        
        /* 关键修改：使用 transform 隐藏到屏幕下方 */
        transform: translateY(101%); 
        /* 加上 !important 确保覆盖其他可能的 transform 设置 */
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    }

    /* 激活状态：滑上来 */
    .mobile-options-panel.active {
        /* 回到原位 */
        transform: translateY(0) !important;
    }


    /* 关键词列表容器 */
    .mobile-keywords-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        max-height: 200px; /* 限制最大高度，内容过多可滚动 */
        overflow-y: auto;
        padding-bottom: 5px;
    }

    /* 移动端关键词标签 */
    .mobile-keyword-tag {
        display: inline-flex;
        align-items: center;
        background: #f0f2f5;
        padding: 4px 10px;
        border-radius: 16px;
        font-size: 13px;
        color: #333;
    }
    
    .mobile-keyword-tag .remove-btn {
        margin-left: 6px;
        color: #999;
        font-weight: bold;
        padding: 0 4px;
    }

    /* 操作按钮行 */
    .mobile-action-row {
        display: flex;
        gap: 10px;
        border-top: 1px solid #eee;
        padding-top: 12px;
    }

    .mobile-btn {
        flex: 1;
        padding: 8px 0;
        border-radius: 6px;
        border: none;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    .mobile-btn-add { background: #e3f2fd; color: #1976d2; }
    .mobile-btn-focus { background: #e8f5e9; color: #2e7d32; }
    .mobile-btn-focus.active { background: #2e7d32; color: #fff; }
    .mobile-btn-clear { background: #ffebee; color: #c62828; }

    /* 遮罩层 - 点击空白关闭面板 */
    .mobile-backdrop {
        position: fixed;
        top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.4); /* 加深一点遮罩颜色 */
        z-index: 1998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }
    .mobile-backdrop.active {
        opacity: 1;
        visibility: visible;
    }
}