/* ========================================
   八方集团全域销售作战系统 - 主样式表
   极简工业硬核风 UI
   ======================================== */

:root {
  /* 主色调 - 工业暗色系 */
  --bg-base: #0a0e14;
  --bg-surface: #111827;
  --bg-card: #1a2332;
  --bg-card-hover: #1f2b3d;
  --bg-input: #0d1420;
  --border: #2a3344;
  --border-light: #364152;
  
  /* 文字 */
  --text-primary: #e8edf4;
  --text-secondary: #9ba8b8;
  --text-dim: #5a6678;
  
  /* 强调色 */
  --accent: #00d4ff;          /* 主科技蓝 */
  --accent-glow: rgba(0,212,255,0.15);
  --orange: #ff6b35;          /* 八方橙 */
  --green: #00e676;           /* 农业绿 */
  --blue: #448aff;            /* 航空蓝 */
  --purple: #b388ff;          /* 软件紫 */
  --red: #ff5252;             /* 警告红 */
  --yellow: #ffd740;          /* 提示黄 */
  
  /* 尺寸 */
  --sidebar-w: 220px;
  --topbar-h: 56px;
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ==================== 顶部导航栏 ==================== */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
  position: relative;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  min-height: 36px;
}
.logo .logo-img { height: 28px; width: auto; max-height: 28px; max-width: 80px; object-fit: contain; display: block; }

.company-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 3px;
}
.company-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  max-height: 30px;
  overflow: hidden;
}
.company-btn .company-logo { height: 16px !important; width: auto !important; max-height: 16px !important; max-width: 20px !important; object-fit: contain; display: block; }
.nav-icon { height: 16px; width: auto; max-height: 16px; max-width: 20px; object-fit: contain; display: inline-block; vertical-align: middle; }
.title-icon { height: 24px; width: auto; max-height: 24px; object-fit: contain; display: inline-block; vertical-align: middle; margin-right: 6px; }
.company-btn:hover { color: var(--text-primary); }
.company-btn.active { background: var(--bg-card); color: var(--accent); }
.company-btn.active.agri { color: var(--green); }
.company-btn.active.avi { color: var(--blue); }
.company-btn.active.soft { color: var(--purple); }
.company-btn.active.group { color: var(--accent); }

.terminal-switcher {
  margin-left: auto;
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 3px;
}
.terminal-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.terminal-btn:hover { color: var(--text-primary); }
.terminal-btn.active { background: var(--accent); color: var(--bg-base); font-weight: 600; }

.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  object-fit: cover;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; font-weight: 500; color: var(--text-dim); }

/* ==================== PC端布局 ==================== */
.pc-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h));
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.nav-group {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.nav-group-title {
  padding: 0 20px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 600;
}
.nav-item {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--bg-card);
  color: var(--accent);
  border-left-color: var(--accent);
}
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; overflow: hidden; white-space: nowrap; }
.nav-item .badge {
  margin-left: auto;
  background: var(--orange);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-base);
}

/* ==================== 通用组件 ==================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
}
.stat-card.green::before { background: var(--green); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.accent::before { background: var(--accent); }

.stat-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 500;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-value.purple { color: var(--purple); }
.stat-value.orange { color: var(--orange); }
.stat-value.accent { color: var(--accent); }
.stat-trend {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  font-weight: 600;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary);
}
.data-table tr:hover td {
  background: var(--bg-card-hover);
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-green { background: rgba(0,230,118,0.15); color: var(--green); }
.tag-blue { background: rgba(68,138,255,0.15); color: var(--blue); }
.tag-purple { background: rgba(179,136,255,0.15); color: var(--purple); }
.tag-orange { background: rgba(255,107,53,0.15); color: var(--orange); }
.tag-red { background: rgba(255,82,82,0.15); color: var(--red); }
.tag-yellow { background: rgba(255,215,64,0.15); color: var(--yellow); }
.tag-accent { background: rgba(0,212,255,0.15); color: var(--accent); }
.tag-gray { background: rgba(155,168,184,0.15); color: var(--text-secondary); }

/* 按钮 */
.btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { border-color: var(--border-light); background: var(--bg-card-hover); }
.btn-primary {
  background: var(--accent);
  color: var(--bg-base);
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: #00b8e0; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { color: var(--red); border-color: rgba(255,82,82,0.3); }

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  width: 300px;
}
.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  flex: 1;
  font-size: 13px;
}

/* 漏斗图 */
.funnel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 0;
}
.funnel-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  transition: var(--transition);
  cursor: pointer;
  width: 100%;
}
.funnel-stage:hover { opacity: 0.85; }
.funnel-stage .stage-name { font-weight: 600; }
.funnel-stage .stage-count { font-weight: 700; }
.funnel-stage .stage-value { font-size: 12px; opacity: 0.8; }

