/* ============================================================
   QQ群成员采集管理系统 — B端卡片式设计系统
   ============================================================ */

/* ----- 设计令牌 ----- */
:root {
  /* 主色调 */
  --c-primary: #4A6CF7;
  --c-primary-light: #EEF1FE;
  --c-primary-dark: #3651D5;

  /* 状态色 */
  --c-success: #22C55E;
  --c-success-light: #F0FDF5;
  --c-warning: #F59E0B;
  --c-warning-light: #FFFDF5;
  --c-danger: #EF4444;
  --c-danger-light: #FEF2F2;
  --c-info: #6366F1;
  --c-info-light: #EEF2FF;

  /* 文字灰度分层 */
  --c-text-title: #1E293B;
  --c-text-body: #475569;
  --c-text-secondary: #94A3B8;
  --c-text-placeholder: #CBD5E1;

  /* 背景 */
  --c-bg-page: #F1F5F9;
  --c-bg-card: #FFFFFF;
  --c-bg-sidebar: #FFFFFF;
  --c-bg-hover: #F8FAFC;

  /* 边框与分割线 */
  --c-border: #E2E8F0;
  --c-border-light: #F1F5F9;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* 阴影 */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.12);

  /* 间距 */
  --space-xs: 6px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 28px;
  --space-xl: 36px;

  /* 布局 */
  --navbar-h: 56px;
  --sidebar-w: 232px;

  /* 过渡 */
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* ----- 全局重置 ----- */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--c-text-body);
  background: var(--c-bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }

/* ----- 布局框架 ----- */
.app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--navbar-h);
}

/* 顶部导航 */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--navbar-h);
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-lg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: var(--c-text-title);
}
.navbar-brand .brand-dot {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.navbar-right {
  display: flex; align-items: center; gap: var(--space-md);
}
.navbar-right .user-info {
  font-size: 13px; color: var(--c-text-secondary);
}
.navbar-right .btn-logout {
  padding: 6px 14px; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); background: #fff;
  color: var(--c-text-body); font-size: 13px; cursor: pointer;
  transition: all var(--transition);
}
.navbar-right .btn-logout:hover {
  border-color: var(--c-danger);
  color: var(--c-danger);
  background: var(--c-danger-light);
}

.user-dropdown { position: relative; }
.user-dropdown-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border: none; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; color: var(--c-text-body);
  font-size: 13px; transition: background var(--transition);
}
.user-dropdown-trigger:hover { background: var(--c-bg); }
.user-dropdown-trigger .user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.user-dropdown-trigger .user-arrow {
  font-size: 10px; margin-left: 2px; color: var(--c-text-placeholder);
}
.user-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 140px; background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--radius-md); box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 1010; padding: 4px 0;
}
.user-dropdown-menu.show { display: block; }
.user-dropdown-menu a {
  display: block; padding: 8px 16px; font-size: 13px; color: var(--c-text-body);
  text-decoration: none; transition: background var(--transition);
}
.user-dropdown-menu a:hover { background: var(--c-bg); }
.user-dropdown-menu .dropdown-divider {
  height: 1px; background: var(--c-border); margin: 4px 0;
}

/* 侧边栏 */
.sidebar {
  position: fixed; top: var(--navbar-h); left: 0; bottom: 0; z-index: 900;
  width: var(--sidebar-w);
  background: var(--c-bg-sidebar);
  display: flex; flex-direction: column;
  transition: left var(--transition-slow);
}
.sidebar-section {
  padding: var(--space-md) var(--space-md) var(--space-xs);
}
.sidebar-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  color: #94A3B8; letter-spacing: 1px;
  padding: 0 6px; margin-bottom: var(--space-xs);
}
.sidebar-nav { flex:1; padding: 0 var(--space-sm); }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: #475569; font-size: 14px; font-weight: 500;
  transition: all var(--transition); margin-bottom: 2px;
  white-space: nowrap;
}
.sidebar-nav a:hover {
  background: #F1F5F9;
  color: #1E293B;
}
.sidebar-nav a.active {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(74,108,247,0.3);
}
.sidebar-nav a.active:hover { background: var(--c-primary); color: #fff; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--c-danger); color: #fff;
  font-size: 11px; font-weight: 600; margin-left: auto; flex-shrink: 0;
}
.sidebar-nav a .nav-dot {
  width: 18px; text-align: center; font-size: 15px; flex-shrink: 0;
}
.sidebar-divider {
  height: 1px; background: #E2E8F0;
  margin: var(--space-sm) var(--space-md);
}
.sidebar-footer {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  margin-top: auto;
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: #94A3B8; font-size: 13px;
  transition: all var(--transition);
}
.sidebar-footer a:hover {
  color: #EF4444; background: rgba(239,68,68,0.1);
}

