/* ===== 客服云 · 控制台样式（亮白主色 · 四套主题） ===== */

/* ---------- 主题令牌 ---------- */
:root,
[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-2: #eef3fa;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --panel-3: #eef2f9;
  --line: rgba(20, 32, 56, 0.08);
  --line-2: rgba(20, 32, 56, 0.14);
  --text: #16203a;
  --text-2: #2b3a57;
  --muted: #66748c;
  --muted-2: #97a3b8;
  --accent: #4f6ef7;
  --accent-2: #0ea5a4;
  --accent-soft: rgba(79, 110, 247, 0.09);
  --grad: linear-gradient(135deg, #4f6ef7 0%, #6f8bff 45%, #0ea5a4 100%);
  --ok: #12a150;
  --warn: #d98a00;
  --danger: #e5484d;
  --ok-soft: rgba(18, 161, 80, 0.1);
  --warn-soft: rgba(217, 138, 0, 0.12);
  --danger-soft: rgba(229, 72, 77, 0.1);
  --shadow: 0 18px 46px rgba(23, 42, 84, 0.1);
  --shadow-sm: 0 2px 8px rgba(23, 42, 84, 0.06);
  --bg-glow: radial-gradient(900px 460px at 6% -12%, rgba(79, 110, 247, 0.13), transparent 62%),
             radial-gradient(760px 420px at 102% -4%, rgba(14, 165, 164, 0.1), transparent 58%);
  --sidebar-bg: linear-gradient(180deg, #ffffff, #f8fbff);
  --bubble-in: #f4f7fd;
  --bubble-out: linear-gradient(135deg, #4f6ef7, #6480f8);
  --bubble-out-text: #ffffff;
  --radius: 16px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-2: #0e1526;
  --panel: #141d31;
  --panel-2: #19233a;
  --panel-3: #1e2a44;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #e9eefb;
  --text-2: #cdd8ee;
  --muted: #94a3bd;
  --muted-2: #64748b;
  --accent: #7c93ff;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(124, 147, 255, 0.14);
  --grad: linear-gradient(135deg, #6d8dff 0%, #2fd6c4 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --warn-soft: rgba(251, 191, 36, 0.14);
  --danger-soft: rgba(248, 113, 113, 0.14);
  --shadow: 0 22px 56px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --bg-glow: radial-gradient(900px 480px at 8% -10%, rgba(109, 141, 255, 0.2), transparent 60%),
             radial-gradient(760px 420px at 100% 0%, rgba(47, 214, 196, 0.13), transparent 55%);
  --sidebar-bg: linear-gradient(180deg, #101a2d, #0c1424);
  --bubble-in: #1b2540;
  --bubble-out: linear-gradient(135deg, #4f6ef7, #3f5ee0);
  --bubble-out-text: #f6f9ff;
}

[data-theme="blue"] {
  --bg: #eef4ff;
  --bg-2: #e6eeff;
  --panel: #ffffff;
  --panel-2: #f2f6ff;
  --panel-3: #e6eeff;
  --line: rgba(28, 58, 120, 0.1);
  --line-2: rgba(28, 58, 120, 0.18);
  --text: #10214a;
  --text-2: #23386b;
  --muted: #5570a0;
  --muted-2: #8298bd;
  --accent: #2f6bff;
  --accent-2: #0e8ce0;
  --accent-soft: rgba(47, 107, 255, 0.1);
  --grad: linear-gradient(135deg, #2f6bff 0%, #4c8dff 50%, #0e8ce0 100%);
  --ok: #0f9d58;
  --warn: #cf8a00;
  --danger: #e5484d;
  --ok-soft: rgba(15, 157, 88, 0.1);
  --warn-soft: rgba(207, 138, 0, 0.12);
  --danger-soft: rgba(229, 72, 77, 0.1);
  --shadow: 0 18px 46px rgba(24, 58, 130, 0.13);
  --shadow-sm: 0 2px 8px rgba(24, 58, 130, 0.08);
  --bg-glow: radial-gradient(880px 460px at 4% -14%, rgba(47, 107, 255, 0.22), transparent 62%),
             radial-gradient(720px 400px at 102% -8%, rgba(14, 140, 224, 0.16), transparent 58%);
  --sidebar-bg: linear-gradient(180deg, #ffffff, #f0f5ff);
  --bubble-in: #eaf1ff;
  --bubble-out: linear-gradient(135deg, #2f6bff, #4c8dff);
  --bubble-out-text: #ffffff;
}

[data-theme="warm"] {
  --bg: #fdf8f1;
  --bg-2: #f8f0e4;
  --panel: #ffffff;
  --panel-2: #fdf8f1;
  --panel-3: #f6ecdd;
  --line: rgba(84, 56, 24, 0.09);
  --line-2: rgba(84, 56, 24, 0.16);
  --text: #352417;
  --text-2: #4d3625;
  --muted: #7d6450;
  --muted-2: #a8917c;
  --accent: #e2683c;
  --accent-2: #c99a2e;
  --accent-soft: rgba(226, 104, 60, 0.1);
  --grad: linear-gradient(135deg, #e2683c 0%, #ec8a4e 50%, #c99a2e 100%);
  --ok: #4f9d2f;
  --warn: #c07a00;
  --danger: #d1453b;
  --ok-soft: rgba(79, 157, 47, 0.12);
  --warn-soft: rgba(192, 122, 0, 0.12);
  --danger-soft: rgba(209, 69, 59, 0.1);
  --shadow: 0 18px 46px rgba(96, 62, 28, 0.12);
  --shadow-sm: 0 2px 8px rgba(96, 62, 28, 0.07);
  --bg-glow: radial-gradient(880px 460px at 4% -14%, rgba(226, 104, 60, 0.16), transparent 62%),
             radial-gradient(720px 400px at 102% -8%, rgba(201, 154, 46, 0.14), transparent 58%);
  --sidebar-bg: linear-gradient(180deg, #fffdf9, #fdf6ea);
  --bubble-in: #f8efe2;
  --bubble-out: linear-gradient(135deg, #e2683c, #ec8a4e);
  --bubble-out-text: #ffffff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg-glow);
  pointer-events: none;
  z-index: 0;
}
a { color: var(--accent); text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.18s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--grad);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(79, 110, 247, 0.28);
}
.btn-primary:hover { filter: brightness(1.05); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { color: var(--text); background: var(--accent-soft); }
.btn-danger { color: var(--danger); border-color: rgba(229, 72, 77, 0.32); background: var(--danger-soft); box-shadow: none; }
.btn-danger:hover { background: rgba(229, 72, 77, 0.16); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field .tip { font-size: 11.5px; color: var(--muted-2); line-height: 1.7; }
input, textarea, select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: 0.18s;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.65; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--panel); color: var(--text); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 40px; height: 22px; border-radius: 22px; background: var(--panel-3);
  border: 1px solid var(--line-2); position: relative; transition: 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: 0.2s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch span.lbl { font-size: 12.5px; color: var(--text-2); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 13px; color: var(--muted); margin: 0 0 14px; font-weight: 600; }

/* ---------- 布局 ---------- */
.app { position: relative; z-index: 1; display: flex; height: 100vh; }
.sidebar {
  width: 232px;
  flex: 0 0 232px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  transition: background 0.3s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 20px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px;
  box-shadow: 0 8px 20px rgba(79, 110, 247, 0.32);
}
.brand-txt b { display: block; font-size: 14.5px; letter-spacing: 0.02em; }
.brand-txt span { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.14em; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 11px;
  border-radius: 11px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: 0.16s;
  user-select: none;
  white-space: nowrap;
}
.nav-ic { width: 17px; height: 17px; display: grid; place-items: center; opacity: 0.85; flex: 0 0 auto; }
.nav-ic svg { width: 17px; height: 17px; }
.nav-item:hover { background: var(--accent-soft); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(79, 110, 247, 0.2);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active .nav-ic { opacity: 1; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; border-radius: 20px; padding: 1px 6px; font-weight: 700; }

.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 11px; }
.side-user:hover { background: var(--accent-soft); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 110, 247, 0.2);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent);
  flex: 0 0 auto;
}
.side-user b { display: block; font-size: 12.5px; font-weight: 600; }
.side-user span { font-size: 11px; color: var(--muted-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 70px; flex: 0 0 70px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  backdrop-filter: blur(14px);
}
.topbar h1 { font-size: 16.5px; margin: 0; font-weight: 650; letter-spacing: 0.01em; }
.topbar p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted-2); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.conn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.conn i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.conn.on i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn.on { color: var(--ok); border-color: rgba(18, 161, 80, 0.24); }

/* 主题切换 */
.theme-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel-2); }
.theme-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  padding: 0; transition: 0.18s; position: relative;
}
.theme-dot:hover { transform: scale(1.1); }
.theme-dot.active { border-color: var(--accent); }
.theme-dot[data-theme-set="light"] { background: linear-gradient(135deg, #ffffff 50%, #dbe4f5 50%); }
.theme-dot[data-theme-set="dark"] { background: linear-gradient(135deg, #22304d 50%, #0b1120 50%); }
.theme-dot[data-theme-set="blue"] { background: linear-gradient(135deg, #dfe9ff 50%, #2f6bff 50%); }
.theme-dot[data-theme-set="warm"] { background: linear-gradient(135deg, #fdf3e4 50%, #e2683c 50%); }

.page { flex: 1; overflow: auto; padding: 22px 24px 30px; display: none; }
.page.active { display: block; }
.page.page-chat { padding: 0; display: none; }
.page.page-chat.active { display: flex; }

/* ---------- 统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat::after {
  content: ""; position: absolute; right: -28px; top: -38px; width: 108px; height: 108px;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
}
.stat-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-val { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; line-height: 1; }
.stat-val small { font-size: 12px; font-weight: 500; color: var(--muted-2); margin-left: 5px; }
.stat-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 9px; }
.stat-sub b { color: var(--accent); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.grid-2.eq { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1160px) { .grid-2, .grid-2.eq, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--muted-2); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 10px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--panel-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--accent); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--line-2); color: var(--muted);
  background: var(--panel-2);
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); border-color: rgba(18, 161, 80, 0.26); background: var(--ok-soft); }
.badge-warn { color: var(--warn); border-color: rgba(217, 138, 0, 0.28); background: var(--warn-soft); }
.badge-danger { color: var(--danger); border-color: rgba(229, 72, 77, 0.26); background: var(--danger-soft); }
.badge-muted { color: var(--muted-2); }
.badge-info { color: var(--accent); border-color: rgba(79, 110, 247, 0.26); background: var(--accent-soft); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search { position: relative; }
.search input { padding-left: 32px; width: 230px; height: 38px; }
.search svg { position: absolute; left: 10px; top: 11px; width: 15px; height: 15px; color: var(--muted-2); }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.seg button {
  border: none; background: transparent; color: var(--muted);
  padding: 6px 13px; border-radius: 8px; font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: 0.15s;
}
.seg button.active { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- 会话 ---------- */
.chat-wrap { display: flex; width: 100%; min-height: 0; flex: 1; }
.chat-list { width: 306px; flex: 0 0 306px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--panel); }
.chat-list-head { padding: 14px; border-bottom: 1px solid var(--line); }
.chat-list-head .search input { width: 100%; }
.chat-list-head .seg { margin-top: 10px; width: 100%; }
.chat-list-head .seg button { flex: 1; }
.conv-list { flex: 1; overflow: auto; }
.conv {
  display: flex; gap: 10px; padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer; position: relative; transition: 0.15s;
}
.conv:hover { background: var(--panel-2); }
.conv.active { background: var(--accent-soft); }
.conv.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); }
.conv-body { min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conv-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 10.5px; color: var(--muted-2); flex: 0 0 auto; }
.conv-last { font-size: 12px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.conv-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.conv-unread {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 20px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 5px;
}
.conv-tag { font-size: 10px; color: var(--muted-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 20px; }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-2); }
.chat-head {
  height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--line);
  background: var(--panel); backdrop-filter: blur(10px);
}
.chat-head h3 { margin: 0; font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.chat-head .sub { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }
.chat-body { flex: 1; overflow: auto; padding: 20px 22px 10px; display: flex; flex-direction: column; gap: 14px; }
.chat-foot { border-top: 1px solid var(--line); padding: 12px 16px 14px; background: var(--panel); }
.chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-input-row textarea {
  flex: 1; min-height: 46px; max-height: 150px; resize: none;
  border-radius: 13px; padding: 12px 14px; line-height: 1.55;
}
.quick-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 9px; margin-bottom: 2px; }
.quick-bar::-webkit-scrollbar { height: 0; }
.chip {
  border: 1px solid var(--line-2); background: var(--panel);
  color: var(--muted); font-size: 12px; padding: 5px 11px; border-radius: 20px;
  cursor: pointer; white-space: nowrap; font-family: inherit; transition: 0.15s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.msg { display: flex; gap: 10px; max-width: 76%; }
.msg .bubble {
  background: var(--bubble-in); border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 4px 15px 15px 15px;
  font-size: 13.5px; line-height: 1.65; word-break: break-word; white-space: pre-wrap;
}
.msg .meta { font-size: 10.5px; color: var(--muted-2); margin-top: 5px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--bubble-out); border: none; color: var(--bubble-out-text); border-radius: 15px 4px 15px 15px; box-shadow: 0 6px 16px rgba(79, 110, 247, 0.22); }
.msg.me .meta { text-align: right; }
.msg.sys { align-self: center; max-width: 90%; }
.msg.sys .bubble {
  background: var(--panel); border: 1px dashed var(--line-2);
  color: var(--muted); font-size: 12px; border-radius: 20px; padding: 7px 14px; text-align: center;
}
.msg.sys .avatar, .msg.sys .meta { display: none; }
.msg .avatar { width: 30px; height: 30px; font-size: 11px; }
.msg.ai .bubble { border-color: rgba(14, 165, 164, 0.3); background: var(--accent-soft); }
.msg.ai .avatar { background: rgba(14, 165, 164, 0.14); color: var(--accent-2); border-color: rgba(14, 165, 164, 0.28); }
.day-sep { align-self: center; font-size: 11px; color: var(--muted-2); background: var(--panel); padding: 3px 12px; border-radius: 20px; border: 1px solid var(--line); }

.typing { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted-2); height: 18px; padding-left: 2px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-2); animation: bob 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bob { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-info { width: 256px; flex: 0 0 256px; border-left: 1px solid var(--line); padding: 18px 16px; overflow: auto; background: var(--panel); }
.info-block { margin-bottom: 20px; }
.info-block h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); margin: 0 0 10px; font-weight: 600; }
.info-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 6px 0; }
.info-row span { color: var(--muted-2); }
.info-row b { font-weight: 500; color: var(--text-2); text-align: right; word-break: break-all; }

/* ---------- 空态 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted-2); padding: 50px 20px; text-align: center; font-size: 12.5px; flex: 1; }
.empty svg { width: 40px; height: 40px; opacity: 0.3; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 26, 46, 0.42); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal-mask.show { display: flex; animation: fade 0.18s ease; }
.modal {
  width: 100%; max-width: 460px; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px; animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-height: 90vh; overflow: auto;
  color: var(--text);
}
.modal.wide { max-width: 640px; }
.modal h3 { margin: 0 0 4px; font-size: 15.5px; }
.modal .modal-sub { font-size: 12px; color: var(--muted-2); margin: 0 0 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@keyframes pop { from { transform: scale(0.96) translateY(6px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--panel); border: 1px solid var(--line-2);
  color: var(--text); padding: 11px 15px; border-radius: 12px; font-size: 12.5px;
  box-shadow: var(--shadow); animation: slideIn 0.22s ease; max-width: 340px;
}
.toast i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.toast.err i { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(16px); opacity: 0; } }

/* ---------- 登录页 ---------- */
.auth-screen { position: relative; z-index: 1; height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-visual {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px; border-right: 1px solid var(--line);
  background: radial-gradient(680px 460px at 12% 12%, rgba(79, 110, 247, 0.14), transparent 62%),
    radial-gradient(560px 460px at 88% 92%, rgba(14, 165, 164, 0.12), transparent 60%), var(--bg-2);
}
.auth-visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 45%, #000 22%, transparent 72%);
  opacity: 0.7;
}
.auth-visual > * { position: relative; z-index: 1; }
.auth-copy h2 { font-size: 30px; line-height: 1.38; margin: 0 0 14px; letter-spacing: -0.01em; }
.auth-copy h2 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { color: var(--muted); font-size: 13.5px; line-height: 1.9; max-width: 400px; margin: 0; }
.auth-points { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.auth-point i {
  width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto;
  background: var(--accent-soft); border: 1px solid rgba(79, 110, 247, 0.24);
  display: grid; place-items: center; font-size: 11px; color: var(--accent); font-style: normal;
}
.auth-form-wrap { display: grid; place-items: center; padding: 30px; background: var(--bg); }
.auth-form { width: 100%; max-width: 348px; }
.auth-form h3 { font-size: 20px; margin: 0 0 6px; }
.auth-form .hint { color: var(--muted-2); font-size: 12.5px; margin: 0 0 24px; }
.demo-accounts { margin-top: 22px; border-top: 1px dashed var(--line-2); padding-top: 16px; font-size: 11.5px; color: var(--muted-2); line-height: 2; }
.demo-accounts b { color: var(--text-2); font-weight: 500; }
.form-err { color: var(--danger); font-size: 12px; min-height: 16px; margin-bottom: 8px; }
@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}

/* ---------- 图表 ---------- */
.chart { width: 100%; height: 168px; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }
.spark-row { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.spark-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.spark-bar { width: 100%; border-radius: 6px 6px 3px 3px; background: var(--grad); min-height: 3px; transition: 0.3s; opacity: 0.9; }
.spark-bar.dim { background: var(--panel-3); opacity: 1; }
.spark-lbl { font-size: 10px; color: var(--muted-2); }

.rank { display: flex; flex-direction: column; gap: 2px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rank-row:last-child { border-bottom: none; }
.rank-no { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; background: var(--panel-3); color: var(--muted); font-weight: 600; }
.rank-row:nth-child(1) .rank-no { background: rgba(217, 138, 0, 0.18); color: var(--warn); }
.rank-row:nth-child(2) .rank-no { background: rgba(148, 163, 184, 0.22); color: #7f8ea3; }
.rank-row:nth-child(3) .rank-no { background: rgba(180, 120, 60, 0.18); color: #b0793f; }
.rank-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-val { color: var(--muted-2); font-size: 11.5px; }

.muted { color: var(--muted-2); }
.nowrap { white-space: nowrap; }
.tag-link { font-size: 11.5px; color: var(--accent); cursor: pointer; }

/* ---------- 图片消息 ---------- */
.msg .bubble .pic {
  display: block; max-width: 190px; max-height: 240px; width: auto; height: auto;
  border-radius: 11px; cursor: zoom-in; object-fit: cover;
}
#lightbox {
  position: fixed; inset: 0; background: rgba(10, 16, 30, 0.84);
  display: none; align-items: center; justify-content: center; z-index: 999; padding: 24px;
}
#lightbox.on { display: flex; }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* ---------- 公告 ---------- */
.announce-list { display: flex; flex-direction: column; gap: 12px; }
.announce {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--panel);
  transition: 0.18s;
}
.announce:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.announce.pinned { border-left: 3px solid var(--accent); }
.announce-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.announce h4 { margin: 0; font-size: 14px; font-weight: 650; flex: 1; min-width: 0; }
.announce p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.85; white-space: pre-wrap; }
.announce .foot { margin-top: 10px; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted-2); }
.announce .foot .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.announce-empty { text-align: center; color: var(--muted-2); font-size: 12.5px; padding: 40px 10px; }

/* 未读红点 */
.dot-badge { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; }

/* ---------- 套餐 ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 14px; }
.plan-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--panel);
  position: relative; transition: 0.2s; display: flex; flex-direction: column;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-card.current::before {
  content: "当前套餐"; position: absolute; top: -10px; right: 14px;
  background: var(--grad); color: #fff; font-size: 10.5px; padding: 3px 9px; border-radius: 20px; font-weight: 600;
}
.plan-name { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.plan-price { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.plan-price small { font-size: 12px; font-weight: 500; color: var(--muted-2); margin-left: 3px; }
.plan-desc { font-size: 11.5px; color: var(--muted-2); margin: 6px 0 14px; line-height: 1.7; min-height: 34px; }
.plan-feat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; font-size: 12.5px; color: var(--text-2); }
.plan-feat div { display: flex; gap: 7px; align-items: center; }
.plan-feat i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); flex: 0 0 auto; }

/* 用量进度 */
.meter { margin-bottom: 14px; }
.meter-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.meter-top span { color: var(--muted); }
.meter-top b { font-weight: 600; }
.meter-bar { height: 7px; border-radius: 7px; background: var(--panel-3); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 7px; background: var(--grad); transition: width 0.4s ease; }
.meter-fill.warn { background: linear-gradient(135deg, #f0a91c, #e2683c); }
.meter-fill.full { background: linear-gradient(135deg, #e5484d, #f0716f); }

/* ---------- 竖向 key-value ---------- */
.kv { display: flex; flex-direction: column; gap: 1px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-row span { color: var(--muted); }
.kv-row b { font-weight: 550; color: var(--text-2); text-align: right; }

/* ---------- 粒子画布 ---------- */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ---------- 首页 ---------- */
.landing-wrap { position: relative; z-index: 1; min-height: 100vh; overflow-y: auto; overflow-x: hidden; }
.landing { max-width: 1120px; margin: 0 auto; padding: 40px 28px 70px; position: relative; z-index: 2; }
.top-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top-nav .links { display: flex; align-items: center; gap: 8px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-top: 58px; }
.hero-copy { flex: 1; min-width: 320px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(79, 110, 247, 0.22); padding: 5px 12px; border-radius: 22px; font-weight: 500;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
.hero h1 { font-size: 50px; line-height: 1.16; margin: 20px 0 18px; letter-spacing: -0.035em; font-weight: 750; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--muted); font-size: 15px; line-height: 1.9; max-width: 520px; margin: 0; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 34px; margin-top: 40px; flex-wrap: wrap; }
.hero-meta b { display: block; font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }
.hero-meta span { font-size: 11.5px; color: var(--muted-2); }
.hero-art {
  flex: 0 0 396px; position: relative; height: 384px;
  border-radius: 24px; border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.hero-art-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.hero-art-head .dots3 { display: flex; gap: 5px; }
.hero-art-head .dots3 i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.hero-art-head b { font-size: 12.5px; font-weight: 600; margin-left: 4px; }
.hero-art-body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 11px; overflow: hidden; }
.demo-bubble { max-width: 82%; padding: 9px 13px; border-radius: 4px 14px 14px 14px; background: var(--bubble-in); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; animation: rise 0.5s ease both; }
.demo-bubble.me { align-self: flex-end; background: var(--bubble-out); color: var(--bubble-out-text); border: none; border-radius: 14px 4px 14px 14px; }
.demo-bubble.ai { background: var(--accent-soft); border-color: rgba(14, 165, 164, 0.28); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 64px; }
.entry {
  display: block; text-decoration: none; color: inherit; position: relative; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px 22px;
  transition: 0.22s ease; box-shadow: var(--shadow-sm);
}
.entry:hover { transform: translateY(-4px); border-color: rgba(79, 110, 247, 0.32); box-shadow: var(--shadow); }
.entry-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid rgba(79, 110, 247, 0.2); color: var(--accent); }
.entry-ic svg { width: 20px; height: 20px; }
.entry h3 { margin: 16px 0 8px; font-size: 16px; }
.entry p { margin: 0; color: var(--muted-2); font-size: 12.5px; line-height: 1.8; min-height: 46px; }
.entry .go { margin-top: 14px; font-size: 12.5px; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.entry .acct { margin-top: 14px; font-size: 11.5px; color: var(--muted-2); padding-top: 13px; border-top: 1px dashed var(--line-2); line-height: 1.9; }
.entry .acct b { color: var(--text-2); font-weight: 550; }

.feats { margin-top: 64px; }
.feats h2 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 8px; }
.feats p.sub { color: var(--muted-2); font-size: 13px; margin: 0 0 26px; }
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feat {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.feat .fi { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); margin-bottom: 12px; }
.feat .fi svg { width: 16px; height: 16px; }
.feat b { display: block; font-size: 13px; margin-bottom: 6px; }
.feat span { font-size: 11.5px; color: var(--muted-2); line-height: 1.75; }

.foot { margin-top: 56px; font-size: 11.5px; color: var(--muted-2); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 22px; border-top: 1px solid var(--line); }

@media (max-width: 960px) {
  .entries { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 34px; }
  .hero-art { flex: 1 1 100%; height: 320px; }
  .landing { padding: 28px 18px 50px; }
}

/* ---------- 通知气泡（站内公告弹层） ---------- */
.announce-pop {
  position: fixed; right: 22px; bottom: 22px; width: 340px; z-index: 70;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px 18px; animation: slideIn 0.28s ease;
}
.announce-pop h4 { margin: 0 0 6px; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.announce-pop p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.75; max-height: 110px; overflow: auto; white-space: pre-wrap; }
.announce-pop .close { position: absolute; top: 10px; right: 12px; border: none; background: none; color: var(--muted-2); cursor: pointer; font-size: 15px; }
.announce-pop .acts { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }

/* ===== 官网悬浮客服 / 炫彩时钟 / 站点状态 ===== */
.chroma-clock {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.chroma-clock .ck-ic {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.chroma-clock .ck-ic svg { width: 18px; height: 18px; }
.chroma-clock .ck-body { display: flex; flex-direction: column; line-height: 1.15; }
.chroma-time {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(92deg, #4f6ef7 0%, #0ea5a4 26%, #f472b6 52%, #f59e0b 74%, #4f6ef7 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: chromaFlow 9s linear infinite;
}
.chroma-date { font-size: 11.5px; color: var(--muted); letter-spacing: 0.08em; margin-top: 3px; }
@keyframes chromaFlow { from { background-position: 0% 50%; } to { background-position: 300% 50%; } }

/* 站点状态小胶囊 */
.site-status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 11.5px; color: var(--muted);
  backdrop-filter: blur(8px);
}
.site-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(18, 161, 80, 0.16); }
.site-status.warn i { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 138, 0, 0.18); }
.site-status b { color: var(--text); font-weight: 600; }

/* 悬浮客服 */
.site-widget { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.site-dock { display: flex; align-items: center; gap: 10px; }
.site-fab {
  position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  box-shadow: 0 16px 34px rgba(79, 110, 247, 0.38);
  animation: fabBreath 2.6s ease-in-out infinite;
  transition: transform 0.2s;
}
.site-fab:hover { transform: scale(1.06); }
.site-fab::before, .site-fab::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(79, 110, 247, 0.5); animation: fabRing 2.4s ease-out infinite;
}
.site-fab::after { animation-delay: 1.2s; }
.site-fab svg { width: 25px; height: 25px; }
.site-fab .fab-badge {
  position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-style: normal;
  display: grid; place-items: center; box-shadow: 0 0 0 2.5px var(--panel);
}
.site-fab .fab-tip {
  position: absolute; right: 72px; top: 50%; transform: translate(6px, -50%);
  white-space: nowrap; font-style: normal; font-size: 12px; padding: 7px 11px; border-radius: 10px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  opacity: 0; pointer-events: none; transition: 0.22s;
}
.site-fab:hover .fab-tip { opacity: 1; transform: translate(0, -50%); }
@keyframes fabBreath {
  0%, 100% { box-shadow: 0 16px 34px rgba(79, 110, 247, 0.34); }
  50% { box-shadow: 0 20px 44px rgba(79, 110, 247, 0.55); }
}
@keyframes fabRing {
  0% { transform: scale(0.86); opacity: 0.9; }
  75% { transform: scale(1.45); opacity: 0; }
  100% { opacity: 0; }
}

.site-panel {
  width: 372px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100vh - 130px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); display: none; flex-direction: column; overflow: hidden;
  transform: translateY(12px) scale(0.98); opacity: 0; transition: 0.22s ease;
}
.site-panel.show { display: flex; transform: none; opacity: 1; }
.site-panel-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  background: var(--grad); color: #fff;
}
.site-panel-head .sp-logo {
  width: 34px; height: 34px; border-radius: 11px; background: rgba(255, 255, 255, 0.2);
  display: grid; place-items: center; font-weight: 700;
}
.site-panel-head b { font-size: 13.5px; display: block; }
.site-panel-head span { font-size: 11px; opacity: 0.88; display: flex; align-items: center; gap: 5px; }
.site-panel-head span i { width: 6px; height: 6px; border-radius: 50%; background: #a7f3d0; }
.site-panel-head .sp-acts { margin-left: auto; display: flex; gap: 4px; }
.site-panel-head .sp-acts button {
  width: 26px; height: 26px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 14px; line-height: 1;
}
.site-panel-head .sp-acts button:hover { background: rgba(255, 255, 255, 0.3); }
.site-panel-notice {
  padding: 7px 14px; font-size: 11px; color: var(--muted); background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.site-panel-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.site-panel-body::-webkit-scrollbar { width: 6px; }
.site-panel-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.sp-msg { display: flex; gap: 8px; max-width: 88%; }
.sp-msg .sp-av {
  width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center;
  font-size: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.sp-msg .sp-bubble {
  padding: 9px 12px; border-radius: 13px; background: var(--bubble-in); color: var(--text);
  font-size: 13px; line-height: 1.65; word-break: break-word; white-space: pre-wrap;
}
.sp-msg .sp-time { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.sp-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.sp-msg.me .sp-bubble { background: var(--bubble-out); color: var(--bubble-out-text); }
.sp-msg.me .sp-av { background: var(--panel-3); color: var(--muted); }
.sp-msg.me .sp-time { text-align: right; }
.sp-msg.sys { align-self: center; max-width: 100%; }
.sp-msg.sys .sp-bubble {
  background: var(--panel-2); color: var(--muted); font-size: 11.5px; border-radius: 10px;
  text-align: center; border: 1px dashed var(--line-2);
}
.sp-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.sp-quick button {
  font-size: 11.5px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2);
  transition: 0.16s;
}
.sp-quick button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.site-panel-foot { padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.site-panel-foot .sp-row { display: flex; gap: 8px; align-items: flex-end; }
.site-panel-foot textarea {
  flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px;
  font-size: 13px; font-family: var(--font); background: var(--panel-2); color: var(--text);
  max-height: 96px; line-height: 1.5; outline: none;
}
.site-panel-foot textarea:focus { border-color: var(--accent); background: var(--panel); }
.site-panel-foot .sp-send {
  width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; display: grid; place-items: center; flex: none;
}
.site-panel-foot .sp-send:disabled { opacity: 0.5; cursor: not-allowed; }
.site-panel-foot .sp-send svg { width: 18px; height: 18px; }
.site-panel-foot .sp-note { font-size: 10.5px; color: var(--muted-2); margin-top: 6px; text-align: center; }

@media (max-width: 560px) {
  .site-widget { right: 14px; bottom: 14px; }
  .site-panel { width: calc(100vw - 28px); height: calc(100vh - 120px); max-height: none; border-radius: 16px; }
  .site-fab { width: 54px; height: 54px; }
  .chroma-clock { padding: 10px 14px; }
}

/* 嵌入代码展示 */
.code-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px dashed var(--line-2);
}
.code-box code {
  flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--text-2); word-break: break-all; line-height: 1.7;
  user-select: all;
}
