/* ===========================================================
   嘉荣教育集团 · 自动菜谱生成系统  —  统一视觉主题
   设计语言与「食安智控」保持一致：深绿 / 薄荷 / 中性灰
   =========================================================== */
:root {
  --brand: #0f766e;
  --brand-dark: #0b5c56;
  --brand-ink: #083f3b;
  --brand-soft: #e6f4f0;
  --brand-mist: #f1f8f5;
  --lime: #8bc34a;
  --gold: #b7791f;
  --gold-soft: #fdf3df;
  --danger: #c0392b;
  --danger-soft: #fdecea;

  --ink: #142a24;
  --ink-2: #33473f;
  --muted: #6b7d76;
  --muted-2: #93a39d;
  --line: #e1e9e4;
  --line-strong: #d3e0da;

  --bg: #f5f9f7;
  --surface: #ffffff;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;

  --shadow-xs: 0 1px 2px rgba(12, 47, 38, .05);
  --shadow-sm: 0 1px 3px rgba(12, 47, 38, .07), 0 1px 2px rgba(12, 47, 38, .04);
  --shadow-md: 0 10px 28px rgba(12, 47, 38, .08);
  --shadow-lg: 0 20px 56px rgba(12, 47, 38, .16);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 12% -10%, #e9f5f0 0%, rgba(233,245,240,0) 60%),
    radial-gradient(900px 520px at 100% 0%, #eef7f2 0%, rgba(238,247,242,0) 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand); }
::selection { background: #cdeee4; color: var(--brand-ink); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfded8; border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6cbc3; background-clip: content-box; }

/* =============== 顶部账号栏 =============== */
.user-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 26px; flex-wrap: wrap;
  color: #d9ece6; font-size: 12px;
  background: linear-gradient(120deg, #0a3a35 0%, #0f5b54 55%, #12736a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  position: relative;
  overflow: hidden;
}
.user-bar::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 120px at 12% 0%, rgba(167, 243, 208, .16), transparent 70%);
  pointer-events: none;
}
.user-left, .user-right, .user-quota { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: relative; z-index: 1; }
.role-chip {
  padding: 3px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  background: rgba(255, 255, 255, .16); color: #ffffff; border: 1px solid rgba(255, 255, 255, .18);
}
.role-chip.paid { background: linear-gradient(120deg, #d9a13b, #b7791f); border-color: transparent; }
.role-chip.admin { background: rgba(255, 255, 255, .24); }
.role-chip.expired { background: linear-gradient(120deg, #e05a4d, #c0392b); border-color: transparent; }
.user-email { color: #c9e3db; letter-spacing: .01em; }
.user-quota { color: #b9d8ce; gap: 16px; font-variant-numeric: tabular-nums; }
.user-quota b { color: #ffffff; font-weight: 650; }
.user-quota .used { color: #ffd98a; }
.user-link { color: #b9d8ce; text-decoration: none; padding: 3px 9px; border-radius: 8px; transition: background .16s, color .16s; }
.user-link:hover { color: #fff; background: rgba(255, 255, 255, .12); }

/* 临时账号规则条 */
.temp-rules {
  max-width: 1400px; margin: 14px auto -4px; padding: 12px 16px;
  background: var(--gold-soft); border: 1px solid #f0dfae; border-radius: var(--radius);
  color: #8a6a1e; font-size: 12px; line-height: 1.7;
}
.temp-rules b { color: var(--brand-dark); margin-right: 8px; }

/* =============== 工具条 =============== */
.toolbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 26px; margin-bottom: 6px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.toolbar h1 {
  display: flex; align-items: center; gap: 9px;
  font-size: 16px; font-weight: 700; letter-spacing: -.01em;
  color: var(--brand-ink); margin: 0 14px 0 0;
}
.toolbar label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.toolbar input[type=date], .toolbar select,
.config-row select, .config-row input {
  padding: 8px 11px; font-size: 12.5px; font-family: inherit;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .16s, box-shadow .16s, background .16s;
  outline: none;
}
.toolbar input[type=date]:hover, .toolbar select:hover,
.config-row select:hover, .config-row input:hover { border-color: #b9cec6; }
.toolbar input[type=date]:focus, .toolbar select:focus,
.config-row select:focus, .config-row input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); background: #fff;
}

/* =============== 按钮 =============== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 12.5px; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s, color .18s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; flex: 0 0 15px; }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .22);
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 8px 22px rgba(15, 118, 110, .3); }
.btn-secondary {
  background: #fff; color: var(--ink-2); border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--brand-mist); border-color: #bcd8ce; color: var(--brand-dark); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 6px 16px rgba(192, 57, 43, .22); }
.btn-danger:hover { filter: brightness(1.05); }
.btn-sm { padding: 6px 12px; font-size: 11.5px; border-radius: 9px; }
.btn-sm svg { width: 13px; height: 13px; flex: 0 0 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* =============== 卡片 / 配置面板 =============== */
.config-panel, .pool-panel {
  max-width: 1400px; margin: 16px auto;
  background: var(--surface); padding: 20px 24px;
  border-radius: var(--radius-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.config-panel h3, .pool-panel h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px; padding-bottom: 12px;
  font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--brand-ink);
  border-bottom: 1px solid var(--line);
}
.config-panel h3 .hint, .config-panel h3 span { font-weight: 500; color: var(--muted-2); font-size: 11.5px; }
.config-row { display: flex; gap: 9px; align-items: center; margin: 8px 0; flex-wrap: wrap; }

/* 星期 chips */
.day-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.day-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-soft);
  border: 1px solid #d3ece4; transition: transform .12s, box-shadow .16s;
}
.day-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 118, 110, .12); }
.day-chip .x { cursor: pointer; color: #c0392b; font-weight: 700; opacity: .75; margin-left: 2px; }
.day-chip .x:hover { opacity: 1; }

/* 菜式行列表 */
.row-list { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px; background: var(--brand-mist); }
.row-item { display: flex; gap: 7px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.row-item:last-child { border-bottom: 0; }

/* =============== 菜谱纸张 =============== */
.sheet {
  max-width: 1400px; margin: 18px auto; padding: 30px 32px 26px;
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
  position: relative;
}
.sheet::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--brand), var(--lime));
  opacity: .85;
}
.title {
  text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .12em;
  color: var(--brand-ink); margin: 4px 0 6px;
}
.sub { text-align: center; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; margin-bottom: 18px; }

.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius); }
table.menu {
  width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0;
  font-size: 12.5px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
table.menu th, table.menu td {
  padding: 9px 8px; text-align: center; vertical-align: middle; line-height: 1.45;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
table.menu thead th {
  background: var(--brand-mist); color: var(--brand-ink);
  font-weight: 700; font-size: 12px; letter-spacing: .04em;
  border-bottom: 1px solid var(--line-strong);
  position: sticky; top: 0; z-index: 2;
}
table.menu thead th .en { color: var(--muted-2); font-weight: 500; }
table.menu thead th:last-child, table.menu td:last-child { border-right: none; }
table.menu tbody tr:last-child td { border-bottom: none; }
table.menu tbody tr:nth-child(even) { background: #fbfdfc; }
table.menu tbody tr:hover { background: #f2faf7; }
.col-meal { width: 66px; font-weight: 700; color: var(--brand-dark); background: var(--brand-mist); }
.col-cat { width: 112px; color: var(--ink-2); font-weight: 600; background: #fbfdfc; }
.col-act { width: 96px; }
table.menu td.col-act, table.menu td:last-child { white-space: nowrap; }
.meal-block { font-weight: 700; letter-spacing: .12em; color: var(--brand-ink); background: var(--brand-mist); }
.en { display: block; margin-top: 2px; font-size: 10px; font-weight: 500; color: var(--muted-2); letter-spacing: 0; }

.dish-cell { cursor: pointer; transition: background .12s, color .12s; }
.dish-cell:hover { background: #e9f6f1; color: var(--brand-ink); }
.dish-cell.dish-empty { color: #c3d2cc; }
.dish-cell.dish-empty::after { content: '＋'; font-size: 12px; opacity: .6; }
.dish-cell.dish-empty:hover { background: #eef8f4; }

/* 备注 / 营养分析 */
.note { margin-top: 20px; }
.diet-note-head {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--brand-dark); background: var(--brand-soft);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 10px;
}
.diet-note-body {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.9; text-align: justify;
  background: var(--brand-mist); border-left: 3px solid var(--brand);
  padding: 14px 18px; border-radius: var(--radius-sm);
}
.featured-row { display: flex; gap: 14px; flex-wrap: wrap; }
.featured-row .featured-dish { flex: 1 1 300px; margin-top: 0; min-width: 0; }
.featured-dish {
  margin-top: 14px; padding: 16px 20px;
  background: linear-gradient(180deg, #fffdf8, #fdf6ea);
  border: 1px solid #f0e0c2; border-radius: var(--radius);
}
.featured-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--gold); }
.nutri-badge { padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #fff; background: linear-gradient(120deg, #e8a33d, #c9791c); }
.featured-name { margin-bottom: 10px; font-size: 17px; font-weight: 700; letter-spacing: .06em; color: #8a5a00; }
.nutri-tag { display: inline-block; margin: 0 7px 6px 0; padding: 3px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: #b3701c; background: #fff5e6; border: 1px solid #f3ddb8; }
.featured-list { margin: 6px 0 10px; padding-left: 18px; }
.featured-list li { font-size: 12.5px; line-height: 1.9; color: var(--ink-2); }
.featured-list li b { color: #b3701c; }
.featured-foot { padding-top: 10px; border-top: 1px dashed #f0e0c2; font-size: 11.5px; color: #a07840; line-height: 1.8; }

/* =============== 菜谱库 =============== */
.pool-panel h2 { cursor: pointer; }
.pool-panel h2::after { content: "▾"; margin-left: auto; font-size: 11px; color: var(--muted-2); }
.pool-body { display: none; }
.pool-body.open { display: block; }
.pool-grid { display: grid; grid-template-columns: 180px 1fr; gap: 20px; }
.cat-list { border-right: 1px solid var(--line); padding-right: 14px; }
.cat-list .cat-btn {
  display: block; width: 100%; text-align: left; padding: 8px 12px; margin: 2px 0;
  background: none; border: 0; border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 600; color: var(--ink-2);
  transition: background .14s, color .14s;
}
.cat-list .cat-btn:hover { background: var(--brand-mist); }
.cat-list .cat-btn.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.pool-right { min-width: 0; }
.dish-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.dish-tag {
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-mist); border: 1px solid #dcefe8;
  transition: transform .12s, box-shadow .16s;
}
.dish-tag:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 118, 110, .12); }
.add-row { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.add-row input {
  flex: 1; padding: 9px 12px; font-family: inherit; font-size: 12.5px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.add-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }

/* 表格内小操作按钮 */
.del-btn, .hide-btn {
  display: inline-block; padding: 2px 7px; border-radius: 6px; cursor: pointer;
  font-size: 9.5px; font-weight: 700; line-height: 1.5; white-space: nowrap;
  transition: transform .12s, box-shadow .16s, background .16s; vertical-align: middle;
}
.del-btn { color: #b62f3a; background: #fdebed; border: 1px solid #f3c3c8; }
.hide-btn { color: #5c6f68; background: #eef3f0; border: 1px solid #dde7e2; margin-left: 4px; }
.del-btn:hover, .hide-btn:hover { transform: translateY(-1px); }

/* 锁定 */
#btnLock.locked { background: var(--gold); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(183, 121, 31, .22); }
.lock-badge {
  position: absolute; top: 16px; right: 20px; padding: 4px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: var(--gold); background: var(--gold-soft); border: 1px solid #f0dfae;
}

/* =============== 弹层 =============== */
.dish-editor, .confirm-mask, .quota-pop {
  position: fixed; inset: 0; z-index: 1000; padding: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 33, 30, .45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.dish-editor-card, .confirm-card, .quota-pop .qp-box {
  width: 380px; max-width: 94vw; padding: 22px;
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.dish-editor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 13px; font-weight: 700; color: var(--brand-ink); }
.dish-editor-close { cursor: pointer; font-size: 20px; line-height: 1; color: var(--muted-2); }
.dish-editor-close:hover { color: var(--danger); }
.dish-editor-card input {
  width: 100%; padding: 10px 12px; font-family: inherit; font-size: 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: none;
}
.dish-editor-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.dish-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.confirm-msg { margin-bottom: 16px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.quota-pop h3 { margin: 0 0 10px; font-size: 16px; color: var(--danger); }
.quota-pop p { margin: 0 0 16px; font-size: 13px; line-height: 1.8; color: var(--ink-2); }
.quota-pop button {
  float: right; padding: 9px 22px; border: 0; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 650; color: #fff; background: var(--brand); cursor: pointer;
}

/* =============== 登录页 =============== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 18px;
}
.login-box {
  width: 400px; max-width: 100%; padding: 34px 34px 28px;
  background: rgba(255, 255, 255, .96); border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 30px 80px rgba(8, 45, 40, .28);
}
.login-box h1 {
  margin: 0 0 8px; text-align: center; font-size: 21px; font-weight: 700;
  letter-spacing: .04em; color: var(--brand-ink);
}
.login-box .sub { margin-bottom: 22px; text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--brand-mist); border-radius: 12px; border: 1px solid var(--line);
}
.tabs button {
  flex: 1; padding: 8px 0; border: 0; border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 650; color: var(--muted); background: transparent;
  transition: background .16s, color .16s, box-shadow .16s;
}
.tabs button.on { color: var(--brand-dark); background: #fff; box-shadow: var(--shadow-sm); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.form-group input {
  width: 100%; padding: 11px 13px; font-family: inherit; font-size: 13px; color: var(--ink);
  background: #fbfdfc; border: 1px solid var(--line-strong); border-radius: 11px; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.form-group input::placeholder { color: #b4c4be; }
.form-group input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.code-btn {
  padding: 0 14px; white-space: nowrap; font-family: inherit; font-size: 12px; font-weight: 650;
  color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #d3ece4;
  border-radius: 11px; cursor: pointer; transition: background .16s;
}
.code-btn:hover { background: #d8efe7; }
.code-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-box .btn {
  width: 100%; justify-content: center; margin-top: 6px; padding: 11px 0; font-size: 13.5px;
  color: #fff; background: var(--brand); border-color: transparent;
  box-shadow: 0 8px 20px rgba(15, 118, 110, .24);
}
.login-box .btn:hover { background: var(--brand-dark); }
.login-box .btn:disabled { opacity: .6; box-shadow: none; }
.msg { margin-top: 12px; padding: 9px 12px; border-radius: 10px; font-size: 12px; line-height: 1.6; display: none; }
.msg.on { display: block; }
.msg.error { color: #9b2c21; background: var(--danger-soft); border: 1px solid #f6cfc9; }
.msg.ok { color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #cfe9e0; }
.rules {
  margin-top: 20px; padding: 14px 16px; border-radius: 12px;
  background: var(--brand-mist); border: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.9; color: var(--muted);
}
.rules > b { display: block; margin-bottom: 6px; color: var(--brand-dark); font-size: 12px; letter-spacing: .04em; }
.rules ul { margin: 0; padding-left: 18px; }
.rules li { margin: 3px 0; }
.rules li b { color: var(--brand-dark); font-weight: 700; }
.devcode { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.hide { display: none !important; }

/* 登录页背景：深绿玻璃 */
body.login-page {
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(20, 160, 143, .35), transparent 60%),
    radial-gradient(700px 500px at 85% 85%, rgba(139, 195, 74, .3), transparent 60%),
    linear-gradient(150deg, #083f3b 0%, #0b5c56 45%, #0f766e 100%);
}
body.login-page::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 72%);
}

/* =============== 管理页 =============== */
.wrap { max-width: 1100px; margin: 24px auto 60px; padding: 0 20px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 19px; font-weight: 700; color: var(--brand-ink); letter-spacing: -.01em; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 16px;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 4px; }
.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--brand-mist); border: 1px solid var(--line); }
.stat .n { font-size: 22px; font-weight: 700; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bar input, .bar select {
  padding: 8px 11px; font-family: inherit; font-size: 12.5px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: none;
}
.bar input:focus, .bar select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag.t-temp { color: var(--gold); background: var(--gold-soft); }
.tag.t-disabled { color: var(--muted); background: #eef2f0; }
.btn.b-green { background: var(--brand); color: #fff; }
.btn.b-red { background: var(--danger); color: #fff; }
.btn.b-grey { background: #eef2f0; color: var(--ink-2); border-color: var(--line-strong); }
.btn.b-gold { background: var(--gold); color: #fff; }
.notice { padding: 12px 14px; border-radius: var(--radius); background: var(--gold-soft); border: 1px solid #f0dfae; color: #8a6a1e; font-size: 12px; line-height: 1.7; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2000;
  padding: 10px 18px; border-radius: 999px; font-size: 12.5px; color: #fff;
  background: rgba(8, 33, 30, .92); box-shadow: var(--shadow-md);
}
.small { font-size: 11.5px; color: var(--muted); }

/* =============== 响应式 =============== */
@media (max-width: 900px) {
  .user-bar { padding: 10px 14px; font-size: 11.5px; }
  .user-quota { gap: 10px; }
  .toolbar { padding: 11px 14px; }
  .toolbar h1 { width: 100%; margin-right: 0; }
  .config-panel, .pool-panel, .sheet { margin: 12px 12px; padding: 16px; border-radius: var(--radius); }
  .sheet { padding: 20px 16px; }
  .title { font-size: 18px; }
  .pool-grid { grid-template-columns: 1fr; }
  .cat-list { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; display: flex; gap: 6px; overflow-x: auto; }
  .cat-list .cat-btn { width: auto; white-space: nowrap; }
  .login-box { padding: 26px 22px 22px; border-radius: 18px; }
}

/* =============== 打印 =============== */
@media print {
  .user-bar, .toolbar, .config-panel, .temp-rules, .pool-panel, .del-btn, .hide-btn,
  .col-act, .dish-editor, .confirm-mask, .lock-badge, .col-weeks, .quota-pop { display: none !important; }
  body { background: #fff; }
  .sheet { margin: 0; padding: 8px; max-width: 100%; border: 0; box-shadow: none; border-radius: 0; }
  .sheet::before { display: none; }
  table.menu { font-size: 11px; min-width: 0; box-shadow: none; }
  .table-wrap { overflow: visible; }
  .diet-note-body, .diet-note-head, .featured-dish, .nutri-badge, .nutri-tag, table.menu thead th {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

/* 工具条副标题 */
.toolbar h1 .h1-sub {
  margin-left: 10px; padding-left: 11px; border-left: 1px solid var(--line-strong);
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--muted-2);
}

/* =============== 营养分析（家长版） =============== */
.nutrition-panel {
  margin-top: 26px; padding-top: 22px;
  border-top: 1px dashed var(--line-strong);
}
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.np-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; letter-spacing: .05em; color: var(--brand-ink); }
.np-badge { padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: #fff; background: linear-gradient(120deg, #2f9e79, #0f766e); }
.np-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; font-size: 12px; color: var(--muted); }
.np-controls select {
  padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 8px;
  font-family: inherit; font-size: 12px; color: var(--ink); background: #fff; outline: none;
}
.np-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.np-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 12px; }
table.np-table th, table.np-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
table.np-table tr:last-child td { border-bottom: 0; }
table.np-table th:last-child, table.np-table td:last-child { border-right: 0; }
table.np-table thead th { background: var(--brand-mist); color: var(--brand-ink); font-weight: 700; font-size: 11.5px; white-space: nowrap; }
table.np-table thead th span { display: block; margin-top: 2px; font-size: 9.5px; font-weight: 500; color: var(--muted-2); }
table.np-table td b { font-size: 13px; font-weight: 700; }
table.np-table td i { display: block; margin-top: 1px; font-style: normal; font-size: 9.5px; color: var(--muted-2); }
table.np-table td.np-ok b { color: #1e7b45; }
table.np-table td.np-low { background: #fff8e6; }
table.np-table td.np-low b { color: #b7791f; }
table.np-table td.np-high { background: #fdecec; }
table.np-table td.np-high b { color: #c0392b; }
table.np-table td.np-day-col { text-align: left; background: #fbfdfc; white-space: nowrap; }
table.np-table td.np-day-col b { font-size: 12.5px; }
table.np-table td.np-day-col span { display: block; margin-top: 1px; font-size: 10px; color: var(--muted-2); }
table.np-table tr.np-avg td { background: #f2faf7; font-weight: 700; }
table.np-table tr.np-ref td { background: #fafafa; color: #888; }
table.np-table tr.np-ref td b { font-size: 11.5px; font-weight: 600; }
.np-summary { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 16px; }
.np-summary-main { flex: 0 0 auto; }
.np-kcal { font-size: 13px; color: var(--muted); }
.np-kcal b { font-size: 30px; font-weight: 700; color: var(--brand-ink); letter-spacing: -.01em; }
.np-kcal span { margin-left: 3px; font-size: 11px; }
.np-kcal-sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.np-tips { flex: 1 1 420px; margin: 0; padding: 0; list-style: none; }
.np-tips li { position: relative; padding: 8px 0 8px 14px; font-size: 12.5px; line-height: 1.8; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.np-tips li:last-child { border-bottom: 0; }
.np-tips li::before { content: ""; position: absolute; left: 0; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.np-tips li b { margin-right: 6px; color: var(--brand-dark); }
.np-detail { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.np-detail summary { padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--brand-dark); background: var(--brand-mist); cursor: pointer; }
.np-detail-body { padding: 6px 14px 12px; }
.np-detail-day { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.np-detail-day:last-child { border-bottom: 0; }
.np-detail-day-head { font-size: 12.5px; font-weight: 700; color: var(--brand-ink); margin-bottom: 4px; }
.np-detail-day-head span { margin-left: 8px; font-size: 11px; font-weight: 500; color: var(--muted); }
.np-detail-meal { margin: 6px 0 2px; }
.np-detail-meal > b { display: inline-block; width: 42px; font-size: 11.5px; color: var(--muted); vertical-align: top; }
.np-detail-meal table { display: inline-table; width: calc(100% - 50px); border-collapse: collapse; }
.np-detail-meal td { padding: 3px 8px 3px 0; font-size: 11.5px; color: var(--ink-2); border-bottom: 1px solid #f2f5f3; }
.np-detail-meal tr:last-child td { border-bottom: 0; }
.np-detail-meal td.np-dish-name { color: var(--ink); font-weight: 600; width: 34%; }
.np-detail-meal td.np-dish-gram { color: var(--muted-2); width: 44px; }
.np-detail-note { margin-top: 4px; font-size: 11px; color: var(--muted-2); }
.np-note { margin-top: 12px; font-size: 11px; line-height: 1.8; color: var(--muted-2); }

@media print {
  .nutrition-panel { page-break-inside: avoid; }
  .np-detail { display: none; }
}
@media (max-width: 640px) {
  .np-title { font-size: 14.5px; }
  .np-kcal b { font-size: 24px; }
  .np-summary { gap: 10px; }
}
.np-dish-tag { display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px; font-size: 9.5px; font-weight: 600; color: #b7791f; background: #fdf3df; border: 1px solid #f0dcb4; vertical-align: 1px; }
.np-legend { display: inline-flex; align-items: center; gap: 4px; margin-left: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.np-legend em { width: 9px; height: 9px; border-radius: 3px; margin-left: 6px; display: inline-block; }
.np-legend em.ok { background: #d9f0e3; border: 1px solid #b7e0c9; }
.np-legend em.low { background: #fdf0d4; border: 1px solid #f0dcb4; }
.np-legend em.high { background: #fadcd9; border: 1px solid #f2c4bf; }
.np-legend-row { margin: -6px 10px 8px 2px; text-align: right; font-size: 11px; color: var(--muted-2); }
