/* ========================================
   IM管理系统 - 管理端（硬核科技风）
   仿微信公众号平台后台风格
   ======================================== */
:root {
  --a-primary: #1677FF;
  --a-primary-hover: #4096FF;
  --a-primary-active: #0958D9;
  --a-primary-bg: #E6F4FF;
  --a-success: #52C41A;
  --a-warning: #FAAD14;
  --a-danger: #FF4D4F;
  --a-info: #1677FF;
  --a-bg: #F5F6FA;
  --a-bg-white: #FFFFFF;
  --a-text: #1D2129;
  --a-text-secondary: #86909C;
  --a-text-muted: #C9CDD4;
  --a-border: #E5E6EB;
  --a-border-light: #F2F3F5;
  --a-radius: 4px;
  --a-radius-sm: 2px;
  --a-shadow: 0 1px 4px rgba(0,0,0,0.06);
  --a-shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --a-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --a-sidebar-w: 220px;
  --a-topbar-h: 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  font-family: var(--a-font); font-size: 13px; color: var(--a-text); 
  background: var(--a-bg); -webkit-font-smoothing: antialiased; 
}

/* ===== 管理端整体布局 ===== */
.admin-layout { display: flex; min-height: 100vh; }

/* ===== 侧边栏 - 深色极简科技风 ===== */
.admin-sidebar {
  width: var(--a-sidebar-w); background: #141A25; color: #8B95A8;
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100;
  border-right: 1px solid #1E2635;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: #2A3548; border-radius: 2px; }

.admin-sidebar .logo { 
  height: 52px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: #E8ECF1; 
  border-bottom: 1px solid #1E2635; letter-spacing: 1px;
  flex-shrink: 0;
}
.admin-sidebar .logo::before {
  content: ''; display: inline-block; width: 20px; height: 20px;
  background: var(--a-primary); border-radius: 3px; margin-right: 8px;
}

.admin-sidebar .menu-group { padding: 8px 0; }
.admin-sidebar .menu-group-label {
  padding: 8px 20px 4px; font-size: 11px; text-transform: uppercase;
  color: #4A5568; letter-spacing: 0.5px; font-weight: 500;
}
.admin-sidebar .menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 20px;
  font-size: 13px; cursor: pointer; transition: all 0.15s;
  border: none; background: none; color: #8B95A8; text-align: left;
  text-decoration: none; border-left: 2px solid transparent;
}
.admin-sidebar .menu-item:hover { 
  background: rgba(255,255,255,0.03); color: #C9CDD4; 
}
.admin-sidebar .menu-item.active { 
  background: rgba(22,119,255,0.08); color: #4096FF; 
  border-left-color: var(--a-primary); font-weight: 500;
}
.admin-sidebar .menu-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.admin-sidebar .menu-item.active .menu-dot { background: var(--a-primary); }
.admin-sidebar .menu-item .menu-dot { background: #4A5568; }

/* ===== 主内容区 ===== */
.admin-main { margin-left: var(--a-sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ===== 顶栏 ===== */
.admin-topbar {
  height: var(--a-topbar-h); background: var(--a-bg-white);
  border-bottom: 1px solid var(--a-border); display: flex;
  align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.admin-topbar .breadcrumb { font-size: 13px; color: var(--a-text-secondary); }
.admin-topbar .breadcrumb .current { color: var(--a-text); font-weight: 500; }
.admin-topbar .user-area { display: flex; align-items: center; gap: 10px; }
.admin-topbar .user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--a-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600;
}
.admin-topbar .user-name { font-size: 13px; color: var(--a-text); }
.admin-topbar .logout-link { 
  font-size: 12px; color: var(--a-text-secondary); text-decoration: none; 
  margin-left: 6px; transition: color 0.15s;
}
.admin-topbar .logout-link:hover { color: var(--a-danger); }

/* ===== 内容区 ===== */
.admin-content { padding: 20px; flex: 1; background: var(--a-bg); }

/* ===== 卡片 ===== */
.card { 
  background: var(--a-bg-white); border-radius: var(--a-radius); 
  border: 1px solid var(--a-border); padding: 20px; margin-bottom: 16px; 
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--a-border-light);
}
.card-title { font-size: 15px; font-weight: 600; color: var(--a-text); }
.card-sub { font-size: 12px; color: var(--a-text-secondary); }

/* ===== 统计卡片行 ===== */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card { 
  background: var(--a-bg-white); border-radius: var(--a-radius); 
  border: 1px solid var(--a-border); padding: 18px 20px; 
  display: flex; align-items: center; gap: 14px; transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--a-shadow-lg); }
.stat-icon { 
  width: 44px; height: 44px; border-radius: var(--a-radius); 
  display: flex; align-items: center; justify-content: center; 
  font-size: 20px; flex-shrink: 0;
}
.stat-icon.blue { background: #E6F4FF; color: #1677FF; }
.stat-icon.green { background: #E8F8EF; color: #52C41A; }
.stat-icon.orange { background: #FFF7E6; color: #FA8C16; }
.stat-icon.red { background: #FFF1F0; color: #FF4D4F; }
.stat-icon.purple { background: #F9F0FF; color: #722ED1; }
.stat-val { font-size: 26px; font-weight: 700; color: var(--a-text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--a-text-secondary); margin-top: 4px; }
.stat-trend { font-size: 11px; margin-top: 2px; }
.stat-trend.up { color: var(--a-success); }
.stat-trend.down { color: var(--a-danger); }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { 
  padding: 10px 14px; text-align: left; background: #FAFAFB; 
  font-weight: 600; color: var(--a-text-secondary); 
  font-size: 12px; border-bottom: 1px solid var(--a-border);
  white-space: nowrap;
}
td { 
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--a-border-light); 
  color: var(--a-text);
}
tr:hover td { background: #FAFBFC; }

/* ===== 标签 ===== */
.tag { 
  display: inline-block; padding: 2px 8px; border-radius: 2px; 
  font-size: 11px; font-weight: 500; line-height: 18px;
}
.tag-success { background: #F6FFED; color: #52C41A; border: 1px solid #B7EB8F; }
.tag-warning { background: #FFFBE6; color: #D48806; border: 1px solid #FFE58F; }
.tag-danger { background: #FFF2F0; color: #FF4D4F; border: 1px solid #FFCCC7; }
.tag-info { background: #E6F4FF; color: #1677FF; border: 1px solid #91CAFF; }
.tag-default { background: #FAFAFB; color: #86909C; border: 1px solid #E5E6EB; }

/* ===== 按钮 ===== */
.btn { 
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: var(--a-radius); 
  font-size: 13px; cursor: pointer; border: 1px solid transparent; 
  text-align: center; transition: all 0.15s; font-family: inherit; 
  text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--a-primary); color: #fff; border-color: var(--a-primary); }
.btn-primary:hover { background: var(--a-primary-hover); border-color: var(--a-primary-hover); }
.btn-outline { background: #fff; color: var(--a-text); border: 1px solid var(--a-border); }
.btn-outline:hover { color: var(--a-primary); border-color: var(--a-primary); }
.btn-danger { background: var(--a-danger); color: #fff; border-color: var(--a-danger); }
.btn-danger:hover { background: #FF7875; border-color: #FF7875; }
.btn-success { background: var(--a-success); color: #fff; border-color: var(--a-success); }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-lg { padding: 8px 22px; font-size: 14px; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-disabled { opacity: 0.45; pointer-events: none; }
.btn-group { display: flex; gap: 6px; }

/* ===== 搜索/筛选 ===== */
.filter-bar { 
  display: flex; gap: 10px; margin-bottom: 16px; 
  align-items: center; flex-wrap: wrap; 
}
.filter-bar input[type="text"],
.filter-bar input[type="date"],
.filter-bar select {
  padding: 6px 10px; border: 1px solid var(--a-border); 
  border-radius: var(--a-radius); font-size: 13px; outline: none; 
  font-family: inherit; color: var(--a-text); background: #fff;
  transition: border-color 0.2s;
}
.filter-bar input:focus,
.filter-bar select:focus { border-color: var(--a-primary); box-shadow: 0 0 0 2px rgba(22,119,255,0.1); }
.filter-bar select { min-width: 120px; }
.filter-bar .sep { color: var(--a-text-muted); font-size: 12px; }
.filter-label { font-size: 12px; color: var(--a-text-secondary); white-space: nowrap; }

/* ===== 分页 ===== */
.pagination { 
  display: flex; justify-content: flex-end; align-items: center; 
  gap: 4px; margin-top: 16px; padding-top: 12px; 
  border-top: 1px solid var(--a-border-light);
}
.pagination .page-info { font-size: 12px; color: var(--a-text-secondary); margin-right: 10px; }
.pagination button { 
  min-width: 30px; height: 30px; padding: 0 8px; 
  border: 1px solid var(--a-border); border-radius: var(--a-radius); 
  background: #fff; cursor: pointer; font-size: 13px; color: var(--a-text);
  transition: all 0.15s;
}
.pagination button:hover:not(:disabled):not(.active) { 
  border-color: var(--a-primary); color: var(--a-primary); 
}
.pagination button.active { 
  background: var(--a-primary); color: #fff; border-color: var(--a-primary); 
}
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ===== 图表区 ===== */
.chart-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.chart-card { 
  background: var(--a-bg-white); border-radius: var(--a-radius); 
  border: 1px solid var(--a-border); padding: 18px;
}
.chart-card .chart-title { font-size: 13px; font-weight: 600; color: var(--a-text); margin-bottom: 14px; }

/* 柱状图 */
.bar-chart { 
  display: flex; align-items: flex-end; gap: 6px; height: 160px; 
  padding-bottom: 22px; position: relative; 
}
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-fill { width: 70%; max-width: 32px; border-radius: 2px 2px 0 0; transition: height 0.3s; min-width: 14px; }
.bar-fill.primary { background: var(--a-primary); }
.bar-fill.success { background: var(--a-success); }
.bar-label { font-size: 10px; color: var(--a-text-secondary); margin-top: 4px; position: absolute; bottom: 0; }
.bar-val { font-size: 9px; color: var(--a-text-secondary); margin-bottom: 3px; }

/* ===== 表单 ===== */
.form-row { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.form-col { flex: 1; }
.form-col-label { 
  font-size: 13px; font-weight: 500; color: var(--a-text); 
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.form-input { 
  width: 100%; height: 34px; border: 1px solid var(--a-border); 
  border-radius: var(--a-radius); padding: 0 10px; font-size: 13px; 
  outline: none; font-family: inherit; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--a-primary); box-shadow: 0 0 0 2px rgba(22,119,255,0.08); }
.form-textarea { 
  width: 100%; min-height: 80px; border: 1px solid var(--a-border); 
  border-radius: var(--a-radius); padding: 8px 10px; font-size: 13px; 
  resize: vertical; outline: none; font-family: inherit; 
}
.form-textarea:focus { border-color: var(--a-primary); box-shadow: 0 0 0 2px rgba(22,119,255,0.08); }

/* ===== Tab切换 ===== */
.tab-nav { 
  display: flex; gap: 0; border-bottom: 1px solid var(--a-border); 
  margin-bottom: 16px; 
}
.tab-nav-item { 
  padding: 8px 16px; font-size: 13px; cursor: pointer; 
  color: var(--a-text-secondary); border-bottom: 2px solid transparent;
  background: none; border-top: none; border-left: none; border-right: none;
  transition: all 0.15s; font-family: inherit; margin-bottom: -1px;
  text-decoration: none; display: inline-block;
}
.tab-nav-item:hover { color: var(--a-text); }
.tab-nav-item.active { 
  color: var(--a-primary); border-bottom-color: var(--a-primary); 
  font-weight: 500;
}

/* ===== 模态框 ===== */
.modal-mask { 
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); 
  display: flex; align-items: center; justify-content: center; z-index: 1000; 
}
.modal-box { 
  background: var(--a-bg-white); border-radius: 6px; padding: 24px; 
  min-width: 400px; max-width: 520px; box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}
.modal-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: var(--a-text); }
.modal-body { font-size: 13px; color: var(--a-text-secondary); line-height: 1.6; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--a-border-light); }

/* ===== 消息/通知彩条 ===== */
.alert { padding: 10px 14px; border-radius: var(--a-radius); font-size: 13px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-info { background: #E6F4FF; border-color: #91CAFF; color: #0958D9; }
.alert-success { background: #F6FFED; border-color: #B7EB8F; color: #389E0D; }
.alert-warning { background: #FFFBE6; border-color: #FFE58F; color: #D48806; }
.alert-danger { background: #FFF2F0; border-color: #FFCCC7; color: #CF1322; }

/* ===== 文件上传区域 ===== */
.upload-area {
  border: 1px dashed var(--a-border); border-radius: var(--a-radius);
  padding: 20px; text-align: center; color: var(--a-text-secondary);
  cursor: pointer; transition: all 0.2s; font-size: 12px;
}
.upload-area:hover { border-color: var(--a-primary); color: var(--a-primary); }

/* ===== 用户头像占位 ===== */
.avatar { 
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* ===== 开关 ===== */
.toggle {
  position: relative; display: inline-block; width: 40px; height: 22px;
}
.toggle input { display: none; }
.toggle .slider {
  position: absolute; inset: 0; background: #CCC; border-radius: 11px;
  cursor: pointer; transition: 0.2s;
}
.toggle .slider::before {
  content: ''; position: absolute; width: 18px; height: 18px; 
  left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .slider { background: var(--a-primary); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

/* ===== 进度条 ===== */
.progress-bar {
  height: 6px; background: var(--a-border-light); border-radius: 3px; overflow: hidden;
}
.progress-bar .fill {
  height: 100%; border-radius: 3px; transition: width 0.3s;
}
.progress-bar .fill.primary { background: var(--a-primary); }
.progress-bar .fill.success { background: var(--a-success); }
.progress-bar .fill.warning { background: var(--a-warning); }
.progress-bar .fill.danger { background: var(--a-danger); }

/* ===== 分割线 ===== */
.divider { 
  height: 1px; background: var(--a-border-light); 
  margin: 16px 0; 
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--a-text-secondary); }
.text-danger { color: var(--a-danger); }
.text-success { color: var(--a-success); }
.text-primary { color: var(--a-primary); }
.text-warning { color: var(--a-warning); }
.font-bold { font-weight: 600; }
.font-mono { font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.ml-8 { margin-left: 8px; }
.p-16 { padding: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.hidden { display: none; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.relative { position: relative; }
.cursor-pointer { cursor: pointer; }
.mono { font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace; }
.uppercase { text-transform: uppercase; letter-spacing: 0.5px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
