/* ===== 全局基础 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --theme: #2563eb;
  --theme-soft: #eff6ff;
  --theme-dark: #1d4ed8;
  --accent: #f59e0b;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --text-soft: #64748b;
  --text-mute: #94a3b8;
  --border: #e2e8f0;
  --border-soft: #eef2f7;
  --red: #ef4444;
  --red-soft: #fff1f2;
  --notice: #fef3c7;
  --notice-text: #92400e;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
  --shadow: 0 4px 14px rgba(15,23,42,.06);
  --shadow-lg: 0 10px 28px rgba(15,23,42,.08);
  --radius: 14px;
  --radius-sm: 10px;
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .15s, opacity .15s; }
a:hover { color: var(--theme); }
img { max-width: 100%; vertical-align: middle; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ===== 容器 / 布局 ===== */
.container {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  position: relative;
}

/* 顶部 LOGO 区 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #ffffff;
  color: var(--text);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.site-header .logo { display: flex; align-items: center; gap: 12px; }
.site-header .logo img { height: 40px; max-width: 200px; }
.site-header .site-title { font-size: 17px; font-weight: 800; line-height: 1.2; color: var(--text); }
.site-header .site-subtitle { font-size: 12px; color: var(--text-soft); line-height: 1.2; margin-top: 2px; }
.site-header .right-logo img { height: 36px; max-width: 90px; }
.site-header .nav-link {
  font-size: 13px; color: var(--text-soft);
  padding: 6px 10px; border-radius: 999px;
  background: var(--theme-soft);
}
.site-header .nav-link:hover { color: var(--theme); }

/* 模块卡片 */
.module {
  margin: 12px 14px 0;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.module:last-child { margin-bottom: 14px; }

/* 模块标题：浅色 + 左侧色条 */
.module-title {
  position: relative;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 14px 12px 18px;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 10px;
}
.module-title::before {
  content: "";
  position: absolute; left: 0; top: 18%; bottom: 18%;
  width: 4px; border-radius: 2px;
  background: linear-gradient(180deg, var(--theme), var(--theme-dark));
}
.module-title .subtitle {
  font-size: 12px; color: var(--text-mute); font-weight: 500;
  margin-left: auto;
}
.module-body { padding: 14px; }

/* 公告 / 跑马灯（重新设计：单一徽章 + 居中跑道，不再使用 ::before 伪元素） */
.marquee {
  display: flex;
  align-items: center;
  height: 36px;
  margin: 12px 14px 0;
  padding: 0 12px;
  background: var(--notice);
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: var(--notice-text);
  font-size: 14px;
  line-height: 1;
  overflow: hidden;
}
.marquee .marquee-tag {
  flex: 0 0 auto;
  padding: 4px 10px;
  margin-right: 10px;
  background: var(--notice-text);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.marquee .marquee-inner {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}
.marquee .marquee-track {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 22s linear infinite;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.marquee .marquee-track span { padding: 0 24px; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* 横幅 */
.banner img { width: 100%; display: block; border-radius: var(--radius); }
.module.banner { background: transparent; border: none; box-shadow: none; padding: 0; }
.module.banner .module-body { padding: 0; }

/* 开奖面板 */
.lottery-tabs {
  display: flex; gap: 8px;
  padding: 12px 12px 0;
  background: #fff;
}
.lottery-tab {
  flex: 1; padding: 10px 0; text-align: center; cursor: pointer;
  border-radius: 10px; font-weight: 600; font-size: 14px;
  background: #f8fafc; color: var(--text-soft); border: 1px solid var(--border-soft);
  transition: all .15s;
}
.lottery-tab:hover { color: var(--theme); border-color: var(--theme-soft); background: var(--theme-soft); }
.lottery-tab.active {
  background: var(--theme); color: #fff; border-color: var(--theme);
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}
.lottery-content { padding: 14px; }
.lottery-info {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--text-soft); margin-bottom: 12px;
  flex-wrap: wrap; gap: 6px;
}
.lottery-info .lname { font-size: 16px; color: var(--text); font-weight: 700; }
.lottery-info .lperiod { color: var(--theme); font-weight: 700; }
.lottery-info .ltime { font-size: 12px; color: var(--text-mute); }
.lottery-info .more {
  font-size: 12px; color: var(--theme); padding: 3px 10px;
  background: var(--theme-soft); border-radius: 999px;
}

.balls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; padding: 8px 0; }
/* 号码球：六合彩三色（红/蓝/绿） */
.ball {
  width: 40px; height: 40px; border-radius: 50%;
  font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #94a3b8, #475569);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.18), inset 0 2px 3px rgba(255,255,255,.35), 0 2px 6px rgba(0,0,0,.12);
  border: none;
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.ball.red {
  background: radial-gradient(circle at 32% 32%, #ff8c8c 0%, #ef4444 45%, #b91c1c 100%);
}
.ball.blue {
  background: radial-gradient(circle at 32% 32%, #93c5fd 0%, #3b82f6 45%, #1e40af 100%);
}
.ball.green {
  background: radial-gradient(circle at 32% 32%, #86efac 0%, #22c55e 45%, #15803d 100%);
}
.ball.special {
  position: relative;
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}
.ball.plus {
  color: var(--text-mute); background: transparent; box-shadow: none; border: none;
  font-size: 22px; font-weight: 700; text-shadow: none;
}
.ball-zodiac {
  font-size: 11px; color: var(--text-soft);
  margin-top: 4px; text-align: center;
}

/* === 号码卡（圆角矩形版，参考样图）：上半数字、下半生肖/五行 === */
.ball-card {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: 50px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #94a3b8 0%, #475569 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18);
  position: relative;
}
.ball-card.red   { background: linear-gradient(180deg, #f23030 0%, #c11414 100%); }
.ball-card.blue  { background: linear-gradient(180deg, #1f6dff 0%, #1145c1 100%); }
.ball-card.green { background: linear-gradient(180deg, #0fb85a 0%, #088f3f 100%); }
.ball-card.special {
  box-shadow: 0 2px 8px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.18),
              inset 0 0 0 2px #f59e0b;
}
/* 紧凑版（用于历史表格里的小球） */
.ball-card.compact { width: 36px; }
.ball-card.compact .ball { height: 28px; font-size: 14px; }
.ball-card.compact .ball-zodiac { font-size: 10px; padding: 1px 0 2px; }

/* 重置：在 .ball-card 内部的 .ball 不再是圆球，而是大字数字 */
.ball-card .ball {
  width: 100%;
  height: 38px;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 3px rgba(0,0,0,.4), 0 0 1px rgba(0,0,0,.45);
  letter-spacing: 0;
}
/* 重置：在 .ball-card 内部的 .ball-zodiac 占下半，半透明黑色覆盖层 */
.ball-card .ball-zodiac {
  width: 100%;
  margin: 0;
  padding: 2px 0 3px;
  background: rgba(0,0,0,.24);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  letter-spacing: 0;
  line-height: 1.35;
  min-height: 18px;
}

/* 直播态号码卡：灰色基底 + 占位字呼吸 */
.ball-card.live {
  background: linear-gradient(180deg, #cbd5e1 0%, #475569 100%);
}
.ball-card.live .ball {
  font-size: 16px;
  animation: liveBall 1.1s ease-in-out infinite;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* 号码之间的"+"分隔（与卡片中线对齐） */
.ball-plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px;
  font-size: 22px; font-weight: 800; color: var(--text-mute);
  line-height: 1;
}

/* 下一期开奖倒计时 */
.next-draw {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 10px;
  font-size: 13px; color: var(--text-soft);
  flex-wrap: wrap;
}
.next-draw .cd {
  display: inline-block;
  min-width: 84px;
  padding: 3px 10px;
  background: var(--theme-soft, #eef4ff);
  color: var(--theme, #2563eb);
  border-radius: 5px;
  font-weight: 800;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 1px;
  text-align: center;
  font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--theme, #2563eb) 18%, transparent);
}
.next-draw .np-target { font-size: 12px; color: var(--text-mute, #94a3b8); }
.next-draw.imminent .cd {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
  animation: cdPulse 1s ease-in-out infinite;
}
@keyframes cdPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234,88,12,.35); }
  50%      { box-shadow: 0 0 0 6px rgba(234,88,12,0); }
}

/* === 直播开奖：占位球 + 弹出动画 + 直播标签 === */
.ball.live {
  background: radial-gradient(circle at 32% 32%, #cbd5e1 0%, #64748b 55%, #334155 100%);
  color: #fff;
  font-size: 16px;
  animation: liveBall 1.1s ease-in-out infinite;
}
@keyframes liveBall {
  0%, 100% { transform: scale(1);   filter: brightness(1); }
  50%      { transform: scale(1.06); filter: brightness(1.18); }
}
.ball.pop-in { animation: popIn .45s cubic-bezier(.22,1.6,.36,1) both; }
@keyframes popIn {
  0%   { transform: scale(.2);  opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}
.lottery-info.live .lperiod { color: #dc2626; }
.live-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #b91c1c; font-weight: 700; font-size: 12px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220,38,38,.6);
  animation: livePulse 1.2s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0    rgba(220,38,38,.65); }
  70%  { box-shadow: 0 0 0 10px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0    rgba(220,38,38,0); }
}

.draw-history {
  margin-top: 14px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.draw-history-title {
  font-size: 12px; color: var(--text-mute); margin-bottom: 6px;
}
.draw-history-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 8px; border-radius: 8px;
  font-size: 13px;
}
.draw-history-row:nth-child(2n) { background: #f8fafc; }
.draw-history-row .p { color: var(--text); font-weight: 700; min-width: 56px; }
.draw-history-row .n { color: var(--text-soft); flex: 1; word-break: break-all; }

/* 预测表格 —— 沿用经典专业彩讯配色：绿底白字（期号/结果列）+ 红字推荐 + 命中黄高亮 */
.predict {
  --predict-green: #028E73;
  --predict-green-soft: #e8f5f1;
  --predict-red: #d4181c;
  --predict-blue: #1d4ed8;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: #fff;
}
.predict thead th {
  background: var(--predict-green);
  color: #fff;
  font-weight: 700;
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  border-right: 1px solid rgba(255,255,255,.18);
}
.predict thead th:last-child { border-right: none; }
.predict tbody td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid #e8eef5;
  vertical-align: middle;
  word-break: break-all;
}
.predict tbody tr:last-child td { border-bottom: none; }
.predict tbody tr:nth-child(2n) td:not(.period):not(.result) { background: #fafbfd; }

.predict td.period {
  background: var(--predict-green);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .5px;
}
.predict td.tip {
  color: var(--predict-red);
  font-weight: 700;
  line-height: 1.7;
  background: #fff;
}
.predict td.tip b,
.predict td.tip strong { color: var(--predict-blue); }

.predict td.result {
  white-space: nowrap;
  font-weight: 700;
  background: var(--predict-green-soft);
  color: var(--predict-green);
}
.predict td.result.hit  { color: #15803d; background: #dcfce7; }
.predict td.result.miss { color: #b91c1c; background: #fee2e2; }
.predict td.result.wait { color: #6b7280; background: #f3f4f6; }
.predict td.result.auto { color: var(--predict-green); }
.predict td.result.auto.wait { color: #6b7280; }

/* 命中标记：当行的"推荐内容"出现了实际开奖号码/生肖时，前端会自动包一层 .hit-mark */
.predict .hit-mark {
  background: #fff200;
  color: #d4181c;
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 800;
}

.predict-footer {
  padding: 10px 14px; font-size: 13px; color: var(--text-soft);
  background: #fafbfd; border-top: 1px solid var(--border-soft);
}

/* 链接列表 */
.links-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
.links-grid a {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 10px; text-align: center; gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-soft); border-radius: 10px;
  font-weight: 600; color: var(--text); font-size: 14px;
  transition: all .15s;
}
.links-grid a:hover {
  background: var(--theme-soft); color: var(--theme);
  border-color: var(--theme-soft);
  transform: translateY(-1px);
}

/* 文本/HTML */
.module.text .module-body, .module.custom_html .module-body {
  padding: 14px 16px;
  line-height: 1.8;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.module.text p, .module.custom_html p { margin-bottom: 8px; color: var(--text); }
.module.text p:last-child { margin-bottom: 0; }

/* 富文本通用排版：表格一定要有边框；图片/视频自适应宽度；表格可横向滚动 */
.rt-body img,
.rt-body video {
  max-width: 100%;
  height: auto;
  display: inline-block;
}
.rt-body p,
.rt-body li,
.rt-body span,
.rt-body div { word-break: break-word; overflow-wrap: anywhere; }
.rt-body a { color: var(--theme); text-decoration: underline; }

/* 表格：包一层 .rt-tbl-wrap。永不出滚动条，强制表格自适应容器、超长内容自动折行。
   - wrap 用 overflow:hidden 永远裁剪溢出（兜底，避免任何 inline 样式触发滚动）
   - table 用 width:100% + table-layout:fixed 严格按容器宽度展开，列按 thead 比例分配
   - td 内长串/URL 用 word-break + overflow-wrap 强制折行 */
.rt-body .rt-tbl-wrap {
  margin: 8px 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;            /* 永不滚动 */
}
.rt-body .rt-tbl-wrap > table {
  width: 100% !important;      /* 强制充满 wrap，覆盖任何 inline 硬宽 */
  max-width: 100% !important;
  table-layout: fixed;         /* 严格按列分配宽度，超长内容按 td 边界折行 */
  margin: 0 auto;
  display: table;
}
.rt-body table {
  border-collapse: collapse;
  background: #fff;
  max-width: 100%;
}
.rt-body table th,
.rt-body table td {
  border: 1px solid #d1d5db;
  padding: 6px 8px;
  vertical-align: middle;
  text-align: center;          /* 与后端编辑器一致：默认居中；用户主动设左/右对齐时 inline style 会覆盖 */
  word-break: break-word;      /* 中文/混排长串自然折行 */
  overflow-wrap: anywhere;     /* 长串/URL/连续数字在任意位置可折行，不撑爆单元格 */
  min-width: 0;                /* 允许 td 在容器变窄时被压缩 */
}
.rt-body table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #0f172a;
}
/* 嵌套表（多见于从外部源站粘贴进来的内容）兜底：永远不超过父单元格宽度，
   避免子表硬宽（如 width:600px）反向撑大外层 .rt-tbl-wrap */
.rt-body table table {
  max-width: 100% !important;
  width: 100% !important;
  table-layout: fixed;
}
/* 单元格内任意层级的元素都不应突破 td 宽度；阻止"内联 inline width / 大图 / nowrap" 撑爆容器 */
.rt-body td *,
.rt-body th * {
  max-width: 100% !important;
  white-space: normal !important;   /* 覆盖外部粘贴带来的 white-space: nowrap */
  word-break: break-word;
  overflow-wrap: anywhere;
}
.rt-body td img,
.rt-body th img {
  height: auto !important;
}

/* 移动端进一步收紧字号/边距，并让整个富文本居中 */
@media (max-width: 480px) {
  .module.text .module-body,
  .module.custom_html .module-body {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.7;
  }
  .rt-body .rt-tbl-wrap {
    max-width: 100%;
  }
  .rt-body table th,
  .rt-body table td {
    padding: 5px 6px;
    font-size: 12px;
  }
  .rt-body img { max-width: 100% !important; height: auto !important; }
}

/* 空广告位 */
.ad-empty {
  border: 2px dashed var(--border);
  background: repeating-linear-gradient(45deg, #f8fafc 0 12px, #f1f5f9 12px 24px);
  height: 110px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute); font-size: 14px; border-radius: 10px;
}

/* 页脚 */
.site-footer {
  text-align: center; color: var(--text-mute);
  padding: 20px 14px 28px; font-size: 12px;
  margin-top: 14px;
}
.site-footer a { color: var(--text-soft); margin: 0 6px; }

/* 波色对照表 / 合数单双对照表（参照源站底部 wave-color 风格，配色统一为红/蓝/绿三色小球） */
.module.wave-color { background: #fff; border: 1px solid #e2e8f0; }
.module.wave-color .module-title.wc-title {
  background: #f1f1f1;
  color: #334155;
  font-weight: 700;
  border-bottom: 1px solid #d8ccb4;
  text-align: center;
  padding: 8px 12px;
  font-size: 14px;
  letter-spacing: 1px;
}
.module.wave-color .module-body { padding: 0; background: #e5e5e5; }
.module.wave-color .wc-row {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: solid 1px #d8ccb4;
  border-top: none;
  min-height: 36px;
}
.module.wave-color .wc-row:first-child { border-top: solid 1px #d8ccb4; }
.module.wave-color .wc-label {
  flex: 0 0 64px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  background: #fff;
  border-right: solid 1px #d8ccb4;
  font-size: 14px;
  white-space: nowrap;
}
.module.wave-color .wc-label-red   { color: #ff0000; }
.module.wave-color .wc-label-blue  { color: #3366ff; }
.module.wave-color .wc-label-green { color: #009933; }
.module.wave-color .wc-nums {
  flex: 1;
  padding: 6px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.module.wave-color .wc-ball {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #f00;
  border-radius: 4px;
  letter-spacing: 0;
}
.module.wave-color .wc-ball.wc-red   { background: #f00; }
.module.wave-color .wc-ball.wc-blue  { background: #3366ff; }
.module.wave-color .wc-ball.wc-green { background: #009933; }

/* 移动端 */
@media (max-width: 480px) {
  .site-header { padding: 10px 12px; }
  .site-header .site-title { font-size: 15px; }
  .site-header .logo img { height: 36px; }
  .module-title { font-size: 14px; padding: 11px 12px 11px 16px; }

  .module.wave-color .wc-label { flex: 0 0 50px; font-size: 13px; }
  .module.wave-color .wc-ball  { min-width: 20px; height: 20px; font-size: 11px; padding: 0 3px; }
  .module.wave-color .wc-nums  { padding: 5px 4px; gap: 3px; }

  /* 开奖号码：强制单行（不换行），色球小一些；空间不够时允许横滑 */
  .balls {
    flex-wrap: nowrap;
    gap: 4px;
    padding: 8px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }
  .balls::-webkit-scrollbar { display: none; }
  .balls > * { flex: 0 0 auto; }
  .ball { width: 30px; height: 30px; font-size: 13px; }
  .ball.plus { width: 14px; font-size: 18px; }
  .ball-zodiac { font-size: 10px; margin-top: 2px; }

  /* 号码卡：移动端缩小 */
  .ball-card { width: 38px; }
  .ball-card .ball { height: 30px; font-size: 17px; }
  .ball-card .ball-zodiac { font-size: 10px; padding: 1px 0 2px; min-height: 14px; }
  .ball-card.compact { width: 30px; }
  .ball-card.compact .ball { height: 24px; font-size: 12px; }
  .ball-card.compact .ball-zodiac { font-size: 9px; padding: 1px 0; }
  .ball-plus { font-size: 18px; width: 12px; }

  .next-draw { font-size: 12px; gap: 4px; margin-top: 8px; }
  .next-draw .cd { min-width: 72px; padding: 2px 8px; font-size: 13px; }
  .next-draw .np-target { display: none; }

  /* 首页"近期开奖"行：单行省略，不换行 */
  .draw-history-row { gap: 6px; }
  .draw-history-row .p { min-width: 50px; font-size: 12px; }
  .draw-history-row .n {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    font-size: 12px;
  }

  /* 历史数据页表格内的色球：单行（不换行也不滚动），整体缩小到一屏装下 */
  .history-table th, .history-table td { padding: 6px 3px; font-size: 12px; }
  .history-table th:nth-child(1), .history-table td:nth-child(1) { width: 56px !important; }
  .history-table th:nth-child(2), .history-table td:nth-child(2) { width: 60px !important; padding: 6px 2px; }
  .history-table .h-balls {
    flex-wrap: nowrap;
    overflow: visible;
    justify-content: center;
    gap: 2px;
  }
  .history-table .h-balls .ball { width: 22px; height: 22px; font-size: 11px; }
  /* 紧凑号码卡：手机端再缩一档，让 6+1+加号 整齐落在一行 */
  .history-table .h-balls .ball-card.compact { width: 26px; }
  .history-table .h-balls .ball-card.compact .ball { height: 22px; font-size: 11px; }
  .history-table .h-balls .ball-card.compact .ball-zodiac { font-size: 8px; padding: 1px 0; min-height: 12px; line-height: 1.2; }
  .history-table .h-balls .ball-plus { font-size: 14px; width: 8px; }

  .links-grid { grid-template-columns: repeat(2, 1fr); }
  .predict thead th, .predict tbody td { padding: 8px 4px; font-size: 12px; }
}

/* 极小屏（≤ 360px）：历史表号码卡再缩一档保证一行装下 */
@media (max-width: 360px) {
  .history-table th, .history-table td { padding: 6px 2px; }
  .history-table th:nth-child(1), .history-table td:nth-child(1) { width: 48px !important; }
  .history-table th:nth-child(2), .history-table td:nth-child(2) { width: 52px !important; }
  .history-table .h-balls .ball-card.compact { width: 23px; }
  .history-table .h-balls .ball-card.compact .ball { height: 20px; font-size: 10px; }
  .history-table .h-balls .ball-card.compact .ball-zodiac { font-size: 8px; min-height: 11px; }
  .history-table .h-balls .ball-plus { font-size: 12px; width: 6px; }
  .history-table .h-balls { gap: 1px; }
}

/* ========= 后台 · 手动直播开奖卡片 ========= */
.live-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; flex-wrap: wrap; gap: 8px;
}
.live-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.live-slot-list {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 14px;
}
.live-slot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #e2e8f0;
}
.live-slot:last-child { border-bottom: 0; }
.live-slot .ls-label  { flex: 0 0 80px; color: #374151; font-weight: 600; }
.live-slot .ls-ball   { flex: 0 0 50px; display: flex; justify-content: center; }
.live-slot .ls-input  { flex: 0 0 110px; }
.live-slot .ls-btn    { flex: 0 0 auto; }
.live-slot .live-feedback {
  flex: 1; font-size: 12px; color: #6b7280; min-height: 20px;
  word-break: break-all;
}
.ls-mini-ball { width: 34px; height: 34px; font-size: 14px; }
.ls-mini-ball.ls-pending {
  background: linear-gradient(135deg, #cbd5e1, #64748b);
  font-size: 13px;
  color: #fff;
}

/* 手机/小屏：每个号码独占一行，文字（生肖/波色提示）显示在底部 */
@media (max-width: 640px) {
  .live-slot-list { padding: 0 10px; }
  .live-slot {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 12px 0;
  }
  .live-slot .ls-label  { flex: 0 0 60px; font-size: 13px; }
  .live-slot .ls-ball   { flex: 0 0 42px; }
  .live-slot .ls-input  { flex: 1 1 auto; min-width: 0; max-width: none; }
  .live-slot .ls-btn    { flex: 0 0 auto; padding: 6px 14px; }
  .live-slot .live-feedback {
    flex: 0 0 100%;
    padding-left: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #4b5563;
    background: #f8fafc;
    border-radius: 6px;
    padding: 6px 8px;
  }
  .live-slot .live-feedback:empty {
    display: none;
  }
  .live-head { font-size: 13px; }
}

/* 站点切换器 */
.site-switcher {
  position: fixed; right: 14px; bottom: 18px; z-index: 100;
  background: #fff; padding: 6px 10px;
  border-radius: 999px; border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
}
.site-switcher select { border: none; background: transparent; outline: none; font-weight: 700; color: var(--theme); }

/* ===== 历史数据页 ===== */
.history-page .module-body { padding: 0; }
.history-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.history-table th, .history-table td {
  padding: 10px 8px; text-align: center; font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
}
.history-table thead th {
  background: var(--theme-soft); color: var(--theme); font-weight: 700;
  position: sticky; top: 0;
}
.history-table .h-balls { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; }
.history-table .h-balls .ball { width: 26px; height: 26px; font-size: 12px; }
/* 历史日期列：桌面显示完整日期，移动端显示 MM-DD */
.history-table .d-short { display: none; }
.history-table .d-full  { display: inline; }
@media (max-width: 480px) {
  .history-table .d-full  { display: none; }
  .history-table .d-short { display: inline; }
}
.history-table .h-balls .ball.plus { width: 12px; }
.history-table tbody tr:nth-child(2n) { background: #fafbfd; }
.history-table tbody tr:hover { background: var(--theme-soft); }
.pager { display: flex; justify-content: center; gap: 6px; padding: 14px; flex-wrap: wrap; }
.pager button {
  border: 1px solid var(--border); background: #fff;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text);
}
.pager button:hover { border-color: var(--theme); color: var(--theme); }
.pager button.active, .pager button:disabled[data-active] {
  background: var(--theme); color: #fff; border-color: var(--theme);
}
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ===== 后台共用 ===== */
.admin-body {
  background: #f1f5f9;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: #0f172a; color: #cbd5e1;
  padding: 0; flex-shrink: 0;
}
.admin-sidebar h1 {
  color: #fff; font-size: 16px; padding: 18px 18px;
  border-bottom: 1px solid #1e293b; letter-spacing: 1px;
}
.admin-sidebar .role-tag {
  font-size: 11px; background: var(--theme);
  padding: 1px 8px; border-radius: 999px; margin-left: 6px;
}
.admin-sidebar nav { padding: 12px 0; }
.admin-sidebar nav a {
  display: block; padding: 10px 18px; color: #cbd5e1;
  border-left: 3px solid transparent; cursor: pointer;
  font-size: 14px;
}
.admin-sidebar nav a.active, .admin-sidebar nav a:hover {
  background: #020617; color: #fff; border-left-color: var(--theme);
}
.admin-main { flex: 1; padding: 0; min-width: 0; }
.admin-topbar {
  background: #fff; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}
.admin-topbar .site-select { display: flex; align-items: center; gap: 10px; }
.admin-topbar select, .admin-topbar input {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff;
}
.admin-content { padding: 20px; }
.admin-content section { display: none; }
.admin-content section.active { display: block; }

.card {
  background: #fff; border-radius: 12px;
  padding: 18px; margin-bottom: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.card h2 { font-size: 16px; margin-bottom: 12px; color: var(--text); }
.card h3 { font-size: 14px; margin-bottom: 10px; color: var(--text); }

.btn {
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 13px;
  transition: all .15s;
}
.btn:hover { background: #f3f4f6; border-color: #cbd5e1; }
.btn.primary { background: var(--theme); color: #fff; border-color: var(--theme); }
.btn.primary:hover { background: var(--theme-dark); border-color: var(--theme-dark); }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn.warn { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.warn:hover { background: #d97706; border-color: #d97706; }
.btn.small { padding: 4px 10px; font-size: 12px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); text-align: left; }
.table th { background: #f8fafc; font-weight: 700; color: var(--text); white-space: nowrap; }
.table tr:hover { background: #f8fafc; }

.form-row { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-row label { width: 130px; flex-shrink: 0; color: var(--text-soft); font-size: 13px; }
.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row input[type="url"],
.form-row textarea,
.form-row select {
  flex: 1; min-width: 200px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; outline: none; transition: border-color .15s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--theme); }
.form-row textarea { min-height: 70px; resize: vertical; font-family: inherit; }
.form-row .hint { font-size: 12px; color: var(--text-soft); width: 100%; padding-left: 130px; margin-top: 4px; }

.tag { display: inline-block; padding: 2px 8px; background: #e0e7ff; color: #4338ca; border-radius: 999px; font-size: 11px; }
.tag.green { background: #dcfce7; color: #166534; }
.tag.red { background: #fee2e2; color: #991b1b; }
.tag.gray { background: #f3f4f6; color: #4b5563; }
.tag.amber { background: #fef3c7; color: #92400e; }

/* 登录页 */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #e0f2fe 100%);
  padding: 20px;
}
.login-box {
  background: #fff; padding: 36px 32px; border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15,23,42,.10);
  width: 100%; max-width: 380px;
}
.login-box h1 { font-size: 22px; margin-bottom: 6px; color: var(--text); text-align: center; }
.login-box .subtitle { font-size: 13px; color: var(--text-soft); text-align: center; margin-bottom: 24px; }
.login-box input {
  width: 100%; padding: 12px 14px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: 8px; outline: none;
}
.login-box input:focus { border-color: var(--theme); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.login-box button {
  width: 100%; padding: 12px;
  background: var(--theme); color: #fff;
  border: none; border-radius: 8px; cursor: pointer;
  font-weight: 700; font-size: 15px;
}
.login-box button:hover { background: var(--theme-dark); }
.login-box .err {
  color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px;
}

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-mask.show { display: flex; }
.modal {
  background: #fff; padding: 22px 24px; border-radius: 14px;
  width: 92%; max-width: 720px; max-height: 86vh; overflow: auto;
  box-shadow: 0 20px 50px rgba(15,23,42,.2);
}
.modal h3 { margin-bottom: 14px; font-size: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* 提示 */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(15,23,42,.92); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 2000;
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

/* 拖拽 */
.draggable { cursor: grab; }
.dragging { opacity: .5; }
.module-item-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px; border: 1px solid var(--border);
  margin-bottom: 6px; border-radius: 6px; background: #fff;
}
.module-item-row .drag-handle { cursor: move; color: var(--text-soft); user-select: none; padding: 0 4px; }
.module-item-row .row-info { flex: 1; min-width: 0; }
.module-item-row .row-info b { color: var(--text); }
.module-item-row .row-info small { color: var(--text-soft); margin-left: 6px; font-weight: normal; }

/* 后台 predict 编辑器 */
.predict-editor .row-edit {
  display: grid; grid-template-columns: 90px 1fr 120px auto;
  gap: 8px; padding: 8px; border-bottom: 1px solid var(--border-soft);
  align-items: start;
}
.predict-editor .row-edit input, .predict-editor .row-edit textarea {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  outline: none; font-size: 13px;
}
.predict-editor .row-edit textarea { min-height: 38px; }

/* ===== predict_table 所见即所得编辑器 ===== */
.pe-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 6px 8px; background: #f8fafc;
  border: 1px solid var(--border-soft); border-bottom: none;
  border-radius: 8px 8px 0 0;
}
.pe-toolbar button,
.pe-toolbar .pe-fontsize,
.pe-toolbar .pe-color-picker {
  height: 28px; padding: 0 8px; min-width: 30px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 5px; color: var(--text);
  font-size: 13px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.pe-toolbar button:hover { background: #eef2f7; }
.pe-toolbar button:active { background: #e2e8f0; }
.pe-toolbar .pe-fontsize { padding: 0 6px; }
.pe-toolbar .pe-color-picker,
.pe-toolbar .pe-bg-picker { width: 36px; padding: 2px; cursor: pointer; }
.pe-toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
/* 背景色按钮：以底色作为整块背景，文字"底"用深灰，hover 时加深边框 */
.pe-toolbar .pe-bg-btn {
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 700;
}
.pe-toolbar .pe-bg-btn:hover {
  border-color: #64748b;
  filter: brightness(.96);
}

.pe-table-wrap {
  border: 1px solid var(--border-soft);
  border-top: 1px solid var(--border-soft);
  border-radius: 0 0 8px 8px;
  overflow: auto; background: #fff;
}
.predict-editor-table { table-layout: fixed; }
.predict-editor-table tbody td[contenteditable] {
  cursor: text; min-height: 38px; transition: outline-color .15s, background-color .15s;
}
.predict-editor-table tbody td[contenteditable]:hover {
  outline: 1px dashed #94a3b8; outline-offset: -2px;
}
.predict-editor-table tbody td[contenteditable]:focus {
  outline: 2px solid #2563eb; outline-offset: -2px;
}
/* 编辑态保持原列底色，但 focus 时叠加一层淡黄色提示 */
.predict-editor-table tbody td.tip[contenteditable]:focus    { background: #fffbe6; }
.predict-editor-table tbody td.period[contenteditable]:focus { background: #056655; }
.predict-editor-table tbody td.result[contenteditable]:focus { background: #fef9c3; color: var(--predict-green); }

/* 列设置 / 行设置 行布局 */
.pe-col-setup {
  display: flex; gap: 8px; align-items: center; margin-bottom: 6px;
  padding: 6px 8px; border: 1px solid #eef2f7; border-radius: 6px; background: #fafbfd;
}
.pe-col-setup .pe-col-idx { width: 50px; color: #64748b; font-size: 12px; flex: 0 0 auto; }
.pe-col-setup input[data-col-label] { flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; }
.pe-col-setup input[data-col-width] { width: 80px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; }

.pe-row-op {
  display: flex; gap: 8px; align-items: center; margin-bottom: 6px;
  padding: 6px 8px; border: 1px solid #eef2f7; border-radius: 6px; background: #fafbfd;
  flex-wrap: wrap;
}
.pe-row-op .pe-row-idx { width: 60px; color: #64748b; font-size: 12px; flex: 0 0 auto; }
.pe-row-op select[data-row-flag] { width: 80px; height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; }
.pe-row-op .pe-auto { font-size: 12px; color: #64748b; display: inline-flex; align-items: center; gap: 4px; }
.pe-row-op .btn.small { padding: 4px 10px; }

/* ===== 富文本编辑器（rich-editor.js）===== */
.rte {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}
.rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
  user-select: none;
}
.rte-group { display: inline-flex; gap: 2px; align-items: center; }
.rte-div {
  width: 1px; height: 18px; background: #d1d5db;
  margin: 0 4px; display: inline-block; flex-shrink: 0;
}
.rte-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 8px; border-radius: 5px;
  cursor: pointer; font-size: 13px;
  min-width: 30px; height: 28px;
  color: #374151;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.rte-btn:hover { background: #e5e7eb; border-color: #cbd5e1; }
.rte-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.rte-btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.rte-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.rte-select {
  height: 28px; padding: 0 6px;
  border: 1px solid #cbd5e1; border-radius: 5px;
  background: #fff; font-size: 13px;
  color: #374151; cursor: pointer;
}
.rte-color-wrap {
  position: relative; height: 28px; width: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #cbd5e1; border-radius: 5px;
  cursor: pointer; background: #fff; overflow: hidden;
}
.rte-color-wrap:hover { background: #f3f4f6; }
.rte-color-swatch {
  font-weight: 800; font-size: 13px;
  border-bottom: 4px solid;
  padding-bottom: 1px; line-height: 1;
}
.rte-color-wrap input[type="color"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%; border: none; padding: 0;
}
.rte-content {
  min-height: 240px; max-height: 60vh;
  overflow: auto;
  padding: 12px 14px;
  outline: none; line-height: 1.7;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
}
.rte-content:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
}
.rte-content p { margin: 4px 0; }
.rte-content h1, .rte-content h2, .rte-content h3, .rte-content h4 {
  margin: 12px 0 8px; font-weight: 700;
}
.rte-content h1 { font-size: 24px; }
.rte-content h2 { font-size: 20px; }
.rte-content h3 { font-size: 17px; }
.rte-content h4 { font-size: 15px; }
.rte-content blockquote {
  border-left: 4px solid #2563eb;
  padding: 4px 12px; margin: 8px 0;
  color: #475569; background: #f1f5f9;
}
.rte-content pre {
  background: #1e293b; color: #e5e7eb;
  padding: 12px; border-radius: 6px;
  font-family: Consolas, Monaco, monospace;
  white-space: pre-wrap; overflow: auto;
}
.rte-content table { border-collapse: collapse; margin: 8px 0; max-width: 100%; }
.rte-content table td, .rte-content table th {
  border: 1px solid #d1d5db; padding: 6px 8px; min-width: 32px;
  text-align: center; /* 编辑器内默认居中，与前端 .rt-body 表格一致；用户用工具栏设左/右对齐时 inline style 会覆盖 */
  vertical-align: middle;
}
.rte-content table th { background: #f1f5f9; }
.rte-content img { max-width: 100%; height: auto; display: inline-block; }
.rte-content ul, .rte-content ol { padding-left: 24px; margin: 4px 0; }
.rte-content a { color: #2563eb; text-decoration: underline; }
.rte-content hr { border: none; border-top: 1px solid #cbd5e1; margin: 12px 0; }
.rte-source {
  width: 100%; min-height: 240px; max-height: 60vh;
  border: none; outline: none; padding: 12px 14px;
  font-family: Consolas, Monaco, monospace; font-size: 12px;
  background: #fff; color: #1e293b; resize: vertical;
}
.rte-fullscreen {
  position: fixed !important; inset: 0;
  z-index: 5000; border-radius: 0;
}
.rte-fullscreen .rte-content,
.rte-fullscreen .rte-source { max-height: none; flex: 1; min-height: 0; }

/* 富文本编辑器内置弹窗（链接/图片/表格的输入框） */
.rte-dialog-mask {
  position: fixed; inset: 0; z-index: 6000;
  background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center;
}
.rte-dialog {
  background: #fff; border-radius: 12px;
  padding: 22px 24px; min-width: 360px; max-width: 92vw;
  box-shadow: 0 20px 50px rgba(15,23,42,.2);
}
.rte-dialog h4 { margin-bottom: 14px; font-size: 16px; color: #0f172a; }
.rte-dialog-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.rte-dialog-row label { width: 110px; flex-shrink: 0; color: #64748b; font-size: 13px; }
.rte-dialog-row input {
  flex: 1; padding: 8px 10px;
  border: 1px solid #cbd5e1; border-radius: 6px; outline: none;
  font-size: 14px;
}
.rte-dialog-row input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.rte-dialog-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px;
}

/* 模块标题富文本编辑器（B/字号/对齐/字色/背景色） */
.title-rte {
  display: flex; flex-direction: column;
  border: 1px solid #cbd5e1; border-radius: 6px;
  background: #fff;
}
.title-rte-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 6px 6px 0 0;
}
.title-rte-toolbar button {
  min-width: 28px; height: 26px; padding: 0 6px;
  border: 1px solid #e2e8f0; background: #fff;
  border-radius: 4px; cursor: pointer; font-size: 12px;
  color: #334155;
}
.title-rte-toolbar button:hover {
  border-color: #94a3b8; background: #f1f5f9;
  filter: brightness(.97);
}
.title-rte-toolbar select { height: 26px; padding: 0 6px; border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; font-size: 12px; }
.title-rte-toolbar input[type="color"] { width: 30px; height: 26px; padding: 2px; border: 1px solid #e2e8f0; border-radius: 4px; cursor: pointer; background: #fff; }
.title-rte-toolbar .sep { width: 1px; height: 18px; background: #e2e8f0; margin: 0 4px; align-self: center; }
.title-rte-content {
  padding: 8px 10px; min-height: 30px;
  font-size: 14px; line-height: 1.6; color: #0f172a;
  outline: none; word-break: break-word;
}
.title-rte-content:focus { background: #fcfcff; }

/* 前端：模块标题里允许富文本 inline 样式（颜色/背景/字号/对齐）覆盖默认 */
.rt-title { line-height: 1.4; }
.rt-title * { vertical-align: baseline; }
/* .module-title 默认是 flex，需要让富文本对齐 (text-align) 在子 block 上生效：
   把直接子级 block 元素撑满父级，subtitle (span) 不受影响 */
.module-title.rt-title { justify-content: flex-start; }
.module-title.rt-title > div,
.module-title.rt-title > p,
.module-title.rt-title > h1,
.module-title.rt-title > h2,
.module-title.rt-title > h3,
.module-title.rt-title > h4 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

@media (max-width: 480px) {
  .title-rte-toolbar { padding: 4px; gap: 3px; }
  .title-rte-toolbar button { min-width: 24px; height: 24px; padding: 0 4px; font-size: 11px; }
  .title-rte-toolbar select { height: 24px; font-size: 11px; }
  .title-rte-toolbar input[type="color"] { width: 26px; height: 24px; }
}

/* 富文本编辑器表格右键菜单 */
.rte-ctxmenu {
  position: fixed; z-index: 9999;
  min-width: 168px; padding: 4px 0;
  background: #fff;
  border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.18);
  font-size: 13px; color: #1e293b;
  user-select: none;
}
.rte-ctxmenu-item {
  padding: 7px 16px; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.rte-ctxmenu-item:hover { background: #eff6ff; color: #1d4ed8; }
.rte-ctxmenu-item.danger { color: #b91c1c; }
.rte-ctxmenu-item.danger:hover { background: #fef2f2; color: #b91c1c; }
.rte-ctxmenu-sep { height: 1px; background: #e5e7eb; margin: 4px 0; }

/* 移动端后台 */
@media (max-width: 720px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-sidebar h1 { padding: 14px 18px; }
  .admin-sidebar nav { display: flex; overflow-x: auto; padding: 6px; }
  .admin-sidebar nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; padding: 8px 12px; }
  .admin-sidebar nav a.active { border-bottom-color: var(--theme); border-left-color: transparent; }
  .form-row label { width: 100%; }
  .form-row .hint { padding-left: 0; }
  .predict-editor .row-edit { grid-template-columns: 1fr; }
  .pe-toolbar { padding: 5px 6px; gap: 3px; }
  .pe-toolbar button, .pe-toolbar .pe-fontsize, .pe-toolbar .pe-color-picker { height: 26px; min-width: 26px; padding: 0 6px; font-size: 12px; }
  .pe-row-op { padding: 6px; gap: 6px; }
  .pe-row-op .pe-row-idx { width: 100%; }
  .pe-col-setup { padding: 6px; gap: 6px; flex-wrap: wrap; }
  .pe-col-setup .pe-col-idx { width: 100%; }
}
