* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #f5f7fa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input {
  font-family: inherit;
  outline: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ===== 登录页面样式 ===== */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #ff6b35 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8f5f 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.3);
}

.login-logo-text {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.login-logo-sub {
  font-size: 13px;
  color: #999;
  margin-top: 4px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  background-color: #fafbfc;
}

.login-form input:focus {
  border-color: #ff6b35;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8f5f 100%);
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  margin-top: 8px;
  transition: all 0.2s;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-hint {
  text-align: center;
  margin-top: 20px;
  padding: 12px;
  background: #f5f7fa;
  border-radius: 8px;
  font-size: 12px;
  color: #888;
}

.login-error {
  background: #fff1f0;
  color: #cf1322;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.login-error.show {
  display: block;
}

/* ===== 主界面布局 ===== */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #eceff1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8f5f 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
}

.header-logo-text {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666;
  font-size: 14px;
}

.header-user-name {
  color: #333;
  font-weight: 500;
}

.logout-btn {
  padding: 8px 16px;
  background: #fff;
  color: #666;
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s;
}

.logout-btn:hover {
  color: #ff6b35;
  border-color: #ff6b35;
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.app-sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #eceff1;
  padding: 20px 0;
  flex-shrink: 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.menu-item:hover {
  background: #f9fafb;
  color: #333;
}

.menu-item.active {
  background: #fff5f0;
  color: #ff6b35;
  border-left-color: #ff6b35;
  font-weight: 500;
}

.menu-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.app-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-width: 0;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}

/* ===== 卡片样式 ===== */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 16px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff6b35, #ff8f5f);
}

.stat-card.blue::before {
  background: linear-gradient(90deg, #4a90e2, #6fb0ff);
}

.stat-card.green::before {
  background: linear-gradient(90deg, #52c41a, #73d13d);
}

.stat-card.purple::before {
  background: linear-gradient(90deg, #722ed1, #9254de);
}

.stat-card.teal::before {
  background: linear-gradient(90deg, #13c2c2, #36cfc9);
}

.stat-label {
  color: #999;
  font-size: 13px;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #333;
}

.stat-value .unit {
  font-size: 14px;
  color: #999;
  font-weight: normal;
  margin-left: 4px;
}

.stat-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  opacity: 0.1;
}

/* ===== 双栏表格布局 ===== */
.tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== 表格样式 ===== */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.status-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  background: #f5f7fa;
  color: #666;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s;
}

.filter-btn.active {
  background: #ff6b35;
  color: #fff;
}

.filter-btn:hover:not(.active) {
  background: #e8ebee;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead tr {
  background: #fafbfc;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  color: #666;
  border-bottom: 1px solid #eceff1;
  white-space: nowrap;
  font-size: 13px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f5f7fa;
  color: #333;
}

.data-table tbody tr:hover {
  background: #fafbfc;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== 状态标签 ===== */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
}

.status-badge.pending {
  background: #fff7e6;
  color: #fa8c16;
}

.status-badge.confirmed {
  background: #e6f7ff;
  color: #1890ff;
}

.status-badge.serving {
  background: #f9f0ff;
  color: #722ed1;
}

.status-badge.completed {
  background: #f6ffed;
  color: #52c41a;
}

.status-badge.cancelled {
  background: #fff1f0;
  color: #cf1322;
}

.status-badge.online {
  background: #f6ffed;
  color: #52c41a;
}

.status-badge.offline {
  background: #f5f7fa;
  color: #999;
}

/* ===== 按钮 ===== */
.btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.2s;
  margin-right: 6px;
}

.btn:last-child {
  margin-right: 0;
}

.btn-primary {
  background: #ff6b35;
  color: #fff;
}

.btn-primary:hover {
  background: #ff824f;
}

.btn-info {
  background: #1890ff;
  color: #fff;
}

.btn-info:hover {
  background: #40a9ff;
}

.btn-success {
  background: #52c41a;
  color: #fff;
}

.btn-success:hover {
  background: #73d13d;
}

.btn-danger {
  background: #ff4d4f;
  color: #fff;
}

.btn-danger:hover {
  background: #ff7875;
}

.btn-default {
  background: #f5f7fa;
  color: #666;
}

.btn-default:hover {
  background: #e8ebee;
}

/* ===== 加载和空状态 ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #ff6b35;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-text {
  font-size: 14px;
}

/* ===== 店铺设置表单 ===== */
.shop-form {
  max-width: 600px;
}

.form-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
}

.form-label {
  width: 120px;
  flex-shrink: 0;
  padding-top: 8px;
  color: #666;
  font-size: 14px;
  text-align: right;
  padding-right: 16px;
}

.form-control {
  flex: 1;
}

.form-control input,
.form-control textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  font-size: 14px;
  background: #fafbfc;
  transition: all 0.2s;
}

.form-control textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.form-control input:focus,
.form-control textarea:focus {
  border-color: #ff6b35;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.08);
}

.form-hint {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
}

.form-actions {
  padding-left: 120px;
  margin-top: 24px;
}

.btn-large {
  padding: 10px 24px;
  font-size: 14px;
}

/* ===== 消息提示 ===== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background: rgba(82, 196, 26, 0.92);
}

.toast.error {
  background: rgba(207, 19, 34, 0.92);
}

/* ===== 排名列表 ===== */
.rank-list {
  list-style: none;
}

.rank-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f5f7fa;
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-num {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f5f7fa;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  margin-right: 12px;
  flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-num {
  background: #fff1e8;
  color: #ff6b35;
}

.rank-item:nth-child(2) .rank-num {
  background: #f0f5ff;
  color: #4a90e2;
}

.rank-item:nth-child(3) .rank-num {
  background: #fff7e6;
  color: #fa8c16;
}

.rank-name {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.rank-value {
  font-size: 15px;
  font-weight: 600;
  color: #ff6b35;
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .tables-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .app-sidebar {
    width: 180px;
  }
  .header-logo-text {
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  .app-body {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    padding: 10px;
    display: flex;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid #eceff1;
  }
  .menu-item {
    padding: 10px 14px;
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }
  .menu-item.active {
    border-left: none;
    border-bottom-color: #ff6b35;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    flex-direction: column;
  }
  .form-label {
    width: auto;
    text-align: left;
    padding: 0 0 6px 0;
  }
  .form-actions {
    padding-left: 0;
  }
  .header-logo-text {
    display: none;
  }
}
