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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.admin-container {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .logo svg {
  flex-shrink: 0;
}

.sidebar .logo h1 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.sidebar .menu {
  padding: 16px 0;
}

.sidebar .menu-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.3s;
  color: rgba(255,255,255,0.7);
  gap: 12px;
}

.sidebar .menu-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar .menu-item.active {
  background: rgba(255,102,0,0.2);
  color: #ff6200;
  border-left: 3px solid #ff6200;
}

.sidebar .menu-item svg {
  flex-shrink: 0;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: #fff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar h2 {
  font-size: 20px;
  font-weight: 600;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f5f5f5;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  transition: all 0.3s;
}

.logout-btn:hover {
  background: #e0e0e0;
}

.content-wrapper {
  padding: 24px;
  flex: 1;
}

.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h3 {
  font-size: 18px;
  font-weight: 600;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.revenue { background: linear-gradient(135deg, #ff6200, #ff8533); }
.stat-icon.orders { background: linear-gradient(135deg, #4CAF50, #66BB6A); }
.stat-icon.activities { background: linear-gradient(135deg, #2196F3, #42A5F5); }
.stat-icon.schools { background: linear-gradient(135deg, #9C27B0, #AB47BC); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
}

.stat-label {
  font-size: 14px;
  color: #888;
  margin-top: 4px;
}

/* 图表区 */
.charts-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.chart-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a2e;
}

.chart-placeholder {
  padding: 20px 0;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 200px;
  padding: 0 20px;
  border-bottom: 2px solid #eee;
}

.bar {
  width: 60px;
  background: linear-gradient(180deg, #ff6200, #ff8533);
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: all 0.3s;
  min-height: 20px;
}

.bar:hover {
  opacity: 0.8;
}

.bar small {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #666;
  margin-bottom: 8px;
  white-space: nowrap;
}

.chart-labels {
  display: flex;
  justify-content: space-around;
  padding: 12px 20px;
  font-size: 12px;
  color: #888;
}

.activity-rank {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
}

.rank-num {
  width: 24px;
  height: 24px;
  background: #ff6200;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.rank-name {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.rank-value {
  font-size: 14px;
  font-weight: 600;
  color: #ff6200;
}

/* 搜索栏 */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.search-bar input:focus,
.search-bar select:focus {
  border-color: #ff6200;
}

.search-bar input[type="text"] {
  flex: 1;
  min-width: 200px;
}

.search-bar input[type="date"] {
  width: 150px;
}

.search-bar select {
  min-width: 120px;
}

.search-btn {
  padding: 10px 24px;
  background: #ff6200;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.search-btn:hover {
  background: #e55a00;
}

/* 按钮 */
.btn-add,
.btn-export,
.btn-edit,
.btn-delete,
.btn-detail,
.btn-refund,
.btn-qrcode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
}

.btn-add,
.btn-export {
  background: #ff6200;
  color: #fff;
}

.btn-add:hover,
.btn-export:hover {
  background: #e55a00;
}

.btn-edit {
  background: #E3F2FD;
  color: #1976D2;
}

.btn-edit:hover {
  background: #BBDEFB;
}

.btn-delete {
  background: #FFEBEE;
  color: #C62828;
}

.btn-delete:hover {
  background: #FFCDD2;
}

.btn-detail {
  background: #E8F5E9;
  color: #388E3C;
}

.btn-detail:hover {
  background: #C8E6C9;
}

.btn-refund {
  background: #FFF3E0;
  color: #E65100;
}

.btn-refund:hover {
  background: #FFE0B2;
}

.btn-qrcode {
  background: #F3E5F5;
  color: #7B1FA2;
}

.btn-qrcode:hover {
  background: #E1BEE7;
}

/* 数据表格 */
.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;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 13px;
  color: #666;
}

.data-table td {
  font-size: 14px;
  color: #333;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #fafafa;
}

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active,
.status-badge.paid {
  background: #E8F5E9;
  color: #388E3C;
}

.status-badge.pending {
  background: #FFF3E0;
  color: #E65100;
}

.status-badge.disabled {
  background: #ECEFF1;
  color: #607D8B;
}

.status-badge.refunded {
  background: #FCE4EC;
  color: #C2185B;
}

.status-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.status-tag.active {
  background: #E8F5E9;
  color: #388E3C;
}

.status-tag.ended {
  background: #ECEFF1;
  color: #607D8B;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.pagination button:hover {
  border-color: #ff6200;
  color: #ff6200;
}

.pagination button.active {
  background: #ff6200;
  color: #fff;
  border-color: #ff6200;
}

/* 活动卡片 */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.activity-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s;
}

.activity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.activity-cover {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #ccc;
}

.activity-body {
  padding: 16px;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.activity-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
}

.activity-body > p {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888;
  margin-bottom: 12px;
}

.activity-meta span:last-child {
  color: #ff6200;
  font-weight: 600;
}

.activity-actions {
  display: flex;
  gap: 8px;
}

/* 统计概览 */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.overview-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.overview-label {
  display: block;
  font-size: 14px;
  color: #888;
  margin-bottom: 8px;
}

.overview-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.overview-change {
  display: inline-block;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 10px;
}

.overview-change.positive {
  background: #E8F5E9;
  color: #388E3C;
}

.overview-change.negative {
  background: #FFEBEE;
  color: #C62828;
}

/* 图表行 */
.chart-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.chart-card.full {
  grid-column: 1 / -1;
}

.pie-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #f0f0f0;
  position: relative;
  overflow: hidden;
  margin: 0 auto 20px;
}

.pie-slice {
  position: absolute;
  width: 100%;
  height: 100%;
}

.pie-slice.wechat {
  background: conic-gradient(#4CAF50 0%, #4CAF50 100%, #f0f0f0 100%);
}

.pie-legend {
  text-align: center;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
}

.legend-dot.wechat {
  background: #4CAF50;
}

.type-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.type-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 80px;
  font-size: 13px;
  color: #666;
}

.bar-fill {
  flex: 1;
  height: 24px;
  background: linear-gradient(90deg, #ff6200, #ff8533);
  border-radius: 4px;
  max-width: 200px;
}

.bar-value {
  font-size: 13px;
  font-weight: 600;
  color: #ff6200;
  width: 40px;
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}

.modal.modal-sm {
  max-width: 400px;
}

.modal.modal-lg {
  max-width: 720px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 4px;
  transition: color 0.3s;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #eee;
}

/* 表单 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #ff6200;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.btn-cancel {
  padding: 10px 24px;
  background: #f5f5f5;
  color: #666;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-cancel:hover {
  background: #e0e0e0;
}

.btn-submit {
  padding: 10px 24px;
  background: #ff6200;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-submit:hover {
  background: #e55a00;
}

/* 订单详情 */
.order-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row label {
  width: 100px;
  color: #888;
  font-size: 14px;
}

.detail-row span {
  flex: 1;
  color: #333;
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .charts-section {
    grid-template-columns: 1fr;
  }
  
  .activity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .stats-grid,
  .activity-grid,
  .stats-overview {
    grid-template-columns: 1fr;
  }
}