/* 商家管理端样式 */
:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --sidebar-bg: #1e1e2e;
  --sidebar-width: 220px;
  --header-h: 60px;
  --bg: #f4f6fb;
  --white: #ffffff;
  --text: #333;
  --text-light: #888;
  --border: #e5e7eb;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'PingFang SC','Microsoft YaHei',sans-serif; background: var(--bg); color: var(--text); }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#f97316,#ea580c); }
.login-box { background: white; border-radius: 16px; padding: 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.login-box .logo { text-align: center; margin-bottom: 30px; }
.login-box .logo img { width: 64px; height: 64px; border-radius: 12px; }
.login-box h2 { text-align: center; font-size: 22px; color: var(--primary); margin-bottom: 6px; }
.login-box .subtitle { text-align: center; color: var(--text-light); font-size: 14px; margin-bottom: 30px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; color: var(--text); margin-bottom: 6px; font-weight: 500; }
.form-group input { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,0.1); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-full { width: 100%; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }

/* 布局 */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--sidebar-bg); position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; display: flex; flex-direction: column; }
.sidebar-logo { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo h1 { color: white; font-size: 16px; }
.sidebar-logo p { color: rgba(255,255,255,0.5); font-size: 12px; margin-top: 4px; }
.sidebar-menu { flex: 1; padding: 12px 0; }
.menu-section { padding: 8px 16px 4px; color: rgba(255,255,255,0.35); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: rgba(255,255,255,0.7); cursor: pointer; font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent; }
.menu-item:hover, .menu-item.active { background: rgba(249,115,22,0.15); color: var(--primary); border-left-color: var(--primary); }
.menu-item .icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer .user-info { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.7); font-size: 13px; }

.main-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.header { height: var(--header-h); background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 99; }
.header h2 { font-size: 18px; color: var(--text); }
.header-right { display: flex; align-items: center; gap: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef9c3; color: #ca8a04; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #2563eb; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

.page-content { padding: 24px; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 600; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-icon.orange { background: #fff7ed; color: var(--primary); }
.stat-icon.green { background: #f0fdf4; color: var(--success); }
.stat-icon.blue { background: #eff6ff; color: var(--info); }
.stat-icon.yellow { background: #fefce8; color: var(--warning); }
.stat-info h3 { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-info p { font-size: 13px; color: var(--text-light); margin-top: 2px; }

/* 卡片 */
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: #f9fafb; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-light); font-size: 13px; }
tr:hover td { background: #fafafa; }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-bar input, .filter-bar select { height: 36px; border: 1px solid var(--border); border-radius: 6px; padding: 0 12px; font-size: 13px; outline: none; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 0 0; }
.page-btn { height: 32px; min-width: 32px; border: 1px solid var(--border); background: white; border-radius: 6px; cursor: pointer; font-size: 13px; padding: 0 10px; }
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-info { font-size: 13px; color: var(--text-light); }

/* 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal { background: white; border-radius: 12px; width: 500px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(0,0,0,0.2); }
.modal-lg { width: 700px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-light); line-height: 1; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 表单 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; font-weight: 500; }
.form-control { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 6px; padding: 0 12px; font-size: 14px; outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,0.1); }
textarea.form-control { height: 80px; padding: 8px 12px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23888' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 8px; color: white; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; max-width: 320px; }
.toast-success { background: #22c55e; }
.toast-error { background: #ef4444; }
.toast-info { background: #3b82f6; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 空状态 */
.empty-state { text-align: center; padding: 40px; color: var(--text-light); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* 订单状态 */
.status-pending { background: #fef9c3; color: #ca8a04; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.status-paid { background: #dbeafe; color: #2563eb; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.status-completed { background: #dcfce7; color: #16a34a; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.status-cancelled { background: #f3f4f6; color: #6b7280; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.status-refunded { background: #fee2e2; color: #dc2626; padding: 2px 8px; border-radius: 12px; font-size: 12px; }

/* 菜品图片 */
.item-img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; background: #f3f4f6; }
.item-img-placeholder { width: 50px; height: 50px; border-radius: 6px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 20px; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
