/* ========== 税务新媒体脚本撰写智能体 · 政务蓝主题 ========== */
:root {
  --primary: #2374c8;            /* 税务蓝 */
  --primary-deep: #14508f;
  --primary-bright: #4a93e0;
  --primary-light: #e8f1fb;
  --primary-softer: #f2f8fd;
  --accent: #14a8c4;             /* 青（活泼点缀） */
  --accent-deep: #0b87a0;
  --accent-light: #e4f7fa;
  --bg: #f2f7fc;                 /* 淡蓝底 */
  --card: #ffffff;
  --border: #dbe6f1;
  --border-strong: #c4d6e8;
  --text: #1f2a37;
  --muted: #64748b;
  --ok: #1e7e34;
  --ok-bg: #e6f4ea;
  --warn: #9a6700;
  --warn-bg: #fff8e1;
  --bad: #b3261e;
  --bad-bg: #fdecea;
  --gray-bg: #edf3f9;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 60, 110, .05), 0 6px 18px rgba(20, 60, 110, .07);
  --shadow-lg: 0 10px 34px rgba(20, 60, 110, .15);
  --grad-blue: linear-gradient(120deg, #0f4f8f 0%, #2374c8 55%, #3f8ddd 100%);
  --grad-blue-btn: linear-gradient(135deg, #2374c8, #3f8ddd);
  --grad-accent-btn: linear-gradient(135deg, #14a8c4, #2bbfd8);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }
.hide { display: none !important; }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }
::selection { background: rgba(35, 116, 200, .18); }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 26px;
  background: var(--grad-blue);
  color: #fff; padding: 0 24px; height: 60px; position: sticky; top: 0; z-index: 50;
  border-bottom: 3px solid var(--accent);
}
.topbar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.5px);
  background-size: 22px 22px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 300px; position: relative; z-index: 1; }