/* 主内容区 */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  padding: var(--space-lg);
}

/* 移动端汉堡按钮 */
.hamburger {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 1001;
  width: 36px; height: 36px; border: none; border-radius: var(--radius-sm);
  background: var(--c-primary); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.hamburger span {
  display: block; width: 18px; height: 2px; background: #fff;
  border-radius: 1px; transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 899;
}
.sidebar-overlay.show { display: block; }

/* ============================================================
   卡片系统
   ============================================================ */

/* 基础卡片 */
.card {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
  transition: box-shadow var(--transition-slow), transform var(--transition-slow);
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* 卡片标题栏 */
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-md); padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--c-border-light);
}
.card-header h3 {
  font-size: 15px; font-weight: 600; color: var(--c-text-title);
  display: flex; align-items: center; gap: 8px;
}
.card-header .card-actions {
  display: flex; align-items: center; gap: var(--space-xs);
}

/* 无标题栏的卡片内容区 */
.card-body { }

/* ----- 卡片类型 ----- */

/* 统计卡片 */
.stat-card {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
  display: flex; align-items: center; gap: var(--space-md);
  transition: all var(--transition-slow);
  cursor: default;
}
.stat-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-card .stat-info { min-width: 0; }
.stat-card .stat-value {
  font-size: 24px; font-weight: 700; color: var(--c-text-title);
  line-height: 1.3;
}
.stat-card .stat-label {
  font-size: 13px; color: var(--c-text-secondary);
}

/* 图表卡片 */
.chart-card {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
  transition: all var(--transition-slow);
}
.chart-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.chart-card .chart-container {
  position: relative; width: 100%; min-height: 280px;
}

/* 表格卡片 (带分页) */
.table-card {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 0;
  transition: all var(--transition-slow);
  overflow: hidden;
}
.table-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* 快捷操作卡片 */
.action-card {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
  transition: all var(--transition-slow);
}
.action-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* 筛选搜索卡片 */
.filter-card {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  transition: all var(--transition-slow);
}
.filter-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* 待办/信息卡片 */
.info-card {
  background: var(--c-primary-light);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border-left: 4px solid var(--c-primary);
}

/* ----- 栅格布局 ----- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-md); }
.grid-sidebar { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-md); align-items: start; }

/* 邮箱添加表单 */
.form-email-add {
  display: grid;
  grid-template-columns: 1fr 80px 1fr 1fr 70px 130px;
  gap: 8px; align-items: end;
  margin-bottom: 20px;
}

/* 邮箱卡片列表项 */
.email-card {
  display: flex; align-items: center;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.email-card-icon {
  flex-shrink: 0; margin-right: 14px;
  display: inline-flex;
  width: 40px; height: 40px;
  border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: 18px;
}
.email-card-icon.active { background: var(--c-success-light); }
.email-card-icon.inactive { background: #F1F5F9; }
.email-card-body { flex: 1; min-width: 0; }
.email-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.section-mb { margin-bottom: var(--space-lg); }

/* ============================================================
   表格
   ============================================================ */

.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.table th {
  padding: 12px 16px; text-align: left;
  font-weight: 600; color: var(--c-text-secondary);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--c-bg-page); border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border-light);
  color: var(--c-text-body);
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--c-bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }

/* 表格内嵌标题 (模拟卡片标题) */
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--c-border-light);
}

