:root {
  --primary: #c0392b;         /* 政务红 */
  --primary-dark: #a93226;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #2c3e50;
  --muted: #7f8c8d;
  --border: #e5e8ec;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;              /* 大字体 */
}

/* 登录页 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #a93226, #c0392b);
}
.login-card {
  background: #fff; border-radius: var(--radius); padding: 40px 36px;
  width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 16px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #2c3e50; color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.sidebar .brand { padding: 22px 20px; font-size: 18px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand small { display: block; font-size: 12px; font-weight: 400; opacity: .7; margin-top: 4px; }
.nav { flex: 1; padding: 12px 0; }
.nav a {
  display: block; padding: 14px 22px; color: rgba(255,255,255,.85);
  text-decoration: none; font-size: 16px; cursor: pointer;
}
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background: var(--primary); color: #fff; }
.sidebar .user { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.sidebar .user button {
  width: 100%; margin-top: 10px; padding: 10px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.15); color: #fff; font-size: 14px; cursor: pointer;
}

.main { flex: 1; padding: 26px; overflow: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.page-head h2 { font-size: 24px; }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.card .num { font-size: 34px; font-weight: 700; color: var(--primary); }
.card .label { color: var(--muted); margin-top: 6px; font-size: 15px; }

/* 表格 */
.table-wrap { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 15px; }
th { background: #fafbfc; color: var(--muted); font-weight: 600; }
tr:hover td { background: #fafbfc; }

/* 按钮 */
.btn {
  display: inline-block; padding: 12px 20px; border: none; border-radius: 10px;
  font-size: 16px; cursor: pointer; background: var(--primary); color: #fff;
  min-height: 44px;
}
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.sm { padding: 8px 14px; font-size: 14px; min-height: 36px; }
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 标签 */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 13px; }
.tag.red { background: #fdecea; color: var(--danger); }
.tag.green { background: #e8f8f0; color: var(--success); }
.tag.orange { background: #fef5e7; color: var(--warning); }
.tag.gray { background: #eef0f2; color: var(--muted); }

/* 文本颜色 */
.txt-green { color: var(--success); font-weight: 600; }
.txt-red { color: var(--danger); font-weight: 600; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: var(--radius); width: 560px; max-width: 92vw;
  max-height: 88vh; overflow: auto; padding: 26px;
}
.modal h3 { margin-bottom: 18px; font-size: 20px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }

/* 提示条 */
.banner {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 15px;
}
.banner.blue { background: #eaf4fd; color: #2471a3; }
.banner.red { background: #fdecea; color: var(--danger); }
.banner.green { background: #e8f8f0; color: var(--success); }
.banner.orange { background: #fef5e7; color: #b9770e; }

/* 表单行 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: span 2; }

/* checkbox 组 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer; font-size: 14px; user-select: none; background: #fff;
}
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 菜品多选列表（手动生成/编辑菜谱） */
.dish-pick-list {
  max-height: 320px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px; background: #fafbfc;
}
.dish-pick {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.dish-pick:hover { background: #f0f2f5; }
.dish-pick input { margin: 0; }
.dish-pick .pick-name { flex: 1; color: var(--text); }
.dish-pick .pick-type { color: var(--muted); font-size: 12px; padding: 2px 8px; background: #eef0f2; border-radius: 10px; }
.dish-pick .pick-cost { color: var(--primary); font-weight: 600; min-width: 60px; text-align: right; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.toolbar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1; min-width: 200px; }

.empty { text-align: center; color: var(--muted); padding: 40px; }
.muted { color: var(--muted); }

/* 菜品图片 */
.dish-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  display: block; background: #f5f6f8;
}
.no-img { color: #bdc3c7; font-size: 12px; }
.img-upload { display: flex; gap: 16px; align-items: flex-start; }
.img-preview {
  width: 120px; height: 120px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border); background: #f5f6f8;
}
.img-actions { display: flex; flex-direction: column; gap: 10px; }
.img-actions label.btn { text-align: center; }

/* 可点击图片（大图预览） */
.clickable { cursor: zoom-in; }
.img-viewer {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.img-viewer-img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 8px; }
.img-viewer-close {
  position: absolute; top: 24px; right: 28px; color: #fff; font-size: 28px;
  cursor: pointer; width: 40px; height: 40px; text-align: center; line-height: 40px;
  background: rgba(255, 255, 255, 0.2); border-radius: 50%;
}
.img-viewer-close:hover { background: rgba(255, 255, 255, 0.35); }

/* 系统信息卡片 */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px; }
.info-item { display: flex; flex-direction: column; gap: 4px; }
.info-item .label { font-size: 13px; color: var(--muted); }
.info-item .value { font-size: 15px; font-weight: 600; color: var(--text); }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.stat-chip {
  display: inline-block; padding: 6px 14px; border-radius: 20px;
  background: #eef0f2; color: var(--text); font-size: 14px;
}
.stat-chip.warn { background: #fdecea; color: var(--danger); font-weight: 600; }

/* 开关 */
.switch-row { display: flex; align-items: center; gap: 12px; height: 40px; }
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: #ccc;
  border-radius: 26px; transition: .3s;
}
.switch .slider:before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .3s;
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* 备份 */
.backup-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.import-box { display: flex; align-items: center; gap: 10px; }
.import-box input[type=file] { font-size: 14px; }
