:root {
  --brand: #b0584a;
  --brand-dark: #9c4a3c;
  --brand-soft: #fbedea;
  --ink: #1a1a1a;
  --text: #333;
  --text-2: #666;
  --text-3: #999;
  --line: #efe3df;
  --bg: #faf7f6;
  --surface: #fff;
  --danger: #fa5151;
  --warning: #ff8f1f;
  --info: #2d7ff9;
  --radius: 12px;
  --sidebar: #2a211e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ------------------------------------------------ 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6e2f26 0%, #b0584a 100%);
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; color: var(--ink); }
.login-card p.sub { margin: 0 0 24px; color: var(--text-3); font-size: 13px; }
.login-card .field { margin-bottom: 16px; }
.login-card input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--brand); }
.btn-login {
  width: 100%; height: 44px; border: none; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-login:hover { background: var(--brand-dark); }
.login-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 10px; text-align: center; }
.login-tip { margin-top: 18px; text-align: center; color: var(--text-3); font-size: 12px; }

/* ------------------------------------------------ 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex: 0 0 208px; background: var(--sidebar); color: #c9cdd4;
  display: flex; flex-direction: column;
}
.logo {
  height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 20px;
  font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08);
}
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.nav { padding: 12px 0; flex: 1; }
.nav-item {
  padding: 11px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  font-size: 14px; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: rgba(176,88,74,.22); color: #fff; border-left-color: var(--brand); }
.nav-item .ico { width: 18px; text-align: center; }
.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.sidebar-footer .logout { color: #8b9199; cursor: pointer; }
.sidebar-footer .logout:hover { color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar h2 { margin: 0; font-size: 17px; color: var(--ink); }
.topbar .me { color: var(--text-2); font-size: 13px; }
.content { padding: 20px 24px 40px; overflow-x: hidden; }

/* ------------------------------------------------ 组件 */
.card { background: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); }
.card h3 { margin: 0 0 14px; font-size: 15px; color: var(--ink); display: flex; align-items: center; justify-content: space-between; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.stat .label { color: var(--text-3); font-size: 12px; margin-bottom: 8px; }
.stat .value { font-size: 24px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-figures; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat .extra { font-size: 12px; color: var(--text-3); margin-top: 6px; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.quick {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer;
  background: #fff; text-align: center; transition: .15s;
}
.quick:hover { border-color: var(--brand); background: var(--brand-soft); }
.quick .q-ico { font-size: 22px; margin-bottom: 6px; }
.quick .q-name { font-size: 13px; color: var(--ink); font-weight: 600; }
.quick .q-desc { font-size: 11px; color: var(--text-3); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--text-3); font-weight: 500; background: #fafbfc; font-size: 12px; }
td { color: var(--text); }
tr:hover td { background: #fafbfc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-figures; }

.btn {
  height: 32px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; font-size: 13px;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: #ffd7d7; }
.btn-danger:hover { background: #fff1f1; border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }

input[type=text], input[type=number], input[type=password], select, textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; outline: none; background: #fff; color: var(--text); font-family: inherit;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }

.upload-row { display: flex; gap: 8px; align-items: center; }
.upload-row input { flex: 1; }
.upload-row .btn { flex-shrink: 0; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; line-height: 18px; }
.tag-green { background: var(--brand-soft); color: var(--brand-dark); }
.tag-red { background: #ffefef; color: var(--danger); }
.tag-grey { background: #f2f3f5; color: var(--text-3); }
.tag-blue { background: #eaf2ff; color: var(--info); }
.tag-orange { background: #fff4e6; color: var(--warning); }
.tag-pink { background: #fff0f6; color: #e0457b; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 13px; }
.detail-grid b { display: block; color: var(--text-3); font-weight: 500; font-size: 12px; margin-bottom: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 9px 16px; cursor: pointer; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* 基础设置：左侧垂直菜单 + 右侧内容 */
.settings-layout { display: flex; gap: 18px; align-items: flex-start; }
.settings-menu {
  width: 164px; flex-shrink: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 8px; position: sticky; top: 20px;
}
.menu-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
  color: var(--text-2); margin-bottom: 2px; transition: background .15s, color .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.menu-item:hover { background: #f5f6f7; color: var(--text); }
.menu-item.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.settings-body { flex: 1; min-width: 0; }

/* 卡片头：标题 + 右侧操作按钮 */
.card-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-hd h3 { margin: 0; font-size: 14px; color: var(--ink); }

/* 头衔胶囊 */
.title-chip {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
}
.title-female { background: linear-gradient(90deg, #ff8fb1, #ff5a8a); color: #fff; }
.title-male   { background: linear-gradient(90deg, #d4af37, #b8860b); color: #fff; }

/* 等级徽章 / 图标 / 胶囊 */
.level-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #f0f2f5; color: var(--text-2); font-size: 11px; font-weight: 600; }
.level-icon { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; vertical-align: middle; background: #f5f6f7; }
.level-icon-sm { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; vertical-align: -3px; margin-right: 4px; }
.level-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; background: linear-gradient(90deg, #6e8efb, #a777e3); color: #fff; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.muted { color: var(--text-3); font-size: 12px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar { width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-label { font-size: 11px; color: var(--text-3); }
.bar-val { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-figures; }

/* ------------------------------------------------ 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
  align-items: center; justify-content: center; z-index: 100;
}
.modal {
  width: 520px; max-width: 92vw; max-height: 86vh; overflow: auto; background: #fff;
  border-radius: 14px; padding: 22px;
}
.modal h3 { margin: 0 0 16px; font-size: 16px; color: var(--ink); }
.modal .fields { display: flex; flex-direction: column; gap: 12px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
/* 分组表单分段 */
.form-section {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fafbfc;
  border: 1px solid #e8eaed;
  border-radius: 6px;
}
.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #5b6573;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.form-section .grid2 {
  margin-top: 0;
}
.form-section-partner {
  background: #f0f5ff;
  border-color: #d6e4ff;
}
.form-section-partner .form-section-title {
  color: #2c5fc7;
}
.form-section-partner .f-hint {
  color: #5b7bb8;
}

/* 单字段加标题/提示的版式 */
label.f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}
label.f .f-label {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}
label.f .f-hint {
  font-size: 11px;
  color: #999;
  line-height: 1.4;
  margin-top: 2px;
}

/* 分组弹窗加宽 */
.modal:has(.form-section) {
  width: 560px;
  max-width: 92vw;
}


.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 13px; z-index: 200;
}
.empty { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; }
.lineclamp { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- v40.24.205 代聊坐席工作台（/agent） ---------------- */
.agent-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2E7BFF, #1F2430); }
.agent-login-box { width: 360px; background: #fff; border-radius: 14px; padding: 30px 28px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.agent-login-box .brand { font-size: 22px; font-weight: 700; color: #1F2430; }
.agent-login-box .sub { font-size: 13px; color: #8A8A8A; margin: 4px 0 18px; }
.agent-login-box input { width: 100%; height: 38px; margin-bottom: 10px; border: 1px solid #E8EAED; border-radius: 6px; padding: 0 10px; font-size: 13px; box-sizing: border-box; }
.agent-login-box .err { color: #E23B3B; font-size: 12px; min-height: 18px; }
.agent-login-box .tip { margin-top: 14px; font-size: 11px; color: #B26A00; background: #FFF8E8; border-radius: 6px; padding: 8px; }

.agbtn { height: 34px; padding: 0 16px; border-radius: 6px; border: 1px solid #E8EAED; background: #fff; font-size: 13px; cursor: pointer; }
.agbtn.primary { background: #2E7BFF; border-color: #2E7BFF; color: #fff; }
.agbtn.ghost { background: #F2F4F7; }
.agbtn.sm { height: 28px; padding: 0 12px; font-size: 12px; }
.agbtn:disabled { opacity: .5; cursor: not-allowed; }

.ag-wrap { height: 100vh; display: flex; flex-direction: column; background: #F2F4F7; }
.ag-top { height: 56px; background: #2E7BFF; color: #fff; display: flex; align-items: center; padding: 0 20px; flex: none; }
.ag-top .ag-brand { font-size: 16px; font-weight: 700; }
.ag-top-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.ag-top-r .muted { color: rgba(255,255,255,.85); }
.ag-body { flex: 1; display: flex; min-height: 0; }
.ag-left { width: 300px; background: #fff; border-right: 1px solid #E8EAED; display: flex; flex-direction: column; flex: none; }
.ag-search { padding: 12px; }
.ag-search input { width: 100%; height: 34px; border: 1px solid #E8EAED; border-radius: 17px; padding: 0 12px; font-size: 13px; box-sizing: border-box; background: #F5F6F8; }
.ag-glist { flex: 1; overflow: auto; }
.ag-girl { display: flex; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #F0F1F3; align-items: center; }
.ag-girl:hover { background: #F7F9FC; }
.ag-girl.sel { background: #EAF2FF; }
.ag-girl.locked { background: #FAFAFB; }
.ag-girl .av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #E8EAED; flex: none; }
.ag-girl .info { flex: 1; min-width: 0; }
.ag-girl .n { font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.ag-girl .lk { font-size: 11px; color: #B26A00; background: #FFF3E0; border-radius: 3px; padding: 1px 5px; }
.ag-girl .p { font-size: 11.5px; color: #8A8A8A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.ag-girl .rr { text-align: right; }
.ag-girl .t { font-size: 10.5px; color: #B9B9B9; }
.ag-girl .rd { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: #FF3B30; color: #fff; font-size: 11px; padding: 0 5px; margin-top: 4px; text-align: center; }

.ag-mid { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #fff; border-right: 1px solid #E8EAED; }
.ag-right { width: 320px; background: #fff; overflow: auto; padding: 14px; flex: none; }
.ag-empty { padding: 40px; text-align: center; color: #B9B9B9; font-size: 13px; }
.ag-chat-head { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid #E8EAED; flex: none; }
.ag-chat-head .av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #E8EAED; }
.ag-chat-head .n { font-size: 14px; font-weight: 600; }
.ag-convlist { flex: 1; overflow: auto; }
.ag-conv { display: flex; gap: 10px; align-items: center; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #F0F1F3; }
.ag-conv:hover { background: #F7F9FC; }
.ag-conv.sel { background: #EAF2FF; }
.ag-conv .av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #E8EAED; }
.ag-conv .info { flex: 1; min-width: 0; }
.ag-conv .n { font-size: 13px; font-weight: 600; }
.ag-conv .p { font-size: 11.5px; color: #8A8A8A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-conv .rd { min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: #FF3B30; color: #fff; font-size: 11px; padding: 0 5px; text-align: center; }
.ag-lockbar { background: #FFF3E0; color: #B26A00; font-size: 12px; padding: 10px 16px; border-bottom: 1px solid #F5E2C0; flex: none; }
.ag-msgs { flex: 1; overflow: auto; padding: 16px; background: #FAFBFC; }
.ag-msg { margin-bottom: 14px; display: flex; flex-direction: column; align-items: flex-start; }
.ag-msg.mine { align-items: flex-end; }
.ag-msg .bub { max-width: 60%; background: #fff; border: 1px solid #E8EAED; border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.5; word-break: break-all; }
.ag-msg.mine .bub { background: #2E7BFF; border-color: #2E7BFF; color: #fff; }
.ag-msg .meta { font-size: 10.5px; color: #B9B9B9; margin-top: 3px; }
.ag-input { border-top: 1px solid #E8EAED; padding: 10px 16px; flex: none; }
.ag-input textarea { width: 100%; height: 56px; border: 1px solid #E8EAED; border-radius: 8px; padding: 10px; font-size: 13px; resize: none; box-sizing: border-box; background: #F7F8FA; }
.ag-input-b { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ag-card { background: #fff; border: 1px solid #E8EAED; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.ag-h { font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.ag-stats { display: flex; gap: 8px; margin-bottom: 12px; }
.ag-stats > div { flex: 1; background: #F7F9FC; border-radius: 8px; padding: 10px; text-align: center; }
.ag-stats b { display: block; font-size: 15px; }
.ag-stats span { font-size: 10.5px; color: #8A8A8A; }
.ag-ops { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ag-op { height: 44px; border: 1px solid #E8EAED; background: #F7F9FC; border-radius: 8px; font-size: 12px; cursor: pointer; }
.ag-op:hover { border-color: #2E7BFF; }
input[type=datetime-local] { height: 34px; border: 1px solid #E8EAED; border-radius: 6px; padding: 0 8px; font-size: 13px; }

/* ----------------------------------------------------------------
   代聊工作台 · 手机版（≤820px）
   单栏导航：女生列表 → 会话列表 → 聊天窗（＋女生详情）
   ---------------------------------------------------------------- */
.ag-mob-only { display: none; }
.ag-mob-back { display: none; }

@media (max-width: 820px) {
  /* 高度用 dvh，避开 iOS Safari 地址栏伸缩导致的底部输入区被吃掉 */
  .ag-wrap { height: 100vh; height: 100dvh; }

  /* 顶栏适配刘海 / 状态栏 */
  .ag-top {
    height: auto; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; gap: 8px;
  }
  .ag-top .ag-brand { font-size: 15px; }
  .ag-top-r { gap: 10px; }
  .ag-top-r .muted {
    font-size: 12px; max-width: 96px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* 一次只显示一屏，靠 .ag-wrap[data-view] 切换 */
  .ag-body { display: block; position: relative; }
  .ag-body > .ag-left,
  .ag-body > .ag-mid,
  .ag-body > .ag-right { display: none; width: 100%; height: 100%; }
  .ag-wrap[data-view="girls"] .ag-left { display: flex; }
  .ag-wrap[data-view="convs"] .ag-mid,
  .ag-wrap[data-view="chat"]  .ag-mid  { display: flex; }
  .ag-wrap[data-view="info"]  .ag-right { display: block; overflow: auto; -webkit-overflow-scrolling: touch; }

  /* 搜索行：输入框 + 只看未读 */
  .ag-search { display: flex; gap: 8px; align-items: center; padding: 10px 12px; }
  .ag-search input { flex: 1; height: 38px; font-size: 16px; border-radius: 19px; }
  #agUnreadOnly { flex: none; height: 34px; padding: 0 12px; }
  #agUnreadOnly.on { background: #2E7BFF; border-color: #2E7BFF; color: #fff; }

  /* 手指友好：行高和头像都加大 */
  .ag-girl { padding: 12px; gap: 12px; }
  .ag-conv { padding: 12px; gap: 12px; }
  .ag-girl .av, .ag-conv .av { width: 44px; height: 44px; }
  .ag-girl .n, .ag-conv .n { font-size: 14.5px; }
  .ag-girl .p, .ag-conv .p { font-size: 12px; max-width: none; }
  .ag-girl .rd, .ag-conv .rd { min-width: 20px; height: 20px; line-height: 20px; font-size: 12px; }

  /* 会话 / 聊天头部在手机上要放得下返回按钮 */
  .ag-chat-head {
    height: auto; min-height: 56px; padding: 8px 12px; gap: 8px; flex-wrap: wrap;
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  .ag-chat-head .n { font-size: 13.5px; }
  .ag-chat-head .agbtn { flex: none; height: 34px; padding: 0 14px; font-size: 13px; }

  .ag-msgs { padding: 12px; }
  .ag-msg .bub { max-width: 80%; font-size: 15px; padding: 10px 12px; }
  .ag-msg .meta { font-size: 11px; }

  /* 输入区贴底 + 避让 iPhone 底部黑条；字号 16px 防 iOS 聚焦自动放大 */
  .ag-input { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: #fff; }
  .ag-input textarea { height: 46px; font-size: 16px; }
  .ag-input-b { gap: 10px; margin-top: 6px; }
  .ag-input-b .agbtn { height: 40px; padding: 0 22px; font-size: 14px; }

  /* 只在手机出现的控件 */
  .ag-mob-only { display: inline-flex !important; align-items: center; justify-content: center; }
  .ag-mob-back {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; color: #2E7BFF; padding: 6px 2px 12px; cursor: pointer;
  }
  .ag-right .ag-card { margin-bottom: 10px; }
  .ag-op { height: 48px; font-size: 13px; }
  .ag-empty { padding: 32px 16px; }

  /* 弹窗：手机上从底部升起，可整屏滚动 */
  .mask { align-items: flex-end; }
  .modal {
    width: 100%; max-width: 100%; max-height: 88vh;
    border-radius: 14px 14px 0 0; padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  }
  .modal h3 { font-size: 15px; }
  .modal input, .modal select { font-size: 16px !important; height: 42px !important; }
  .modal .btn, .modal .btn-sm { height: 42px; padding: 0 18px; font-size: 14px; }
  .modal table { font-size: 12px; }
}

/* 登录页手机适配 */
@media (max-width: 820px) {
  .agent-login { min-height: 100vh; min-height: 100dvh; padding: 20px; align-items: flex-start; padding-top: 12vh; }
  .agent-login-box { width: 100%; max-width: 360px; padding: 24px 20px; }
  .agent-login-box input { height: 46px; font-size: 16px; margin-bottom: 12px; }
  .agent-login-box .brand { font-size: 20px; }
  .agent-login-box .agbtn { height: 46px; font-size: 16px; width: 100%; }
}