/* ============================================================
   状态标签
   ============================================================ */

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.tag-success { background: var(--c-success-light); color: #15803D; }
.tag-danger  { background: var(--c-danger-light);  color: #B91C1C; }
.tag-warning { background: var(--c-warning-light); color: #B45309; }
.tag-default { background: #F1F5F9; color: #64748B; }
.tag-primary { background: var(--c-primary-light); color: var(--c-primary-dark); }

/* ============================================================
   通知/提示
   ============================================================ */

.toast {
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 14px; margin-bottom: var(--space-md);
  animation: toastIn 0.3s ease;
}
.toast-success { background: var(--c-success-light); color: #15803D; border-left: 3px solid var(--c-success); }
.toast-error   { background: var(--c-danger-light);  color: #B91C1C; border-left: 3px solid var(--c-danger); }
.toast-warning { background: var(--c-warning-light); color: #B45309; border-left: 3px solid var(--c-warning); }
.toast-info    { background: var(--c-primary-light); color: var(--c-primary-dark); border-left: 3px solid var(--c-primary); }

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

/* ============================================================
   表单
   ============================================================ */

.form-group { margin-bottom: var(--space-sm); }
.form-label {
  display: block; margin-bottom: 4px; font-size: 13px;
  font-weight: 600; color: var(--c-text-title);
}
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--c-text-body);
  background: #fff; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-light);
}
.form-control::placeholder { color: var(--c-text-placeholder); }
select.form-control {
  appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394A3B8' stroke-linecap='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 10px center;
  background-size: 14px; padding-right: 32px;
}
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: flex; align-items: flex-end; gap: var(--space-sm);
  flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 120px; margin-bottom: 0; }

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled,.btn.disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); box-shadow: 0 2px 8px rgba(74,108,247,0.25); }
.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover { background: #16A34A; }
.btn-danger  { background: var(--c-danger);  color: #fff; }
.btn-danger:hover  { background: #DC2626; }
.btn-warning { background: var(--c-warning); color: #fff; }
.btn-warning:hover { background: #D97706; }
.btn-default { background: #fff; color: var(--c-text-body); border: 1px solid var(--c-border); }
.btn-default:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-light); }
.btn-ghost   { background: transparent; color: var(--c-text-secondary); }
.btn-ghost:hover { background: var(--c-bg-hover); color: var(--c-text-body); }
.btn-sm  { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg  { padding: 12px 24px; font-size: 16px; }

/* ============================================================
   分页
   ============================================================ */

.pagination {
  display: flex; justify-content: center; gap: 4px;
  padding: var(--space-md);
}
.pagination a,.pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 6px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--c-text-body);
  transition: all var(--transition);
}
.pagination a:hover {
  border-color: var(--c-primary); color: var(--c-primary);
  background: var(--c-primary-light);
}
.pagination a.active {
  background: var(--c-primary); color: #fff; border-color: var(--c-primary);
}

/* ============================================================
   模态框
   ============================================================ */

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,23,42,0.45);
  align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  padding: var(--space-lg); box-shadow: var(--shadow-modal);
  max-width: 600px; width: calc(100vw - 32px);
  max-height: 85vh; overflow-y: auto;
  animation: scaleIn 0.2s ease;
}
.modal h3 { font-size: 17px; font-weight: 600; color: var(--c-text-title); margin-bottom: var(--space-md); }
.modal .modal-footer { display: flex; gap: var(--space-sm); justify-content: flex-end; margin-top: var(--space-md); }

@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes scaleIn { from { opacity:0; transform: scale(0.96); } to { opacity:1; transform: scale(1); } }

/* ============================================================
   登录页
   ============================================================ */

.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--c-bg-sidebar); padding: var(--space-md);
}
.auth-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-modal);
}
.auth-card h2 {
  font-size: 22px; font-weight: 700; color: var(--c-text-title);
  margin-bottom: 4px; text-align: center;
}
.auth-card .auth-subtitle {
  font-size: 13px; color: var(--c-text-secondary);
  text-align: center; margin-bottom: var(--space-lg);
}
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: var(--space-lg);
  background: var(--c-bg-page); border-radius: var(--radius-sm); padding: 4px;
}
.auth-tabs button {
  flex: 1; padding: 8px 12px; border: none; border-radius: 4px;
  background: transparent; color: var(--c-text-secondary);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.auth-tabs button.active {
  background: #fff; color: var(--c-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.auth-card .btn-submit {
  width: 100%; padding: 12px; font-size: 15px;
  border-radius: var(--radius-sm); margin-top: var(--space-sm);
}

/* ============================================================
   安装页
   ============================================================ */

.install-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--c-bg-sidebar); padding: var(--space-md);
}
.install-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-modal);
}
.install-card h2 {
  font-size: 22px; font-weight: 700; color: var(--c-text-title);
  margin-bottom: 4px;
}
.install-card .install-subtitle {
  font-size: 13px; color: var(--c-text-secondary);
  margin-bottom: var(--space-lg);
}
.install-card .install-section {
  padding-top: var(--space-md); margin-top: var(--space-md);
  border-top: 1px solid var(--c-border-light);
}
.install-card .install-section h4 {
  font-size: 14px; font-weight: 600; color: var(--c-text-title);
  margin-bottom: var(--space-sm);
}

