/* ═══════════════════════════════════════════════════════════
   客服聊天系统 · 样式（客户页 / 客服后台共用）
   ═══════════════════════════════════════════════════════════ */

:root {
  --brand-1: #2a6ae0;
  --brand-2: #6d5bea;
  --bubble-user: #2b7cff;
  --bg: #f1f3f7;
  --line: #e6e9ef;
  --text: #1f2329;
  --text-2: #6b7280;
  --text-3: #9aa1ad;
  --admin-tag: #2b7cff;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 30, 60, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior: none;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
textarea, input { font-family: inherit; }

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 780px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ───────────── 顶部渐变头 ───────────── */
.head {
  flex: none;
  background: linear-gradient(120deg, #2f6fe4 0%, #3b62e6 45%, #7a52ec 100%);
  padding: 16px 18px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.head::after {
  content: "";
  position: absolute;
  right: -60px; top: -70px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.head .avatar-big {
  width: 66px; height: 66px;
  flex: none;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .16);
  position: relative;
  z-index: 1;
}

.head .avatar-big svg { width: 100%; height: 100%; border-radius: 50%; display: block; }

.head-info { min-width: 0; position: relative; z-index: 1; }

.head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.head-title h1 {
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  letter-spacing: .3px;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .18);
  color: #eafff1;
  border: 1px solid rgba(255, 255, 255, .25);
  white-space: nowrap;
}

.online-pill i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #43e97b;
  box-shadow: 0 0 0 3px rgba(67, 233, 123, .22);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.head-sub {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .88);
  letter-spacing: .2px;
}

/* ───────────── 公告条 ───────────── */
.notice {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f4;
  font-size: 13.5px;
  color: #3a3f47;
}

.notice .horn { flex: none; color: var(--brand-1); display: flex; }
.notice .horn svg { width: 18px; height: 18px; }

.notice-scroll {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}

.notice-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
}

.notice-item {
  display: inline-block;
  white-space: nowrap;
}

@keyframes noticeMove {
  from { transform: translateX(var(--bx, 100%)); }
  to   { transform: translateX(calc(-1 * var(--mw, 100%))); }
}

.notice-tag {
  flex: none;
  font-size: 11.5px;
  color: #fff;
  background: #4b8bf5;
  border-radius: 4px;
  padding: 1px 6px;
  line-height: 1.6;
}

.notice-close {
  flex: none;
  color: #b6bcc6;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
}

/* ───────────── 消息区 ───────────── */
.chat {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 14px 8px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.chat::-webkit-scrollbar { width: 5px; }
.chat::-webkit-scrollbar-thumb { background: #d5dae3; border-radius: 3px; }

.sys-tip {
  text-align: center;
  margin: 4px 0 16px;
}

.sys-tip span {
  display: inline-block;
  background: rgba(255, 255, 255, .92);
  color: #6a7280;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 20px;
  box-shadow: 0 1px 4px rgba(30, 40, 70, .05);
}

/* 客服名片 */
.cs-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  margin: 0 auto 20px;
  padding: 34px 18px 16px;
  width: 88%;
  text-align: center;
  box-shadow: 0 4px 18px rgba(30, 45, 80, .07);
}

.cs-card .card-avatar {
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(40, 70, 140, .16);
}

.cs-card .card-avatar svg { width: 100%; height: 100%; border-radius: 50%; display: block; }

.cs-card h2 {
  margin: 6px 0 4px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .3px;
}

.cs-card p {
  margin: 0;
  color: var(--brand-1);
  font-size: 13px;
}

/* 消息行 */
.msg {
  display: flex;
  gap: 9px;
  margin-bottom: 14px;
  align-items: flex-start;
  animation: fadeUp .22s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.msg .avatar {
  width: 38px; height: 38px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 5px rgba(30, 40, 70, .12);
}

.msg .avatar svg { width: 100%; height: 100%; display: block; }

.msg-body { max-width: min(76%, 560px); min-width: 0; }

.msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--text-3);
  flex-wrap: wrap;
}

.tag-official {
  background: var(--admin-tag);
  color: #fff;
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.6;
}

