:root {
  --topbar-h: 52px;
  /* 基底：略抬亮度、减少脏灰，便于长时间阅读 */
  --bg: #05070c;
  --bg-elevated: #0a0f16;
  --panel: #0f141d;
  --panel-hover: #151c28;
  --text: #eef2f9;
  --muted: #8a94a8;
  /* 主色：偏主流 IM 的蓝紫饱和，与阴影层级统一 */
  --accent: #7c9cff;
  --accent-dim: #5578e8;
  --accent-glow: rgba(108, 154, 255, 0.26);
  --accent-soft: rgba(108, 154, 255, 0.14);
  --border: rgba(255, 255, 255, 0.065);
  --border-strong: rgba(255, 255, 255, 0.095);
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 10px;
  --radius-lg: 16px;
  /* 阴影层级：卡片浅抬升 / 浮层深分离 */
  --shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  --shadow-card: var(--shadow-inset-top), 0 2px 6px rgba(0, 0, 0, 0.16), 0 20px 48px rgba(0, 0, 0, 0.32);
  --shadow-elevated: var(--shadow-inset-top), 0 10px 28px rgba(0, 0, 0, 0.26), 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-float: 0 28px 64px rgba(0, 0, 0, 0.48), 0 2px 0 rgba(255, 255, 255, 0.035) inset;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
* { box-sizing: border-box; }
::selection {
  background: rgba(108, 154, 255, 0.28);
  color: var(--text);
}
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 70% at 50% -28%, rgba(124, 156, 255, 0.065), transparent 58%),
    radial-gradient(ellipse 55% 45% at 100% 0%, rgba(124, 108, 255, 0.04), transparent 48%);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.52rem 0.95rem 0.52rem max(0.7rem, env(safe-area-inset-left));
  padding-right: max(0.7rem, env(safe-area-inset-right));
  border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(18, 24, 34, 0.92) 0%, rgba(12, 16, 24, 0.88) 100%);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  position: sticky;
  top: 0;
  z-index: 70;
}
.top-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.auth-bar {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.8125rem;
}
.tenant-scope-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: auto;
}
.tenant-scope-bar .muted { font-size: 0.75rem; opacity: 0.9; }
.tenant-scope-select {
  min-width: 120px;
  max-width: min(220px, 46vw);
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(8, 11, 18, 0.55);
  color: var(--text);
  font-size: 0.8rem;
}
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 1.5rem);
}
main.with-shell {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: calc(100vh - var(--topbar-h));
}
.app-shell {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}
.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--panel) 0%, rgba(12, 16, 24, 0.98) 100%);
  border-right: 1px solid var(--border-strong);
  padding: 0.5rem 0 0.85rem;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}
