/* 广东天使医疗集团 · 提成数据管理系统 - 全局样式 */
:root {
  --primary: #14b8a6;
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-200: #99f6e4;
  --primary-500: #14b8a6;
  --primary-600: #0d9488;
  --primary-700: #0f766e;
  --accent: #5eead4;
  --bg: #f0fdfa;
  --card: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-disabled: #cbd5e1;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --purple: #a855f7;
  --orange: #f97316;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.1), 0 2px 4px -1px rgba(15,23,42,0.06);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
img { max-width: 100%; }

/* 顶部导航栏 */
.app-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header .logo { display: flex; align-items: center; gap: 10px; }
.app-header .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.app-header .logo-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.app-header .logo-text { font-size: 16px; font-weight: 600; }
.app-header .logo-sub { font-size: 12px; color: var(--text-secondary); }
.app-header .user { display: flex; align-items: center; gap: 14px; }
.app-header .user-name { color: var(--text-secondary); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.app-header .user-name .un-role { white-space: nowrap; }
.app-header .user-name::before { content: "👤"; }
.app-header .btn-logout { color: var(--text-secondary); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.app-header .btn-logout::before { content: "⏻"; }
.app-header .btn-menu { color: var(--text-secondary); padding: 6px 10px; border-radius: 6px; }
.app-header .btn-menu:hover { background: var(--bg); }
/* 返回上一页按钮 */
.app-header .btn-back {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: white; color: var(--text);
  font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.app-header .btn-back:hover { background: var(--primary-50); border-color: var(--primary); color: var(--primary-700); }

/* 侧边栏抽屉 */
.drawer { position: fixed; top: 0; left: 0; height: 100vh; width: 240px; background: white; box-shadow: var(--shadow-md); z-index: 200; transform: translateX(-100%); transition: transform .2s; padding: 20px 0; overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer .drawer-close { position: absolute; top: 8px; right: 8px; color: var(--text-secondary); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 16px; border: none; background: none; }
.drawer .drawer-link { display: flex; align-items: center; padding: 10px 20px; color: var(--text); font-size: 14px; }
.drawer .drawer-link:hover, .drawer .drawer-link.active { background: var(--primary-50); color: var(--primary-700); }
.drawer .drawer-link .ico { margin-right: 10px; font-size: 16px; }
/* 抽屉顶部显示当前登录人：手机上头部放不下角色标签，收到这里显示 */
.drawer .drawer-user { padding: 4px 20px 12px; font-size: 12px; color: var(--text-secondary); border-bottom: 1px solid var(--border-light); margin-bottom: 8px; word-break: break-all; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 150; display: none; }
.drawer-overlay.open { display: block; }

/* 主容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.container-sm { max-width: 480px; }

/* 欢迎 Banner */
.banner {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-500));
  color: white;
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.banner .banner-left { display: flex; align-items: center; gap: 16px; }
.banner .logo-circle {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.banner .logo-circle img { width: 100%; height: 100%; object-fit: contain; display: block; }
.banner h1 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.banner p { opacity: 0.85; font-size: 13px; }
.banner .banner-status { font-size: 12px; opacity: 0.7; margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.banner .banner-status::before { content: "●"; color: var(--accent); }
.banner .btn-fill {
  background: var(--accent);
  color: var(--primary-700);
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.banner .btn-fill::before { content: "+"; font-size: 18px; line-height: 1; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--border-light);
  transition: all .15s;
  position: relative;
}
.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.stat-card .ico {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  margin-bottom: 8px;
}
.stat-card.primary .ico { background: var(--primary); }
.stat-card.warning .ico { background: var(--orange); }
.stat-card.danger .ico { background: var(--danger); }
.stat-card.info .ico { background: var(--info); }
.stat-card.purple .ico { background: var(--purple); }
.stat-card.success .ico { background: var(--success); }
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--text); }
.stat-card .label { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.stat-card .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--danger);
  color: white;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
}

/* 通用卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-light); }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head .actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 16px 18px; }

/* 按钮 */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-600); }
.btn-outline { background: white; color: var(--text-secondary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline.active { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-200); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 表单 */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 120px; flex: 1; }
.field label { font-size: 12px; color: var(--text-secondary); }
.field input, .field select, .field textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field input[disabled] { background: var(--border-light); cursor: not-allowed; }

/* Pill 选择器 / Chip 标签 */
.pill {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: white; cursor: pointer; user-select: none; font-size: 13px;
  transition: all .15s; display: inline-flex; align-items: center;
}
.pill:hover { border-color: var(--primary); }
.pill.on { background: var(--primary); border-color: var(--primary); color: white; }
.pill-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-block; padding: 3px 10px; margin: 2px 4px 2px 0;
  background: var(--primary-50); color: var(--primary-700);
  border: 1px solid var(--primary-100); border-radius: 999px;
  font-size: 12px;
}
.sort-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 10px;
  background: var(--primary-50); color: var(--text);
  border: 1px solid var(--primary-100); border-radius: 999px;
  font-size: 13px;
}
.chip-no { color: var(--text-disabled); font-size: 11px; margin-right: 2px; }
.btn-sort {
  width: 24px; height: 24px; padding: 0; border: none; background: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; border-radius: 4px;
}
.btn-sort:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-icon {
  width: 28px; height: 28px; padding: 0; border: none; background: rgba(0,0,0,0.5); color: white;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer;
}
/* 牙位图谱（详情/编辑共用） */
.tooth-chart { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.tooth-row { display: grid; grid-template-columns: 28px repeat(8, 1fr) 28px; gap: 4px; align-items: center; margin-bottom: 4px; }
.tooth-quadrant { font-size: 11px; color: var(--text-secondary); text-align: center; }
.tooth-row-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.tooth-row-2x2:last-of-type { margin-bottom: 0; }
.tooth-quadrant-cell {
  border: 1px solid var(--border-light); border-radius: 8px; padding: 8px 6px 6px;
  background: white; display:flex; flex-direction:column; align-items:center; gap:4px;
}
.tooth-quadrant-label { font-size: 11px; color: var(--text-secondary); }
.tooth-quadrant-teeth { display:flex; gap:3px; flex-wrap:wrap; justify-content:center; }
.tooth {
  aspect-ratio: 1; max-width: 32px; max-height: 32px; margin: 0 auto;
  border: 1px solid var(--border); background: white; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  cursor: pointer; user-select: none;
}
.tooth:hover { border-color: var(--primary); }
.tooth.on { background: var(--primary); color: white; border-color: var(--primary-700); }

/* 品类汇总 */
.cat-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 16px 18px; }
@media (max-width: 900px) { .cat-summary { grid-template-columns: repeat(2, 1fr); } }
.cat-card {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
  cursor: pointer;
}
.cat-card .cat-name { font-size: 13px; color: var(--primary-700); font-weight: 500; }
.cat-card .cat-stat { font-size: 20px; font-weight: 700; color: var(--primary-700); margin-top: 6px; }
.cat-card .cat-stat small { font-size: 12px; font-weight: 400; margin-left: 4px; }
.cat-card .cat-action { color: var(--success); font-size: 12px; margin-top: 6px; display: inline-flex; align-items: center; gap: 2px; }
.cat-card .cat-action::before { content: "+"; font-weight: 600; }
/* 品类环比（红涨绿跌） */
.cat-card .cat-trend { font-size: 11px; margin-top: 4px; font-weight: 500; line-height: 1.3; }
.cat-card .cat-trend.up { color: #d92d20; }
.cat-card .cat-trend.down { color: #12925f; }
.cat-card .cat-trend.flat { color: var(--text-secondary); font-weight: 400; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.table th { background: var(--bg); color: var(--text-secondary); font-weight: 500; font-size: 12px; }
.table tr:hover td { background: var(--bg); }
.table tr.clickable { cursor: pointer; }

/* 状态徽章 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.tag-pending { background: #fef3c7; color: #92400e; }
.tag-approved { background: #d1fae5; color: #065f46; }
.tag-rejected { background: #fee2e2; color: #991b1b; }
.tag-dean_approved { background: #dbeafe; color: #1e40af; }
.tag-director_approved { background: #dbeafe; color: #1e40af; }
.tag-director_rejected { background: #fce7f3; color: #9d174d; }
.tag-cat { background: var(--primary-100); color: var(--primary-700); padding: 1px 6px; font-size: 11px; }

/* 折叠卡片 */
.collapse-card { background: var(--card); border: 1px solid var(--border-light); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.collapse-card .head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .15s;
}
.collapse-card .head:hover { background: var(--bg); }
.collapse-card.expanded { border-color: var(--primary-200); box-shadow: var(--shadow-sm); }
.collapse-card .head .meta { flex: 1; }
.collapse-card .head .meta .row1 { display: flex; align-items: center; gap: 8px; }
.collapse-card .head .meta .row2 { color: var(--text-secondary); font-size: 12px; margin-top: 4px; }
.collapse-card .chevron { color: var(--text-disabled); margin-left: auto; transition: transform .2s; }
.collapse-card.expanded .chevron { transform: rotate(180deg); }
.collapse-card .body { padding: 0 16px 16px; border-top: 1px solid var(--border-light); padding-top: 12px; }
.collapse-card .body img { max-width: 240px; border-radius: 8px; border: 1px solid var(--border); }
.collapse-card .body .actions { display: flex; gap: 8px; margin-top: 12px; }

/* 登录页 */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-50), #ecfeff);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card { background: white; border-radius: var(--radius-xl); padding: 32px; max-width: 360px; width: 100%; box-shadow: var(--shadow-md); }
.login-card .login-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin: 0 auto 16px;
  background: white;
  border: 1px solid var(--border-light);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.login-card .login-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.login-card h1 { text-align: center; font-size: 20px; margin-bottom: 6px; }
.login-card .subtitle { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 12px; }
.login-card .field input { width: 100%; padding: 10px 12px; }
.login-card .verify-row { display: flex; gap: 8px; }
.login-card .verify-row .field { flex: 1; }
.login-card .verify-row button { padding: 0 16px; border: 1px solid var(--primary); background: white; color: var(--primary); border-radius: 8px; font-size: 13px; }
.login-card .verify-row button:disabled { color: var(--text-disabled); border-color: var(--border); }
.login-card .btn-login { width: 100%; padding: 12px; background: var(--primary); color: white; border-radius: 8px; font-size: 15px; font-weight: 600; margin-top: 8px; }
.login-card .divider { text-align: center; color: var(--text-secondary); font-size: 12px; margin: 16px 0; position: relative; }
.login-card .divider::before, .login-card .divider::after { content: ""; position: absolute; top: 50%; width: 30%; height: 1px; background: var(--border); }
.login-card .divider::before { left: 0; }
.login-card .divider::after { right: 0; }
.login-card .btn-wecom { width: 100%; padding: 10px; background: white; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-card .tip { font-size: 12px; color: var(--text-secondary); text-align: center; margin-top: 16px; line-height: 1.6; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: var(--radius-lg); max-width: 480px; width: 100%; padding: 24px; }
.modal h3 { font-size: 18px; margin-bottom: 16px; }
.modal .field { margin-bottom: 12px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Toast */
.toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); background: var(--text); color: white; padding: 10px 20px; border-radius: 8px; font-size: 14px; z-index: 2000; box-shadow: var(--shadow-md); opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* 工具栏 */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; align-items: center; }

/* 列表卡片项 */
.list-item { padding: 12px 16px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 10px; }
.list-item:last-child { border-bottom: none; }
.list-item .content { flex: 1; }
.list-item .title { font-size: 14px; }
.list-item .sub { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }

/* 标签按钮组 */
.tabs { display: flex; gap: 6px; padding: 12px 18px 0; flex-wrap: wrap; }
.tabs button { padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--text-secondary); background: white; border: 1px solid var(--border); }
.tabs button.active { background: var(--primary-100); color: var(--primary-700); border-color: var(--primary-200); }

/* 图表 */
.chart-card { background: var(--card); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; }
.chart-card h3 { font-size: 14px; margin-bottom: 10px; color: var(--text-secondary); font-weight: 500; }
.chart-card svg { width: 100%; }

/* 空状态 */
.empty { text-align: center; color: var(--text-secondary); padding: 40px 20px; font-size: 13px; }

/* 复选框 */
.checkbox { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ===== H5 移动端适配（企微内嵌 / 手机浏览器） ===== */
/* 全局触控优化：去除点击高亮、防止下拉橡皮筋误触 */
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

@media (max-width: 640px) {
  html, body { font-size: 13px; }
  /* 页面整体固定不横向漂移：个别控件超宽只允许在自己的滚动容器里滑（.table-wrap 等） */
  body { overflow-x: hidden; }
  .container, .card { max-width: 100%; }
  /* iPhone 刘海/灵动岛与底部安全区（需配合 viewport-fit=cover） */
  .app-header { padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; }
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .app-header .logo-sub { display: none; }
  .app-header .logo-text { font-size: 14px; max-width: 42vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 手机上头部横向空间紧张：只留姓名（角色标签移到抽屉顶部显示），
     这样「系统管理员」不会再被裁成「系统管理…」 */
  .app-header .user-name { font-size: 12px; max-width: 40vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-header .user-name .un-role { display: none; }
  .app-header .btn-logout { font-size: 0; padding: 6px 8px; }
  .app-header .btn-logout::before { font-size: 14px; }
  .app-header .btn-back { width: 30px; height: 30px; font-size: 14px; }
  .app-header .btn-menu { padding: 6px 8px; }
  .drawer { width: 210px; }

  .container { padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .card-head { padding: 12px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 12px; }

  /* 工作台入口卡：管理员 6 卡 → 3 列×2 排（紧凑版）；员工 4 卡 → .m2 两列 */
  .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 12px 4px 10px; border-radius: 10px; min-height: 76px; }
  .stat-card .ico { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; margin-bottom: 4px; }
  .stat-card .num { font-size: 17px; line-height: 1.2; }
  .stat-card .label { font-size: 11px; margin-top: 2px; }
  .stat-card .badge { top: 4px; right: 4px; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; }
  .stat-grid.m2 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-grid.m1 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-grid.m2 .stat-card { padding: 16px 8px; min-height: 92px; }
  .stat-grid.m2 .stat-card .ico { width: 38px; height: 38px; font-size: 16px; border-radius: 10px; margin-bottom: 6px; }
  .stat-grid.m2 .stat-card .num { font-size: 22px; }
  .stat-grid.m2 .stat-card .label { font-size: 12px; }

  .banner { padding: 16px 18px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .banner h1 { font-size: 19px; }
  .banner .logo-circle { width: 48px; height: 48px; border-radius: 10px; padding: 5px; }
  .banner .btn-fill { align-self: stretch; justify-content: center; }

  .toolbar { padding: 10px 12px; gap: 6px; }
  .toolbar .field { min-width: calc(50% - 6px) !important; flex: 1; }
  .toolbar .field input, .toolbar .field select { width: 100%; }
  .toolbar select, .toolbar input[type="date"] { max-width: none; }

  /* 数据查询筛选区（移动端页面固定不漂移）：
     筛选项两列换行、各控件限定在自身格子里（不撑破页面宽度），
     日期范围独占一整行（两个日期输入 flex 均分）——页面整体不横向晃动，
     数据表格在 .table-wrap 内横向滑动查看 */
  .query-toolbar .field { flex: 1 1 calc(50% - 6px); min-width: 0 !important; max-width: 100%; }
  .query-toolbar .field input, .query-toolbar .field select { width: 100%; min-width: 0; max-width: 100%; }
  .query-toolbar .field-date { flex: 1 1 100% !important; min-width: 0 !important; }
  .query-toolbar .date-pair { display: flex; gap: 4px; align-items: center; width: 100%; }
  .query-toolbar .date-pair input[type="date"] { flex: 1 1 0; min-width: 0; }
  .query-toolbar .date-pair .sep { font-size: 12px; color: var(--text-secondary); flex: 0 0 auto; }

  .tabs { padding: 10px 12px 0; flex-wrap: wrap; gap: 6px; }
  .tabs button { padding: 8px 14px; font-size: 12px; min-height: 36px; }
  /* 品类 tab（全部/洁牙手工提成/五星好评提成…）：单行放不下自动换行成两行；
     文本本身也允许在极窄屏折行，绝不溢出卡片 */
  .tabs button { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }

  /* 按钮触控目标 ≥36px（华为/安卓也清晰可点） */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 32px; }
  .pill { min-height: 32px; }
  select, input[type="date"] { min-height: 34px; }

  .chart-card { padding: 12px; max-width: 100%; overflow-x: auto; }
  .chart-card svg { display: block; max-width: 100%; height: auto; }
  .chart-filter { flex-wrap: wrap; gap: 6px; }
  .chart-filter select { max-width: 46%; min-width: 120px; font-size: 12px; min-height: 34px; }

  /* 品类汇总卡紧凑化（2 列） */
  .cat-summary { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px; }
  .cat-card { padding: 10px 12px; }

  .table { table-layout: auto; }
  .table th, .table td { padding: 8px; font-size: 12px; white-space: nowrap; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; max-width: 100%; display: block; box-sizing: border-box; }

  .collapse-card .body { padding: 10px 12px 12px; }
  .collapse-card .head { padding: 10px 12px; }
  .collapse-card .head .meta .row1 { flex-wrap: wrap; gap: 4px 8px; }
  .collapse-card .body img { max-width: 100%; }

  /* 弹窗改为底部抽屉（贴合拇指操作区） */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 86vh; overflow-y: auto; border-radius: 14px 14px 0 0; width: 100%; max-width: 100%; }
  .login-card { padding: 22px 18px; margin: 16px auto; }

  .field { min-width: 100%; }
  .form-row { flex-direction: column; align-items: stretch; }
  .field input, .field select, .field textarea { font-size: 16px; } /* 防 iOS 聚焦自动放大 */

  .pill-grid { gap: 6px; }
  .tooth { max-width: 26px; max-height: 26px; font-size: 10px; }
  .tooth-row-2x2 { grid-template-columns: 1fr; }

  /* 配置管理页：品牌 chip 里的排序/移动/删除按钮必须能点到 */
  .brand-chip { padding: 5px 8px 5px 10px; font-size: 13px; }
  .brand-chip .btn-sort { width: 36px; height: 36px; font-size: 15px; }
  .sort-chip { padding: 5px 8px 5px 10px; }
  .sort-chip .btn-sort { width: 34px; height: 34px; font-size: 15px; }
  .btn-icon { width: 34px; height: 34px; font-size: 16px; }

  /* 通用：所有 icon-only 小按钮点触区域 ≥32×32 */
  button:empty, .btn-icon, .app-header .btn-menu, .app-header .btn-back { min-width: 32px !important; min-height: 32px !important; }

  /* 管理员管理：小屏下表格变卡片，避免操作列被挤出视口 */
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; box-sizing: border-box; }
  .admin-table tr { margin-bottom: 12px; border: 1px solid var(--border-light); border-radius: 10px; padding: 10px 12px; background: white; }
  .admin-table td { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border: none; font-size: 13px; }
  .admin-table td::before { content: attr(data-label); color: var(--text-secondary); font-size: 12px; flex-shrink: 0; margin-right: 12px; }
  .admin-table td[data-label="操作"] { justify-content: flex-start; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-light); margin-top: 6px; }
  .admin-table td[data-label="授权门店/品类"] { justify-content: flex-start; text-align: right; flex-wrap: wrap; gap: 4px; }
}