.msg-meta .who { color: #6a7280; font-size: 12.5px; }
.msg-meta .time { color: #a9b0bb; }

.bubble {
  display: inline-block;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 15.5px;
  line-height: 1.62;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: var(--shadow);
  background: #fff;
  border-top-left-radius: 4px;
}

.msg.user {
  flex-direction: row-reverse;
}

.msg.user .msg-body { text-align: right; }
.msg.user .msg-meta { justify-content: flex-end; }

.msg.user .bubble {
  background: var(--bubble-user);
  color: #fff;
  border-top-left-radius: 12px;
  border-top-right-radius: 4px;
  text-align: left;
  box-shadow: 0 3px 12px rgba(43, 124, 255, .22);
}

.bubble.img {
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}

.bubble.img img {
  display: block;
  max-width: 220px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(20, 30, 60, .1);
}

.sending { opacity: .55; }

/* ───────────── 输入区 ───────────── */
.composer {
  flex: none;
  background: #fff;
  border-top: 1px solid #eceef3;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  position: relative;
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.input-wrap {
  flex: 1;
  background: #f2f4f8;
  border-radius: 12px;
  padding: 10px 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.input-wrap textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  font-size: 15px;
  line-height: 1.45;
  max-height: 110px;
  color: var(--text);
  padding: 0;
}

.input-wrap textarea::placeholder { color: #a6adba; }

.icon-btn {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b93a1;
  background: #f2f4f8;
  transition: background .15s, color .15s;
}

.icon-btn:active { background: #e6eaf1; }
.icon-btn svg { width: 21px; height: 21px; }

.send-btn {
  flex: none;
  height: 40px;
  padding: 0 18px;
  border-radius: 20px;
  background: #ccd9f2;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background .18s, transform .1s;
  white-space: nowrap;
}

.send-btn.on { background: var(--bubble-user); box-shadow: 0 4px 12px rgba(43, 124, 255, .3); }
.send-btn:active { transform: scale(.96); }

/* 客户页：输入框 + 工具条两行（照原图） */
.composer.stacked .input-wrap.big {
  border-radius: 12px;
  padding: 13px 15px;
  min-height: 64px;
  align-items: flex-start;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.composer-tools .send-btn {
  margin-left: auto;
  min-width: 92px;
}

/* 表情面板 */
.emoji-panel {
  position: absolute;
  left: 10px; right: 10px; bottom: 100%;
  background: #fff;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -6px 24px rgba(30, 40, 70, .1);
  padding: 10px;
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 4px;
  max-height: 190px;
  overflow-y: auto;
  z-index: 20;
}

.emoji-panel.show { display: grid; }

.emoji-panel button {
  font-size: 21px;
  line-height: 1;
  padding: 6px 0;
  border-radius: 8px;
}

.emoji-panel button:active { background: #eef2f9; }

/* 图片预览大图 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99;
  padding: 20px;
}

.lightbox.show { display: flex; }
.lightbox img { max-width: 95%; max-height: 92%; border-radius: 6px; }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 10px);
  background: rgba(20, 24, 34, .86);
  color: #fff;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 120;
  max-width: 80vw;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ═══════════════════════════════════════════════════════════
   客服工作台
   ═══════════════════════════════════════════════════════════ */

body.admin { background: #eef1f6; }

.wrap {
  display: flex;
  height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  background: #fff;
  overflow: hidden;
}

/* 左侧会话列表 */
.side {
  width: 300px;
  flex: none;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: #fff;
}

.side-head {
  flex: none;
  padding: 14px 16px;
  background: linear-gradient(120deg, #2f6fe4, #6d5bea);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.side-head h1 { font-size: 15.5px; margin: 0; font-weight: 700; }

.side-head .badge {
  background: rgba(255, 255, 255, .22);
  border-radius: 20px;
  font-size: 12px;
  padding: 2px 9px;
}

.side-tools {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f2f6;
}

.side-tools input {
  flex: 1;
  border: 1px solid #e2e6ee;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
  background: #f8f9fc;
}

.side-tools input:focus { border-color: #9dbcf5; background: #fff; }

.side-list { flex: 1; overflow-y: auto; }

.conv {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f2f4f8;
  cursor: pointer;
  transition: background .12s;
}

.conv:hover { background: #f7f9fd; }
.conv.active { background: #eef4ff; }

.conv .avatar {
  width: 38px; height: 38px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: #eef1f7;
}

.conv .avatar svg { width: 100%; height: 100%; display: block; }

.conv-main { flex: 1; min-width: 0; }

.conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.conv-name {
  font-size: 14px;
  font-weight: 600;
  color: #23272f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-time { font-size: 11.5px; color: #a9b0bb; flex: none; }

.conv-last {
  font-size: 12.5px;
  color: #8b93a1;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-dot {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff4d4f;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

/* 右侧聊天 */
.mainpane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.pane-head {
  flex: none;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.pane-head .title { font-weight: 600; font-size: 15px; }
.pane-head .meta { font-size: 12px; color: #98a0ad; }
.pane-head .spacer { flex: 1; }

.pane-back {
  display: none;
  width: 30px; height: 30px;
  align-items: center;
  justify-content: center;
  color: #4b5563;
}

.empty-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #a3aab6;
  gap: 12px;
  font-size: 14px;
}

.empty-pane svg { width: 64px; height: 64px; opacity: .5; }

/* 登录 */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(130deg, #eef3ff, #f6f0ff);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 44px rgba(35, 55, 100, .12);
  padding: 28px 24px;
}

.login-card h1 {
  font-size: 19px;
  margin: 0 0 6px;
  text-align: center;
}

.login-card p { text-align: center; color: #98a0ad; font-size: 13px; margin: 0 0 20px; }

.login-card input {
  width: 100%;
  border: 1px solid #e3e7ef;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  background: #f8f9fc;
  margin-bottom: 12px;
}

.login-card input:focus { border-color: #8fb4f7; background: #fff; }

.login-card button {
  width: 100%;
  background: linear-gradient(120deg, #2f6fe4, #6d5bea);
  color: #fff;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
}

.login-err { color: #ff4d4f; font-size: 13px; text-align: center; height: 18px; }

/* 响应式：手机端后台 */
@media (max-width: 720px) {
  .side { width: 100%; border-right: none; }
  .mainpane { display: none; }
  .wrap.chatting .side { display: none; }
  .wrap.chatting .mainpane { display: flex; }
  .pane-back { display: flex; }
  .msg-body { max-width: 80%; }
}

/* 手机端：底部按钮收窄，给输入框留位置 */
@media (max-width: 640px) {
  .composer .send-btn {
    min-width: 66px;
    padding: 0 14px;
  }
  .composer .icon-btn {
    width: 38px;
    height: 38px;
    flex: none;
  }
}

/* 自定义头像图片 */
.avatar-big img,
.card-avatar img,
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

/* ───────── 2026-12-03 新增：删除消息 / 显示客户 IP ───────── */

/* 会话列表里的客户 IP */
.conv-ip {
  font-size: 11px;
  line-height: 1.5;
  color: #98a2b3;
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 单条消息的删除按钮（只在后台出现，客户页没有） */
.msg-del {
  flex: none;
  align-self: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 30, 50, .06);
  color: #8b93a1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity .15s, background .15s, color .15s;
}
.msg-del svg { width: 13px; height: 13px; }
.msg:hover .msg-del { opacity: 1; }
.msg-del:hover { background: #ffe8e8; color: #e5484d; }
.msg-del:active { background: #ffdcdc; }

/* 触屏设备没有 hover，按钮常显但淡一些 */
@media (hover: none) {
  .msg-del { opacity: .55; }
}

/* 后台头部删除会话按钮 */
.icon-btn.danger { color: #e5484d; }
.icon-btn.danger:hover { background: #ffecec; }

/* ================= 引用回复 / 长按菜单 ================= */
.quote {
  display: inline-block;
  max-width: min(72vw, 320px);
  text-align: left;
  background: rgba(47, 111, 228, .07);
  border-left: 3px solid rgba(47, 111, 228, .45);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #5b636f;
  overflow: hidden;
  cursor: pointer;
  vertical-align: bottom;
}
.quote-who { font-size: 12px; font-weight: 600; color: var(--brand-1); margin-bottom: 1px; }
.quote-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  opacity: .85;
}
.msg.user .quote {
  background: rgba(255, 255, 255, .2);
  border-left-color: rgba(255, 255, 255, .75);
  color: #fff;
}
.msg.user .quote-who { color: #fff; }

.msg.flash .bubble { animation: flashBubble 1.1s ease; }
@keyframes flashBubble {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 200, 0, 0); }
  35% { box-shadow: 0 0 0 4px rgba(255, 200, 0, .55); }
}

/* 输入区上方的引用条 */
.reply-bar {
  display: none;
  align-items: center;
  gap: 8px;
  background: #f4f6fa;
  border: 1px solid #e6eaf2;
  border-radius: 10px;
  padding: 7px 8px 7px 11px;
  margin-bottom: 8px;
}
.reply-bar.show { display: flex; }
.reply-bar-main { flex: 1; min-width: 0; }
.reply-bar-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--brand-1); margin-bottom: 1px; }
.reply-bar-text {
  display: block;
  font-size: 12.5px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-bar-x {
  flex: none;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: #9aa3b0;
  font-size: 20px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
}
.reply-bar-x:hover { background: #e8ecf3; color: #5b636f; }

/* 长按 / 右键 弹出菜单 */
.msg-menu {
  position: fixed;
  z-index: 900;
  display: none;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(20, 30, 60, .18);
  padding: 4px;
  min-width: 128px;
}
.msg-menu.show { display: block; animation: menuIn .12s ease; }
@keyframes menuIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
.msg-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: none;
  background: none;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #38404d;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
}
.msg-menu button:hover,
.msg-menu button:active { background: #f1f4f9; }
.msg-menu button svg { width: 15px; height: 15px; color: var(--brand-1); flex: none; }

/* ───────────── 设置面板（弹窗式）───────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18, 24, 36, .45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal.show { display: flex; }
.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(15, 25, 50, .22);
  animation: sheetUp .22s cubic-bezier(.2, .8, .3, 1);
  overflow: hidden;
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: .6; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.modal-x {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f2f4f8;
  color: #5a6472;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.modal-x:active { background: #e6eaf1; }
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px 18px 14px;
}
.modal-foot {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #fff;
}
.btn-primary, .btn-ghost {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: linear-gradient(120deg, #2f6fe4, #6d5bea); color: #fff; }
.btn-primary:active { filter: brightness(.94); }
.btn-ghost { background: #f2f4f8; color: #4a5464; }
.btn-ghost:active { background: #e6eaf1; }

/* 开关行 */
.sw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f2f4f8;
  cursor: pointer;
}
.sw-row > span {
  flex: 1 1 auto;
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.45;
}
.sw-row em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}
.sw-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 46px;
  height: 28px;
  border-radius: 99px;
  background: #d5dae3;
  position: relative;
  cursor: pointer;
  transition: background .18s ease;
  margin: 0;
  outline: none;
}
.sw-row input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .18s ease;
}
.sw-row input[type="checkbox"]:checked { background: #2b7cff; }
.sw-row input[type="checkbox"]:checked::after { transform: translateX(18px); }

/* 输入字段 */
.fld { padding: 14px 0; border-bottom: 1px solid #f2f4f8; }
.fld > label {
  display: block;
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 8px;
  line-height: 1.5;
}
.fld textarea, .fld input[type="number"], .fld input[type="text"] {
  width: 100%;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text);
  background: #fafbfd;
  outline: none;
  resize: vertical;
  transition: border-color .15s ease, background .15s ease;
}
.fld textarea:focus, .fld input:focus { border-color: var(--brand-1); background: #fff; }

@media (min-width: 641px) {
  .modal { align-items: center; padding: 24px; }
  .modal-card { border-radius: 18px; max-height: 82vh; }
  .modal-foot { border-radius: 0 0 18px 18px; }
}
