/* ============================================================
   style.css — 客服聊天系统 · 成熟聊天产品级 UI
   设计语言：微信聊天质感 × 飞书/DeepSeek 官网式留白与克制
   ============================================================ */
:root {
  --green: #07c160;          /* 微信绿 */
  --green-hover: #06ad56;
  --bubble-self: #95ec69;    /* 微信气泡绿 */
  --blue: #4d6bfe;           /* DeepSeek 蓝（客服端主色） */
  --qq: #12b7f5;
  --ink: #17181a;            /* 近黑文字 */
  --ink-2: #55585f;
  --ink-3: #9aa0a8;
  --line: #ececee;           /* 发丝线 */
  --bg: #f2f3f5;             /* 聊天背景 */
  --card: #ffffff;
  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(23, 24, 26, .05);
  --shadow-2: 0 8px 30px rgba(23, 24, 26, .07);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #f7f8fa;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input { font-family: inherit; }
img { -webkit-user-drag: none; }
.hidden { display: none !important; }

/* 统一线性图标 */
.ic { width: 22px; height: 22px; display: block; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .14); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 12%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(23, 24, 26, .85); color: #fff;
  padding: 10px 20px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s cubic-bezier(.2, .7, .3, 1);
  z-index: 999; max-width: 72vw; text-align: center;
  backdrop-filter: blur(6px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   登录页 — 大留白、克制、浅色氛围渐变（飞书/DeepSeek 式）
   ============================================================ */
.login-view {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px 20px;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(77, 107, 254, .07), transparent 60%),
    radial-gradient(820px 460px at 108% 12%, rgba(7, 193, 96, .08), transparent 60%),
    #f7f8fa;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border: 1px solid var(--line); border-radius: 24px;
  padding: 40px 32px 28px; text-align: center;
  box-shadow: var(--shadow-2);
}
.logo {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 18px;
  background: linear-gradient(135deg, #34d17b, #07c160 55%, #0aa856);
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 8px 20px rgba(7, 193, 96, .28);
}
.logo .ic { width: 30px; height: 30px; }
.login-card h1 { font-size: 20px; letter-spacing: .5px; }
.login-sub { font-size: 13px; color: var(--ink-3); margin: 6px 0 22px; }
.qr-box {
  width: 200px; height: 200px; margin: 0 auto; padding: 10px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
  box-shadow: var(--shadow-1);
}
.qr-box img { width: 100%; height: 100%; border-radius: 10px; display: block; }
.qr-tip { font-size: 12px; color: var(--ink-3); margin: 10px 0 20px; }
.divider { display: flex; align-items: center; gap: 14px; color: #c6c9cf; font-size: 12px; margin-bottom: 18px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 46px; border-radius: 13px;
  font-size: 15px; font-weight: 500; margin-bottom: 10px;
  transition: filter .15s, transform .06s, background .15s;
}
.btn:active { transform: scale(.985); filter: brightness(.96); }
.btn-ic { display: flex; }
.btn-ic .ic { width: 20px; height: 20px; }
.btn-wx { background: var(--green); color: #fff; box-shadow: 0 4px 14px rgba(7, 193, 96, .25); }
.btn-wx:hover { background: var(--green-hover); }
.btn-qq { background: var(--qq); color: #fff; box-shadow: 0 4px 14px rgba(18, 183, 245, .25); }
.btn-qq:hover { filter: brightness(.96); }
.btn-guest { background: #fff; border: 1px solid #dfe2e7; color: var(--ink-2); }
.btn-guest:hover { border-color: #c9cdd4; color: var(--ink); }
.login-foot { font-size: 11px; color: #b8bcc4; margin-top: 10px; }

/* ============================================================
   聊天页
   ============================================================ */
.chat-view {
  height: 100dvh; max-width: 680px; margin: 0 auto;
  display: flex; flex-direction: column;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(23, 24, 26, .07);
}
.chat-header {
  height: 56px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; flex: none;
}
.ch-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600; }
.ch-logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #34d17b, #07c160);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(7, 193, 96, .25); flex: none;
}
.ch-logo .ic { width: 16px; height: 16px; }
.dot-online {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, .15); flex: none;
}
.dot-online.off { background: #c3c7cd; box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
.ch-status { font-size: 12px; color: var(--ink-3); }

.msg-list { flex: 1; overflow-y: auto; padding: 16px 14px 20px; overscroll-behavior: contain; }
.sys-time { text-align: center; font-size: 11px; color: #a7abb3; margin: 14px 0 6px; }
.sys-msg {
  text-align: center; margin: 6px auto 14px; max-width: 84%;
  background: rgba(0, 0, 0, .05); color: #70747c; font-size: 12px;
  padding: 6px 14px; border-radius: 10px; line-height: 1.55;
}

.msg-row { display: flex; gap: 10px; margin: 14px 0; align-items: flex-start; }
.msg-row.self { flex-direction: row-reverse; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px;
  color: #fff; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex: none; user-select: none;
  box-shadow: var(--shadow-1);
}
.avatar-cs { background: linear-gradient(135deg, #34d17b, #07c160); }
.avatar-cs .ic { width: 21px; height: 21px; }
.msg-body { max-width: 70%; display: flex; flex-direction: column; min-width: 0; }
.bubble {
  padding: 10px 14px; font-size: 15px; line-height: 1.5;
  border-radius: 14px; word-break: break-word;
  white-space: pre-wrap; position: relative; min-width: 0;
}
.msg-row.other .bubble { background: #fff; border-top-left-radius: 5px; box-shadow: var(--shadow-1); }
.msg-row.self .bubble { background: var(--bubble-self); border-top-right-radius: 5px; box-shadow: 0 1px 2px rgba(96, 158, 51, .18); }
.msg-row.pending .bubble { opacity: .45; }

.chat-img { max-width: min(200px, 60vw); border-radius: 10px; display: block; cursor: zoom-in; }
.bubble-image { background: transparent !important; padding: 0 !important; box-shadow: none !important; }

/* 语音气泡 */
.bubble-voice {
  display: flex; align-items: center; gap: 10px;
  min-width: 88px; padding: 12px 15px; cursor: pointer; user-select: none;
}
.v-bars { display: flex; align-items: center; gap: 2.5px; height: 16px; }
.v-bars i { width: 3px; border-radius: 2px; background: #44a454; }
.msg-row.self .v-bars i { background: #3d9a4a; }
.v-bars i:nth-child(1) { height: 5px; }
.v-bars i:nth-child(2) { height: 10px; }
.v-bars i:nth-child(3) { height: 15px; }
.v-bars i:nth-child(4) { height: 9px; }
.v-bars i:nth-child(5) { height: 5px; }
.v-len { font-size: 12px; color: #8a9098; }
.msg-row.self .v-len { color: #3e7c3f; }
.playing .v-bars i { animation: vw 1s infinite ease-in-out; }
.playing .v-bars i:nth-child(2) { animation-delay: .12s; }
.playing .v-bars i:nth-child(3) { animation-delay: .24s; }
.playing .v-bars i:nth-child(4) { animation-delay: .36s; }
.playing .v-bars i:nth-child(5) { animation-delay: .48s; }
@keyframes vw { 0%, 100% { transform: scaleY(.5); } 50% { transform: scaleY(1.15); } }

/* 输入中提示 */
.typing-row .bubble { padding: 13px 15px; }
.dots { display: flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #b9bdc5; animation: dt 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dt {
  0%, 60%, 100% { transform: translateY(0); opacity: .55; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ============================================================
   输入条
   ============================================================ */
.composer {
  background: #f7f8fa; border-top: 1px solid var(--line);
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); flex: none;
}
.composer-row { display: flex; align-items: center; gap: 9px; }
.cbtn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #6a7078; flex: none; transition: background .15s, color .15s;
}
.cbtn .ic { width: 23px; height: 23px; }
.cbtn:hover { color: var(--ink); }
.cbtn:active { background: #e8eaee; }
.text-input {
  flex: 1; min-width: 0; height: 40px; border-radius: 11px;
  border: 1px solid transparent; background: #fff;
  padding: 0 13px; font-size: 15px; outline: none;
  box-shadow: var(--shadow-1);
  transition: border-color .15s;
}
.text-input:focus { border-color: var(--green); }
.btn-send {
  height: 38px; padding: 0 17px; border-radius: 11px;
  background: var(--green); color: #fff; font-size: 14px; font-weight: 500; flex: none;
  box-shadow: 0 3px 10px rgba(7, 193, 96, .25);
  transition: background .15s, transform .06s;
}
.btn-send:active { transform: scale(.97); background: var(--green-hover); }
.btn-talk {
  flex: 1; height: 40px; border-radius: 11px;
  background: #fff; border: 1px solid #e3e5e9;
  font-size: 14px; color: var(--ink-2); text-align: center;
  user-select: none; touch-action: none;
  box-shadow: var(--shadow-1);
  transition: background .15s;
}
.btn-talk.recording { background: #e8eaee; color: var(--ink); }

.panel { display: flex; gap: 20px; padding: 20px 6px 8px; }
.panel-item { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.pi-icon {
  width: 58px; height: 58px; border-radius: 18px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: #6a7078; box-shadow: var(--shadow-1);
  transition: transform .12s, box-shadow .12s;
}
.panel-item:hover .pi-icon { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(23, 24, 26, .09); }
.pi-icon .ic { width: 26px; height: 26px; }
.emoji-panel {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  padding: 12px 4px; max-height: 192px; overflow-y: auto;
}
.emoji-item { font-size: 23px; padding: 5px 0; border-radius: 9px; transition: background .12s; }
.emoji-item:hover { background: #ecedf0; }
.hidden-file { display: none; }

/* 录音浮层 */
.rec-overlay {
  position: fixed; inset: 0; background: rgba(23, 24, 26, .45);
  backdrop-filter: blur(2px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
}
.rec-card {
  background: rgba(23, 24, 26, .78); border-radius: 20px;
  padding: 28px 44px; text-align: center; color: #fff;
  transition: background .15s;
}
.rec-card.cancel { background: rgba(224, 66, 66, .88); }
.rec-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 36px; }
.rec-wave i { width: 4px; border-radius: 2px; background: #fff; animation: rw .7s infinite ease-in-out; }
.rec-wave i:nth-child(1) { height: 10px; }
.rec-wave i:nth-child(2) { height: 20px; animation-delay: .1s; }
.rec-wave i:nth-child(3) { height: 30px; animation-delay: .2s; }
.rec-wave i:nth-child(4) { height: 20px; animation-delay: .3s; }
.rec-wave i:nth-child(5) { height: 10px; animation-delay: .4s; }
@keyframes rw { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
.rec-text { margin-top: 14px; font-size: 14px; letter-spacing: 1px; }

/* 转账气泡（微信转账卡风格） */
.msg-row .bubble.bubble-transfer {
  background: linear-gradient(135deg, #ffb75e, #ed8f03) !important;
  color: #fff; padding: 11px 14px; cursor: pointer;
}
.transfer-bubble { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.tr-ic {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.tr-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tr-amt { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.tr-note { font-size: 11px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-status { font-size: 11px; opacity: .9; margin-top: 2px; }
.transfer-bubble.paid .tr-status { opacity: 1; font-weight: 600; }

/* 转账弹窗 */
.pay-mask {
  position: fixed; inset: 0; background: rgba(23, 24, 26, .55);
  backdrop-filter: blur(3px); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.pay-modal {
  width: 100%; max-width: 350px; background: #fff; border-radius: 20px;
  padding: 22px 24px 24px; box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
}
.pay-head {
  font-size: 16px; font-weight: 600; text-align: center; position: relative;
}
.pay-close {
  position: absolute; right: -6px; top: -4px; width: 30px; height: 30px;
  border-radius: 50%; color: var(--ink-3); font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pay-close:hover { background: #f2f3f5; }
.pay-sub { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.pay-amt-row {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  margin: 18px 0 10px; border-bottom: 2px solid var(--ink); padding-bottom: 6px;
}
.pay-cur { font-size: 22px; font-weight: 700; }
.pay-amt {
  width: 200px; border: none; outline: none; font-size: 34px; font-weight: 700;
  text-align: center; font-family: inherit; color: var(--ink);
  -moz-appearance: textfield;
}
.pay-amt::-webkit-outer-spin-button, .pay-amt::-webkit-inner-spin-button { -webkit-appearance: none; }
.pay-quick { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.pay-chip {
  padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2); transition: all .13s;
}
.pay-chip:hover { border-color: var(--green); color: var(--green); }
.pay-remark {
  width: 100%; height: 40px; border: 1px solid #e2e5e9; border-radius: 10px;
  padding: 0 13px; font-size: 14px; outline: none; margin-bottom: 14px;
  transition: border-color .15s;
}
.pay-remark:focus { border-color: var(--green); }
.pay-methods { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.pay-method {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 13px;
  cursor: pointer; transition: border-color .13s, background .13s;
}
.pay-method.sel { border-color: var(--green); background: #f4fbf7; }
.pm-ic { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.pm-ic .ic { width: 24px; height: 24px; }
.ali-glyph {
  background: #1677ff; color: #fff; border-radius: 7px;
  font-size: 15px; font-weight: 700; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.pm-name { flex: 1; font-size: 14px; }
.pm-radio {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #c9cdd4;
  transition: all .13s; flex: none; position: relative;
}
.pay-method.sel .pm-radio { border-color: var(--green); }
.pay-method.sel .pm-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--green);
}
.pay-btn {
  width: 100%; height: 46px; border-radius: 13px;
  background: var(--green); color: #fff; font-size: 15px; font-weight: 500;
  box-shadow: 0 4px 14px rgba(7, 193, 96, .28);
  transition: filter .15s, transform .06s;
}
.pay-btn:hover { filter: brightness(.97); }
.pay-btn:active { transform: scale(.98); }
.pay-btn:disabled { opacity: .6; }

/* 图片查看 */
.img-viewer {
  position: fixed; inset: 0; background: rgba(10, 10, 12, .92);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.img-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

/* ============================================================
   客服工作台 — 深色侧栏 × 蓝色主色（飞书式）
   ============================================================ */
.admin-login {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 480px at 10% -8%, rgba(77, 107, 254, .25), transparent 60%),
    radial-gradient(820px 460px at 108% 14%, rgba(52, 209, 123, .14), transparent 60%),
    linear-gradient(160deg, #1d2233, #262c42);
  padding: 20px;
}
.al-card {
  width: 100%; max-width: 350px; background: #fff;
  border-radius: 20px; padding: 36px 30px; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.al-card .logo {
  background: linear-gradient(135deg, #6a8bff, var(--blue) 60%, #3d55d8);
  box-shadow: 0 8px 20px rgba(77, 107, 254, .35);
}
.al-card h1 { font-size: 18px; margin-bottom: 20px; letter-spacing: .5px; }
.al-card input {
  width: 100%; height: 46px; border: 1px solid #e2e5e9; border-radius: 12px;
  padding: 0 15px; font-size: 15px; outline: none; margin-bottom: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.al-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77, 107, 254, .12); }
.al-btn {
  width: 100%; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #6a8bff, var(--blue));
  color: #fff; font-size: 15px; font-weight: 500;
  transition: filter .15s, transform .06s;
}
.al-btn:active { filter: brightness(.95); transform: scale(.99); }

.admin-app { height: 100dvh; display: grid; grid-template-columns: 308px 1fr; }
.room-pane { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.rp-head {
  padding: 16px 16px 13px; color: var(--ink); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); flex: none;
}
.rp-brand { display: flex; align-items: center; gap: 10px; letter-spacing: .3px; }
.rp-logo {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, #6a8bff, var(--blue));
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 3px 10px rgba(77, 107, 254, .35); flex: none;
}
.rp-logo .ic { width: 17px; height: 17px; }
.rp-head .logout { color: var(--ink-3); font-size: 12px; text-decoration: none; transition: color .15s; }
.rp-head .logout:hover { color: var(--blue); }
.head-actions { display: flex; align-items: center; gap: 10px; }
.room-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.room-item {
  display: flex; gap: 11px; padding: 13px 16px; cursor: pointer;
  align-items: center; border-left: 3px solid transparent;
  transition: background .12s;
}
.room-item:hover { background: #f5f7fb; }
.room-item.active { background: #eef3ff; border-left-color: var(--blue); }
.room-item .avatar { width: 42px; height: 42px; border-radius: 12px; box-shadow: none; }
.ri-main { flex: 1; min-width: 0; }
.ri-top { display: flex; align-items: center; gap: 6px; }
.ri-name { color: var(--ink); font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-ch { font-size: 10px; padding: 1px 6px; border-radius: 4px; flex: none; background: #eef0f3; color: #8a9099; }
.ri-ch.wx { background: #e6f9ee; color: #07b351; }
.ri-ch.qq { background: #e5f5fd; color: #0f9fd8; }
.ri-time { font-size: 11px; color: #b0b4bc; flex: none; }
.ri-bottom { display: flex; align-items: center; margin-top: 4px; gap: 8px; }
.ri-last { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-unread {
  background: #f45454; color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; flex: none;
  box-shadow: 0 2px 6px rgba(244, 84, 84, .35);
}
.room-empty { color: #b0b4bc; font-size: 13px; text-align: center; padding: 44px 0; }

.chat-pane { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.no-room { flex: 1; display: flex; align-items: center; justify-content: center; color: #a7abb3; font-size: 14px; }
.chat-area { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.btn-back {
  display: none; width: 32px; height: 32px; border-radius: 9px;
  color: #5c6470; align-items: center; justify-content: center;
  margin-left: -8px; transition: background .15s;
}
.btn-back:active { background: #e8eaee; }

@media (max-width: 760px) {
  .admin-app { grid-template-columns: 1fr; }
  .chat-pane { display: none; }
  .admin-app.show-chat .room-pane { display: none; }
  .admin-app.show-chat .chat-pane { display: flex; }
  .btn-back { display: flex; }
  .btn-back .ic { width: 24px; height: 24px; }
}

/* ============================================================
   管理后台
   ============================================================ */
.manage-app { height: 100dvh; display: grid; grid-template-columns: 236px 1fr; }
.m-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.m-nav-item {
  display: flex; align-items: center; gap: 11px;
  text-align: left; padding: 11px 14px; border-radius: 10px;
  color: var(--ink-2); font-size: 14px; transition: background .13s, color .13s;
}
.m-nav-item .ic { width: 18px; height: 18px; flex: none; color: #a0a5ae; }
.m-nav-item:hover { background: #f5f7fb; color: var(--ink); }
.m-nav-item.active { background: #eef3ff; color: var(--blue); font-weight: 500; }
.m-nav-item.active .ic { color: var(--blue); }
.m-foot { padding: 14px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.m-foot-link {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 9px;
  color: var(--ink-3); font-size: 12px; text-decoration: none;
  transition: background .13s, color .13s; cursor: pointer;
}
.m-foot-link:hover { background: #f5f7fb; color: var(--ink); }

.manage-main { overflow-y: auto; padding: 32px 36px 48px; background: #f4f5f8; }
.sec { max-width: 980px; margin: 0 auto; }
.sec-title { font-size: 20px; font-weight: 600; margin-bottom: 20px; letter-spacing: .3px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 18px; box-shadow: var(--shadow-1);
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.nav-ic { display: flex; }
.stat-num { font-size: 28px; font-weight: 700; letter-spacing: .5px; }
.stat-num.accent { color: var(--blue); }
.stat-label { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.card-block {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-1); margin-bottom: 22px; overflow: hidden;
}
.block-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 16px; font-size: 14px; font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.head-actions { display: flex; gap: 8px; }

.mbtn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 18px; border-radius: 10px;
  background: var(--blue); color: #fff; font-size: 13px; font-weight: 500;
  text-decoration: none; transition: filter .13s, transform .05s; cursor: pointer;
}
.mbtn:hover { filter: brightness(1.06); }
.mbtn:active { transform: scale(.97); }
.mbtn-danger { background: #fff0f0; color: #e5484d; }
.mbtn-danger:hover { background: #ffe4e4; }
.mbtn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px; border-radius: 9px;
  background: #f4f5f8; color: var(--ink-2); font-size: 13px;
  border: 1px solid var(--line); text-decoration: none;
  transition: background .13s, color .13s; cursor: pointer;
}
.mbtn-ghost:hover { background: #eceef2; color: var(--ink); }
.mbtn-ghost.danger { color: #e5484d; }

.room-table { padding: 4px 0; }
.rt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; cursor: pointer; transition: background .12s;
}
.rt-row:hover { background: #f8f9fb; }
.rt-row .avatar { width: 38px; height: 38px; border-radius: 11px; font-size: 15px; }
.rt-main { flex: 1; min-width: 0; }
.rt-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.rt-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-act { flex: none; height: 32px; padding: 0 13px; font-size: 12px; }
.room-table .room-empty { padding: 28px 0; }

/* 客户入口 */
.entry-block { display: flex; gap: 28px; padding: 24px; align-items: center; flex-wrap: wrap; }
.entry-qr {
  width: 180px; height: 180px; padding: 10px; flex: none;
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
}
.entry-qr img { width: 100%; height: 100%; border-radius: 10px; display: block; }
.entry-info { flex: 1; min-width: 260px; }
.entry-label { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.entry-url {
  font-size: 16px; font-weight: 600; letter-spacing: .3px;
  background: #f4f5f8; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px; word-break: break-all;
}
.entry-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.entry-tip { font-size: 12px; color: #b0b4bc; margin-top: 14px; line-height: 1.6; }

/* 设置表单 */
.form-block { padding: 22px 24px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 0 0 8px; }
.form-label:first-child { margin-top: 0; }
.form-input {
  width: 100%; max-width: 460px; height: 42px; border: 1px solid #e2e5e9;
  border-radius: 10px; padding: 0 14px; font-size: 14px; outline: none;
  margin: 0 0 18px; transition: border-color .15s, box-shadow .15s;
  display: block;
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77, 107, 254, .12); }
#btnSave { height: 40px; padding: 0 26px; }
.form-textarea {
  width: 100%; max-width: 460px; border: 1px solid #e2e5e9;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; outline: none;
  margin: 0 0 14px; transition: border-color .15s, box-shadow .15s;
  display: block; font-family: var(--font); resize: vertical; line-height: 1.7;
}
.form-textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77, 107, 254, .12); }
.domain-status { display: flex; flex-direction: column; gap: 8px; }
.ds-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f8f9fb; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.ds-name { font-size: 13px; color: var(--ink); }
.ds-badge { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; }
.ds-empty { font-size: 12px; color: #b0b4bc; text-align: center; padding: 8px 0; }

/* 会话查看弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(23, 24, 26, .5);
  backdrop-filter: blur(3px); z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  width: 100%; max-width: 620px; max-height: 84dvh;
  background: #fff; border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line); flex: none;
  font-size: 14px; font-weight: 600;
}
.viewer-list { flex: 1; background: var(--bg); }

@media (max-width: 700px) {
  .manage-app { grid-template-columns: 1fr; }
  .room-pane { display: none; }
  .manage-main { padding: 20px 16px 40px; }
  .manage-app .room-pane { display: none; }
}

