/*
 * 丝绸之路机器人系统 SilkRoad Bot Admin - 界面样式
 * Copyright © 2026 逆行者联盟 · 官网 www.nxzlm.com · Telegram 频道 https://t.me/NxzGF
 */
/* 丝绸之路机器人系统 — 浅色企业风格 */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #e7e9ed;
  --line-2: #d9dce1;
  --text: #24292f;
  --muted: #69707a;
  --faint: #9aa1ab;
  --accent: #b45309;
  --accent-h: #92400e;
  --accent-bg: #fdf6ee;
  --green: #15803d;
  --green-bg: #ecfdf5;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --orange: #c2620a;
  --orange-bg: #fff7ed;
  --blue: #2563eb;
  --side: #1f2430;
  --side-text: #a7adba;
  --side-line: rgba(255, 255, 255, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
code { background: #f0f1f3; padding: 1px 5px; border-radius: 4px; font-size: 12px; color: #c2410c; }
a { color: var(--blue); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px; font-size: 13px; font-family: inherit;
  border-radius: 6px; border: 1px solid transparent; cursor: pointer;
  transition: all .12s; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }
.btn-ghost { background: #fff; color: #374151; border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: #f9fafb; border-color: #c8ccd3; }
.btn-danger-ghost { background: #fff; color: var(--red); border-color: #f0c7c7; }
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-bg); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.btn-block { width: 100%; }
.mini-btn {
  background: #f3f4f6; border: 1px solid var(--line); color: var(--muted);
  font-size: 11px; padding: 2px 8px; border-radius: 4px; cursor: pointer; font-family: inherit;
}
.mini-btn:hover { color: var(--text); background: #eceded; }
.link-btn { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 4px 6px; text-align: left; font-family: inherit; }
.link-btn:hover { color: var(--text); }
.icon-btn { background: none; border: none; color: var(--faint); font-size: 15px; cursor: pointer; padding: 4px 6px; }
.icon-btn:hover { color: var(--text); }

/* ---------- 登录（全屏插画背景 + 玻璃拟态卡片） ---------- */
.login-wrap {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-bg {
  position: absolute; inset: 0;
  background: url('/img/qiuya1.jpg') center 38% / cover no-repeat;
}
.login-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 78% 50%, rgba(9,14,30,.18), rgba(9,14,30,.55) 70%),
    linear-gradient(112deg, rgba(8,13,28,.86) 0%, rgba(8,13,28,.55) 46%, rgba(8,13,28,.28) 100%);
}
.login-card {
  position: relative; width: 384px; max-width: 100%;
  background: rgba(13, 19, 38, .58);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px; padding: 34px 30px 22px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 24px 60px rgba(4, 8, 20, .45), inset 0 1px 0 rgba(255,255,255,.10);
  animation: cardIn .5s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.985); } }
.login-head { display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 24px; }
.login-mark {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 11px;
  object-fit: cover; display: block;
  box-shadow: 0 4px 14px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.18);
}
.login-card h1 { font-size: 16.5px; font-weight: 600; color: #fff; letter-spacing: .5px; }
.login-card .sub { color: rgba(255,255,255,.62); margin: 4px 0 0; font-size: 11.5px; }
.login-card input {
  margin-bottom: 12px; text-align: left;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  color: #fff; border-radius: 9px; height: 42px; padding: 0 13px;
  transition: border-color .15s, background .15s;
}
.login-card input::placeholder { color: rgba(255,255,255,.4); }
.login-card input:focus {
  outline: none; border-color: rgba(124,169,247,.75);
  background: rgba(255,255,255,.10);
  box-shadow: 0 0 0 3px rgba(96,148,240,.18);
}
.login-card .captcha-row { margin-bottom: 12px; }
.login-card .captcha-row input { flex: 1; margin-bottom: 0; letter-spacing: 4px; }
.login-card .captcha-img {
  width: 118px; height: 42px; flex-shrink: 0; cursor: pointer;
  border-radius: 9px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.2);
}
.login-card .captcha-img svg { display: block; }
.login-card .btn-primary {
  width: 100%; height: 44px; margin-top: 4px; border-radius: 9px; font-size: 14px;
  background: linear-gradient(135deg, #6ea8f7, #4d84e8);
  box-shadow: 0 6px 18px rgba(77,132,232,.38);
  letter-spacing: 6px; text-indent: 6px;
}
.login-card .btn-primary:hover { background: linear-gradient(135deg, #83b6f9, #5c92ee); box-shadow: 0 8px 22px rgba(77,132,232,.5); }
.login-error { color: #ff9a9d; font-size: 12px; margin-top: 12px; min-height: 16px; text-align: center; }
.login-foot { margin-top: 14px; text-align: center; font-size: 10.5px; color: rgba(255,255,255,.38); letter-spacing: .3px; }
.login-foot a { color: rgba(255,255,255,.62); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.22); padding-bottom: 1px; transition: color .15s, border-color .15s; }
.login-foot a:hover { color: #fff; border-color: rgba(255,255,255,.6); }

/* ---------- 侧栏版权 ---------- */
.sidebar-foot { margin-top: auto; padding: 12px 12px 0; border-top: 1px solid var(--side-line); }
.sf-brand { font-size: 11px; color: rgba(255,255,255,.55); font-weight: 600; margin-bottom: 6px; letter-spacing: .3px; }
.sf-line { display: block; font-size: 10.5px; color: rgba(255,255,255,.32); text-decoration: none; line-height: 1.8; }
a.sf-line:hover { color: rgba(255,255,255,.75); }

/* ---------- 关于系统 ---------- */
.about-card { margin-top: 14px; }
.about-rows { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.about-row { display: flex; font-size: 12.5px; }
.about-k { width: 110px; flex-shrink: 0; color: var(--faint); }
.about-row span:last-child { color: var(--text); }

/* ---------- 欢迎横幅 ---------- */
.welcome-banner {
  position: relative; height: 128px; margin-bottom: 14px; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--line);
  background:
    linear-gradient(88deg, #1b2440 0%, #243254 46%, rgba(36,50,84,.42) 72%, rgba(36,50,84,.06) 100%),
    url('/img/qiuya2.jpg') 82% 22% / auto 190% no-repeat;
  display: flex; align-items: center;
}
.wb-text { padding: 0 26px; color: #fff; }
.wb-text h2 { font-size: 19px; font-weight: 600; letter-spacing: .3px; }
.wb-text p { margin-top: 7px; font-size: 12.5px; color: rgba(255,255,255,.66); }
.wb-text p b { color: #ffd58a; font-weight: 600; }

/* ---------- 空状态 ---------- */
.empty-state {
  padding: 34px 20px 38px; text-align: center; color: var(--faint); font-size: 12.5px;
}

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--side); padding: 14px 12px 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 16px; border-bottom: 1px solid var(--side-line); margin-bottom: 10px; }
.brand-mark {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 6px;
  object-fit: cover; display: block;
  box-shadow: 0 0 0 1px var(--side-line);
}
.brand-text { color: #e6e8ec; font-size: 13px; font-weight: 500; letter-spacing: .3px; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px;
  border-radius: 6px; color: var(--side-text); cursor: pointer; font-size: 13.5px;
  text-decoration: none; user-select: none; transition: background .12s, color .12s;
}
#nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
#nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
#nav a.active { color: #fff; background: var(--accent); }
/* ---------- 顶栏 ---------- */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 54px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 26px;
  position: sticky; top: 0; z-index: 40;
}
.topbar h1 { font-size: 15px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.bot-status {
  display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted);
  padding: 6px 12px; background: #f6f7f8; border: 1px solid var(--line); border-radius: 6px; word-break: break-all;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-on { background: #22c55e; }
.dot-off { background: #6b7280; }

.main { flex: 1; padding: 22px 28px 60px; width: 100%; }
.view-head { margin-bottom: 16px; }
.view-head h2 { font-size: 15px; font-weight: 600; }
.view-head p { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- 卡片与表单 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 14px; }
.card-title { font-size: 13px; font-weight: 600; margin-bottom: 14px; color: var(--text); }
.field { margin-bottom: 16px; }
.field > label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.hint-inline { font-weight: 400; font-size: 11px; color: var(--faint); }
input, textarea, select {
  width: 100%; background: #fff; border: 1px solid var(--line-2);
  color: var(--text); border-radius: 6px; padding: 7px 10px; font-size: 13px;
  outline: none; transition: border .12s, box-shadow .12s; font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(180,83,9,.12); }
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
select { width: auto; cursor: pointer; }
.inline-input { display: flex; gap: 8px; }
.inline-input input { flex: 1; }
.hint { color: var(--faint); font-size: 12px; margin-top: 8px; line-height: 1.7; }
.sep { border: none; border-top: 1px solid var(--line); margin: 22px 0 18px; }

/* ---------- 分段选择 ---------- */
.seg { display: inline-flex; background: #eef0f3; padding: 3px; border-radius: 7px; gap: 2px; }
.seg button {
  background: transparent; border: none; color: var(--muted); font-family: inherit;
  padding: 5px 14px; border-radius: 5px; cursor: pointer; font-size: 13px; transition: all .12s;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: #fff; color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- 上传 ---------- */
.upload-zone {
  border: 1px dashed var(--line-2); border-radius: 8px; padding: 22px;
  text-align: center; cursor: pointer; transition: all .12s; background: #fcfcfd;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-bg); }
.upload-hint { color: var(--muted); font-size: 12px; }
.upload-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.upload-previews:empty { display: none; }
.up-item { position: relative; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #f6f7f8; }
.up-item img { width: 100%; height: 100%; object-fit: cover; }
.up-item .file-box { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px; text-align: center; }
.up-item .file-box b { font-size: 15px; font-weight: 400; color: var(--faint); }
.up-item .file-box small { font-size: 10px; color: var(--muted); word-break: break-all; line-height: 1.3; max-height: 26px; overflow: hidden; }
.up-item .rm {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 4px;
  background: rgba(0,0,0,.55); color: #fff; border: none; cursor: pointer; font-size: 10px; line-height: 1;
}

/* ---------- 按钮编辑行 ---------- */
.btn-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.btn-row { display: grid; grid-template-columns: 140px 1fr 28px; gap: 8px; }
.btn-row .del { background: #fff; border: 1px solid var(--line-2); color: var(--red); border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-row .del:hover { background: var(--red-bg); border-color: #f0c7c7; }

/* ---------- 目标选择 ---------- */
.target-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.target-checks label {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 6px;
  cursor: pointer; font-size: 12.5px; transition: all .12s;
}
.target-checks label:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.target-checks input { width: auto; accent-color: var(--accent); margin: 0; }
.target-checks small { color: var(--faint); font-size: 11px; }
.tgt-bar { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; }
.disc-row .tag-dim { flex-shrink: 0; }
.check-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); cursor: pointer; user-select: none; }
.check-line input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.tgt-count { font-size: 11.5px; color: var(--faint); }
.form-actions { margin-top: 18px; }
.pub-result { margin-top: 14px; padding: 10px 12px; border-radius: 6px; font-size: 12.5px; line-height: 1.7; }
.pub-result.ok { background: var(--green-bg); border: 1px solid #bbe7cc; color: var(--green); }
.pub-result.err { background: var(--red-bg); border: 1px solid #f3c1c1; color: var(--red); }

/* ---------- 工具栏 / 消息列表 ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type="search"] { width: 200px; height: 28px; font-size: 12px; }
.toolbar select { height: 28px; font-size: 12px; padding: 0 8px; }
.toolbar-spacer { flex: 1; }
.check-all-wrap { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; cursor: pointer; }
.check-all-wrap input { width: auto; accent-color: var(--accent); margin: 0; }
.msg-list { padding: 0; overflow: hidden; }
.msg-row {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: start; gap: 4px;
  padding: 12px 16px; border-bottom: 1px solid #f0f1f3; transition: background .1s;
}
.msg-row:last-child { border-bottom: none; }
.msg-row:hover { background: #fafbfc; }
.msg-row input[type="checkbox"] { width: auto; accent-color: var(--accent); margin: 2px 0 0; }
.msg-main { min-width: 0; }
.msg-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 5px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #f3f4f6; color: #4b5563; }
.tag-dim { background: transparent; border: 1px solid var(--line); color: var(--faint); }
.st { font-size: 11px; padding: 1px 7px; border-radius: 4px; display: inline-flex; align-items: center; gap: 5px; }
.st::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.st-ok { color: var(--green); background: var(--green-bg); }
.st-partial { color: var(--orange); background: var(--orange-bg); }
.st-failed { color: var(--red); background: var(--red-bg); }
.st-dim { color: var(--muted); background: #f3f4f6; }
.msg-text {
  color: var(--text); font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.msg-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-thumbs img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.msg-file {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px;
}
.msg-file span { color: var(--faint); font-size: 11px; }
.msg-url { display: inline-block; margin-top: 6px; color: var(--blue); font-size: 12px; word-break: break-all; }
.msg-kb { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-kb .kb-btn {
  font-size: 12px; padding: 4px 10px; border-radius: 5px; background: #f9fafb;
  border: 1px solid var(--line-2); color: #4b5563; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-meta { margin-top: 7px; color: var(--faint); font-size: 11px; display: flex; gap: 12px; flex-wrap: wrap; }
.msg-actions { display: flex; gap: 6px; padding-top: 1px; }
.empty-state { text-align: center; padding: 44px 20px; color: var(--faint); font-size: 13px; }

/* ---------- 目标列表 ---------- */
.target-list .target-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px;
}
.target-item .t-info { flex: 1; min-width: 0; }
.target-item .t-info b { display: block; font-size: 13px; font-weight: 500; }
.target-item .t-info small { color: var(--faint); font-size: 11.5px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,18,25,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  width: 520px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 10px; padding: 20px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: pop .15s ease;
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 14px; font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.edit-preview { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.edit-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- 表情面板 ---------- */
.emoji-panel {
  position: fixed; z-index: 120; width: 300px; max-height: 360px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,.14); padding: 8px 10px;
  animation: pop .12s ease;
}
.emoji-cat { color: var(--faint); font-size: 10px; margin: 8px 2px 4px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button { background: none; border: none; font-size: 18px; cursor: pointer; padding: 3px; border-radius: 5px; }
.emoji-grid button:hover { background: #f3f4f6; }

/* ---------- 机器人管理 ---------- */
.bots-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.bot-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc;
}
.bot-row .bot-info { flex: 1; min-width: 0; }
.bot-row .bot-info b { font-size: 13px; display: block; }
.bot-row .bot-info small { color: var(--muted); font-size: 11.5px; }
.bot-add-grid { display: grid; grid-template-columns: 200px 1fr auto; gap: 12px; align-items: end; }
.bot-add-grid .bot-add-btn { padding-bottom: 2px; }
.bot-edit-grid { display: grid; grid-template-columns: 200px 1fr auto; gap: 10px; align-items: end; width: 100%; }
.be-btns { display: flex; gap: 6px; padding-bottom: 2px; }
.warn-text { color: #b45309; }
.pub-bot-group { margin-bottom: 10px; }
.pub-bot-group:last-child { margin-bottom: 0; }
.pub-bot-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  padding: 6px 2px; border-bottom: 1px dashed var(--line); margin-bottom: 6px;
}
.pub-bot-title small { font-weight: 400; color: var(--muted); }

/* ---------- Toast（layui 风格：顶部居中白底 + 彩色圆图标） ---------- */
.toast-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding-top: 20px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 13px 24px;
  background: #fff; border-radius: 6px;
  box-shadow: 0 5px 20px rgba(0,0,0,.16);
  font-size: 13px; line-height: 1.6; color: var(--text);
  max-width: min(640px, calc(100vw - 32px));
  animation: tIn .22s ease both;
}
.toast.t-out { opacity: 0; transform: translateY(-12px); transition: all .2s ease; }
@keyframes tIn { from { transform: translateY(-16px); opacity: 0; } }
.t-icon {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.t-icon svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 2.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.toast.success .t-icon { background: #16a34a; }
.toast.error .t-icon { background: #dc2626; }
.toast.warning .t-icon { background: #e8930c; }
.toast.info .t-icon { background: #3b82f6; }
.t-body { flex: 1; min-width: 0; word-break: break-word; }

/* ---------- 数据概览 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px 14px; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-num { font-size: 26px; font-weight: 600; letter-spacing: .5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11px; color: var(--faint); margin-top: 5px; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-bottom: 14px; }
.dash-card, .dash-recent { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head .card-title { margin-bottom: 0; }
.more-link { font-size: 12px; color: var(--muted); text-decoration: none; }
.more-link:hover { color: var(--accent); }
.trend-chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 6px; }
.trend-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.trend-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-bar { width: 60%; max-width: 34px; min-height: 3px; background: var(--accent); opacity: .85; border-radius: 3px 3px 0 0; transition: opacity .12s; }
.trend-col:hover .trend-bar { opacity: 1; }
.trend-date { font-size: 11px; color: var(--faint); }
.type-dist { padding-top: 4px; }
.dist-row { display: grid; grid-template-columns: 52px 1fr 28px; align-items: center; gap: 10px; margin-bottom: 14px; }
.dist-row:last-child { margin-bottom: 0; }
.dist-label { font-size: 12px; color: var(--muted); }
.dist-track { height: 8px; background: #f0f1f3; border-radius: 4px; overflow: hidden; }
.dist-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.dist-num { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.recent-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #f0f1f3; }
.recent-row:last-child { border-bottom: none; }
.recent-text { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-time { font-size: 11px; color: var(--faint); flex-shrink: 0; }

/* ---------- 定时发布 / 常用语 / 日志 ---------- */
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.schedule-box { margin-bottom: 12px; padding: 12px; background: var(--accent-bg); border: 1px solid #eed9bd; border-radius: 6px; }
.schedule-box label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.schedule-box input { max-width: 240px; }
.st-warn { color: #b45309; background: var(--accent-bg); }
.tag-warn { color: #b45309; background: var(--accent-bg); }
.snippet-panel {
  position: fixed; z-index: 120; width: 300px; max-height: 300px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,.14); padding: 6px; animation: pop .12s ease;
}
.snippet-item { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.snippet-item:hover { background: #f6f7f8; }
.snippet-text { flex: 1; font-size: 12.5px; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.snippet-empty { padding: 14px 8px; color: var(--faint); font-size: 12px; text-align: center; line-height: 1.6; }
.logs-list { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 8px 2px; border-bottom: 1px solid #f0f1f3; font-size: 12.5px; }
.log-row:last-child { border-bottom: none; }
.log-action { color: var(--accent); font-weight: 500; white-space: nowrap; }
.log-detail { color: var(--muted); word-break: break-all; }
.log-time { color: var(--faint); font-size: 11px; white-space: nowrap; }
.logs-empty { padding: 16px 0; color: var(--faint); font-size: 12.5px; text-align: center; }

/* ---------- 登录验证码 ---------- */
.captcha-row { display: flex; gap: 8px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img {
  flex-shrink: 0; width: 118px; height: 42px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 6px; background: #f4f5f6; font-size: 11px; color: var(--faint);
}
.captcha-img svg { display: block; }

/* ---------- 自动发现 ---------- */
.disc-list { display: flex; flex-direction: column; }
.disc-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 6px;
  border-bottom: 1px solid #f0f1f3; cursor: pointer; font-size: 13px;
}
/* 全局 input{width:100%} 会把复选框拉成整行长条并挤掉标题，必须豁免 */
.disc-row input[type="checkbox"] {
  width: 15px; height: 15px; flex-shrink: 0; margin: 2px 0 0;
  accent-color: var(--accent); cursor: pointer;
}
.disc-row:last-child { border-bottom: none; }
.disc-row:hover { background: #fafafa; }
.disc-dead { opacity: .55; }
.disc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.icon-btn { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 4px; flex-shrink: 0; }
.icon-btn:hover { color: var(--danger); background: #fdf0ee; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 0 4px; }
.pager-info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager .btn:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 860px) {
  .pager { gap: 10px; padding: 12px 0 2px; }
  .pager .btn { min-width: 88px; }
}

/* ---------- 响应式（移动端） ---------- */
@media (max-width: 860px) {
  body { font-size: 14px; }
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 45; flex-direction: column; padding: 0 0 6px; }
  .brand { border-bottom: none; padding: 12px 14px 8px; margin-bottom: 0; gap: 8px; }
  .brand-mark { width: 24px; height: 24px; font-size: 12px; }
  #nav { flex-direction: row; overflow-x: auto; padding: 0 8px 4px; gap: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  #nav::-webkit-scrollbar { display: none; }
  #nav a { height: 36px; padding: 0 13px; white-space: nowrap; flex-shrink: 0; font-size: 13px; }
  .topbar { height: 48px; padding: 0 12px; gap: 8px; }
  .bot-status { padding: 4px 8px; font-size: 11px; max-width: 46vw; }
  .bot-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 14px 12px 70px; }
  .view-head { margin-bottom: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .welcome-banner { height: 92px; border-radius: 10px; background: linear-gradient(88deg, #1b2440 0%, rgba(36,50,84,.55) 60%, rgba(36,50,84,.15) 100%), url('/img/qiuya2.jpg') 78% 20% / cover no-repeat; }
  .wb-text { padding: 0 18px; }
  .wb-text h2 { font-size: 16px; }
  .wb-text p { font-size: 11.5px; margin-top: 4px; }
  .kpi { padding: 12px 14px; }
  .kpi-num { font-size: 21px; }
  .dash-grid { grid-template-columns: 1fr; }
  .trend-chart { height: 130px; }
  .card { padding: 14px; }
  /* 触控友好 */
  input, textarea, select { font-size: 16px; } /* 防 iOS 聚焦缩放 */
  .btn { height: 40px; padding: 0 16px; }
  .btn-sm { height: 34px; padding: 0 12px; }
  .mini-btn { padding: 5px 10px; font-size: 12px; }
  .seg { display: flex; width: 100%; overflow-x: auto; }
  .seg button { flex: 1; padding: 8px 10px; white-space: nowrap; }
  .field > label { flex-wrap: wrap; }
  .action-row { flex-wrap: wrap; }
  .action-row .btn { flex: 1 1 44%; }
  .schedule-box input { max-width: none; width: 100%; }
  .upload-zone { padding: 18px 12px; }
  /* 工具栏与消息列表 */
  .toolbar { gap: 6px; }
  .toolbar input[type="search"] { flex: 1; min-width: 0; width: auto; height: 34px; }
  .toolbar select { height: 34px; font-size: 13px; }
  .msg-row { grid-template-columns: 26px 1fr; padding: 12px; }
  .msg-actions { grid-column: 1 / -1; padding-top: 8px; }
  .msg-actions .btn { flex: 1; }
  .msg-meta { flex-direction: column; gap: 2px; }
  .recent-time { display: none; }
  /* 弹窗与浮层 */
  .modal { width: 94vw; padding: 16px; max-height: 90vh; }
  .modal-foot .btn { flex: 1; }
  .btn-row { grid-template-columns: 1fr; }
  .emoji-panel, .snippet-panel { left: 12px !important; right: 12px; width: auto; max-width: none; }
  .toast-wrap { padding-top: 12px; }
  .bot-add-grid, .bot-edit-grid { grid-template-columns: 1fr; align-items: stretch; }
  .bot-row { flex-wrap: wrap; }
  .bot-row .bot-info { flex: 1 1 100%; }
  .target-checks label { width: 100%; }
  .log-row { grid-template-columns: auto 1fr; }
  .log-time { grid-column: 2; }
}
@media (max-width: 380px) {
  .action-row .btn { flex: 1 1 100%; }
}