/* ============================================================
   成员卡片网格 (可视化)
   ============================================================ */

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
}
.member-card {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-md); text-align: center;
  transition: all var(--transition-slow);
}
.member-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.member-card .member-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  margin: 0 auto var(--space-sm); overflow: hidden;
  background: var(--c-bg-page);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.member-card .member-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.member-card .member-qq {
  font-weight: 600; font-size: 14px; color: var(--c-text-title);
}
.member-card .member-nick {
  font-size: 12px; color: var(--c-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-card .member-group {
  font-size: 11px; color: var(--c-primary); font-weight: 500;
  margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-card .member-time {
  font-size: 11px; color: var(--c-text-placeholder); margin-top: 2px;
}
.member-card .member-checkbox {
  position: absolute; top: 8px; left: 8px; z-index: 2;
}
.member-card .member-checkbox input {
  width: 16px; height: 16px; cursor: pointer; accent-color: var(--c-primary);
}
.member-card { position: relative; }
.member-card.selected { box-shadow: 0 0 0 2px var(--c-primary), var(--shadow-hover); }

.batch-toolbar {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 10px 16px; margin-bottom: var(--space-md);
  background: var(--c-bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); font-size: 13px;
}
.batch-select-all {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  color: var(--c-text-body); user-select: none;
}
.batch-select-all input { width: 16px; height: 16px; accent-color: var(--c-primary); cursor: pointer; }
.batch-count { flex: 1; color: var(--c-text-secondary); font-size: 12px; }

/* ============================================================
   空状态
   ============================================================ */

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: var(--space-xl) var(--space-md);
  text-align: center;
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: var(--space-sm); opacity: .5; }
.empty-state .empty-title { font-size: 15px; font-weight: 600; color: var(--c-text-secondary); margin-bottom: 4px; }
.empty-state .empty-desc { font-size: 13px; color: var(--c-text-placeholder); }

/* ============================================================
   工具类
   ============================================================ */

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--c-text-secondary); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mr-sm { margin-right: var(--space-sm); }
.flex       { display: flex; }
.flex-wrap  { flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.w-full { width: 100%; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1024px) {
  .grid-sidebar { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .sidebar { left: calc(-1 * var(--sidebar-w)); }
  .sidebar.open { left: 0; }
  .main-content {
    margin-left: 0;
    padding: var(--space-md);
    padding-top: calc(var(--navbar-h) + var(--space-md));
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 60px);
  }
  .grid-2,.grid-3,.grid-4,.grid-sidebar { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .members-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .form-row { flex-direction: column; }
  .form-row .form-group { min-width: 100%; }
  .form-email-add { grid-template-columns: 1fr; }
  .form-email-add .btn { width: 100%; }
  .email-card { flex-wrap: wrap; }
  .email-card-actions { width: 100%; justify-content: flex-end; margin-top: 8px; }
  .navbar { padding: 0 var(--space-md); }
  .navbar .navbar-brand { padding-left: 44px; }
  .stat-card .stat-value { font-size: 20px; }
  .app-layout { padding-top: 0; }
  .modal { padding: var(--space-md); }
}

@media (max-width: 480px) {
  .grid-stats { grid-template-columns: 1fr; }
  .members-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ============================================================
   移动端表格卡片式布局
   ============================================================ */

@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }

  .table-mobile,
  .table-mobile thead,
  .table-mobile tbody,
  .table-mobile th,
  .table-mobile td,
  .table-mobile tr {
    display: block;
  }

  .table-mobile thead { display: none; }

  .table-mobile tr {
    margin-bottom: var(--space-sm);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    background: var(--c-bg-card);
    box-shadow: var(--shadow-card);
    padding: var(--space-sm);
  }

  .table-mobile td {
    border-bottom: none;
    padding: 6px 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .table-mobile td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    color: var(--c-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    min-width: 60px;
  }

  .table-mobile td[data-label] {
    text-align: left;
  }

  .table-mobile td .tag {
    margin-left: auto;
  }

  .btn-group-mobile {
    display: flex;
    gap: 6px;
    width: 100%;
  }

  .btn-group-mobile .btn,
  .btn-group-mobile button {
    flex: 1;
    min-width: 0;
    text-align: center;
  }

  .table-card .table-header {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
}

/* ----- 邮箱水平列表 ----- */
.email-horizontal-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.email-horizontal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--c-bg-card);
}
.email-horizontal-item:hover {
  background: var(--c-bg-page);
}
.email-h-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.email-h-account {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-title);
}
.email-h-host {
  font-size: 12px;
  color: var(--c-text-placeholder);
}
.email-h-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.email-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-active { background: var(--c-success); }
.dot-inactive { background: var(--c-text-placeholder); }

/* ----- 移动端适配 ----- */
@media (max-width: 640px) {
  .filter-bar select.form-control {
    min-width: 80px !important;
    max-width: 160px !important;
  }
  .email-horizontal-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .email-h-item-main {
    width: 100%;
  }
  .email-h-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