.side-brand {
  padding: 0.62rem 0.75rem 0.72rem;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.4rem;
  line-height: 1.35;
}
.side-nav { padding: 0 0.32rem; }
.side-link {
  display: block;
  padding: 0.44rem 0.68rem;
  margin: 0.06rem 0;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.side-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.side-link.active {
  background: var(--accent-glow);
  color: #d8e4ff;
  border: 1px solid rgba(108, 154, 255, 0.32);
  box-shadow: inset 3px 0 0 0 var(--accent), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.side-group {
  margin: 0.28rem 0;
  border-radius: var(--radius);
}
.side-group summary {
  cursor: pointer;
  padding: 0.38rem 0.62rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.88;
  list-style: none;
}
.side-group summary::-webkit-details-marker { display: none; }
.side-sublink {
  display: block;
  padding: 0.34rem 0.62rem 0.34rem 1.02rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.16s ease, color 0.16s ease;
}
.side-sublink:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}
.side-sublink.active {
  color: #c5d8ff;
  background: rgba(108, 154, 255, 0.12);
}
.side-block { margin: 0.12rem 0 0.38rem; }
.side-block > .side-link { margin-bottom: 0.04rem; }
a.side-sublink.side-nested {
  padding-left: 1.45rem;
  font-size: 0.76rem;
}
.um-detail-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  line-height: 1.55;
  font-size: 0.88rem;
}
.um-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  .um-grid { grid-template-columns: 1fr; }
}
.um-tbl-wrap { overflow-x: auto; }
.um-user-row { cursor: pointer; }
.um-user-row:hover { background: rgba(255, 255, 255, 0.03); }
.um-user-sel {
  outline: 1px solid rgba(108, 154, 255, 0.42);
  background: rgba(108, 154, 255, 0.1);
}
.um-tag-custom { font-size: 0.75rem; color: #fbbf24; font-weight: 600; }
.um-grp-title { margin: 0.75rem 0 0.35rem; font-size: 0.88rem; color: var(--muted); }
.um-grp { display: flex; flex-direction: column; gap: 0.45rem; }
.um-chk {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.84rem;
  line-height: 1.4;
  cursor: pointer;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
}
.um-chk:hover { background: rgba(255, 255, 255, 0.04); }
.um-chk input { margin-top: 0.15rem; flex-shrink: 0; }
.um-chk-desc { font-size: 0.78rem; display: inline-block; margin-top: 0.12rem; }
.um-cap-hint { font-size: 0.8rem; margin: 0.75rem 0 0.5rem; }
.um-ref-list { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.um-ref-list li { margin: 0.35rem 0; line-height: 1.55; }
.cap-page-lead {
  margin: 0.35rem 0 0;
  max-width: 52rem;
  font-size: clamp(0.82rem, 2.2vw, 0.9rem);
  line-height: 1.55;
}
.cap-role-card .cap-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.cap-owner-foot {
  margin: 0.85rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  line-height: 1.5;
}
.um-ref-details.card { padding: 0; }
.um-ref-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.95rem 1.1rem;
  list-style: none;
  user-select: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.18);
  transition: background 0.15s ease;
}
.um-ref-summary::-webkit-details-marker { display: none; }
.um-ref-summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  flex-shrink: 0;
  opacity: 0.75;
  margin-top: -0.1rem;
}
.um-ref-details[open] .um-ref-summary::after {
  transform: rotate(45deg);
  margin-top: 0.12rem;
}
.um-ref-summary:hover { background: rgba(255, 255, 255, 0.04); }
.um-ref-details[open] .um-ref-summary { border-bottom: 1px solid var(--border); }
.um-ref-details-body {
  padding: 0.85rem 1rem 1.1rem;
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.shell-main {
  flex: 1;
  width: 100%;
  max-width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(0.7rem, 2vw, 1.25rem) clamp(0.8rem, 2.6vw, 1.65rem);
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.page-title-inline {
  margin: 0;
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
  border: none;
  padding: 0.52rem 1.15rem;
  min-height: 42px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 20px rgba(108, 154, 255, 0.22);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-add:hover {
  filter: brightness(1.06);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.14) inset, 0 8px 26px rgba(108, 154, 255, 0.28);
}
.btn-add:active { transform: translateY(1px); }
.table-card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
/* 与 .card 同用时由本规则统一抬升，避免双边框叠影 */
.card.table-card {
  padding: 0;
  box-shadow: var(--shadow-elevated);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0%, var(--panel) 22%);
}
/* 机器人列表：允许操作区浮层逻辑上「穿出」卡片（实际菜单挂 body）；避免裁剪感 */
.table-card.bots-list-card {
  overflow: visible;
}
.tp-table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table { font-size: 0.8125rem; }
.data-table th {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(0, 0, 0, 0.12) 100%);
  padding: 0.7rem 0.8rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 245, 0.82);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 0.7rem 0.8rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.cell-desc { max-width: 280px; color: var(--muted); font-size: 0.82rem; }
