/* AI点餐助手 - 商家管理后台样式（手机适配） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px; color: #333; background: #F5F5F5;
}

/* ===== 登录 ===== */
.login-panel {
  display: flex; justify-content: center; align-items: center; height: 100vh;
  background: linear-gradient(135deg, #B71C1C, #C41A1A); padding: 16px;
}
.login-card {
  background: #FFF; padding: 32px 24px; border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2); width: 100%; max-width: 380px; text-align: center;
}
.login-card h1 { font-size: 24px; color: #C41A1A; margin-bottom: 6px; }
.login-subtitle { color: #999; margin-bottom: 24px; font-size: 15px; }
.login-hint { color: #CCC; font-size: 12px; margin-top: 16px; line-height: 1.5; }

.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 600; color: #666; font-size: 13px; }
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid #E0E0E0;
  border-radius: 8px; font-size: 14px; color: #333; font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus { border-color: #C41A1A; outline: none; }

button {
  padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px;
  cursor: pointer; font-weight: 600; transition: all 0.15s;
}
button:active { transform: scale(0.97); }
.login-card button {
  width: 100%; padding: 14px; background: linear-gradient(135deg, #C41A1A, #D93939);
  color: #FFF; font-size: 16px; border-radius: 10px;
}

.btn-primary { background: #C41A1A; color: #FFF; }
.btn-primary:hover { background: #A01515; }
.btn-success { background: #4CAF50; color: #FFF; }
.btn-danger { background: #E53935; color: #FFF; }
.btn-cancel { background: #F5F5F5; color: #666; }
.btn-refresh { background: #F5F5F5; color: #666; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-logout { background: none; color: #FF5252; padding: 8px 16px; font-size: 13px; }

/* ===== 主布局 ===== */
.main-panel { display: flex; height: 100vh; position: relative; }

/* 汉堡菜单 */
.menu-toggle {
  display: none; position: fixed; top: 10px; left: 10px; z-index: 1001;
  background: #C41A1A; color: #FFF; border: none; font-size: 22px;
  width: 40px; height: 40px; border-radius: 8px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 侧边栏遮罩 */
.sidebar-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 999;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: 220px; background: #1A1A2E; color: #FFF; display: flex;
  flex-direction: column; flex-shrink: 0; z-index: 1000;
  transition: transform 0.3s;
}
.sidebar-brand { padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand h2 { font-size: 18px; color: #FF5252; }
.sidebar-brand p { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.nav-menu { list-style: none; padding: 12px 0; flex: 1; }
.nav-item {
  padding: 14px 22px; cursor: pointer; font-size: 14px;
  color: rgba(255,255,255,0.65); border-left: 3px solid transparent; transition: all 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: #FFF; }
.nav-item.active {
  background: rgba(196,26,26,0.12); color: #FF5252; border-left-color: #FF5252;
}

.sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.08); }

/* ===== 内容区 ===== */
.content { flex: 1; overflow-y: auto; padding: 20px 24px; }
.page-title { font-size: 22px; margin-bottom: 20px; color: #1A1A2E; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 看板 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: #FFF; border-radius: 12px; padding: 20px 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  text-align: center;
}
.stat-card-title { font-size: 13px; color: #999; margin-bottom: 6px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: #C41A1A; }

.card { background: #FFF; border-radius: 12px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); margin-bottom: 14px; }
.card h3 { font-size: 15px; margin-bottom: 12px; }

.hot-item { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid #F5F5F5; }
.hot-item:last-child { border-bottom: none; }
.hot-rank {
  width: 26px; height: 26px; border-radius: 50%; background: #FFF0EE;
  color: #C41A1A; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; margin-right: 10px; flex-shrink: 0;
}
.hot-name { flex: 1; font-size: 14px; }
.hot-qty { color: #999; font-size: 12px; }

/* ===== 订单 ===== */
.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar select { padding: 8px 12px; border: 1px solid #E0E0E0; border-radius: 8px; font-size: 14px; }

.order-admin-card {
  background: #FFF; border-radius: 10px; padding: 16px; margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03); cursor: pointer; user-select: none;
  border-left: 3px solid transparent; transition: 0.15s;
}
.order-admin-card:hover { border-left-color: #C41A1A; }
.oac-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.oac-id { font-weight: 700; color: #C41A1A; font-size: 14px; }
.oac-time { color: #999; font-size: 12px; margin-left: auto; }
.oac-body { margin-bottom: 10px; }
.oac-items { font-size: 14px; line-height: 1.5; }
.oac-meta { font-size: 12px; color: #999; margin-top: 6px; }
.oac-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.oac-amount { font-size: 18px; font-weight: 700; color: #C41A1A; }
.oac-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-warning { background: #FFF8E1; color: #F57C00; }
.badge-info { background: #E3F2FD; color: #1976D2; }
.badge-success { background: #E8F5E9; color: #388E3C; }
.badge-default { background: #F5F5F5; color: #999; }

/* ===== 菜品管理 ===== */
.dish-admin-row {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  background: #FFF; border-radius: 10px; margin-bottom: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03); flex-wrap: wrap; gap: 8px;
}
.dish-admin-row.disabled { opacity: 0.5; }
.dar-name { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.dar-meta { font-size: 12px; color: #999; }
.dar-tags { margin-top: 2px; }
.dar-actions { display: flex; gap: 6px; }

/* ===== 对话框 ===== */
.dialog-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); display: flex; justify-content: center;
  align-items: center; z-index: 2000; padding: 16px;
}
.dialog {
  background: #FFF; border-radius: 14px; padding: 24px;
  width: 100%; max-width: 460px; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.dialog h3 { font-size: 18px; margin-bottom: 18px; color: #1A1A2E; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ===== 待接单badge ===== */
.pending-badge {
  display: inline-block; background: #C41A1A; color: #FFF; font-size: 11px;
  font-weight: 700; padding: 1px 7px; border-radius: 10px; margin-left: 6px;
  animation: pulse 2s infinite; vertical-align: middle;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ===== 打印样式 ===== */
.order-print-dialog {
  max-width: 440px; width: 92vw; font-family: 'SimSun','宋体',STSong,serif;
}
.order-print-dialog * { font-family: 'SimSun','宋体',STSong,serif; }
.print-header { text-align: center; padding-bottom: 8px; }
.print-header h2 { font-size: 20px; color: #C41A1A; margin-bottom: 2px; }
.print-header p { font-size: 12px; color: #666; }
.print-divider { border-top: 2px dashed #E0E0E0; margin: 10px 0; }
.print-info { font-size: 13px; }
.print-row { display: flex; justify-content: space-between; padding: 4px 0; }
.print-row span:first-child { color: #888; }
.print-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.print-table th, .print-table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid #F0F0F0; }
.print-table th { background: #F9F9F9; color: #666; font-weight: 600; }
.print-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; padding: 10px 0; }
.print-total span:last-child { color: #C41A1A; font-size: 22px; }
.print-footer { text-align: center; font-size: 12px; color: #999; margin-top: 6px; }
.print-footer p { margin: 1px 0; }
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; left: 0; top: 0; width: 100%; font-family: 'SimSun','宋体',serif !important; }
  #printArea * { font-family: 'SimSun','宋体',serif !important; }
  .no-print { display: none !important; }
  .print-header h2 { font-size: 24px; }
  .print-total span:last-child { font-size: 24px; }
}

/* ===== 手机端适配 ===== */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .sidebar-overlay { display: none; }
  .sidebar-overlay.show { display: block; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.show { transform: translateX(0); }

  .content { padding: 56px 12px 20px 12px; }
  .page-title { font-size: 20px; margin-bottom: 14px; }

  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 14px 10px; }
  .stat-card-value { font-size: 22px; }

  .oac-footer { flex-direction: column; align-items: flex-start; }
  .dish-admin-row { flex-direction: column; align-items: flex-start; }
  .dar-actions { align-self: flex-end; }

  .filter-bar { flex-wrap: wrap; }
  .filter-bar select { flex: 1; min-width: 120px; }

  .dialog { max-width: 96vw; padding: 18px; border-radius: 12px; }
  .login-card { margin: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-card { padding: 10px 6px; }
  .stat-card-title { font-size: 11px; }
  .stat-card-value { font-size: 18px; }

  .oac-actions button { font-size: 11px; padding: 5px 10px; }
  .dish-admin-row button { font-size: 11px; padding: 5px 10px; }
}