.brand-badge {
  width: 38px; height: 38px; border-radius: 10px; background: #fff; color: var(--primary);
  display: grid; place-items: center; font-size: 20px; font-weight: 800;
  box-shadow: 0 0 0 2px rgba(20, 168, 196, .85), 0 4px 10px rgba(0, 0, 0, .18);
}
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 11px; opacity: .78; margin-top: 1px; letter-spacing: 1px; }
.nav { display: flex; gap: 6px; flex: 1; position: relative; z-index: 1; }
.nav a {
  color: rgba(255, 255, 255, .85); padding: 8px 16px; border-radius: 999px; font-size: 14px;
  transition: all .18s;
}
.nav a:hover { background: rgba(255, 255, 255, .16); text-decoration: none; transform: translateY(-1px); }
.nav a.active {
  background: #fff; color: var(--primary-deep); font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
}
.userbox { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.avatar {
  width: 33px; height: 33px; border-radius: 50%; background: rgba(255, 255, 255, .2);
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
  box-shadow: 0 0 0 2px rgba(20, 168, 196, .7);
}
.userinfo { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }
.userinfo .role { font-size: 11px; opacity: .78; }

/* ---------- 布局 ---------- */
.container { width: min(1560px, 96vw); margin: 20px auto; flex: 1; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px;
  animation: rise .35s ease both;
}
.panel:nth-child(2) { animation-delay: .05s; }
.panel:nth-child(3) { animation-delay: .1s; }
.panel:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.panel-title { font-size: 15px; font-weight: 800; color: var(--primary-deep); display: flex; align-items: center; gap: 8px; }
.panel-title::before {
  content: ""; width: 5px; height: 17px; border-radius: 3px; flex: none;
  background: linear-gradient(180deg, var(--accent), var(--primary-bright));
}
.panel-title svg { color: var(--primary); }
.footer {
  text-align: center; color: var(--muted); font-size: 12px; padding: 16px;
  border-top: 1px solid var(--border); background: linear-gradient(180deg, transparent, rgba(20, 168, 196, .05));
}

/* ---------- 页面 hero 分区 ---------- */
.page-hero {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background:
    radial-gradient(circle at calc(100% - 75px) -60px, rgba(20, 168, 196, .18), transparent 200px),
    linear-gradient(105deg, #fff 0%, var(--primary-softer) 55%, #e2eefb 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 22px; margin-bottom: 16px; position: relative;
  animation: rise .35s ease both;
}
.ph-icon {
  width: 52px; height: 52px; border-radius: 15px; flex: none;
  background: var(--grad-blue-btn); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(35, 116, 200, .35);
}
.ph-title {
  font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: .5px;
  display: flex; align-items: center; gap: 9px;
}
.ph-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.hero-tags { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--primary-deep);
  background: #fff; border: 1px solid #cfe1f4; border-radius: 999px; padding: 4px 11px;
  font-family: inherit; font-weight: 600; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.hero-tag:hover {
  border-color: var(--primary-bright); box-shadow: 0 4px 12px rgba(35, 116, 200, .16);
  transform: translateY(-1px);
}
.hero-tag.active { border-color: var(--primary); background: var(--primary-softer); }
.hero-tag .tag-i {
  width: 13px; height: 13px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary-deep); font-style: normal; font-size: 9px; font-weight: 800;
  display: inline-grid; place-items: center; line-height: 1;
}
.hero-tag:hover .tag-i, .hero-tag.active .tag-i { background: var(--primary); color: #fff; }

/* ---------- 悬停说明气泡（功能表述旁的解释） ---------- */
.tip-label {
  cursor: help; border-bottom: 1px dashed rgba(35, 116, 200, .45);
  text-underline-offset: 3px;
}
.tip-label.tip-on { color: var(--primary); border-bottom-color: var(--primary); }
.hover-tip {
  position: fixed; z-index: 9999; width: max-content;
  max-width: min(370px, calc(100vw - 24px));
  background: #fff; border: 1px solid #cfe1f4; border-radius: 12px;
  padding: 11px 14px; color: var(--text);
  box-shadow: 0 20px 48px rgba(14, 46, 78, .24);
  animation: tipIn .14s ease both; pointer-events: none;
}
.hover-tip::before {
  content: ""; position: absolute; width: 10px; height: 10px; background: #fff;
  border-left: 1px solid #cfe1f4; border-top: 1px solid #cfe1f4;
  left: var(--ax, 20px); margin-left: -5px; transform: rotate(45deg);
}
.hover-tip[data-place="bottom"]::before { top: -6px; }
.hover-tip[data-place="top"]::before { bottom: -6px; transform: rotate(225deg); }
.hover-tip .ht-body {
  max-height: min(56vh, 400px); overflow: auto;
  font-size: 12.5px; line-height: 1.85;
}
.hover-tip .hp-line { margin: 0; }
.hover-tip .hp-line + .hp-line { margin-top: 6px; }
@keyframes tipIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* ---------- 检索规则总览（总规则常驻展示） ---------- */
.rules-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 12px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.rules-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.rules-head b { font-size: 14px; color: var(--primary-deep); }
.rules-head .muted { font-size: 11.5px; }
.rules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; }
.rules-item { display: flex; gap: 9px; align-items: flex-start; }
.rules-no {
  font-size: 10.5px; font-weight: 800; color: var(--primary);
  background: var(--primary-light); border-radius: 6px; padding: 2px 6px; flex: none; margin-top: 1px;
}
.rules-item b { font-size: 12.5px; color: var(--text); }
.rules-item p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

/* ---------- 检索流程步骤条 ---------- */
.flow-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.flow-step {
  display: flex; align-items: center; gap: 9px; padding: 7px 16px 7px 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  box-shadow: var(--shadow); font-size: 13px; color: var(--muted); font-weight: 600;
}
.fs-num {
  width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; background: var(--gray-bg); color: var(--muted); flex: none;
}
.flow-step.current { border-color: #bcd9f2; background: linear-gradient(180deg, #fff, var(--primary-softer)); color: var(--primary-deep); }
.flow-step.current .fs-num {
  background: var(--grad-blue-btn); color: #fff; box-shadow: 0 0 0 4px rgba(35, 116, 200, .16);
}
.flow-link { width: 30px; height: 2px; margin: 0 4px; flex: none;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 11px); }

/* ---------- 表单与按钮 ---------- */
.btn {
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  border-radius: 999px; padding: 7px 18px; font-size: 13px; cursor: pointer; font-weight: 600;
  transition: all .16s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary {
  background: var(--grad-blue-btn); border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px rgba(35, 116, 200, .3);
}
.btn.primary:hover { filter: brightness(1.07); color: #fff; box-shadow: 0 6px 16px rgba(35, 116, 200, .38); }
.btn.danger { color: var(--bad); border-color: #ecc4c0; }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.btn.ok { color: var(--ok); border-color: #b7dfc2; }
.btn.ok:hover { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.btn.ghost { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .24); color: #fff; border-color: #fff; transform: none; box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.sm { padding: 4px 12px; font-size: 12px; }
input[type="text"], input[type="password"], select, textarea {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text); transition: border .15s, box-shadow .15s;
}
input[type="date"] { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13px; font-family: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus, input[type="date"]:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(35, 116, 200, .14);
}
select { appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }

.topic-bar { display: flex; gap: 10px; }
.topic-bar input { flex: 1; }
.topic-bar select { width: 130px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.7; }
.legend { color: var(--muted); font-size: 12px; margin-top: 10px; line-height: 1.7; }

/* ---------- 口径说明 callout ---------- */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(100deg, var(--accent-light), #f2fbfd);
  border: 1px solid #bde7f0; border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 11px 14px; margin-top: 12px;
  font-size: 12.5px; line-height: 1.75; color: #0f5d70;
}
.callout svg { color: var(--accent-deep); flex: none; margin-top: 2px; }

/* ---------- 运行状态 ---------- */
.run-status { display: flex; align-items: center; gap: 12px; padding: 6px 0; flex-wrap: wrap; }
.run-meta { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.run-progress {
  height: 6px; border-radius: 999px; background: #e8f1fa; overflow: hidden; margin: 10px 0 8px;
}
.run-bar {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--grad-blue-btn); transition: width .5s ease;
}
.run-hint { font-size: 12px; color: var(--muted); }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--primary-light);
  border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.run-fail { color: var(--bad); background: var(--bad-bg); border-radius: 6px; padding: 10px 12px; display: inline-block; }

/* ---------- 用户表格操作列 ---------- */
.row-act { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; white-space: nowrap; }
.row-act .btn { white-space: nowrap; }
table.data td.row-act { vertical-align: middle; padding-top: 8px; padding-bottom: 8px; }

/* ---------- 抓取情况小结 ---------- */
.crawl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.crawl-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px;
  font-size: 12px; background: #fbfdff; color: var(--text);
}
.crawl-chip b { font-weight: 700; }
.crawl-chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.crawl-chip.ok .dot { background: var(--ok, #1a9c63); }
.crawl-chip.skipped .dot { background: #c9a227; }
.crawl-chip.failed .dot, .crawl-chip.timeout .dot { background: var(--bad, #cf3b3b); }
.crawl-chip .why { color: var(--muted); font-weight: 400; }

/* 渠道无结果归因：原因 + 建议 + 逐入口明细 */
.why-bad { color: #b4322c; font-weight: 600; }
.why-advice { margin-top: 3px; color: var(--muted); font-size: 12px; }
.ch-diag { margin-top: 6px; }
.ch-diag summary {
  cursor: pointer; color: var(--primary); font-size: 12px; user-select: none;
  list-style: none;
}
.ch-diag summary::-webkit-details-marker { display: none; }
.ch-diag summary::before { content: "▸ "; }
.ch-diag[open] summary::before { content: "▾ "; }
.diag-table { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 12px; }
.diag-table th, .diag-table td {
  border: 1px solid var(--border); padding: 4px 6px; text-align: left; vertical-align: top;
}
.diag-table th { background: #f5f9fd; font-weight: 600; color: var(--primary-deep); }

/* ---------- 排序按钮 ---------- */
.sort-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sortbtn {
  border: 1px solid var(--border-strong); background: #fff; border-radius: 999px;
  padding: 4px 14px; font-size: 12px; cursor: pointer; color: var(--muted); font-weight: 600;
  transition: all .15s;
}
.sortbtn:hover { border-color: var(--primary); color: var(--primary); }
.sortbtn.active { background: var(--grad-blue-btn); border-color: transparent; color: #fff; box-shadow: 0 3px 8px rgba(35, 116, 200, .28); }

/* ---------- 操作条 ---------- */
.action-bar {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  padding-top: 14px; border-top: 1px dashed var(--border-strong); flex-wrap: wrap;
}
.action-bar .muted { margin-right: auto; }

/* ---------- AG Grid 覆写（政务蓝） ---------- */
.ag-theme-quartz {
  --ag-font-size: 13px;
  --ag-font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  --ag-border-color: var(--border);
  --ag-header-background-color: #e3eef9;
  --ag-header-foreground-color: var(--primary-deep);
  --ag-odd-row-background-color: #fbfdff;
  --ag-row-hover-color: #eef6fd;
  --ag-selected-row-background-color: #e2eefb;
  --ag-background-color: #fff;
  --ag-foreground-color: var(--text);
  --ag-wrapper-border-radius: var(--radius-sm);
  --ag-cell-horizontal-padding: 10px;
  --ag-row-border-color: #e6edf5;
  border-radius: var(--radius-sm); overflow: hidden;
}
.ag-theme-quartz .ag-header-cell { font-weight: 700; border-bottom: 2px solid #c9dcf0; }
.ag-theme-quartz .ag-row { border-color: #e6edf5; }
.ag-theme-quartz .ag-header-cell-text { color: var(--primary-deep); }
.ag-theme-quartz .ag-root-wrapper { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ag-theme-quartz input[type="checkbox"], .ag-theme-quartz .ag-checkbox-input-wrapper { accent-color: var(--primary); }

/* 素材勾选框（自绘：点击即写 picked 字段，不依赖 ag-grid 行选中态） */
.pick-box {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #b9cee3;
  background: #fff; display: inline-block; position: relative; cursor: pointer;
  transition: all .14s; box-sizing: border-box; flex: none;
}
.pick-box:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(35, 116, 200, .12); }
.pick-box.on { background: var(--grad-blue-btn); border-color: transparent; }
.pick-box.on::after {
  content: ""; position: absolute; left: 4.5px; top: 1px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.pick-box.dis { background: #f2f5f9; border-style: dashed; cursor: not-allowed; opacity: .75; }
.pick-box.dis:hover { border-color: #b9cee3; box-shadow: none; }
.link-cell { color: var(--primary); }
.link-cell:hover { text-decoration: underline; }
.clip2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.badge {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; line-height: 1.7;
  background: var(--gray-bg); color: var(--text); margin: 1px 2px; font-weight: 600;
}
.badge.blue { background: var(--primary-light); color: var(--primary-deep); }
.badge.yellow { background: var(--warn-bg); color: var(--warn); }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.red { background: var(--bad-bg); color: var(--bad); }
.star { color: #e8a33d; letter-spacing: 1px; }

/* ---------- 脚本面板 ---------- */
.script-head { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.script-title { font-size: 18px; font-weight: 800; color: var(--primary-deep); line-height: 1.4; }
.script-alt { margin-top: 6px; }
.script-block { margin: 14px 0; }
.script-block h4 {
  margin: 0 0 6px; font-size: 14px; color: var(--primary-deep); display: flex; align-items: center; gap: 7px;
}
.script-block h4::before {
  content: ""; width: 6px; height: 6px; border-radius: 2px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--primary-bright));
}
.script-sentence { line-height: 1.9; margin: 2px 0; }
.src-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 5px; background: var(--primary-light); color: var(--primary-deep);
  font-size: 11px; margin: 0 4px; cursor: help; vertical-align: 1px; font-weight: 700;
}
.proof-item {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm);
  margin: 6px 0; font-size: 13px; line-height: 1.6;
}
.proof-item .tag { font-weight: 700; flex: none; }
.proof-item.block { background: var(--bad-bg); color: var(--bad); }
.proof-item.warn { background: var(--warn-bg); color: var(--warn); }
.proof-item.info { background: var(--primary-light); color: var(--primary-deep); }

/* ---------- 表格（历史/审核/管理） ---------- */
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
table.data th {
  text-align: left; background: linear-gradient(180deg, #e9f2fb, #dce9f8); color: var(--primary-deep);
  padding: 10px; border-bottom: 2px solid #c9dcf0; white-space: nowrap; font-weight: 700;
}
table.data td { padding: 10px; border-bottom: 1px solid #e6edf5; vertical-align: top; background: #fff; }
table.data tbody tr:nth-child(even) td { background: #fbfdff; }
table.data tr:hover td { background: var(--primary-softer); }
table.data tr:last-child td { border-bottom: none; }

/* ---------- 卡片列表（审核台） ---------- */
.review-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px;
  background: #fff; box-shadow: var(--shadow); transition: transform .16s, box-shadow .16s;
}
.review-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.review-card .rc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-card .rc-title { font-weight: 800; color: var(--primary-deep); }
.review-card .rc-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.review-card .rc-body {
  margin-top: 10px; max-height: 180px; overflow: auto;
  background: linear-gradient(180deg, #fbfdff, #f5fafd);
  border: 1px solid #e6edf5; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; line-height: 1.8;
}
.review-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.review-actions input { flex: 1; }

/* ---------- 登录页（分裂式） ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 560px at 78% -12%, #e2eefb 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #e4f7fa 0%, transparent 55%),
              var(--bg);
}
.login-shell {
  display: grid; grid-template-columns: 420px 460px; width: 880px; max-width: 96vw;
  background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(20, 60, 110, .2), 0 2px 8px rgba(20, 60, 110, .08);
  animation: rise .4s ease both;
}
.login-visual {
  background: var(--grad-blue); color: #fff; padding: 44px 38px 34px;
  position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.login-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.5px);
  background-size: 22px 22px;
}
.login-visual::after {
  content: ""; position: absolute; right: -70px; bottom: -70px; width: 230px; height: 230px;
  border-radius: 50%; border: 28px solid rgba(20, 168, 196, .35);
}
.lv-badge {
  width: 54px; height: 54px; border-radius: 14px; background: #fff; color: var(--primary);
  display: grid; place-items: center; font-size: 28px; font-weight: 800; position: relative; z-index: 1;
  box-shadow: 0 0 0 2px rgba(20, 168, 196, .9);
}
.lv-title { font-size: 20px; font-weight: 800; margin: 18px 0 6px; position: relative; z-index: 1; }
.lv-sub { font-size: 12px; opacity: .82; letter-spacing: 1.5px; position: relative; z-index: 1; }
.lv-slogan {
  margin-top: 26px; padding: 12px 18px; border-radius: 12px; font-size: 16px; font-weight: 700;
  letter-spacing: 4px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3);
  position: relative; z-index: 1; width: fit-content;
}
.lv-feats { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.lv-feat { display: flex; align-items: center; gap: 11px; font-size: 13px; opacity: .95; }
.lv-feat .lf-icon {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
}
.lv-foot { margin-top: auto; padding-top: 26px; font-size: 11px; opacity: .65; position: relative; z-index: 1; }
.login-card { padding: 48px 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-card h1 { font-size: 21px; color: var(--text); margin: 0 0 4px; font-weight: 800; }
.login-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 26px; }
.login-card label { display: block; font-size: 13px; margin: 14px 0 6px; color: var(--text); font-weight: 600; }
.login-card input { width: 100%; }
.login-card .btn { width: 100%; margin-top: 24px; padding: 11px; font-size: 15px; }
.login-err { color: var(--bad); font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; }

/* ---------- 管理页 ---------- */
.tabs {
  display: inline-flex; gap: 3px; background: #e9f1fa; border-radius: 999px; padding: 4px;
  border: 1px solid var(--border);
}
.tabs button {
  border: none; background: none; padding: 7px 18px; font-size: 13px; cursor: pointer; font-weight: 600;
  color: var(--muted); border-radius: 999px; transition: all .15s;
}
.tabs button:hover { color: var(--primary); }
.tabs button.active { color: var(--primary); background: #fff; font-weight: 700; box-shadow: var(--shadow); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.form-row input, .form-row select { width: 180px; }

/* ---------- 提示 toast ---------- */
#toast {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  background: #1f2a37; color: #fff; padding: 10px 20px; border-radius: 10px;
  border-left: 4px solid var(--accent);
  font-size: 13px; z-index: 99; opacity: 0; transition: opacity .25s; pointer-events: none;
  max-width: 70vw; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
#toast.show { opacity: .96; }

/* ---------- 选题设置（检索功能台） ---------- */
.load-rule { display: flex; align-items: center; gap: 8px; }
.load-rule select { width: 220px; }
.settings-head { align-items: flex-start; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-tools .muted { white-space: nowrap; }
.collapse-btn { display: inline-flex; align-items: center; gap: 5px; }
.collapse-btn .chev { transition: transform .2s; }
.settings-panel:not(.collapsed) .collapse-btn .chev { transform: rotate(180deg); }
.settings-panel.collapsed .panel-head { margin-bottom: 0; }
.settings-panel.collapsed .panel-body { display: none; }
.settings-panel .panel-body { animation: rise .28s ease both; }
/* 渠道板块与选题设置互相独立：各自折叠、各自记忆状态 */
.channel-setup.collapsed .panel-head { margin-bottom: 0; }
.channel-setup.collapsed .panel-body { display: none; }
.channel-setup:not(.collapsed) .collapse-btn .chev { transform: rotate(180deg); }
.channel-setup .panel-body { animation: rise .28s ease both; }
.chan-hint {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 11.5px;
}
.chan-legend { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.chan-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chan-legend .dot.blue { background: var(--primary); }
.chan-legend .dot.gray { background: #9aa8ba; }

.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.rule-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rule-label { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 6px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rule-label .req { color: var(--primary); font-weight: 800; }
.rule-col textarea, .rule-col input[type="text"], .rule-col input[type="date"] { width: 100%; resize: vertical; font-family: inherit; }
.logic-row { display: flex; gap: 10px; align-items: stretch; }
.logic-row textarea { flex: 1; }
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; align-self: flex-start; background: #fff; }
.segbtn {
  border: none; background: #fff; padding: 8px 15px; font-size: 13px; cursor: pointer; font-weight: 700;
  color: var(--muted); border-right: 1px solid var(--border); transition: all .15s;
}
.segbtn:last-child { border-right: none; }
.segbtn:hover { color: var(--primary); }
.segbtn.active { background: var(--grad-blue-btn); color: #fff; }
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range input { flex: 1; min-width: 0; }
.rule-opts { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; font-weight: 600; }
.chk input { width: 15px; height: 15px; accent-color: var(--primary); }
.rule-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
#rule-desc { font-size: 12px; }
/* 主/辅词标签 */
.kw-chip {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 8px;
  border-radius: 8px; font-size: 12px; font-weight: 800; color: #fff; flex: none;
}
.kw-chip.main { background: var(--grad-blue-btn); box-shadow: 0 3px 8px rgba(35, 116, 200, .3); }
.kw-chip.aux { background: var(--grad-accent-btn); box-shadow: 0 3px 8px rgba(11, 135, 160, .3); }
.kw-tip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  color: var(--primary-deep); background: var(--primary-light); border-radius: 999px; padding: 2px 10px;
}

/* ---------- 脚本成稿 ---------- */
.scripts-layout { display: grid; grid-template-columns: 330px 1fr; gap: 18px; min-height: 480px; }
.script-list {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: auto;
  max-height: 760px; background: linear-gradient(180deg, #fbfdff, #f5fafd);
}
.script-item { padding: 13px 15px; border-bottom: 1px solid #e6edf5; cursor: pointer; transition: background .15s; }
.script-item:hover { background: var(--primary-light); }
.script-item.active {
  background: linear-gradient(90deg, var(--primary-light), transparent);
  border-left: 3px solid var(--primary); padding-left: 12px;
}
.si-title { font-weight: 700; font-size: 13px; color: var(--primary-deep); line-height: 1.45; }
.si-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.si-badges { margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.script-detail {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  background: #fff; max-height: 760px; overflow: auto; box-shadow: var(--shadow);
}
.edit-form label.rule-label { display: flex; margin: 14px 0 6px; }
.edit-form input[type="text"], .edit-form textarea { width: 100%; font-family: inherit; resize: vertical; }
.edit-block {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px;
  margin: 10px 0; background: linear-gradient(180deg, #fbfdff, #f5fafd);
}
.eb-heading { font-weight: 700; margin-bottom: 8px; }
.eb-sentence { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.eb-sentence textarea { flex: 1; }
.eb-sentence .src-badge { margin-top: 8px; flex: none; }

/* ---------- 顶部：本次检索口径概览 ---------- */
.brief-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.brief-item {
  flex: 1 1 150px; min-width: 140px; display: flex; flex-direction: column; gap: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 14px; box-shadow: var(--shadow);
}
.brief-item.wide { flex: 2 1 300px; }
.bi-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.bi-value { font-size: 14px; font-weight: 700; color: var(--primary-deep); line-height: 1.45; }
.brief-item.wide .bi-value { font-size: 12.5px; font-weight: 600; }

/* ---------- 口径名片：鼠标悬停看名词解释 ---------- */
.hero-tag.tip { position: relative; cursor: help; }
.hero-tag.tip::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 12px); right: -6px; width: 300px;
  padding: 11px 13px; border-radius: 10px; background: #123a63; color: #e9f3fb;
  font-size: 12px; font-weight: 500; line-height: 1.7; text-align: left;
  box-shadow: 0 12px 28px rgba(14, 46, 78, .3);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s, transform .18s; z-index: 40; pointer-events: none;
}
.hero-tag.tip:hover::after, .hero-tag.tip:focus::after {
  opacity: 1; visibility: visible; transform: translateY(0);
}

/* ---------- 匹配模式（模糊搜索 / 精准匹配）与精准补充条件 ---------- */
.rule-opts { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 10px; }
.opt-label { font-size: 12px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg.wide .segbtn { padding: 8px 20px; }
.adv-fields {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-strong);
  animation: advIn .22s ease both;
}
.adv-title { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .5px; }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.adv-sub { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.adv-sub .rule-label { margin-top: 4px; }
.adv-sub .logic-row { align-items: center; gap: 8px; margin-top: 4px; }
.adv-sub .segbtn { padding: 6px 16px; }
@keyframes advIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

/* ---------- 素材库：库内再筛选 ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;
  padding: 10px 12px; background: linear-gradient(180deg, #fbfdff, #f5fafd);
  border: 1px solid var(--border); border-radius: 10px;
}
.filter-bar input[type="date"] { width: 134px; padding: 5px 8px; }
.filter-bar select { width: auto; min-width: 120px; padding: 5px 8px; }
.chipbtn {
  border: 1px solid var(--border-strong); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.chipbtn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.filter-gap { flex: 1 1 12px; }

/* ---------- 取材素材清单 ---------- */
.aside-title {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 12px;
  font-weight: 800; color: var(--primary-deep); letter-spacing: .3px;
  background: linear-gradient(90deg, var(--primary-light), transparent);
  border-bottom: 1px solid #e6edf5;
}
.aside-title svg { color: var(--primary); flex: none; }
.src-panel {
  margin: 12px 0 16px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: linear-gradient(180deg, #fbfdff, #f6fafd);
}
.src-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.src-head .btn { margin-left: auto; }
.src-title-sm { font-size: 13px; font-weight: 800; color: var(--primary-deep); }
.src-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.src-item {
  display: flex; gap: 10px; align-items: flex-start; background: #fff; cursor: pointer;
  border: 1px solid #e6edf5; border-radius: 10px; padding: 9px 11px; transition: all .15s;
}
.src-item:hover { border-color: var(--primary); box-shadow: 0 6px 16px rgba(35, 116, 200, .12); transform: translateY(-1px); }
.src-no {
  flex: none; min-width: 26px; height: 22px; display: grid; place-items: center;
  border-radius: 7px; background: var(--grad-blue-btn); color: #fff; font-size: 12px; font-weight: 800;
}
.src-main { flex: 1; min-width: 0; }
.src-title {
  font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.45;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.src-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.src-hit { font-size: 11px; color: var(--accent-deep); margin-top: 3px; }
.src-link { flex: none; font-size: 11.5px; color: var(--primary); font-weight: 700; text-decoration: none; }
.btn.block { width: 100%; margin-top: 10px; justify-content: center; }

/* ---------- 分页 ---------- */
.pager-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.pager-bar select { width: auto; min-width: 84px; padding: 5px 8px; }
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagebtn {
  min-width: 32px; height: 30px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  font-size: 12.5px; cursor: pointer; transition: all .18s;
}
.pagebtn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagebtn.active {
  background: var(--grad-blue-btn); border-color: transparent; color: #fff;
  font-weight: 700; box-shadow: 0 3px 8px rgba(35, 116, 200, .28);
}
.pagegap { color: var(--muted); padding: 0 2px; }

/* ---------- 脚本成稿页：头部操作区与历史库 ---------- */
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.history-search {
  width: 320px; padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 13px; color: var(--text); background: #fff;
}
.history-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(35, 116, 200, .14); outline: none; }
.rename-btn, .export-btn {
  border: none; background: none; color: var(--primary); font-size: 11.5px;
  cursor: pointer; padding: 0 2px; text-decoration: underline dotted;
}
.rename-btn:hover, .export-btn:hover { color: var(--primary-deep); }

/* ---------- 成稿操作条（导出 / 自定义编辑，任何状态常驻） ---------- */
.script-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 12px;
  background: linear-gradient(180deg, #f8fbff, #eef6fd);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.st-label {
  font-size: 12px; font-weight: 800; color: var(--primary-deep);
  letter-spacing: .5px; padding-right: 4px;
}
.script-status-note {
  margin-top: 8px; padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--primary-softer, #f4f9fe); border-left: 3px solid var(--primary);
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
}

/* ---------- 抓取渠道选择（标准第二章 9 个渠道） ---------- */
.chan-panel {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, #f7f9fc);
  padding: 14px 16px 12px; margin-bottom: 16px;
}
.chan-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.chan-title {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px;
  color: var(--text);
}
.chan-head .muted { font-size: 12px; }
.chan-count { font-size: 12.5px; color: var(--primary); white-space: nowrap; }
.chan-tier { margin-bottom: 10px; }
.chan-tier-head {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.chan-tier-head b { font-size: 13px; color: var(--text); }
.chan-tier-head .muted { font-size: 11.5px; }
.chan-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.chan-card {
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  padding: 10px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.chan-card:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(35, 116, 200, .12); }
.chan-card.on {
  border-color: var(--primary); background: rgba(35, 116, 200, .06);
  box-shadow: 0 0 0 2px rgba(35, 116, 200, .16);
}
.chan-card.disabled { opacity: .6; }
.chan-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.chan-box {
  width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; background: #fff; flex: 0 0 16px;
}
.chan-card.on .chan-box { background: var(--primary); border-color: var(--primary); }
.chan-name { font-size: 13px; font-weight: 600; color: var(--text); }
.chan-badge {
  margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.chan-badge.blue { background: rgba(35, 116, 200, .12); color: var(--primary-deep); }
.chan-badge.gray { background: #eef1f5; color: var(--muted); }
.chan-meta { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.chan-meta b { color: var(--text); font-weight: 500; }
.chan-srcs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chan-src {
  font-size: 10.5px; padding: 2px 7px; border-radius: 4px; background: #eef3f9;
  color: var(--primary-deep); max-width: 100%;
}
.chan-foot { font-size: 11.5px; margin-top: 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .rule-grid { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scripts-layout { grid-template-columns: 1fr; }
  .chan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .rule-grid { grid-template-columns: 1fr; }
  .adv-grid { grid-template-columns: 1fr; }
  .chan-list { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; max-width: 460px; }
  .login-visual { padding: 30px 32px; }
  .lv-feats, .lv-foot { display: none; }
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 12px; }
  .brand { min-width: 0; }
}

/* ---------- 审核台：稿件详情弹层（含审核环节编辑） ---------- */
body.modal-open { overflow: hidden; }
.review-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.review-modal.hide { display: none; }
.rm-backdrop {
  position: absolute; inset: 0; background: rgba(12, 32, 56, .46);
  backdrop-filter: blur(2px);
}
.rm-sheet {
  position: relative; width: min(1080px, 96vw); height: min(88vh, 920px);
  background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(10, 30, 56, .35);
  animation: rmIn .18s ease both;
}
@keyframes rmIn { from { opacity: 0; transform: translateY(8px) scale(.995); } to { opacity: 1; transform: none; } }
.rm-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fbfdff, #f5fafd);
}
.rm-head-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rm-head-main b { font-size: 15px; color: var(--primary-deep); }
.rm-head-main .muted { font-size: 11.5px; }
.rm-head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rm-body { flex: 1; overflow: auto; padding: 16px 20px 20px; }
.rm-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--border); background: #fbfdff;
}
.rm-foot input[type="text"] { flex: 1; min-width: 220px; }
.rm-meta {
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
  padding: 8px 10px; background: #f7fafd; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 14px;
}
.rm-script-title { font-size: 19px; color: var(--text); margin: 4px 0 6px; line-height: 1.5; }
.rm-alt { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.7; }
.rm-sec { margin: 16px 0; }
.rm-sec h4 {
  font-size: 13px; color: var(--primary-deep); margin: 0 0 7px;
  padding-left: 9px; border-left: 3px solid var(--primary); line-height: 1.2;
}
.rm-sec p { margin: 0; font-size: 13.5px; line-height: 1.95; color: var(--text); }
.rm-block { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fcfdff; }
.rm-block h4 { font-size: 13.5px; color: var(--primary-deep); margin: 0 0 6px; }
.rm-sentence { margin: 6px 0; font-size: 13.5px; line-height: 1.95; }
.rm-src { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rm-src li {
  display: grid; grid-template-columns: 34px 1fr 210px 44px; gap: 8px; align-items: center;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  font-size: 12px;
}
.rm-src-no { color: var(--primary); font-weight: 800; }
.rm-src-title { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-src-meta { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-src a { color: var(--primary); text-decoration: none; }
.rm-sec ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.9; }
@media (max-width: 860px) {
  .rm-sheet { height: 92vh; }
  .rm-src li { grid-template-columns: 28px 1fr; }
  .rm-src-meta, .rm-src a { display: none; }
  .rules-grid { grid-template-columns: 1fr; }
}
