/* 管理后台通用样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f7fa;
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h1 {
  font-size: 32px;
  color: #2D5A3F;
  margin-bottom: 8px;
}

.login-header p {
  color: #999;
  font-size: 14px;
}

.login-form .form-item {
  margin-bottom: 20px;
}

.login-form input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
}

.btn-primary {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* 管理后台布局 */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 220px;
  background: #2D5A3F;
  color: #fff;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.logo {
  padding: 30px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.logo p {
  font-size: 12px;
  opacity: 0.7;
}

.nav-menu {
  padding: 20px 0;
}

.nav-menu a {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-menu .icon {
  margin-right: 12px;
  font-size: 18px;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 220px;
  min-height: 100vh;
}

.header {
  height: 60px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header h3 {
  font-size: 18px;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-name {
  color: #666;
}

.btn-logout {
  padding: 6px 16px;
  background: #f5f5f5;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.content {
  padding: 30px;
}

/* 仪表盘 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #999;
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.chart-card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-card h4 {
  margin-bottom: 20px;
  font-size: 16px;
}

.chart-placeholder {
  height: 200px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 160px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.bar {
  width: 30px;
  background: linear-gradient(to top, #667eea, #764ba2);
  border-radius: 4px 4px 0 0;
}

.chart-labels {
  display: flex;
  justify-content: space-around;
  margin-top: 10px;
  font-size: 12px;
  color: #999;
}

.top-products {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
}

.product-item .rank {
  width: 24px;
  height: 24px;
  background: #667eea;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-right: 12px;
}

.product-item .name {
  flex: 1;
  font-size: 14px;
}

.product-item .sales {
  font-size: 14px;
  color: #999;
}

/* 页面通用 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.search-box input {
  width: 240px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* 数据表格 */
.data-table {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
}

.data-table th {
  background: #f9f9f9;
  font-weight: 500;
  color: #666;
  font-size: 13px;
}

.data-table td {
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.data-table tr:hover {
  background: #fafafa;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.status-badge.active, .status-badge.completed, .status-badge.paid {
  background: #e6f7ed;
  color: #52c41a;
}

.status-badge.pending {
  background: #fff7e6;
  color: #faad14;
}

.status-badge.shipped {
  background: #e6f7ff;
  color: #1890ff;
}

.btn-text {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  margin-right: 10px;
  font-size: 14px;
}

.btn-text:hover {
  text-decoration: underline;
}

/* 筛选标签 */
.filter-tabs {
  display: flex;
  gap: 10px;
}

.filter-tabs button {
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
}

.filter-tabs button.active {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}

/* 设置页面 */
.settings-section {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.settings-section h4 {
  margin-bottom: 20px;
  font-size: 16px;
}

.form-group {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.form-group label {
  width: 120px;
  font-size: 14px;
  color: #666;
}

.form-group input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.form-group span {
  margin-left: 10px;
  color: #999;
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
  }
}
