* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #E53935;
  --dark: #1A1A1A;
  --sidebar: #1E1E2E;
  --card: #FFFFFF;
  --bg: #F5F5FA;
  --text: #333;
  --text-light: #888;
  --border: #E0E0E0;
  --green: #4CAF50;
  --orange: #FF9800;
}
body { font-family: -apple-system, "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }

/* ==================== 登录注册页 ==================== */
.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #1A1A2E, #16213E); }
.auth-box { background: #fff; border-radius: 16px; padding: 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.auth-box h1 { text-align: center; font-size: 24px; margin-bottom: 8px; }
.auth-box .sub { text-align: center; color: var(--text-light); font-size: 14px; margin-bottom: 30px; }
.auth-tabs { display: flex; margin-bottom: 24px; border-bottom: 2px solid var(--border); }
.auth-tab { flex: 1; text-align: center; padding: 10px; cursor: pointer; font-size: 16px; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: bold; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.form-group input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-block { width: 100%; padding: 12px; font-size: 16px; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: #f44336; color: #fff; }
.btn-success { background: var(--green); color: #fff; }

/* ==================== 主框架 ==================== */
.main-wrap { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--sidebar); color: #ccc; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .logo { padding: 20px; font-size: 18px; font-weight: bold; color: #fff; border-bottom: 1px solid #333; }
.sidebar .nav { flex: 1; padding: 10px 0; }
.sidebar .nav-item { padding: 12px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 14px; transition: all 0.2s; }
.sidebar .nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar .nav-item.active { background: rgba(229,57,53,0.15); color: var(--primary); border-left: 3px solid var(--primary); }
.sidebar .nav-item .icon { font-size: 18px; }
.sidebar .store-info { padding: 16px 20px; border-top: 1px solid #333; font-size: 13px; }
.sidebar .store-info .store-name { color: #fff; font-weight: bold; margin-bottom: 4px; }
.sidebar .store-info .store-switch { color: var(--primary); cursor: pointer; font-size: 12px; }
.content { flex: 1; padding: 24px; overflow-y: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.topbar h2 { font-size: 20px; }
.topbar .user-info { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar .user-info .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ==================== 卡片/表格 ==================== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-card .stat-label { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: bold; }
.stat-card .stat-value.red { color: var(--primary); }
.stat-card .stat-value.green { color: var(--green); }
.stat-card .stat-value.orange { color: var(--orange); }

.card { background: var(--card); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 16px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 16px; }
.card-body { padding: 20px; }

table { width: 100%; border-collapse: collapse; }
table th { text-align: left; padding: 12px 16px; font-size: 13px; color: var(--text-light); border-bottom: 2px solid var(--border); }
table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
table tr:hover { background: var(--bg); }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.tag-red { background: #FFEBEE; color: #C62828; }
.tag-green { background: #E8F5E9; color: #2E7D32; }
.tag-orange { background: #FFF3E0; color: #E65100; }
.tag-blue { background: #E3F2FD; color: #1565C0; }
.tag-gray { background: #F5F5F5; color: #666; }

/* 弹窗 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 500px; max-width: 90%; max-height: 80vh; overflow-y: auto; }
.modal h3 { margin-bottom: 20px; font-size: 18px; }
.modal .form-group { margin-bottom: 14px; }
.modal .modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.modal textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; resize: vertical; min-height: 60px; }

/* 门店选择器 */
.store-selector { padding: 16px 20px; border-bottom: 1px solid #333; }
.store-selector select { width: 100%; padding: 8px; background: #2A2A3E; color: #fff; border: 1px solid #444; border-radius: 6px; font-size: 13px; outline: none; }

/* 空状态 */
.empty { text-align: center; padding: 40px; color: var(--text-light); }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* 图片上传预览 */
.img-preview { width: 120px; height: 120px; border: 2px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview .placeholder { color: var(--text-light); font-size: 12px; }

/* 响应式 */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 60px; }
  .sidebar .logo, .sidebar .store-info, .sidebar .nav-item span:not(.icon) { display: none; }
  .sidebar .nav-item { justify-content: center; }
}
