/* 管理员后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  background: #f5f7fa;
  color: #333;
}

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

/* 侧边栏 */
.admin-sidebar {
  width: 250px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  flex-direction: column;
}

.logo {
  padding: 30px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo h2 {
  font-size: 1.5em;
}

.admin-menu {
  flex: 1;
  padding: 20px 0;
}

.menu-btn {
  width: 100%;
  padding: 15px 25px;
  background: none;
  border: none;
  color: white;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  transition: all 0.3s;
}

.menu-btn:hover {
  background: rgba(255,255,255,0.1);
  padding-left: 30px;
}

.menu-btn.active {
  background: rgba(255,255,255,0.2);
  border-left: 4px solid white;
}

.menu-btn .icon {
  font-size: 20px;
}

.admin-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-back {
  display: block;
  text-align: center;
  color: white;
  text-decoration: none;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.3s;
}

.btn-back:hover {
  background: rgba(255,255,255,0.1);
}

/* 主内容区 */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-header {
  background: white;
  padding: 25px 40px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 1.8em;
  color: #333;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-logout {
  background: #f5f7fa;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

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

/* 页面内容 */
.admin-page {
  flex: 1;
  padding: 30px 40px;
  overflow-y: auto;
}

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

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

.search-input {
  padding: 10px 20px;
  border: 2px solid #e9ecef;
  border-radius: 20px;
  font-size: 14px;
  width: 300px;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
}

/* 统计卡片 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 3em;
}

.stat-value {
  font-size: 2em;
  font-weight: bold;
  color: #667eea;
}

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

/* 表格 */
.table-container {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: #f8f9fa;
}

.data-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: #666;
  font-size: 14px;
  border-bottom: 2px solid #e9ecef;
}

.data-table td {
  padding: 15px;
  border-bottom: 1px solid #f5f7fa;
}

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

.status-badge {
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background: #c8e6c9;
  color: #2e7d32;
}

.status-expired {
  background: #ffcdd2;
  color: #c62828;
}

.status-expiring {
  background: #fff3e0;
  color: #e65100;
}

.btn-action {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  padding: 5px 10px;
  margin: 0 3px;
  transition: color 0.3s;
}

.btn-action:hover {
  color: #5568d3;
  text-decoration: underline;
}

.btn-delete {
  color: #f44336;
}

.btn-delete:hover {
  color: #d32f2f;
}

/* 统计概览 */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.overview-card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.overview-card h3 {
  font-size: 1.3em;
  margin-bottom: 20px;
  color: #333;
}

.overview-data {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
}

.data-label {
  font-size: 14px;
  color: #666;
}

.data-value {
  font-size: 1.5em;
  font-weight: bold;
  color: #667eea;
}

/* 图表区域 */
.chart-section {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chart-section h3 {
  font-size: 1.3em;
  margin-bottom: 20px;
  color: #333;
}

.chart-placeholder {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 10px;
  color: #999;
  font-size: 1.2em;
}

/* 设置页面 */
.settings-section {
  background: white;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.settings-section h3 {
  font-size: 1.2em;
  margin-bottom: 20px;
  color: #333;
  padding-bottom: 10px;
  border-bottom: 2px solid #f5f7fa;
}

.setting-item {
  margin-bottom: 20px;
}

.setting-item label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.setting-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.setting-input:focus {
  outline: none;
  border-color: #667eea;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

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

.modal-header h2 {
  font-size: 1.5em;
  color: #333;
}

.modal-close {
  font-size: 30px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s;
}

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

.modal-body {
  padding: 30px;
}

.form-group {
  margin-bottom: 20px;
}

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

.form-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: #667eea;
}

.form-input:disabled {
  background: #f5f7fa;
  color: #999;
}

.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid #f5f7fa;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  padding: 10px 25px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: #667eea;
  color: white;
}

/* 响应式 */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .admin-container {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }

  .admin-menu {
    display: flex;
    padding: 0;
  }

  .menu-btn {
    flex: 1;
    padding: 15px 10px;
    justify-content: center;
  }

  .admin-footer {
    display: none;
  }

  .page-actions {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .search-input {
    width: 100%;
  }

  .stats-cards {
    grid-template-columns: 1fr;
  }

  .stats-overview {
    grid-template-columns: 1fr;
  }
}