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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: #f0f2f5;
  color: #333333;
  line-height: 1.5;
  min-height: 100vh;
}

/* 1. 登录卡片 */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 16px;
  padding: 36px 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.logo-circle {
  width: 56px;
  height: 56px;
  background: #ebf8ff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 6px;
}

.login-header p {
  font-size: 13px;
  color: #718096;
}

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

.form-item label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 6px;
}

.form-item input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s;
}

.form-item input:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.login-tip {
  background: #f7fafc;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #718096;
  margin-bottom: 22px;
  line-height: 1.4;
}

.login-tip code {
  background: #edf2f7;
  padding: 2px 4px;
  border-radius: 4px;
  color: #2b6cb0;
  font-weight: 600;
}

.login-btn {
  width: 100%;
  height: 44px;
  background: #3182ce;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.login-btn:hover {
  background: #2b6cb0;
}

/* 2. 后台主界面 */
.top-nav {
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 22px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a202c;
}

.db-badge {
  font-size: 11px;
  background: #e2e8f0;
  color: #4a5568;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.admin-name strong {
  color: #2b6cb0;
}

.nav-link {
  color: #3182ce;
  text-decoration: none;
  font-size: 13px;
}

.logout-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #718096;
  cursor: pointer;
}

.logout-btn:hover {
  background: #fff5f5;
  color: #e53e3e;
  border-color: #feb2b2;
}

.admin-body {
  max-width: 1360px;
  margin: 24px auto;
  padding: 0 20px 40px;
}

/* 统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.stat-label {
  font-size: 13px;
  color: #718096;
  font-weight: 500;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
}

.stat-value small {
  font-size: 14px;
  font-weight: normal;
}

.text-green { color: #07C160; }
.text-blue { color: #3182ce; }
.text-orange { color: #dd6b20; }
.text-gray { color: #4a5568; }

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.icon-green { background: #e6fffa; color: #319795; }
.icon-blue { background: #ebf8ff; color: #3182ce; }
.icon-orange { background: #fffaf0; color: #dd6b20; }
.icon-gray { background: #f7fafc; color: #718096; }

/* 筛选与操作条 */
.toolbar-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #3182ce;
  border-color: #3182ce;
  color: #ffffff;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-wrap input {
  height: 38px;
  width: 260px;
  padding: 0 12px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  outline: none;
}

.search-wrap input:focus {
  border-color: #3182ce;
}

.search-btn,
.reset-btn,
.export-btn,
.refresh-btn {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-weight: 500;
  transition: all 0.2s;
}

.search-btn {
  background: #3182ce;
  color: #ffffff;
}

.search-btn:hover { background: #2b6cb0; }

.reset-btn {
  background: #edf2f7;
  color: #4a5568;
}

.export-btn {
  background: #07C160;
  color: #ffffff;
}

.export-btn:hover { background: #06ad56; }

.refresh-btn {
  background: #edf2f7;
  color: #4a5568;
}

/* 表格卡片 */
.table-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table th {
  background: #f8fafc;
  color: #718096;
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  color: #2d3748;
  white-space: nowrap;
}

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

.status-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-paid {
  background: #def7ec;
  color: #03543f;
}

.status-pending {
  background: #feecdc;
  color: #8a2b0d;
}

.order-no-cell {
  font-family: monospace;
  font-size: 12px;
  color: #718096;
}

.time-cell {
  font-size: 12px;
  color: #718096;
}

.action-btn {
  background: #edf2f7;
  color: #2b6cb0;
  border: 1px solid #cbd5e0;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.action-btn:hover {
  background: #3182ce;
  color: #ffffff;
  border-color: #3182ce;
}

.loading-td,
.empty-td {
  text-align: center;
  padding: 40px !important;
  color: #a0aec0;
}

/* 分页条 */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid #edf2f7;
  font-size: 13px;
  color: #718096;
}

.page-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #4a5568;
  cursor: pointer;
  margin-left: 8px;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-btn:not(:disabled):hover {
  border-color: #3182ce;
  color: #3182ce;
}

/* 模式切换卡片 */
.mode-switch-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 5px solid #07C160;
  transition: all 0.3s;
}

.mode-switch-card.off {
  border-left-color: #4a5568;
}

.mode-info {
  flex: 1;
}

.mode-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin-bottom: 6px;
}

.mode-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.badge-green {
  background: #def7ec;
  color: #03543f;
}

.badge-gray {
  background: #edf2f7;
  color: #4a5568;
}

.mode-desc {
  font-size: 12px;
  color: #718096;
}

/* iOS 风格开关滑块 */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 28px;
  margin-left: 20px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e0;
  transition: .3s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: #07C160;
}

input:checked + .slider:before {
  transform: translateX(26px);
}