.cell-actions {
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.cell-actions-bots {
  justify-content: flex-end;
  align-items: center;
  gap: 0.3rem 0.45rem;
}
@media (max-width: 720px) {
  .cell-actions-bots {
    justify-content: flex-start;
  }
}
.linklike {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
  background: none;
  border: none;
  margin: 0;
  color: var(--accent);
  cursor: pointer;
  padding: 0.35rem 0.45rem;
  min-height: 40px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.linklike:focus-visible {
  outline: 2px solid rgba(108, 154, 255, 0.55);
  outline-offset: 2px;
}
.linklike:hover { background: rgba(108, 154, 255, 0.1); color: #dbe8ff; }
.linklike.danger { color: var(--danger); }
.linklike.danger:hover { background: rgba(248, 113, 113, 0.1); color: #fecaca; }
.page-title h1 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.page-title h1.page-title-inline { font-size: clamp(1.1rem, 2.8vw, 1.35rem); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.card-grid .btn { display: inline-block; margin-top: 0.5rem; text-decoration: none; text-align: center; }
.kv th { width: 160px; color: var(--muted); font-weight: 500; }
.modal {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0;
  min-width: min(400px, 92vw);
  max-width: 96vw;
  background: linear-gradient(165deg, #151c28 0%, #0e131c 100%);
  color: var(--text);
  box-shadow: var(--shadow-float), 0 0 0 1px rgba(255, 255, 255, 0.045) inset;
}
.cmd-global-dlg {
  min-width: min(720px, 96vw);
  max-width: 96vw;
}
.cmd-global-dlg .gcmd-tid { min-width: 140px; width: 100%; }
.cmd-global-dlg .gcmd-c,
.cmd-global-dlg .gcmd-d { min-width: 0; width: 100%; }
.modal::backdrop {
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h2,
.modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.modal-x {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-x:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.modal-body {
  padding: 1rem 1.2rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.modal-body label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.modal-body label.req { margin-top: 0.15rem; }
.modal-body input,
.modal-body textarea {
  background: rgba(6, 9, 14, 0.65);
  border: 1px solid var(--border);
  color: var(--text);
  min-width: 100%;
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.modal-body input::placeholder,
.modal-body textarea::placeholder {
  color: rgba(139, 151, 171, 0.55);
}
.modal-body input:focus,
.modal-body textarea:focus {
  outline: none;
  border-color: rgba(108, 154, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(108, 154, 255, 0.12);
}
.modal-body textarea { min-height: 80px; resize: vertical; }
.modal-body p { margin: 0; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.hint-red {
  display: inline;
  font-size: 0.7rem;
  color: #fca5a5;
  font-weight: 500;
  margin-left: 0.2rem;
}
.modal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.9rem 1.2rem 1rem;
  border-top: 1px solid var(--border);
}
#globalCmdAddRow { margin-right: auto; }
.breadcrumb {
  font-size: 0.8rem;
  margin: 0.2rem 0 0.7rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.breadcrumb a:hover {
  color: #dbe8ff;
  text-decoration: none;
  opacity: 0.95;
}
.bc-sep { margin: 0 0.35rem; color: var(--muted); opacity: 0.85; }
.bc-here { color: var(--text); font-weight: 500; }
.chat-load-older {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}
.chat-load-older[hidden] { display: none !important; }
.modal-foot .secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  min-height: 42px;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
}
.modal-foot .btn-primary {
  min-height: 42px;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
  border: none;
  padding: 0.48rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 20px rgba(108, 154, 255, 0.22);
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.14) inset, 0 8px 26px rgba(108, 154, 255, 0.28);
}
.btn-primary:active { transform: translateY(1px); }
/* —— 全局提示（替代 alert） —— */
.tp-app-notice {
  z-index: 240;
  max-width: min(460px, 94vw);
}
.tp-app-notice-body .notice-p {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
}
.tp-app-notice-body .notice-sub {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}
.tp-app-notice-body code {
  font-size: 0.82em;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}
.tp-toast-stack {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 230;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.45rem;
  pointer-events: none;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.tp-toast-stack .tp-toast {
  width: 100%;
}
.tp-toast {
  pointer-events: auto;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: var(--shadow-float);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.tp-toast-show {
  opacity: 1;
  transform: translateY(0);
}
.tp-toast-ok {
  background: rgba(14, 28, 22, 0.96);
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.28);
}
.tp-toast-warn {
  background: rgba(40, 32, 14, 0.96);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}
/* —— 机器人详情：返回 —— */
.nav-back-row { margin: 0 0 0.35rem; }
.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.95rem 0.42rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.nav-back-btn:hover {
  background: rgba(108, 154, 255, 0.12);
  border-color: rgba(108, 154, 255, 0.38);
  color: #e8f0ff;
  box-shadow: 0 2px 14px rgba(108, 154, 255, 0.12);
}
.nav-back-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: rgba(108, 154, 255, 0.16);
  color: var(--accent);
  flex-shrink: 0;
}
.nav-back-chevron::before {
  content: "‹";
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 2px;
}
.nav-back-label { line-height: 1.2; }
.bot-list-lead {
  margin: -0.15rem 0 0.7rem;
  font-size: clamp(0.82rem, 2.2vw, 0.88rem);
  line-height: 1.5;
  max-width: 52rem;
}

/* 机器人概览：Telegram 展示信息（说明 / 简介 / 头像 / 说明图）统一宽度与对齐 */
.tg-prof-section {
  width: 100%;
  max-width: min(720px, 100%);
  margin: 0 auto;
  box-sizing: border-box;
}
.tg-prof-heading {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.tg-prof-lead {
  margin: 0 0 0.9rem;
  font-size: 0.84rem;
  line-height: 1.55;
}
.tg-prof-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 0.85rem;
  box-sizing: border-box;
}
.tg-form-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.12) 100%);
  box-shadow: var(--shadow-inset-top);
}
.tg-form-block textarea,
.tg-form-block input[type="text"] {
  width: 100%;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
}
.tg-prof-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  padding-top: 0.1rem;
}
.tg-prof-msg {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.84rem;
}
.tg-field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(226, 232, 245, 0.88);
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.tg-file-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}
.tg-file-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.tg-file-btn {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0.4rem 0.95rem !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
}
.tg-file-name {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tg-inline-chk {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding-top: 0.15rem;
}
.tg-inline-chk input {
  width: auto;
  min-width: 0;
  margin: 0;
}
.tg-file-preview {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  padding: 0.75rem 0.85rem;
  min-height: 3.25rem;
}
.tg-preview-caption {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(138, 148, 168, 0.95);
}
.tg-preview-empty {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}
.tg-preview-only {
  text-align: center;
  padding: 0.85rem 0.5rem;
}
.tg-preview-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 5.5rem;
}
.tg-preview-stage--avatar {
  min-height: 6.5rem;
}
.tg-preview-stage--cover {
  min-height: 7rem;
}
.tg-preview-img--avatar {
  display: block;
  max-width: min(280px, 100%);
  max-height: min(280px, 46vh);
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}
.tg-preview-img--cover {
  display: block;
  max-width: 100%;
  max-height: min(320px, 50vh);
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}
.bot-detail-card .bot-detail-title {
  margin: 0 0 1rem;
  font-size: clamp(1.05rem, 2.6vw, 1.22rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.subhead {
  margin: 0 0 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.webhook-block {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}
.webhook-url { margin: 0 0 0.5rem; }
.webhook-hint { margin: 0; font-size: 0.82rem; }
.callout {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.55;
  border: 1px solid var(--border);
}
.callout-warn {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fcd34d;
}
.callout-warn strong { color: #fde68a; font-weight: 600; }
.callout-hint {
  background: var(--accent-soft);
  border-color: rgba(108, 154, 255, 0.24);
  color: #d0d8e6;
}
.callout-hint strong {
  color: #e8eef8;
  font-weight: 600;
}
.bot-ops-strip .row {
  margin-bottom: 0;
}
.bot-ops-strip .btn-linkish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
}
.bot-ops-strip .btn-linkish:hover {
  background: rgba(108, 154, 255, 0.1);
  border-color: rgba(108, 154, 255, 0.35);
}
.card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.03) 0%, var(--panel) 42%, var(--panel) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(0.95rem, 2.8vw, 1.28rem);
  margin-bottom: 0.95rem;
  box-shadow: var(--shadow-card);
}
.card h2 { margin: 0 0 1rem; font-size: 0.9375rem; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin-bottom: 0.75rem; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--muted); }
input, textarea, select {
  background: rgba(6, 9, 14, 0.55);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  min-width: min(200px, 100%);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(108, 154, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(108, 154, 255, 0.1);
}
textarea { min-width: 100%; min-height: 100px; font-family: inherit; }
button, .btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  min-height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: filter 0.15s ease, transform 0.1s ease;
}
button.secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.16s ease, border-color 0.16s ease;
}
button.secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-strong);
}
button.secondary:focus-visible {
  outline: 2px solid rgba(108, 154, 255, 0.45);
  outline-offset: 2px;
}
button.danger { background: var(--danger); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; }
.err { color: var(--danger); font-size: 0.85rem; margin-top: 0.5rem; }
.ok { color: var(--ok); font-size: 0.85rem; }
.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.15rem;
  margin-left: -0.15rem;
  margin-right: -0.15rem;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  color: var(--muted);
  min-height: 42px;
  padding: 0.45rem 0.95rem;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.tabs button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  border-color: var(--border-strong);
}
@media (min-width: 901px) {
  .tabs { flex-wrap: wrap; overflow-x: visible; }
}
.tabs button.active {
  background: var(--accent-glow);
  border-color: rgba(108, 154, 255, 0.42);
  color: #e8f0ff;
  box-shadow: inset 0 -2px 0 0 var(--accent), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.mono { font-family: ui-monospace, monospace; font-size: 0.8rem; word-break: break-all; }

.tpl-grid {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .tpl-grid { grid-template-columns: 1fr; }
  main { padding: 0.75rem; }
}
.phone-preview {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  position: sticky;
  top: 12px;
}
.phone-preview .bubble {
  background: #182433;
  border-radius: 12px 12px 12px 4px;
  padding: 8px 10px;
  font-size: 0.85rem;
  max-width: 100%;
  overflow: hidden;
}
.phone-preview .cap { margin-top: 8px; font-size: 0.8rem; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.phone-preview .kb { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.phone-preview .kb span {
  display: block;
  text-align: center;
  padding: 6px 8px;
  background: #243044;
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.78rem;
}
.phone-preview .hint { font-size: 0.72rem; color: var(--muted); margin-top: 10px; }
dialog.cmd-dlg {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 1.25rem;
  border-radius: 12px;
  max-width: 420px;
}
dialog.cmd-dlg::backdrop { background: rgba(0,0,0,0.55); }
.chat-pick-user-hint-mobile {
  display: none;
}
@media (max-width: 900px) {
  .chat-pick-user-hint-desktop {
    display: none;
  }
  .chat-pick-user-hint-mobile {
    display: block;
  }
}
.chat-tab-lead {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.55;
  max-width: 52rem;
}
.chat-bot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.1) 100%);
  box-shadow: var(--shadow-inset-top);
}
.chat-bot-bar--solo {
  align-items: center;
}
.chat-bot-bar-lab {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  min-width: min(280px, 100%);
}
.chat-bot-bar-t {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.chat-bot-sel {
  min-width: min(320px, 100%);
  max-width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.875rem;
}
.chat-bot-bar-hint {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.45;
}
.chat-bot-single {
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.chat-bot-single strong {
  color: var(--text);
  font-weight: 600;
}
.chat-ch {
  display: flex;
  flex-direction: row;
  gap: 0;
  min-height: 420px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 24, 34, 0.55) 0%, var(--panel) 22%);
  position: relative;
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.chat-list-backdrop {
  display: none;
}
.chat-sidebar-dock {
  flex-shrink: 0;
  width: 268px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-sidebar {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 720px);
}
.chat-m-list-btn {
  display: none;
}
@media (max-width: 900px) {
  .chat-ch {
    flex-direction: column;
    flex: 1;
    min-height: min(72vh, 680px);
    overflow: visible;
  }
  .chat-list-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(2, 6, 14, 0.52);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }
  .chat-list-backdrop.on {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .chat-sidebar-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(74vh, 580px);
    z-index: 160;
    border-radius: 18px 18px 0 0;
    border: 1px solid var(--border-strong);
    border-bottom: none;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.45);
    transform: translateY(115%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    background: linear-gradient(180deg, #151c28 0%, var(--panel) 12%);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .chat-ch.chat-list-open .chat-sidebar-dock {
    transform: translateY(0);
  }
  .chat-sidebar-dock .chat-sidebar {
    max-height: none;
    border-right: none;
    border-bottom: none;
  }
  .chat-m-list-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.4rem 0.85rem !important;
    font-weight: 600 !important;
    font-size: 0.8125rem !important;
  }
  .chat-main {
    max-height: none;
    flex: 1 1 auto;
    min-height: min(52vh, 520px);
  }
  .chat-stream {
    min-height: 180px;
    max-height: none;
    flex: 1;
  }
  .chat-acc-item {
    min-height: 48px;
    padding: 0.65rem 0.75rem;
  }
  .chat-topbar {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.55rem 0.65rem;
  }
  .chat-sel-label {
    max-width: min(200px, 46vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }
  .chat-compose-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 0.45rem;
  }
  .chat-compose-tools::-webkit-scrollbar {
    height: 4px;
  }
  .chat-tool-labeled {
    flex-shrink: 0;
  }
  .chat-bot-bar {
    margin-bottom: 0.5rem;
  }
}
.chat-sidehead {
  padding: 0.55rem 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.08) 100%);
  flex-shrink: 0;
}
.chat-sidehead-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.chat-sidehead-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.chat-sidehead-meta {
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}
.chat-acc-search-lab {
  display: block;
  margin: 0;
}
.chat-acc-search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.42rem 0.55rem 0.42rem 2rem;
  font-size: 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(6, 9, 14, 0.65) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a94a8' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M21 21l-4.2-4.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0.5rem 50%;
  background-size: 16px 16px;
  color: var(--text);
  outline: none;
}
.chat-acc-search::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
.chat-acc-search:focus {
  border-color: rgba(124, 156, 255, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chat-acc-list { overflow-y: auto; flex: 1; }
.chat-acc-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.55rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.chat-acc-item:hover {
  background: rgba(124, 156, 255, 0.1);
}
.chat-acc-item.on {
  background: rgba(124, 156, 255, 0.16);
  box-shadow: inset 3px 0 0 var(--accent);
}
.chat-acc-avcell {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}
.chat-acc-item .av {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-dim), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.chat-unread-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #ff6b6b, #e11d48);
  box-shadow: 0 1px 4px rgba(225, 29, 72, 0.45);
  border: 1.5px solid rgba(15, 20, 29, 0.95);
}
.chat-acc-meta { flex: 1; min-width: 0; }
.chat-acc-meta .nm { font-weight: 600; font-size: 0.82rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-acc-meta .sub { font-size: 0.7rem; color: var(--muted); opacity: 0.92; }
.chat-acc-actions { display: flex; gap: 0.2rem; flex-shrink: 0; }
.chat-acc-actions button { font-size: 0.7rem; padding: 0.2rem 0.35rem; }
.chat-acc-more { position: relative; flex-shrink: 0; }
.chat-acc-more summary {
  list-style: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 1rem;
  user-select: none;
}
.chat-acc-more summary::-webkit-details-marker { display: none; }
.chat-acc-more summary:hover { background: rgba(255, 255, 255, 0.06); }
.chat-acc-more .more-sheet {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 2px;
  z-index: 6;
  min-width: 11rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.chat-acc-more .more-sheet button {
  text-align: left;
  width: 100%;
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
}
.chat-acc-more .more-sheet button:hover { background: rgba(108, 154, 255, 0.2); }
/* 机器人列表「更多」：按钮（菜单由 JS 挂到 body） */
.bot-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.38rem 0.55rem;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(108, 154, 255, 0.28);
  background: rgba(108, 154, 255, 0.08);
  color: #c7d9ff;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bot-more-btn:focus-visible {
  outline: 2px solid rgba(108, 154, 255, 0.55);
  outline-offset: 2px;
}
.bot-more-btn:hover {
  background: rgba(108, 154, 255, 0.16);
  border-color: rgba(108, 154, 255, 0.45);
  color: #eef4ff;
}
.bot-more-btn[aria-expanded="true"] {
  background: rgba(108, 154, 255, 0.22);
  border-color: rgba(108, 154, 255, 0.55);
}
.bot-more-chev {
  font-size: 0.65rem;
  opacity: 0.85;
}
.bot-more-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(2, 6, 14, 0.52);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  pointer-events: none;
}
.bot-more-overlay--show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.bot-more-flyout {
  position: fixed;
  z-index: 200;
  min-width: 13rem;
  max-width: min(20rem, calc(100vw - 24px));
  background: linear-gradient(165deg, #1a2230 0%, #121820 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: var(--shadow-float), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
  overflow: hidden;
}
.bot-more-flyout--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.bot-more-flyout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.bot-more-flyout-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.bot-more-flyout-x {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bot-more-flyout-x:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.bot-more-flyout-body {
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.bot-more-flyout .bm-item {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  min-height: 46px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.bot-more-flyout a.bm-item:hover,
.bot-more-flyout a.bm-item:focus-visible {
  background: rgba(108, 154, 255, 0.12);
  outline: none;
}
.bot-more-flyout button.bm-item:hover,
.bot-more-flyout button.bm-item:focus-visible {
  background: rgba(248, 113, 113, 0.1);
  outline: none;
}
.bot-more-flyout .bm-del {
  margin-top: 0.25rem;
  color: #fecaca !important;
}
/* 移动端：底部抽屉 */
.bot-more-flyout--sheet {
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  border-radius: 18px 18px 0 0;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  transform: translateY(100%);
}
.bot-more-flyout--sheet.bot-more-flyout--open {
  transform: translateY(0);
}
.bot-more-flyout--sheet .bot-more-flyout-body {
  padding: 0.5rem 0.65rem 0.75rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}
.danger.ghost { color: #f87171; background: transparent !important; }
.chat-sidefoot {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.35rem 0;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}
.chat-sf {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
  opacity: 0.88;
  padding: 0.28rem;
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-sf-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.92;
}
.chat-sf-svg svg {
  display: block;
}
.chat-sf:hover {
  opacity: 1;
  background: rgba(124, 156, 255, 0.12);
  color: var(--text);
}
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: min(70vh, 720px);
}
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}
.chat-topbar-sp {
  flex: 1;
  min-width: 0.25rem;
}
.chat-topbar-sess {
  flex-shrink: 0;
}
.chat-poll-tag {
  font-size: 0.75rem;
  flex-shrink: 0;
}
.chat-compose {
  border-top: 1px solid var(--border-strong);
  padding: 0.55rem 0.7rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0%, rgba(15, 20, 29, 0.92) 100%);
  flex-shrink: 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}
.chat-compose-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.chat-tool {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.chat-tool:hover { background: rgba(124, 156, 255, 0.14); }
.chat-tool-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.95;
}
.chat-tool-svg svg {
  display: block;
}
.chat-tool-labeled {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-width: 4.25rem;
  padding: 0.32rem 0.4rem;
  font-size: inherit;
}
.chat-tool-labeled .chat-tool-ic { font-size: 1.05rem; line-height: 1; }
.chat-tool-labeled .chat-tool-lbl {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.1;
  max-width: 5rem;
  text-align: center;
}
.chat-tool-labeled-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  margin-left: 0.15rem;
  padding: 0.28rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}
.chat-tool-labeled-wrap .chat-tpl-sel { max-width: 10rem; }
.chat-tool-tplbtn { font-size: 0.72rem !important; padding: 0.28rem 0.45rem !important; }
.chat-tool-tplwrap { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.1rem; }
.chat-tpl-sel { max-width: 9rem; font-size: 0.78rem; padding: 0.25rem; border-radius: 6px; }
.chat-txt {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  resize: vertical;
  min-height: 2.5rem;
  font-size: 0.88rem;
}
.chat-compose-actions { display: flex; justify-content: flex-end; gap: 0.4rem; margin-top: 0.45rem; }
.chat-adv { font-size: 0.8rem; border-top: 1px solid var(--border); }
.chat-adv summary { cursor: pointer; padding: 0.4rem 0.75rem; color: var(--muted); }
.chat-adv-body { padding: 0 0.5rem 0.5rem; }
.chat-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 0.78rem;
}
.chat-toolbar label { display: flex; align-items: center; gap: 0.35rem; }
.chat-toolbar textarea { min-height: 36px; resize: vertical; min-width: 160px; }
.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  background: linear-gradient(180deg, #0a0e14 0%, #0e131a 40%, #0f1419 100%);
}
.chat-bubble-row { display: flex; align-items: flex-end; gap: 0.35rem; margin: 0.45rem 0; }
.chat-bubble-row.in { justify-content: flex-start; }
.chat-bubble-row.out { justify-content: flex-end; }
.chat-mini-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  flex-shrink: 0;
  color: #e2e8f0;
}
.chat-mini-me { background: #14532d; color: #bbf7d0; }
.chat-bubble-row .chat-bubble {
  max-width: 78%;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-word;
}
.chat-bubble.in {
  margin-right: 0;
  background: linear-gradient(165deg, #2a3852 0%, #1e2a3d 100%);
  border-radius: 12px 12px 12px 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.chat-bubble.out {
  margin-left: 0;
  background: linear-gradient(165deg, #166534 0%, #134a28 100%);
  border-radius: 12px 12px 4px 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.chat-bubble .chat-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.chat-bubble .ts { font-size: 0.68rem; color: var(--muted); margin-top: 0; }
.chat-dc { font-size: 0.72rem; color: #4ade80; letter-spacing: -0.12em; }
.chat-media-tag { font-size: 0.78rem; color: var(--muted); font-style: italic; }
dialog.chat-acc-dlg.modal {
  margin: auto;
  width: min(420px, 94vw);
  max-height: min(88vh, 640px);
  height: auto;
  padding: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #161d2a 0%, #10151f 100%);
  color: var(--text);
  box-shadow: var(--shadow-float), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: 220;
}
@media (min-width: 960px) {
  dialog.chat-acc-dlg.modal {
    position: fixed;
    right: max(0.75rem, env(safe-area-inset-right));
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: min(400px, 34vw);
    max-height: min(86vh, 560px);
  }
}
dialog.chat-acc-dlg.modal::backdrop {
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}
.chat-acc-dlg-head.modal-head { border-bottom: 1px solid var(--border); }
.chat-acc-dlg-body.modal-body {
  max-height: min(52vh, 420px);
  padding: 1rem 1.2rem;
}
.chat-acc-dlg-foot.modal-foot { justify-content: flex-end; }
.chat-acc-dlg table { width: 100%; font-size: 0.86rem; }
.chat-acc-dlg th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  width: 40%;
  border-bottom: 1px solid var(--border);
}
.chat-acc-dlg td {
  word-break: break-word;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

/* 自动回复页：与幻灯一致的分区表单 */
.ar-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 900px) {
  .ar-page-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: start;
  }
}
.ar-card {
  padding: 1rem 1.1rem;
}
.ar-sec-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.ar-sec-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
}
.ar-kw-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ar-kw-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.ar-kw-row .kwr {
  flex: 1;
  min-width: min(200px, 100%);
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
}
.ar-kw-actions {
  margin: 0.5rem 0 0.85rem;
}
.ar-field,
.ar-field-row label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}
.ar-field input,
.ar-field textarea,
.ar-field select,
.ar-field-row input,
.ar-field-row select {
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: rgba(0, 0, 0, 0.2);
}
.ar-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin-top: 0.5rem;
}
.ar-field-row-wrap label {
  min-width: min(160px, 100%);
}
.ar-src-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}
.ar-src-label {
  font-size: 0.82rem;
  color: var(--muted);
}
.ar-radio {
  font-size: 0.86rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.ar-inline-sub {
  margin: 0.65rem 0 0.35rem;
  font-size: 0.8rem;
}
.ar-btn-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.ar-btn-table {
  width: 100%;
  min-width: 320px;
  font-size: 0.82rem;
  border-collapse: collapse;
}
.ar-btn-table th,
.ar-btn-table td {
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
}
.ar-btn-table input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
}
.ar-card-foot {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.ar-list-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}
.cell-clip {
  display: inline-block;
  max-width: min(220px, 32vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.muted { color: var(--muted); }
.muted-note { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }

.tp-colset-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
}
.tp-colset-lab {
  display: block;
  margin: 0.35rem 0;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
}
.modal .tp-colset-lab { color: #cbd5e1; }
.tp-colset-body { max-height: 60vh; overflow: auto; }
.col-hidden { display: none !important; }

/* —— 模版自选定时 —— */
.sched-wrap {
  display: none;
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}
.sched-wrap.on { display: block; }
.sched-times { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.35rem 0; }
.sched-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.sched-row .sched-inp {
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

/* —— 聊天媒体预览 —— */
.chat-media-box {
  margin-bottom: 0.35rem;
  border-radius: 10px;
  overflow: hidden;
  max-width: min(280px, 88vw);
}
.chat-thumb {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  background: #0a0f14;
}
.chat-vid {
  display: block;
  width: 100%;
  max-height: 240px;
  background: #000;
}
.chat-audio { width: 100%; min-width: 200px; max-width: 320px; }
.chat-cap { font-size: 0.82rem; margin-top: 0.25rem; word-break: break-word; }
.chat-doc-chip {
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.chat-dc-fail { color: #f87171 !important; letter-spacing: 0 !important; }

/* —— Emoji 选择器 —— */
.emoji-dlg { max-width: min(420px, 96vw); border: none; border-radius: 14px; padding: 0; }
.emoji-dlg::backdrop { background: rgba(0, 0, 0, 0.55); }
.emoji-dlg-body { max-height: min(70vh, 520px); overflow-y: auto; padding: 0.5rem 1rem 1rem; }
.emoji-sec { margin-bottom: 0.5rem; border: none; }
.emoji-sec summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.35rem 0;
  list-style: none;
}
.emoji-sec summary::-webkit-details-marker { display: none; }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 4px;
}
.emoji-cell {
  min-height: 44px;
  min-width: 44px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.emoji-cell:hover { background: rgba(108, 154, 255, 0.22); }

/* —— 侧栏抽屉（移动端） —— */
.shell-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 12, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 80;
}
.shell-backdrop.on { display: block; }
.nav-open {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-right: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.top { gap: 0.35rem; flex-wrap: wrap; }
@media (max-width: 900px) {
  .nav-open { display: inline-flex; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 90;
    width: min(300px, 88vw);
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }
  .sidebar.open { transform: translateX(0); }
  .shell-main {
    width: 100%;
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .page-head .btn-add {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .top-title {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
  }
  .shell-backdrop.on {
    backdrop-filter: blur(2px);
  }
}
@media (min-width: 901px) {
  .shell-backdrop { display: none !important; }
}

/* —— 登录页：全屏、单入口、偏商业产品风 —— */
#app.mode-auth .top {
  display: none;
}
main.auth-main {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1.25rem 2rem;
  background:
    radial-gradient(ellipse 72% 48% at 50% -12%, rgba(108, 154, 255, 0.08), transparent 52%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(124, 108, 255, 0.05), transparent 46%),
    linear-gradient(165deg, #06080d 0%, #0d121a 40%, #080a10 100%);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: rgba(18, 22, 30, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 2.25rem 1.85rem 2rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.035) inset,
    0 32px 64px rgba(0, 0, 0, 0.55);
}
.auth-card-wide {
  max-width: 420px;
}
.auth-brand {
  text-align: center;
  margin-bottom: 1.85rem;
}
.auth-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(139, 155, 180, 0.75);
  -webkit-font-smoothing: antialiased;
}
.auth-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #f1f5f9;
  -webkit-font-smoothing: antialiased;
}
.auth-tagline {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: rgba(148, 163, 184, 0.92);
  font-weight: 400;
}
.auth-dev-only {
  margin: 1rem 0 0;
  text-align: center;
}
.auth-textlink {
  background: none;
  border: none;
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  padding: 0.25rem;
}
.auth-textlink:hover {
  color: #cbd5e1;
}
.auth-form {
  display: block;
  margin: 0;
}
.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.auth-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}
.auth-label-t {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.auth-input {
  width: 100%;
  min-width: 0 !important;
  padding: 0.7rem 0.9rem !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  background: rgba(7, 10, 15, 0.55) !important;
  color: #f1f5f9 !important;
  font-size: 0.9375rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.auth-input::placeholder {
  color: rgba(100, 116, 139, 0.55);
}
.auth-input:focus {
  outline: none;
  border-color: rgba(108, 154, 255, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(108, 154, 255, 0.12);
}
.auth-submit {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.78rem 1rem !important;
  border-radius: 12px !important;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%) !important;
  color: #fff !important;
  border: none !important;
  cursor: pointer;
  -webkit-font-smoothing: antialiased;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.12) inset, 0 10px 28px rgba(108, 154, 255, 0.24);
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.auth-submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.14) inset, 0 12px 34px rgba(108, 154, 255, 0.3);
}
.auth-submit:active {
  transform: translateY(1px);
}
.auth-err {
  min-height: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: #fca5a5;
}
.auth-top-btn {
  border-radius: 10px !important;
  padding: 0.45rem 0.95rem !important;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
button.auth-top-btn.secondary {
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #e8eef8 !important;
}

/* 消息模版：搜索区、分页、状态徽章（与幻灯列表一致） */
.tpl-search-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.025) 0%, var(--panel) 50%);
  box-shadow: var(--shadow-card);
}
.tpl-search-row label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--muted);
}
.tpl-toolbar .secondary {
  font-size: 0.8125rem;
}
.tpl-pager-bar {
  padding: 0.5rem 0;
  font-size: 0.8125rem;
}
.tpl-pager-bar button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.tpl-st {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tpl-st-on {
  color: #86efac;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.25);
}
.tpl-st-off {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.22);
}
.tpl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  max-width: min(220px, 36vw);
}
@media (max-width: 720px) {
  .tpl-actions {
    max-width: 100%;
  }
}
