/* ==========================================================================
   聚合面板 v2 — 设计系统
   手机端优先；桌面端在 920px 以上切换为双栏。
   ========================================================================== */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --surface-3: #e4e8ef;
  --border: #e3e7ed;
  --border-strong: #d2d8e2;
  --text: #0a0d14;
  --text-2: #414b5c;
  --text-3: #78828f;
  --brand: #2563eb;
  --brand-ink: #1d4ed8;
  --brand-soft: #ecf3ff;
  --brand-ring: rgba(37, 99, 235, .18);
  --green: #0ea371;
  --green-soft: #e6f7f0;
  --amber: #d97706;
  --amber-soft: #fdf3e2;
  --red: #e03131;
  --red-soft: #fdecec;
  --violet: #7c3aed;
  --violet-soft: #f2ecfe;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-2: 0 6px 20px rgba(16, 24, 40, .09);
  --shadow-3: 0 18px 48px rgba(16, 24, 40, .16);
  --top-h: 56px;
  --nav-h: 58px;
  --side-w: 336px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

[data-theme="dark"] {
  --bg: #0e1016;
  --surface: #161a22;
  --surface-2: #1c212a;
  --surface-3: #232833;
  --border: #262c37;
  --border-strong: #333a47;
  --text: #e9ecf1;
  --text-2: #98a1b0;
  --text-3: #6b7482;
  --brand: #5b8ff9;
  --brand-ink: #93b6ff;
  --brand-soft: #1b2740;
  --brand-ring: rgba(91, 143, 249, .22);
  --green: #34d399;
  --green-soft: #10291f;
  --amber: #fbbf24;
  --amber-soft: #2b2110;
  --red: #f87171;
  --red-soft: #2d1616;
  --violet: #a78bfa;
  --violet-soft: #211b38;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, .6);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

/* ---------------------------------------------------------------- 排版基调
   用户要求：字体更深、更粗、更大，让内容更显眼。
   这里统一抬高字重与常用字号，个别组件仍可单独覆盖。 */
input, select, textarea, button { font-weight: 500; }
input, select, textarea { font-size: 14.5px; }
.hint, .tiny { font-weight: 500; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- 通用组件 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; transition: .15s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(1.06); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 7px 13px; font-size: 14px; font-weight: 700; border-radius: 8px; }
.btn-xs { padding: 5px 10px; font-size: 13px; font-weight: 700; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 6px;
}
.field .hint { font-size: 13px; font-weight: 500; color: var(--text-3); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
/* 图标统一默认尺寸：任何没有被具体规则覆盖的地方都不会再撑成大图 */
svg.ico { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -2px; }
.card > h3 {
  font-size: 16px; font-weight: 800; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card > .card-sub { font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.pill-brand { background: var(--brand-soft); color: var(--brand-ink); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-red   { background: var(--red-soft);   color: var(--red); }
.pill-violet{ background: var(--violet-soft);color: var(--violet); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }

.muted { color: var(--text-2); }
.tiny { font-size: 13px; font-weight: 500; color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 13.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }

.flash {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 12px; border: 1px solid transparent;
}
.flash-ok    { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.flash-error { background: var(--red-soft);   color: var(--red);   border-color: var(--red); }

.empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 56px 20px;
  color: var(--text-3); text-align: center; font-size: 15px; font-weight: 500;
}
.empty .big { font-size: 40px; line-height: 1; opacity: .5; }

/* --------------------------------------------------------------- 应用外壳 */
.shell { display: flex; flex: 1; min-height: 0; overflow: hidden; background: var(--bg); }

.side {
  display: flex; flex-direction: column; background: var(--surface);
  width: 100%; position: relative;
}

.main {
  flex: 1; display: none; flex-direction: column;
  min-width: 0; background: var(--bg);
}

.topbar {
  height: var(--top-h); flex-shrink: 0;
  padding-top: var(--safe-t);
  display: flex; align-items: center; gap: 10px;
  padding-left: 12px; padding-right: 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: relative; z-index: 20;
}
.topbar .title { font-size: 16px; font-weight: 700; }
.topbar .sub { font-size: 12px; color: var(--text-3); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.icon-btn { position: relative; }

.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}

.notice {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 14px; font-size: 14px; font-weight: 500; line-height: 1.55;
  background: var(--amber-soft); color: var(--amber);
  border-bottom: 1px solid var(--border);
}
.notice svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; }

/* v5 · 频道公告（聊天页顶部黄框，模仿同行） */
.ch-notice {
  flex-shrink: 0;
  margin: 10px 12px 0; padding: 9px 13px;
  background: var(--amber-soft);
  border: 1px solid rgba(217, 119, 6, .35);
  border-radius: 10px;
  color: #a34a06; font-size: 14px; font-weight: 500; line-height: 1.75;
  white-space: pre-line; word-break: break-word;
  max-height: 34%; overflow-y: auto;
}
.ch-notice .chn-t {
  font-weight: 800; margin-bottom: 2px;
  display: flex; align-items: center; gap: 6px;
  color: #b45309;
}
[data-theme="dark"] .ch-notice,
[data-theme="dark"] .ch-notice .chn-t { color: var(--amber); }
[data-theme="dark"] .ch-notice { border-color: rgba(251, 191, 36, .35); }

/* --------------------------------------------------------------- 频道列表 */
/* 5 个页签强制一排（不换行），等宽均分 */
.tabs {
  display: flex; flex-wrap: nowrap; gap: 3px; padding: 9px 10px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1 1 0; min-width: 0;
  padding: 8px 2px; font-size: 13.5px; font-weight: 700;
  color: var(--text-2); border: none;
  border-radius: 8px; background: var(--surface-2);
  white-space: nowrap; transition: .15s; line-height: 1.2;
  text-align: center; overflow: hidden; text-overflow: ellipsis;
}
.tab:hover { color: var(--text); }
.tab.on { color: #fff; background: var(--brand); }
.tab.on .n { background: rgba(255,255,255,.25) !important; }
.tab .n {
  display: inline-block; margin-left: 3px; padding: 0 5px;
  border-radius: 8px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700;
}

.searchbar { padding: 8px 16px 3px; background: var(--surface); display: flex; gap: 8px; }
.sb-field {
  position: relative; flex: 1; min-width: 0;
}
.sb-ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}
.sb-field input {
  width: 100%; height: 35px; box-sizing: border-box;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px; padding: 0 12px 0 30px; font-size: 13.5px;
}

/* 「授权频道」小节标题 + 加号（模仿同行） */
.ch-sec {
  display: flex; flex-direction: column; gap: 6px;
  padding: 5px 16px 3px; background: var(--surface);
}
.ch-sec > span { font-size: 13.5px; font-weight: 800; color: var(--text); }

/* 邀请码一体化输入（输入框 + 激活按钮 同框；与搜索框同宽同高） */
.code-entry {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); overflow: hidden;
  height: 35px; transition: .15s;
}
.code-entry:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.ce-input {
  flex: 1; min-width: 0; width: auto; height: 100%;
  border: none; outline: none; box-shadow: none; background: transparent;
  padding: 0 12px; font-size: 13.5px; font-weight: 700; color: var(--text);
  letter-spacing: 1.5px; font-family: var(--mono); border-radius: 0;
}
.ce-input:focus { border: none; box-shadow: none; }
.ce-input::placeholder { color: var(--text-3); font-weight: 500; letter-spacing: .5px; font-family: inherit; }
.ce-input:-webkit-autofill { -webkit-text-fill-color: var(--text); }
.ce-btn {
  flex-shrink: 0; border: none; cursor: pointer;
  padding: 0 16px; font-size: 13.5px; font-weight: 800; letter-spacing: 1px;
  background: var(--brand); color: #fff; transition: .15s;
}
.ce-btn:hover { background: #1d4ed8; }
.ce-btn:active { transform: scale(.97); }

.mini-add {
  width: 26px; height: 26px; border-radius: 8px;
  border: none; background: var(--brand);
  color: #fff; font-size: 20px; font-weight: 900; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .15s;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .35);
}
.mini-add:hover { background: #1d4ed8; color: #fff; transform: scale(1.08); box-shadow: 0 3px 9px rgba(37, 99, 235, .45); }

.chlist {
  flex: 1; overflow-y: auto; padding: 2px 10px 12px;
  -webkit-overflow-scrolling: touch;
}
.chgroup-title {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  padding: 12px 6px 6px; letter-spacing: .3px;
}

/* ---------------------------------------------------------------
 * v13.5 · 5 个页签（我的频道 / 免费频道 / 推荐频道 / 国内资讯 / 国际资讯）
 * 统一为同一套消息源行样式：同一个头像尺寸、同一行高、同一间距、同一个轻线框。
 * 线框用 inset box-shadow 实现 —— 不占布局高度，行高与间距不会被撑开。
 * --------------------------------------------------------------- */
.ch {
  display: flex; gap: 8px; align-items: center;
  padding: 3px 8px; border-radius: 10px;
  margin: 0 0 3px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: .13s; position: relative;
}
.ch:last-child { margin-bottom: 0; }
.ch:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--brand); text-decoration: none; }
.ch.on { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand); }
.ch.on .ch-name { color: var(--brand-ink); }

/* v12.5 · 「我的频道」拖拽排序
 * v13.5 · 手柄改绝对定位：不再挤占行内空间，
 *         这样「我的频道」和其他 4 个页签的行宽 / 文字起始位置完全一致。
 */
/* v13.8 · 5 个页签全部可拖拽排序（不再只限「我的频道」） */
[data-sortable] .ch { cursor: grab; }
[data-sortable] .ch.dragging { opacity: .45; cursor: grabbing; }
[data-sortable] .ch.drop-before::before,
[data-sortable] .ch.drop-after::after {
  content: ''; position: absolute; left: 6px; right: 6px; height: 2px;
  background: var(--brand); border-radius: 2px;
}
[data-sortable] .ch.drop-before::before { top: -3px; }
[data-sortable] .ch.drop-after::after { bottom: -3px; }
/* 恢复默认排序：每个页签列表底部的小按钮 */
.ch-reset {
  display: block; width: 100%; margin: 6px 0 2px; padding: 5px 8px;
  border: 1px dashed var(--border); border-radius: 8px; background: transparent;
  color: var(--text-3); font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: .13s;
}
.ch-reset:hover { color: var(--brand-ink); border-color: var(--brand); background: var(--brand-soft); }
.ch-drag {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 9px; text-align: center;
  color: var(--text-3); font-size: 13px; line-height: 1;
  cursor: grab; opacity: 0; transition: .13s;
}
[data-sortable] .ch:hover .ch-drag { opacity: .7; }
[data-sortable] .ch.dragging .ch-drag { opacity: 1; }

.ch-av {
  /* v13.6 · 头像放大 15%：30px → 34px（5 个页签共用，天然一致） */
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700; overflow: hidden;
}
/* 黄框区：方形头像（同行风格） */
.ch-av.sq { border-radius: 9px; }
.ch-av img { width: 100%; height: 100%; object-fit: cover; }
.ch-body { flex: 1; min-width: 0; }
.ch-line { display: flex; align-items: center; gap: 6px; }
/* v13.6 · 频道名 + 小标签同一行：避免「推荐频道」的「需邀请码」
   竖着堆在右侧把行撑高，导致 5 个页签行高不一致 */
.ch-name-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.ch-name {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  line-height: 1.2; flex: 0 1 auto; min-width: 0;
  /* 一律单行省略：保证 5 个页签每一行高度完全一致 */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill-sm {
  flex-shrink: 0; padding: 1px 6px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; line-height: 1.45;
}
.ch-time2 {
  display: block; margin-top: 0; line-height: 1.2;
  font-size: 11px; font-weight: 600; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-height: 13px;   /* 没消息时也占位，行高不塌陷 */
}
.ch-prev {
  font-size: 13.5px; color: var(--text-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-right {
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  flex-shrink: 0;   /* v13.6 · 标签/角标横排靠右，行高不再被撑大 */
}
.ch-time { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.ch-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ch-badge.dim { background: var(--surface-3); color: var(--text-3); }

.av-1 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.av-2 { background: linear-gradient(135deg, #f97316, #ea580c); }
.av-3 { background: linear-gradient(135deg, #10b981, #059669); }
.av-4 { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.av-5 { background: linear-gradient(135deg, #ef4444, #dc2626); }
.av-6 { background: linear-gradient(135deg, #ec4899, #db2777); }
.av-7 { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.av-8 { background: linear-gradient(135deg, #6b7280, #4b5563); }

/* ---------------------------------------------------------------- 聊天区 */
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.chat-head .info { flex: 1; min-width: 0; }
.chat-head .name {
  font-size: 16.5px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-head .meta { font-size: 13px; font-weight: 500; color: var(--text-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.msgs {
  /* v13.9 · 消息间距收紧到约 5mm（padding 2 + gap 1 + head 14 ≈ 20px ≈ 5.3mm） */
  flex: 1; overflow-y: auto; padding: 10px 12px 6px;
  display: flex; flex-direction: column; gap: 0;
  -webkit-overflow-scrolling: touch; overflow-anchor: none;
}
.msgs-inner { display: flex; flex-direction: column; }

.loadmore {
  align-self: center; margin: 4px 0 12px; padding: 6px 16px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2); font-weight: 600;
}

.daysep {
  /* v13.9 · 日期分隔条也一起收紧，不再把消息撑开一大截 */
  display: flex; align-items: center; gap: 10px;
  margin: 5px 0 4px; color: var(--text-3); font-size: 11.5px;
}
.daysep::before, .daysep::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.msg { display: flex; gap: 10px; padding: 1px 2px; }
.msg-av {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700; overflow: hidden;
}
.msg-av img { width: 100%; height: 100%; object-fit: cover; }
.msg-main { flex: 1; min-width: 0; }
.msg-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  line-height: 1.2; margin-bottom: 1px;
}
/* 「管理」小标签不能把整行撑高，否则消息间距又变回一大截 */
.msg-head .pill { padding: 0 6px; font-size: 11px; line-height: 15px; }
.msg-head .who { font-weight: 800; color: var(--text-2); }
.msg-bubble {
  display: inline-block; max-width: 100%;
  padding: 7px 11px; border-radius: 4px 13px 13px 13px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 15.5px; line-height: 1.5; font-weight: 500;
  word-break: break-word; white-space: pre-wrap;
}
/* v13.9 · 管理员消息样式（类名 msg-admin，避免撞后台布局的 .admin） */
.msg.msg-admin .msg-bubble { background: var(--brand-soft); border-color: transparent; }
.msg-bubble a { word-break: break-all; }
.msg-img {
  display: block; border-radius: 12px; overflow: hidden; max-width: 300px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.msg-img img { width: 100%; cursor: zoom-in; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-main { display: flex; flex-direction: column; align-items: flex-end; }
.msg.mine .msg-head { flex-direction: row-reverse; }
.msg.mine .msg-bubble {
  border-radius: 13px 4px 13px 13px;
  background: var(--brand); color: #fff; border-color: transparent;
}
.msg.new { animation: pop .28s ease-out; }
@keyframes pop {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.jump {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 74px);
  padding: 7px 16px; border-radius: 999px; z-index: 30;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-2); display: flex; align-items: center; gap: 6px;
}

.composer {
  flex-shrink: 0; background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 9px 10px calc(9px + var(--nav-h) + var(--safe-b));
  display: flex; gap: 8px; align-items: flex-end;
}
.composer textarea {
  min-height: 42px; max-height: 132px; padding: 10px 14px;
  border-radius: 21px; background: var(--surface-2); border-color: transparent;
  resize: none; overflow-y: auto; line-height: 1.45;
}
.composer textarea:focus { background: var(--surface); }
.composer .send {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.composer .send[disabled] { background: var(--surface-3); color: var(--text-3); }
.composer .clip {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); background: var(--surface-2);
}
.composer .clip svg { width: 20px; height: 20px; }

.readonly-bar {
  flex-shrink: 0; background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 14px calc(12px + var(--nav-h) + var(--safe-b));
  text-align: center; font-size: 13.5px; color: var(--text-2);
}

/* -------------------------------------------------------------- 底部导航 */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex; background: var(--surface);
  border-top: 1px solid var(--border);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--text-3); font-size: 11px; font-weight: 600; position: relative;
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav a.on { color: var(--brand); }
.bottomnav svg { width: 22px; height: 22px; }
.bottomnav .badge {
  position: absolute; top: 4px; left: 50%; margin-left: 4px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ----------------------------------------------------------------- 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; z-index: 80; background: rgba(15, 20, 30, .45);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; z-index: 90;
  width: min(86vw, 320px); background: var(--surface);
  transform: translateX(102%); transition: transform .24s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-3);
}
.drawer.on { transform: none; }
.drawer-head {
  padding: calc(18px + var(--safe-t)) 18px 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-head .who { font-size: 16px; font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px; }
.drawer-foot { padding: 12px 12px calc(12px + var(--safe-b)); border-top: 1px solid var(--border); }
.menu-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 13px; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 600; color: var(--text); text-align: left;
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item svg { width: 19px; height: 19px; color: var(--text-2); flex-shrink: 0; }

/* ----------------------------------------------------------------- 登录页 */
.auth {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 26px 18px calc(26px + var(--safe-b));
  background:
    radial-gradient(900px 480px at 12% -8%, var(--brand-soft), transparent 62%),
    var(--bg);
}
.auth-wrap { width: 100%; max-width: 404px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .mark {
  width: 60px; height: 60px; border-radius: 19px; margin: 0 auto 14px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 800; box-shadow: var(--shadow-2);
}
.auth-head h1 { font-size: 25px; font-weight: 800; letter-spacing: .5px; }
.auth-head p { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 22px;
  box-shadow: var(--shadow-2);
}
.seg {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: var(--surface-2); border-radius: 12px;
}
.seg a, .seg button {
  flex: 1; padding: 9px 0; border-radius: 9px; text-align: center;
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.seg a.on, .seg button.on {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-1);
}
.seg a:hover { text-decoration: none; }
.feats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.feat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 14px;
}
.feat b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.feat span { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.auth-foot { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 18px; line-height: 1.8; }

/* --------------------------------------------------------------- 后台 */
/* ==========================================================================
   管理后台 —— 桌面优先布局（电脑端固定侧边栏 + 宽内容区 + 多列表格）
   ========================================================================== */
/* v13.9 · 后台根容器改用 admin-root：不能再让「管理员消息（.admin）」误命中这条规则 */
.admin-root { display: flex; min-height: 100dvh; background: var(--bg); }

/* 侧边栏：固定不动，不随内容滚动 */
.admin-side {
  width: 232px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); padding: 0 0 20px;
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  overflow-y: auto; z-index: 60;
}
.admin-side .brand {
  display: flex; align-items: center; gap: 9px;
  padding: 18px 18px; font-size: 16px; font-weight: 800;
  border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.admin-nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.admin-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.admin-nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.admin-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav .grp {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  padding: 14px 12px 5px; letter-spacing: .4px;
}
.admin-nav .n {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* 主区域：给固定侧边栏让出左边距 */
.admin-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  margin-left: 232px;
}

/* 顶栏 */
.admin-top {
  height: 56px; flex-shrink: 0; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.admin-top .grow { font-size: 15.5px; }
.adm-link {
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  padding: 7px 12px; border-radius: 9px; white-space: nowrap;
  transition: .15s; border: 1px solid transparent;
}
.adm-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.adm-out { border-color: var(--border-strong); color: var(--text); }
.adm-out:hover { background: var(--surface-2); }

/* 内容区：宽屏铺开，最多 1440px 居中 */
.admin-body {
  padding: 24px 28px 48px; max-width: 1440px; width: 100%;
}
.admin-body > h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.3px; }
.admin-body > .lead { font-size: 13.5px; color: var(--text-2); margin-bottom: 20px; line-height: 1.6; }

/* 卡片：桌面端横向铺开 */
.admin-body .card { margin-bottom: 16px; }
.admin-body .card > h3 { font-size: 15.5px; }

/* 栅格：桌面多列 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* 底部固定保存条 */
.save-bar {
  position: sticky; bottom: 0; z-index: 30;
  margin: 0 -28px -48px; padding: 14px 28px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  display: flex; gap: 10px;
}

/* 数据概览统计卡：桌面更紧凑的栅格 */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px;
}
.stat .n { font-size: 25px; font-weight: 800; letter-spacing: -.5px; }
.stat .l { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.stat.warn .n { color: var(--amber); }
.stat.bad .n { color: var(--red); }
.stat.good .n { color: var(--green); }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; }
th {
  font-size: 12px; font-weight: 700; color: var(--text-3);
  background: var(--surface-2); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td .row { flex-wrap: nowrap; }
.nowrap { white-space: nowrap; }

/* -------------------------------------------------------------- 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; padding: 20px;
  background: rgba(15, 20, 30, .5); display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.modal-mask.on { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 440px; max-height: 88dvh; overflow-y: auto;
  padding: 22px; box-shadow: var(--shadow-3);
  transform: translateY(10px); transition: transform .18s;
}
.modal-mask.on .modal { transform: none; }
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .actions .btn { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
  transform: translate(-50%, 20px); z-index: 200;
  padding: 11px 20px; border-radius: 999px;
  background: #131720; color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-3); opacity: 0; pointer-events: none; transition: .22s;
  max-width: 88vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .9);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.lightbox.on { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lightbox .close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}

/* ------------------------------------------------------------ 老消息提示 */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--amber-soft); font-size: 13.5px;
}
.alert-item.bad { background: var(--red-soft); }

.codebox {
  display: flex; gap: 8px; align-items: center;
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 9px 12px; font-family: var(--mono); font-size: 12.5px;
  overflow-x: auto; white-space: nowrap;
}
.codebox button { flex-shrink: 0; }

/* --------------------------------------------------------------- 客服 */
.ico-sm { width: 17px; height: 17px; }
/* v14.2 · 客服会话列表收紧；消息区改用和普通聊天同一套 .msg 排版 */
.cs-msgs {
  flex: 1; overflow-y: auto; padding: 6px 4px 2px; max-height: 56dvh;
  -webkit-overflow-scrolling: touch;
}
.cs-thread {
  display: flex; gap: 8px; align-items: center; padding: 5px 8px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); margin-bottom: 4px; text-decoration: none;
}
.cs-thread:hover { background: var(--surface-2); text-decoration: none; }
.cs-thread.on { border-color: var(--brand); background: var(--brand-soft); }
.cs-thread .who {
  font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-thread .prev {
  font-size: 11.5px; color: var(--text-3); margin-top: 1px; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.cs-tmeta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  flex-shrink: 0; margin-left: auto;
}
.cs-tmeta .pill { padding: 0 5px; font-size: 10.5px; line-height: 15px; }
.cs-tmeta .tiny { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.chk-list {
  max-height: 260px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface);
}
.chk-list label {
  display: flex; gap: 9px; align-items: center; padding: 6px 4px;
  font-size: 13.5px; border-radius: 7px;
}
.chk-list label:hover { background: var(--surface-2); }
.chk-list input[type=checkbox] {
  width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0;
}
details.fold { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; }
details.fold > summary {
  padding: 11px 16px; cursor: pointer; font-weight: 700; font-size: 14px;
  list-style: none; display: flex; align-items: center; gap: 7px;
  color: var(--text); user-select: none;
}
details.fold > summary::marker { content: ''; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary > svg.ico { width: 15px; height: 15px; color: var(--brand); }
details.fold > summary::after {
  content: '展开'; margin-left: auto;
  font-size: 12px; font-weight: 600; color: var(--text-3);
}
details.fold[open] > summary::after { content: '收起'; }
details.fold[open] > summary { border-bottom: 1px solid var(--border); }
details.fold > .fold-body { padding: 16px 18px; }

/* ------------------------------------------------------------- 响应式 */
@media (min-width: 920px) {
  :root { --nav-h: 0px; }
  .shell { flex-direction: row; }
  .side { width: var(--side-w); border-right: 1px solid var(--border); flex-shrink: 0; }
  .main { display: flex; }
  .bottomnav { display: none; }
  .composer { padding-bottom: 12px; }
  .readonly-bar { padding-bottom: 14px; }
  .jump { bottom: 84px; }
  .toast { bottom: 28px; }
  .desk-only { display: initial; }
  .mob-only { display: none !important; }
  .admin-body { padding: 24px 28px; }
}

@media (max-width: 919px) {
  .desk-only { display: none !important; }
  .msgs { padding-bottom: 6px; }
  /* 手机端：列表页看 .side，聊天页看 .main */
  body.view-chat .side { display: none; }
  body.view-chat .main { display: flex; }
  body.view-chat .bottomnav { display: none; }
  body.view-chat .composer { padding-bottom: calc(10px + var(--safe-b)); }
  body.view-chat .readonly-bar { padding-bottom: calc(12px + var(--safe-b)); }
  body.view-chat .jump { bottom: calc(var(--safe-b) + 78px); }
  .admin-side {
    position: fixed; z-index: 95; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%); transition: transform .24s cubic-bezier(.32,.72,0,1);
    width: min(80vw, 250px);
  }
  .admin-side.on { transform: none; }
  .admin-main { margin-left: 0; }
  .admin-top { padding: 0 14px; }
  .admin-body { padding: 16px 14px 40px; }
  .save-bar { margin: 0 -14px -40px; padding: 12px 14px; }
  th, td { padding: 9px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================ v3 新增
   需求1 验证码 / 需求7 右上角一行菜单 / 需求8 多条公告 / 需求10 未读角标 */

/* ---------- 登录验证码 ---------- */
.captcha-row { display: flex; gap: 9px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img {
  width: 132px; height: 46px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface-2);
  object-fit: cover; cursor: pointer; transition: .15s;
}
.captcha-img:hover { border-color: var(--brand); }
.captcha-img:active { transform: scale(.98); }

/* ---------- 右上角一行式菜单（替代三条杠） ---------- */
.topmenu {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.topmenu-me {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 4px 9px 4px 4px; border-radius: 11px; transition: .15s;
  color: var(--text); max-width: 170px;
}
.topmenu-me:hover { background: var(--surface-2); }
.topmenu-name {
  font-size: 13px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.icon-btn.is-locked { opacity: .45; cursor: not-allowed; }
@media (max-width: 900px) {
  .topmenu-name { display: none; }
  .topmenu-me { padding: 3px; }
}
@media (max-width: 620px) {
  .topbar .sub { display: none; }
  .topmenu { gap: 0; }
  .topmenu .icon-btn { width: 33px; height: 33px; }
  .topmenu .icon-btn svg { width: 18px; height: 18px; }
}

/* ---------- 多条公告 ---------- */
.notice-stack { display: flex; flex-direction: column; }
.notice-stack .notice { position: relative; padding-right: 34px; }
.notice-title { font-weight: 800; margin-right: 5px; }
.notice-text { line-height: 1.55; }
.notice-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 7px; line-height: 1;
  font-size: 17px; color: currentColor; opacity: .55; transition: .15s;
}
.notice-close:hover { opacity: 1; background: rgba(0, 0, 0, .09); }

.notice-info {
  background: var(--brand-soft, var(--surface-2));
  color: var(--brand);
}
.notice-promo {
  background: linear-gradient(92deg, var(--brand), var(--brand-2, var(--brand)));
  color: #fff;
}
.notice-promo .notice-close:hover { background: rgba(255, 255, 255, .22); }
.notice-warn { background: var(--amber-soft); color: var(--amber); }

/* ---------- 未读角标强化 ---------- */
.ch.has-unread {
  background: var(--brand-soft, var(--surface-2));
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .38);
}
.ch.has-unread .ch-name { font-weight: 800; }
.ch-unread-txt {
  font-size: 11.5px; font-weight: 700; color: var(--red);
  margin-top: 2px;
}
.ch-unread-txt.hide { display: none; }

/* 推荐频道里未开通的条目：v13.6 起不再弱化头像/名字，
   统一由「需邀请码」小标签标识，保证 5 个页签展示方式完全一致 */
.ch-locked:hover { background: var(--surface-2); }

/* ---------- 后台公告列表 ---------- */
.ann-row { padding: 13px; border: 1px solid var(--line, var(--border)); border-radius: 12px; }
.ann-row.off { opacity: .55; }
.ann-row textarea { width: 100%; }

/* ---------- 小按钮 ---------- */
.btn-xs { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }

/* ==========================================================================
   v5 · 页面骨架：全宽顶栏（众筹联盟 + 中文菜单）+ 行情栏 + 内容
   ========================================================================== */
.pagecol { height: 100dvh; display: flex; flex-direction: column; }

.sitehead {
  flex-shrink: 0; z-index: 55;
  display: flex; align-items: center; gap: 10px;
  height: calc(64px + var(--safe-t)); padding: var(--safe-t) 12px 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.sh-logo {
  flex-shrink: 0; display: flex; align-items: flex-end; gap: 8px;
  padding: 0; margin-left: 38px; background: transparent; color: var(--text);
  white-space: nowrap;
}
.sh-mark {
  display: flex; align-items: flex-end; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  overflow: hidden;
}
.sh-mark img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; display: block; }
/* 深色模式下 LOGO（深蓝图形）垫白底保证可见 */
[data-theme="dark"] .sh-mark { background: #fff; }
[data-theme="dark"] .sh-mark img { width: 84%; height: 84%; }
.sh-word { font-size: 19px; font-weight: 800; letter-spacing: 1px; line-height: 1; padding-bottom: 2px; }
.sh-menu { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* 顶栏小图标按钮（提示音 / 深浅色 / 客服） */
.sh-ico {
  position: relative; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .15s; text-decoration: none;
}
.sh-ico:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sh-ico svg { width: 16px; height: 16px; }
.sh-ico.is-locked { opacity: .5; cursor: not-allowed; }
.sh-ico-red { background: #fdecec; border-color: #f5c2c2; color: #d92d2d; }
.sh-ico-red:hover { background: #fbdcdc; border-color: #eea9a9; color: #b91c1c; }
.sh-ico-n {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--surface);
}
/* 顶栏中文文字按钮（提示音开/关 · 切换深浅色） */
.sh-ico-txt {
  width: auto; height: 32px; padding: 0 11px; border-radius: 9px;
  font-size: 13px; font-weight: 700; white-space: nowrap; letter-spacing: .2px;
}
.sh-ico-txt.is-off { color: var(--text-3); }
.sh-ico-txt.is-locked { opacity: .55; cursor: not-allowed; }
/* 账号名 */
.sh-user {
  flex-shrink: 0; margin: 0 2px;
  font-size: 13px; font-weight: 700; color: var(--text);
  padding: 6px 4px; white-space: nowrap;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis;
}

/* 中文字菜单（管理后台 / 设置 / 退出）：纯文字，模仿同行无边框样式 */
.sh-pill {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 7px 9px; border-radius: 8px; border: none;
  background: transparent; color: var(--text);
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
  cursor: pointer; transition: .15s; text-decoration: none;
}
.sh-pill:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sh-pill.is-locked { opacity: .5; cursor: not-allowed; }
.sh-pill-red {
  background: #fdecec; border-color: #f5c2c2; color: #d92d2d;
}
.sh-pill-red:hover { background: #fbdcdc; border-color: #eea9a9; color: #b91c1c; }
.sh-pill-out { border-color: var(--border-strong); }
.sh-pill-n {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 620px) {
  .sitehead { height: calc(64px + var(--safe-t)); gap: 6px; padding-left: 9px; padding-right: 9px; }
  .sh-logo { gap: 6px; }
  .sh-mark { width: 36px; height: 36px; border-radius: 9px; }
  .sh-mark img { width: 100%; height: 100%; }
  .sh-word { font-size: 17px; line-height: 1; padding-bottom: 2px; }
  .sh-menu { gap: 4px; }
  .sh-ico { width: 29px; height: 29px; border-radius: 8px; }
  .sh-ico svg { width: 15px; height: 15px; }
  .sh-ico-txt { width: auto; height: 29px; padding: 0 8px; font-size: 11.5px; }
  .sh-user { max-width: 66px; font-size: 12px; }
  .sh-pill { padding: 5px 8px; font-size: 11.5px; border-radius: 8px; }
}

/* ==========================================================================
   v6 · 行情小卡片（1:1 模仿同行：名称/价格/涨跌 三行，涨红底、跌绿底）
   ========================================================================== */
.marketbar {
  flex: 1; min-width: 0; display: flex; align-items: center;
  overflow: hidden; margin-left: 18px;
}
.marketbar.hide { display: none; }
.mq-scroll {
  display: flex; align-items: stretch; gap: 5px;
  overflow-x: auto; scrollbar-width: none; width: 100%;
  padding: 0;
}
.mq-scroll::-webkit-scrollbar { display: none; }
.mq-item {
  flex: 0 0 auto; min-width: 77px; max-width: 119px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 0;
  padding: 4px 6px; border-radius: 8px; line-height: 1.25;
  background: var(--surface-2);
}
.mq-item.up { background: rgba(224, 49, 49, .09); }
.mq-item.down { background: rgba(14, 163, 113, .11); }
.mq-item .mq-top {
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.mq-item .mq-val {
  font-size: 15px; font-weight: 800; color: var(--text);
  font-family: var(--mono); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  line-height: 1.25;
}
.mq-item .mq-sub,
.mq-item .mq-pct { font-size: 12.5px; font-weight: 700; font-family: var(--mono); white-space: nowrap; line-height: 1.25; }
.mq-item.up .mq-sub, .mq-item.up .mq-pct { color: var(--red); }
.mq-item.down .mq-sub, .mq-item.down .mq-pct { color: var(--green); }
.mq-item.flat .mq-sub, .mq-item.flat .mq-pct { color: var(--text-3); }

/* ==========================================================================
   v4 · 侧栏顶部：下载APP / 在线客服（图3样式）
   ========================================================================== */
.quick-actions {
  display: flex; gap: 8px; padding: 10px 12px 2px;
  background: var(--surface);
}
.quick-actions:only-child, .quick-actions + .tabs { margin-top: 0; }
.qa {
  flex: 1; height: 34px; border: none; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; color: #fff; cursor: pointer;
  transition: .15s; text-decoration: none;
}
.qa svg { width: 16px; height: 16px; }
.qa-app { background: var(--brand); }
.qa-app:hover { background: var(--brand-ink); }
.qa-cs { background: var(--green); }
.qa-cs:hover { filter: brightness(1.08); }
.qa-n {
  background: rgba(255, 255, 255, .28); border-radius: 999px;
  font-size: 11px; font-weight: 800; padding: 1px 7px;
}
.dl-row { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }

/* ==========================================================================
   v4 · 右上角文字菜单（图2样式：设置 / 退出）
   ========================================================================== */
.tm-link {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  padding: 7px 10px; border-radius: 10px; white-space: nowrap;
  transition: .15s; flex-shrink: 0;
}
.tm-link:hover { background: var(--surface-2); color: var(--text); }
.tm-out { border: 1px solid var(--border-strong); color: var(--text); }
.tm-out:hover { background: var(--surface-2); color: var(--text); }
.adm-link {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  padding: 7px 10px; border-radius: 10px; white-space: nowrap;
  transition: .15s; flex-shrink: 0;
}
.adm-link:hover { background: var(--surface-2); color: var(--text); }
.adm-out { border: 1px solid var(--border-strong); color: var(--text); }
.adm-out:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 900px) {
  .adm-link { padding: 6px 8px; }
}
@media (max-width: 620px) {
  .tm-me-link { display: none; }   /* 头像本身指向「我的」，小屏只留退出 */
  .tm-link, .adm-link { padding: 6px 8px; font-size: 12.5px; }
}

/* ==========================================================================
   v11 · 用户管理页（1:1 模仿参考截图：统计卡 + 搜索筛选 + 账号表）
   ========================================================================== */

/* 页头：标题/副标题 在左，操作按钮 在右 */
.pg-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 4px;
}
.pg-head h2 { margin-bottom: 4px; }
.pg-actions { display: flex; gap: 9px; flex-shrink: 0; align-items: center; }
.pg-form { display: inline-flex; margin: 0; }

/* 试用账号按钮（琥珀色） */
.btn-amber { background: var(--amber); color: #fff; }
.btn-amber:hover { filter: brightness(1.06); }

/* 统计卡：图标块 + 大数字 + 标签 */
.ustats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px; margin: 14px 0 16px;
}
.ucard {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  text-decoration: none; transition: .15s;
}
.ucard:hover { border-color: var(--border-strong); text-decoration: none; }
.ucard .ico-box {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ucard .ico-box svg { width: 19px; height: 19px; }
.ico-blue   { background: var(--brand-soft);  color: var(--brand); }
.ico-indigo { background: var(--violet-soft); color: var(--violet); }
.ico-amber  { background: var(--amber-soft);  color: var(--amber); }
.ico-red    { background: var(--red-soft);    color: var(--red); }
.ucard .n  { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--text); }
.ucard .l  { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 3px; font-weight: 500; }

/* 筛选行：搜索框 + 分段 pill 组 */
.ufilter {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 14px;
}
.ufilter .fsearch { position: relative; flex: 1; min-width: 170px; max-width: 250px; }
.ufilter .fsearch .ico {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}
.ufilter .fsearch input {
  width: 100%; padding: 8px 12px 8px 31px; font-size: 13.5px;
  background: var(--surface); border-color: var(--border-strong); border-radius: 9px;
}
.useg {
  display: flex; gap: 4px; background: var(--surface-2);
  border-radius: 9px; padding: 3px; flex-shrink: 0;
}
.useg a {
  padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 700;
  color: var(--text-2); text-decoration: none; white-space: nowrap; transition: .15s;
}
.useg a:hover { color: var(--text); text-decoration: none; }
.useg a.on { background: var(--text); color: #fff; }

@media (max-width: 620px) {
  .pg-head { flex-direction: column; }
  .pg-actions { width: 100%; }
  .pg-actions .btn { flex: 1; }
}

/* ==========================================================================
   v11.1 · 弹窗右上角 × 关闭按钮 + 首页公告弹窗（1:1 模仿参考截图）
   ========================================================================== */
.modal { position: relative; }
.modal-x {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .15s;
}
.modal-x:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 首页公告：打开首页即弹出 */
.boot-ann { z-index: 130; }
.boot-modal {
  max-width: 400px; text-align: center;
  padding: 26px 26px 22px;
}
.boot-title {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 16.5px; font-weight: 800; color: var(--text);
  margin-bottom: 14px;
}
.boot-title .ico { width: 19px; height: 19px; color: var(--red); flex-shrink: 0; }
.boot-body {
  font-size: 14.5px; font-weight: 500; line-height: 1.95;
  color: var(--text); white-space: pre-line; text-align: center;
  word-break: break-word; margin-bottom: 18px;
}
.boot-body a { color: var(--brand); text-decoration: underline; }
.boot-actions { display: flex; flex-direction: column; gap: 10px; }
.boot-btn {
  display: flex; align-items: center; justify-content: center;
  height: 42px; border-radius: 10px; border: none;
  font-size: 14.5px; font-weight: 700; color: #fff;
  cursor: pointer; text-decoration: none; transition: .15s;
}
.boot-btn:hover { filter: brightness(1.05); text-decoration: none; }
.boot-btn-orange { background: linear-gradient(90deg, #ff9a3c, #ff7a1a); }
.boot-btn-blue { background: var(--brand); }

/* ==========================================================================
   v11.3 · 消息接入：6 大导入卡片 + 接入令牌
   ========================================================================== */
.imp-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; margin-top: 12px;
}
.imp-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.imp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.imp-head .ico-box {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.imp-head .ico-box svg { width: 17px; height: 17px; }
.imp-head b { display: block; font-size: 14.5px; font-weight: 800; color: var(--text); }
.imp-head .tiny { display: block; margin-top: 1px; }
.imp-head .pill { margin-left: auto; }
.imp-desc { line-height: 1.6; flex: 1; }
.imp-card .btn { align-self: flex-start; }

/* ==========================================================================
   v13.9 · 后台排版收紧：留白 / 行距 / 行高整体压缩，一屏能看到更多内容
   （只作用于 .admin-root 后台，不影响前台）
   ========================================================================== */
.admin-root .admin-body { padding: 16px 20px 32px; }
.admin-root .admin-top { height: 50px; padding: 0 18px; }
.admin-root .pg-head { margin-bottom: 8px; }
.admin-root .pg-titles h2 { font-size: 19px; }
.admin-root .pg-titles .lead,
.admin-root .admin-body > .lead { font-size: 13px; margin-bottom: 12px; line-height: 1.5; }

.admin-root .stats { gap: 10px; margin-bottom: 12px; }
.admin-root .stat { padding: 11px 13px; }
.admin-root .stat .n { font-size: 21px; }
.admin-root .stat .l { font-size: 12px; margin-top: 1px; }

.admin-root .ch-tabs { margin-bottom: 10px; }
.admin-root .ufilter { padding: 8px 10px; margin-bottom: 10px; }

.admin-root .card { padding: 13px 14px; margin-bottom: 10px; }
.admin-root .admin-body .card { margin-bottom: 10px; }
.admin-root .card > h3 { font-size: 15px; margin-bottom: 3px; }
.admin-root .card > .card-sub { margin-bottom: 10px; }

.admin-root table { font-size: 13.5px; }
.admin-root th, .admin-root td { padding: 6px 10px; }
.admin-root th { font-size: 11.5px; }
.admin-root .table-wrap { border-radius: 10px; }

.admin-root details.fold { margin-bottom: 10px; }
.admin-root details.fold > summary { padding: 9px 13px; font-size: 13.5px; }
.admin-root details.fold > .fold-body { padding: 12px 14px; }

.admin-root .field { margin-bottom: 10px; }
.admin-root .field > label { font-size: 13px; margin-bottom: 4px; }
.admin-root .field .hint { font-size: 12px; margin-top: 4px; }
.admin-root input[type=text], .admin-root input[type=email], .admin-root input[type=password],
.admin-root input[type=number], .admin-root input[type=url], .admin-root input[type=search],
.admin-root select, .admin-root textarea {
  padding: 8px 11px; font-size: 13.5px; border-radius: 8px;
}
.admin-root textarea { min-height: 62px; }
.admin-root .grid-2, .admin-root .grid-3 { gap: 10px; }
.admin-root .btn { padding: 7px 13px; font-size: 13.5px; }
.admin-root .btn-sm { padding: 6px 11px; font-size: 13.5px; }
.admin-root .btn-xs { padding: 4px 9px; font-size: 12.5px; }
.admin-root .chk-list { gap: 4px; }
.admin-root .admin-nav { gap: 1px; }
.admin-root .admin-nav a { padding: 7px 11px; font-size: 13.5px; }
.admin-root .admin-nav .grp { padding: 10px 12px 4px; }
.admin-root td { line-height: 1.35; }
.admin-root tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.admin-root tbody tr:hover { background: var(--surface-2); }

/* ==========================================================================
   v14.0 · 顶部公告横幅（全站，可多条轮播）
   ========================================================================== */
.topbar-ann {
  flex-shrink: 0; position: relative; z-index: 50;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; height: 34px;
  background: var(--brand-soft); color: var(--brand);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.topbar-ann .tan-scroll {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 26px;
  overflow: hidden;
}
.topbar-ann .tan-item {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: 13px; font-weight: 600; line-height: 1.3;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-ann .tan-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.topbar-ann .tan-item b { font-weight: 800; margin-right: 2px; }
.topbar-ann .tan-warn { color: var(--amber); }
.topbar-ann .tan-promo { color: var(--brand); }
.topbar-ann .tan-info { color: var(--text-2); }
.topbar-ann .tan-close {
  flex-shrink: 0; border: none; background: transparent; cursor: pointer;
  width: 22px; height: 22px; border-radius: 6px;
  font-size: 17px; line-height: 1; color: currentColor; opacity: .55;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.topbar-ann .tan-close:hover { opacity: 1; background: rgba(0, 0, 0, .09); }
/* 多条时轮播（只有 1 条就静止，避免无意义闪动） */
.topbar-ann[data-multi="1"] .tan-scroll { animation: tanRoll 22s linear infinite; }
.topbar-ann[data-multi="1"] .tan-scroll:hover { animation-play-state: paused; }
@keyframes tanRoll {
  0%, 8%      { transform: translateX(0); }
  50%, 58%    { transform: translateX(-50%); }
  100%        { transform: translateX(0); }
}

/* v14.0 · 消息源公告支持多条 + 三种配色（默认沿用原来的黄框） */
.ch-notice { display: flex; flex-direction: column; gap: 8px; }
.ch-notice .chn-row + .chn-row { padding-top: 8px; border-top: 1px dashed rgba(217, 119, 6, .3); }
.ch-notice .chn-info { color: var(--brand); }
.ch-notice .chn-promo { color: var(--brand); font-weight: 600; }
[data-theme="dark"] .ch-notice .chn-info,
[data-theme="dark"] .ch-notice .chn-promo { color: var(--brand); }

/* v14.0 · 后台分类页签（从频道管理提升为通用组件） */
.admin-root .ch-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.admin-root .ch-tab {
  display:inline-flex; align-items:center; gap:6px;
  padding:7px 13px; border-radius:9px; font-size:13px; font-weight:700;
  border:1px solid var(--border); background:var(--surface); color:var(--text-2);
  text-decoration:none; transition:.13s;
}
.admin-root .ch-tab:hover { border-color:var(--brand); color:var(--brand-ink); }
.admin-root .ch-tab.on { background:var(--brand); border-color:var(--brand); color:#fff; }
.admin-root .ch-tab .n {
  min-width:20px; padding:0 5px; border-radius:20px; font-size:11px; font-weight:800;
  background:var(--surface-2); color:var(--text-3); text-align:center;
}
.admin-root .ch-tab.on .n { background:rgba(255,255,255,.25); color:#fff; }
/* v14.2 · 页签也可以用 button（邀请码管理里的分类切换） */
.admin-root button.ch-tab { font-family:inherit; cursor:pointer; line-height:1.3; }
.admin-root .chk-list label .grow { flex:1; min-width:0; }
.admin-root .chk-list label { gap:7px; padding:5px 4px; }

/* ==========================================================================
   v14.4 · 登录页重做 —— 双栏排版（左品牌区 + 右登录卡）
   全新 .lg- 前缀，不影响 error.html/me.html 沿用的旧 .auth 系列
   ========================================================================== */
.lg {
  min-height: 100dvh; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 480px at 6% -6%, var(--brand-soft), transparent 55%),
    radial-gradient(760px 440px at 102% 108%, var(--brand-soft), transparent 55%),
    var(--bg);
}
.lg-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.lg-bar-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15.5px; }
.lg-bar-mark {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.lg-theme {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.lg-body {
  flex: 0 0 auto; margin: auto 0;   /* 整块内容在页面垂直居中 */
  display: flex; align-items: flex-end; justify-content: center;
  gap: 96px; padding: 40px 30px; flex-wrap: wrap;
}
.lg-left { max-width: 620px; }
.lg-logo {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-ink));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; box-shadow: 0 8px 20px var(--brand-ring);
  margin-bottom: 22px;
}
.lg-left h1 { font-size: 44px; font-weight: 800; letter-spacing: 1px; line-height: 1.1; }
.lg-slogan { font-size: 18.5px; font-weight: 700; margin: 12px 0 30px; }
.lg-headline { font-size: 27px; font-weight: 800; margin: 14px 0 7px; line-height: 1.35; }
.lg-headline .hl { color: var(--brand); }
.lg-sub2 { font-size: 16px; font-weight: 600; color: var(--text-2); margin: 0 0 18px; letter-spacing: .3px; }
.lg-feats { display: flex; flex-direction: column; gap: 11px; }
.lg-feat {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.lg-feat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.lg-feat-ico {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: var(--ico-bg, var(--brand-soft));
}
.lg-feat-ico.gold   { --ico-bg: #fff7e6; }
.lg-feat-ico.red    { --ico-bg: #fff0f0; }
.lg-feat-ico.green  { --ico-bg: #f6ffed; }
.lg-feat-ico.orange { --ico-bg: #fff7e6; }
.lg-feat-tx { min-width: 0; }
.lg-feat-tx b { display: block; font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.lg-feat-tx span { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.lg-feat-kw { color: var(--text); font-weight: 600; }

.lg-card {
  width: 100%; max-width: 420px;
  min-height: 620px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 48px 36px 40px;
  box-shadow: var(--shadow-3); text-align: center;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.lg-card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-ink));
}
.lg-eyebrow { font-size: 11px; letter-spacing: 3px; color: var(--text-3); font-weight: 700; }
.lg-card h2 { font-size: 24px; font-weight: 800; margin-top: 6px; }
.lg-seg { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.lg-seg a {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 9px;
  font-size: 14px; font-weight: 700; color: var(--text-2); text-decoration: none;
  cursor: pointer; transition: .15s; user-select: none;
}
.lg-seg a.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-ink));
  color: #fff; box-shadow: var(--shadow-1);
}
.lg-seg a:not(.on):hover { color: var(--brand); }
.lg-pane { display: none; text-align: left; }
.lg-pane.on { display: block; }
/* 短信演示模式提示条：未接短信网关时才出现 */
.lg-demo-tip {
  margin-bottom: 12px; padding: 9px 12px; border-radius: 10px;
  border: 1px dashed var(--brand); background: var(--brand-ring);
  color: var(--text-2); font-size: 12.5px; line-height: 1.6;
}
.lg-demo-tip b { color: var(--brand); }
.lg-code-row { display: flex; gap: 8px; align-items: stretch; }
.lg-code-row input { flex: 1; min-width: 0; }
.lg-code-btn {
  flex-shrink: 0; padding: 0 14px; border: 1px solid var(--brand);
  border-radius: 12px; background: var(--surface); color: var(--brand);
  font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
  white-space: nowrap; transition: .15s;
}
.lg-code-btn:hover:not(:disabled) { background: var(--brand); color: #fff; }
.lg-code-btn:disabled { opacity: .5; cursor: not-allowed; }
.lg-field { margin-bottom: 12px; }
.lg-field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); margin-bottom: 5px;
}
.lg-field .req { color: var(--red); }
.lg-field input {
  width: 100%; padding: 11px 13px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); color: var(--text); transition: .15s;
}
.lg-field input:focus { border-color: var(--brand); outline: none; background: var(--surface); box-shadow: 0 0 0 3px var(--brand-ring); }
.lg-agree {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-2);
  margin: 4px 0 6px; text-align: left; cursor: pointer;
}
.lg-agree input { width: 15px; height: 15px; accent-color: var(--brand); }
.lg-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 2px; }
.lg-chip {
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  font-family: inherit; transition: .15s;
}
.lg-chip:hover { color: var(--brand); border-color: var(--brand); }
.lg-forgot { display: inline-block; font-size: 12.5px; color: var(--text-2); margin-top: 5px; }
.lg-forgot:hover { color: var(--brand); text-decoration: none; }
.lg-btn {
  width: 100%; padding: 12px; margin-top: 4px;
  border: 0; border-radius: 13px; cursor: pointer;
  font-size: 15px; font-weight: 700; font-family: inherit;
  background: linear-gradient(135deg, var(--brand), var(--brand-ink));
  color: #fff; transition: .18s; box-shadow: 0 8px 18px var(--brand-ring);
}
.lg-btn:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 10px 22px var(--brand-ring); }
.lg-btn:disabled { background: linear-gradient(135deg, var(--brand), var(--brand-ink)); color: #fff; opacity: .55; cursor: not-allowed; filter: none; transform: none; box-shadow: none; }
.lg-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 12px 0 10px; }
.lg-or::before, .lg-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.lg-sso { display: flex; flex-direction: column; gap: 8px; }
.lg-sso a, .lg-sso button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px; border-radius: 11px; cursor: pointer;
  font-size: 13.5px; font-weight: 700; font-family: inherit;
  border: 1px solid transparent; transition: .15s; text-decoration: none;
}
.lg-sso .qq { background: #e8f4ff; color: #1f8ee5; }
.lg-sso .qq:hover { background: #dceeff; }
.lg-sso .wx { background: #e9f8ee; color: #2aae67; }
.lg-sso .wx:hover { background: #ddf3e5; }
.lg-ico {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: #fff; letter-spacing: 0;
}
.lg-ico.qq { background: #12b7f5; }
.lg-ico.wx { background: #2aae67; }
.lg-hint { font-size: 11.5px; color: var(--text-3); margin-top: 12px; }
.lg-foot { text-align: center; font-size: 12px; color: var(--text-3); padding: 14px; }
.lg-resetbox {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; font-size: 13.5px;
  color: var(--text-2); line-height: 1.7; margin-bottom: 8px;
}
.lg-resetbox b { color: var(--text); }

/* 协议弹窗正文 */
.lg-agr { max-width: 560px; max-height: 78dvh; }
.lg-agr-body {
  overflow-y: auto; max-height: calc(78dvh - 90px);
  font-size: 13px; color: var(--text-2); line-height: 1.75;
  display: flex; flex-direction: column; gap: 10px; padding-right: 4px;
}
.lg-agr-body b { color: var(--text); }
.lg-agr-body p { margin: 0; }

/* 暗色主题下快捷登录按钮底色 */
[data-theme="dark"] .lg-sso .qq { background: rgba(31, 142, 229, .16); }
[data-theme="dark"] .lg-sso .wx { background: rgba(42, 174, 103, .16); }

/* 窄屏：收起左栏，卡片全宽 */
@media (max-width: 980px) {
  .lg-left { display: none; }
  .lg-body { padding: 22px 14px; gap: 0; }
}

/* ==========================================================================
   v14.8 · 右侧 AI 助手面板（常驻 · 上半总结 · 下半聊天）
   ========================================================================== */
.ai-panel {
  width: 680px; flex-shrink: 0; display: flex; flex-direction: column;
  min-height: 0; background: var(--surface); border-left: 1px solid var(--border);
}
.ai-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-bottom: 1px solid var(--border); font-size: 14px; flex-shrink: 0;
}
.ai-badge {
  padding: 2px 7px; border-radius: 8px; flex-shrink: 0;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.ai-mini {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.ai-mini:hover { color: var(--brand); border-color: var(--brand); }
.ai-top {
  flex: 1 1 45%; min-height: 0; display: flex; flex-direction: column;
  border-bottom: 1px solid var(--border);
}
.ai-bottom {
  flex: 1 1 55%; min-height: 0; display: flex; flex-direction: column;
}
.ai-subhead {
  padding: 7px 12px; font-size: 12.5px; font-weight: 700; color: var(--text-2);
  background: var(--surface-2); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ai-pane {
  flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px;
  -webkit-overflow-scrolling: touch;
}
.ai-empty { color: var(--text-3); font-size: 12.5px; line-height: 1.7; padding: 18px 6px; text-align: center; }
.ai-task {
  border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px;
  margin-bottom: 8px; background: var(--surface-2);
}
.ai-task-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.ai-task-h b { font-size: 13px; flex: 1; min-width: 0; }
.ai-task-t { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.ai-task-b {
  font-size: 12.5px; color: var(--text-2); line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.ai-msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.ai-msg-av {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.ai-msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* 账号/时间在上，内容在下；全部左对齐 */
.ai-msg-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.ai-msg-who { font-size: 11px; font-weight: 700; color: var(--text-2); }
.ai-msg-meta time { font-size: 10px; color: var(--text-3); }
.ai-msg-body { font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.ai-msg-text { padding: 2px 0; }
.ai-msg-img-wrap { display: inline-block; max-width: 100%; border-radius: 10px; overflow: hidden; }
.ai-msg-img { display: block; max-width: 160px; max-height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.ai-msg-file { display: inline-block; max-width: 100%; font-size: 13px; color: var(--brand); word-break: break-all; text-decoration: none; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.ai-msg-file:hover { text-decoration: underline; }
.ai-msg-who { font-size: 11px; font-weight: 700; color: var(--text-2); }
.ai-msg-meta time { font-size: 10px; color: var(--text-3); }
/* 撤回 / 删除后的系统占位 */
.ai-msg-sys {
  text-align: center; font-size: 11px; color: var(--text-3);
  margin: 6px 0 10px; padding: 3px 0;
}
/* 消息上的管理按钮（撤回 / 删除）：本人 2 分钟内、或管理员/代理商可见 */
.ai-msg-acts { display: inline-flex; gap: 8px; margin-left: 8px; }
.ai-msg-acts a {
  font-size: 10px; color: var(--brand); cursor: pointer; opacity: .8;
  user-select: none;
}
.ai-msg-acts a:hover { opacity: 1; text-decoration: underline; }

.ai-foot { display: flex; gap: 6px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.ai-foot input[type="text"] {
  flex: 1; min-width: 0; padding: 8px 11px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
}
.ai-foot input[type="text"]:focus { outline: none; border-color: var(--brand); }
.ai-foot button {
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 700; border: 0; background: var(--brand); color: #fff;
}
/* 相机 / 别针按钮：无底色、放大 30% */
.ai-foot button.ai-tool-btn {
  padding: 12px 14px; border-radius: 10px; cursor: pointer;
  font-size: 23px; line-height: 1;
  background: transparent; border: 0; color: var(--text);
}
.ai-foot button.ai-tool-btn:hover { background: var(--surface-2); }
.ai-preview { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-top: 1px dashed var(--border); }
.ai-preview img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.ai-preview-x { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; font-size: 14px; }
.ai-preview-name { font-size: 12px; color: var(--text-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-preview.hide { display: none; }
@media (max-width: 900px) {
  .ai-panel { display: none; position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: 88%; max-width: 360px; box-shadow: var(--shadow-2); }
  .ai-panel.on { display: flex; }
}
.ai-toggle {
  font-size: 12px; font-weight: 800; letter-spacing: .5px;
  background: var(--brand); color: #fff; border-radius: 8px; width: auto; padding: 0 8px;
}
.ai-toggle:hover { background: var(--brand-ink); color: #fff; }
@media (max-width: 640px) { .ai-toggle { display: none; } }

/* v14.8.2 · 频道名 16px / 时间 12px 黑字 / 头像 40px；国内·国际资讯消息源列表整体放大 20% */
.ch-name { font-size: 16px; }
.ch-time2 { font-size: 12px; color: #000; font-weight: 600; }
.ch-av { width: 40px; height: 40px; font-size: 24px; }   /* 首字图标再放大 20%（20px→24px） */
.ch-badge { min-width: 24px; height: 24px; font-size: 13px; }
/* 「我的频道」与免费 / 推荐频道同字号（沿用全局 16px / 12px） */
/* 国内 / 国际资讯消息源：文字 / 图片（头像）/ 时间整体放大 20% */
.chlist-zoom .ch-av { width: 48px; height: 48px; font-size: 29px; }   /* 首字图标再放大 20%（24px→29px） */
.chlist-zoom .ch-name { font-size: 19.2px; }
.chlist-zoom .ch-time2 { font-size: 14.4px; color: #000; font-weight: 600; }
.chlist-zoom .ch-badge { min-width: 29px; height: 29px; font-size: 15px; }

/* v14.7 · 国内 / 国际资讯频道：消息源图片与文字放大 20% */
.ch-zoom .msg-bubble { font-size: 1.2em; line-height: 1.55; }
.ch-zoom .msg-img { max-width: 360px; }
.ch-zoom .msg-head { font-size: 1.05em; }