/* 进度条 */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* 图表容器 */
.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* 双列布局 */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ==================== 手机端布局 ==================== */
.mobile-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: calc(100vh - var(--topbar-h));
  background: var(--bg-base);
  padding: 20px;
  overflow-y: auto;
}
.phone-frame {
  width: 375px;
  height: 760px;
  background: var(--bg-surface);
  border: 3px solid var(--border-light);
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.phone-statusbar {
  height: 36px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.phone-header {
  background: var(--bg-card);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.phone-header .title { font-size: 18px; font-weight: 700; }
.phone-header .sub { font-size: 12px; color: var(--text-dim); }

.phone-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.phone-tabbar {
  height: 56px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
}
.phone-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-dim);
}
.phone-tab .icon { font-size: 20px; }
.phone-tab .label { font-size: 10px; }
.phone-tab.active { color: var(--accent); }
.phone-tab .dot {
  position: absolute;
  top: 6px;
  right: 50%;
  margin-right: -16px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
}

/* 手机端卡片 */
.m-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.m-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.m-card-title { font-size: 14px; font-weight: 600; }
.m-card-body { font-size: 13px; color: var(--text-secondary); }

.m-stat-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.m-stat {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.m-stat .val { font-size: 20px; font-weight: 700; }
.m-stat .lbl { font-size: 11px; color: var(--text-dim); }

/* 手机端快捷操作宫格 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.quick-actions .m-stat {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 14px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  cursor: pointer;
  transition: var(--transition);
}
.quick-actions .m-stat:active {
  background: var(--border-light);
  transform: scale(0.96);
}
.quick-actions .m-stat .val {
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}
.quick-actions .m-stat .lbl {
  font-size: 12px;
  color: var(--text-secondary);
}

.m-action-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.m-action-btn.primary { background: var(--accent); color: var(--bg-base); }
.m-action-btn.primary:hover { background: #00b8e0; }

.m-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.m-list-item:hover { background: var(--bg-card-hover); }
.m-list-item .avatar {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.m-list-item .info { flex: 1; min-width: 0; }
.m-list-item .name { font-size: 14px; font-weight: 600; }
.m-list-item .desc { font-size: 12px; color: var(--text-dim); }
.m-list-item .arrow { color: var(--text-dim); }

/* ==================== 小程序端布局 ==================== */
.miniapp-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: calc(100vh - var(--topbar-h));
  background: var(--bg-base);
  padding: 20px;
  overflow-y: auto;
}
.miniapp-frame {
  width: 375px;
  height: 700px;
  background: #f5f6f8;
  border: 3px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.miniapp-header {
  background: linear-gradient(135deg, #07c160, #06ad56);
  padding: 20px 16px 16px;
  color: white;
  flex-shrink: 0;
}
.miniapp-header .brand { font-size: 18px; font-weight: 700; }
.miniapp-header .sub { font-size: 12px; opacity: 0.9; }
.miniapp-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.miniapp-tabbar {
  height: 50px;
  background: white;
  border-top: 1px solid #e8e8e8;
  display: flex;
  flex-shrink: 0;
}
.miniapp-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: #999;
}
.miniapp-tab .icon { font-size: 18px; }
.miniapp-tab .label { font-size: 10px; }
.miniapp-tab.active { color: #07c160; }

/* 小程序卡片 (浅色主题) */
.wx-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.wx-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}
.wx-card-body {
  font-size: 13px;
  color: #666;
}
.wx-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.wx-grid-item {
  background: white;
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
}
.wx-grid-item .icon { font-size: 28px; margin-bottom: 6px; }
.wx-grid-item .label { font-size: 11px; color: #666; }
.wx-banner {
  background: linear-gradient(135deg, #07c160, #06ad56);
  border-radius: 12px;
  padding: 16px;
  color: white;
  margin-bottom: 12px;
}
.wx-banner .title { font-size: 16px; font-weight: 700; }
.wx-banner .desc { font-size: 12px; opacity: 0.9; margin-top: 4px; }

/* ==================== 工具类 ==================== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-bold { font-weight: 700; }
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }
.text-orange { color: var(--orange); }
.text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* 加载动画 */
.loading-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 2px;
  animation: bounce 1.4s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* 提醒/通知 */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-info { background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.2); color: var(--accent); }
.alert-warn { background: rgba(255,215,64,0.1); border: 1px solid rgba(255,215,64,0.2); color: var(--yellow); }
.alert-danger { background: rgba(255,82,82,0.1); border: 1px solid rgba(255,82,82,0.2); color: var(--red); }
.alert-success { background: rgba(0,230,118,0.1); border: 1px solid rgba(0,230,118,0.2); color: var(--green); }

/* 分段控制器 */
.seg-control {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 16px;
  width: fit-content;
}
.seg-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.seg-btn.active { background: var(--bg-card); color: var(--accent); }

/* 时间线 */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 16px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-base);
}
.timeline-item .time { font-size: 11px; color: var(--text-dim); }
.timeline-item .content { font-size: 13px; margin-top: 2px; }

/* 响应式 - 平板 */
@media (max-width: 1200px) {
  .two-col { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr; }
}

/* 响应式 - 真实手机端访问 */
@media (max-width: 768px) {

  /* 顶部导航栏：简化布局 */
  .topbar {
    padding: 0 10px;
    gap: 8px;
    height: 48px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .logo { font-size: 15px; gap: 4px; min-height: 32px; }
  .logo .logo-img { height: 22px; max-height: 22px; }
  .logo span { white-space: nowrap; }

  /* 公司切换器：缩小按钮 */
  .company-switcher { padding: 2px; gap: 2px; }
  .company-btn { padding: 4px 8px; font-size: 11px; max-height: 26px; }
  .company-btn .company-logo { height: 12px !important; max-height: 12px !important; max-width: 14px !important; }

  /* 终端切换器：隐藏文字只留图标 */
  .terminal-switcher { padding: 2px; gap: 2px; }
  .terminal-btn { padding: 4px 8px; font-size: 11px; }

  /* 用户区域：隐藏角色只留头像 */
  .user-area { gap: 6px; }
  .user-area .user-name { font-size: 12px; }
  .user-area .user-role { display: none; }
  .user-avatar { width: 28px; height: 28px; font-size: 12px; }

  /* PC布局：隐藏侧边栏，内容全宽 */
  .pc-layout { flex-direction: column; height: calc(100vh - 48px); }
  .sidebar {
    width: 100%;
    height: auto;
    max-height: 0;
    overflow: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border);
    transition: max-height 0.3s ease;
  }
  .sidebar.mobile-open {
    max-height: 400px;
    overflow-y: auto;
  }
  .nav-group { padding: 6px 0; }
  .nav-item { padding: 8px 16px; font-size: 13px; }
  .nav-group-title { padding: 0 16px; font-size: 11px; }
  .main-content { padding: 12px; flex: 1; }

  /* 移动端菜单按钮（仅手机显示） */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    color: var(--text-primary);
    flex-shrink: 0;
  }

  /* 统计卡片：2列 */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 12px; }

  /* 页面标题缩小 */
  .page-title { font-size: 18px; }
  .page-header { margin-bottom: 16px; }

  /* 卡片内边距缩小 */
  .card { padding: 14px; margin-bottom: 14px; }
  .card-title { font-size: 14px; margin-bottom: 12px; }

  /* 表格：横向滚动 */
  .card:has(.data-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 12px; white-space: nowrap; }

  /* 搜索框：自适应宽度 */
  .search-box { width: 100%; max-width: 100%; }
  .search-box input { font-size: 12px; }

  /* 弹窗：全宽 */
  .modal { width: 100%; max-width: 100%; max-height: 90vh; padding: 16px; border-radius: 0; }
  .modal-overlay { align-items: flex-end; }
  .modal-title { font-size: 16px; }

  /* 双列/三列布局：单列 */
  .two-col, .three-col { grid-template-columns: 1fr; gap: 12px; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  /* 图表容器高度缩小 */
  .chart-container { height: 220px; }

  /* 模拟手机框架：在真手机上铺满全屏 */
  .mobile-layout {
    padding: 0;
    height: calc(100vh - 48px);
  }
  .phone-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .phone-statusbar { display: none; }

  /* 小程序框架：在真手机上铺满全屏 */
  .miniapp-layout {
    padding: 0;
    height: calc(100vh - 48px);
  }
  .miniapp-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  /* 手机端卡片：增大触控区域 */
  .m-card { padding: 16px; margin-bottom: 10px; }
  .m-list-item { padding: 14px 12px; }
  .m-list-item .avatar { width: 44px; height: 44px; font-size: 20px; }
  .m-action-btn { padding: 16px; font-size: 16px; }
  .phone-tab { min-height: 56px; }
  .phone-tab .icon { font-size: 22px; }
  .phone-tab .label { font-size: 11px; }

  /* 小程序卡片触控优化 */
  .wx-grid-item { padding: 16px 8px; }
  .wx-grid-item .icon { font-size: 30px; }
  .miniapp-tab { min-height: 50px; }
  .miniapp-tab .icon { font-size: 20px; }

  /* 漏斗图 */
  .funnel-stage { padding: 10px 14px; font-size: 12px; }

  /* 按钮触控优化 */
  .btn { padding: 10px 16px; font-size: 13px; }
  .btn-sm { padding: 8px 14px; }

  /* 分段控制器 */
  .seg-control { width: 100%; }
  .seg-btn { flex: 1; text-align: center; padding: 8px 12px; }

  /* 表单 */
  .form-input, .form-select, .form-textarea { padding: 12px 14px; font-size: 15px; }

  /* 标签 */
  .tag { padding: 4px 8px; font-size: 11px; }

  /* 工具类 */
  .mt-24 { margin-top: 16px; }
  .mb-16 { margin-bottom: 12px; }
}

/* 响应式 - 超小屏手机 */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .company-btn { padding: 3px 6px; font-size: 10px; }
  .terminal-btn { padding: 3px 6px; font-size: 10px; }
  .logo span { display: none; }
  .logo .logo-img { height: 24px; max-height: 24px; }
}
