/**
 * 后台管理系统样式表
 * 设计风格：简洁现代，以深色侧边栏+白色内容区为主
 */

/* ========== 全局重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #333;
  display: flex;
  min-height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
  width: 240px;
  background: #1a1a2e;
  color: #fff;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 30px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.sidebar-header p {
  font-size: 12px;
  opacity: 0.6;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 15px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,107,107,0.15);
  color: #FF6B6B;
  border-left-color: #FF6B6B;
}

.nav-icon {
  margin-right: 12px;
  font-size: 18px;
}

/* ========== 主内容区 ========== */
.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
}

/* 顶部栏 */
.top-bar {
  background: #fff;
  padding: 16px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 99;
}

.top-bar h1 {
  font-size: 22px;
  color: #333;
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-info span {
  font-size: 14px;
  color: #666;
}

.logout-btn {
  background: #ff4d4f;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.logout-btn:hover {
  background: #ff7875;
}

/* 页面内容 */
.page-content {
  display: none;
  padding: 30px;
}

.page-content.active {
  display: block;
}

/* ========== 统计卡片 ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.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.04);
}

.stat-icon {
  width: 60px;
  height: 60px;
  background: #FFF0F0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #333;
}

.stat-label {
  font-size: 14px;
  color: #999;
  margin-top: 4px;
}

/* ========== 图表区域 ========== */
.chart-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chart-section h3 {
  font-size: 18px;
  margin-bottom: 20px;
}

/* ========== 数据表格 ========== */
.recent-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.recent-section h3 {
  font-size: 18px;
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.data-table thead {
  background: #fafafa;
}

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  color: #666;
  font-weight: 600;
  border-bottom: 2px solid #f0f0f0;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #f5f5f5;
}

.data-table tr:hover {
  background: #fafafa;
}

/* 状态标签 */
.status-badge {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-pending { background: #FFF0F0; color: #FF6B6B; }
.status-pending_use { background: #FFF7E6; color: #FA8C16; }
.status-completed { background: #F6FFED; color: #52C41A; }
.status-cancelled { background: #F5F5F5; color: #999; }

/* ========== 操作按钮 ========== */
.page-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.btn-primary {
  background: #FF6B6B;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #FF5252;
}

.btn-outline {
  background: #fff;
  color: #666;
  border: 1px solid #ddd;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-outline:hover {
  border-color: #FF6B6B;
  color: #FF6B6B;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  margin-right: 6px;
}

.btn-sm.edit { color: #1890ff; border-color: #1890ff; }
.btn-sm.delete { color: #ff4d4f; border-color: #ff4d4f; }
.btn-sm.confirm { color: #52C41A; border-color: #52C41A; }

/* 输入控件 */
input[type="text"], input[type="number"], input[type="date"], 
select, textarea {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: #FF6B6B;
}

select {
  cursor: pointer;
}

/* ========== 表单 ========== */
.store-form {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  max-width: 800px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.store-form h3 {
  font-size: 18px;
  margin: 24px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.store-form h3:first-child {
  margin-top: 0;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: #666;
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
}

.form-actions {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

/* ========== 弹窗 ========== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 600px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
}

.close {
  font-size: 28px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ========== 充值方案编辑器 ========== */
.plan-editor-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
}

.plan-editor-item .form-group {
  margin-bottom: 0;
}

.plan-editor-item .form-group label {
  font-size: 12px;
}

.plan-remove-btn {
  background: #ff4d4f;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  height: 36px;
}

/* ========== 轮播图编辑器 ========== */
.banner-editor-item {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  background: #f9f9f9;
  padding: 12px;
  border-radius: 8px;
}

.banner-editor-item input {
  flex: 1;
}