* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f0f2f5;
  color: #333;
}

/* 导航栏 */
.navbar {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .logo {
  font-size: 18px;
  font-weight: 600;
  color: #667eea;
}
.navbar .nav-links {
  display: flex;
  gap: 4px;
}
.navbar .nav-links a {
  text-decoration: none;
  color: #666;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}
.navbar .nav-links a:hover,
.navbar .nav-links a.active {
  background: #667eea;
  color: #fff;
}
.navbar .nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbar .nav-right .user-info {
  font-size: 14px;
  color: #999;
}
.btn-logout {
  background: none;
  border: 1px solid #ddd;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  transition: all 0.2s;
}
.btn-logout:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* 页面容器 */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.stat-card .label {
  font-size: 14px;
  color: #999;
  margin-bottom: 8px;
}
.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  color: #333;
}
.stat-card:nth-child(1) .value { color: #667eea; }
.stat-card:nth-child(2) .value { color: #764ba2; }
.stat-card:nth-child(3) .value { color: #f5576c; }
.stat-card:nth-child(4) .value { color: #4facfe; }

/* 图表区域 */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.chart-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.chart-card h3 {
  font-size: 15px;
  color: #333;
  margin-bottom: 16px;
  font-weight: 600;
}
.chart-box {
  height: 300px;
}

/* 数据浏览页 */
.browser-layout {
  display: flex;
  gap: 20px;
  height: calc(100vh - 104px);
}
.sidebar {
  width: 260px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar .db-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
}
.sidebar .db-tabs button {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  transition: all 0.2s;
}
.sidebar .db-tabs button.active {
  color: #667eea;
  border-bottom: 2px solid #667eea;
  font-weight: 600;
}
.sidebar .search-box {
  padding: 12px;
}
.sidebar .search-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #eee;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.sidebar .search-box input:focus {
  border-color: #667eea;
}
.sidebar .table-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}
.sidebar .table-list .table-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  color: #555;
  transition: all 0.15s;
}
.sidebar .table-list .table-item:hover {
  background: #f5f5f5;
}
.sidebar .table-list .table-item.active {
  background: #667eea;
  color: #fff;
}

/* 数据表格区域 */
.data-panel {
  flex: 1;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.data-panel .panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.data-panel .panel-header h3 {
  font-size: 15px;
  font-weight: 600;
}
.data-panel .panel-header .record-count {
  font-size: 13px;
  color: #999;
}
.table-wrapper {
  flex: 1;
  overflow: auto;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data-table th {
  background: #fafafa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #666;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f5f5f5;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.data-table tr:hover td {
  background: #fafbff;
}

/* 分页 */
.pagination {
  padding: 12px 20px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #999;
}
.pagination .page-btns {
  display: flex;
  gap: 6px;
}
.pagination button {
  padding: 6px 14px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.pagination button:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 会员数据页 */
.members-panel {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 104px);
  overflow: hidden;
}
.members-panel .panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.members-panel .panel-header h3 {
  font-size: 15px;
  font-weight: 600;
}
.members-panel .panel-header .filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.members-panel .panel-header .filter-bar label {
  color: #666;
}
.members-panel .panel-header .filter-bar select {
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.members-panel .panel-header .filter-bar select:focus {
  border-color: #667eea;
}
.members-panel .panel-header .record-count,
.members-panel .panel-header .filter-bar .record-count {
  font-size: 13px;
  color: #999;
  margin-left: 12px;
}
.btn-export {
  margin-left: auto;
  padding: 5px 14px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-export:hover {
  background: #5a6fd6;
}
.members-panel .table-wrapper {
  flex: 1;
  overflow: auto;
}

/* 空状态 */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #ccc;
  font-size: 15px;
}

/* 加载动画 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #999;
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .browser-layout { flex-direction: column; height: auto; }
  .sidebar { width: 100%; max-height: 300px; }
}
