/* ============================================================
   明天吃什么 —— 移动端风格样式
   浅色暖调主题：主色 橙 #FF7A45
   ============================================================ */

:root {
  --primary: #ff7a45;
  --primary-dark: #f2601f;
  --primary-light: #fff1e9;
  --primary-grad: linear-gradient(135deg, #ff9a4d 0%, #ff7043 55%, #f4511e 100%);
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --line: #eceef1;
  --line-2: #f5f6f8;
  --green: #16a34a;
  --blue: #2f80ed;
  --red: #e5484d;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(31, 35, 41, 0.06);
  --shadow-lg: 0 12px 40px rgba(31, 35, 41, 0.16);
  --tab-h: 58px;
  --top-h: 56px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------------------
   关键：让 hidden 属性永远生效。
   .mask / .sheet / .dialog-wrap / .voicebar / .tabbar 这些浮层都写了
   display: flex|grid，作者样式的 display 会盖掉浏览器默认的
   [hidden] { display: none }，导致浮层即使标了 hidden 也照常渲染成
   全屏遮罩挡住所有点击。这条规则必须留在最前面，不要删。
   ------------------------------------------------------------ */
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------
   所有内联图标（<svg>）的统一默认样式。
   没有这条兜底时，任何没被具体规则覆盖的 <svg> 都会按替换元素的默认尺寸
   渲染成 300×150、fill 为黑色的实心图形 —— 页面上的"巨大黑图标"就是这么来的。
   具体位置的尺寸可以再单独覆盖（见 .tabbar button svg / .icon-btn svg 等）。
   ------------------------------------------------------------ */
svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue',
    Arial, sans-serif;
  color: var(--text);
  background: #eef0f3;
  background-image: radial-gradient(circle at 12% 18%, #ffe6d8 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, #fff0d6 0%, transparent 46%);
  background-attachment: fixed;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

input,
textarea,
select {
  outline: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------------- 手机外壳 ---------------- */

.stage {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}

.phone {
  position: relative;
  width: 420px;
  height: 860px;
  max-height: calc(100vh - 48px);
  background: var(--bg);
  border-radius: 30px;
  box-shadow: 0 24px 60px rgba(31, 35, 41, 0.18), 0 0 0 10px #1f2329, 0 0 0 12px #34383f;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 560px) {
  .stage {
    padding: 0;
  }
  .phone {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ---------------- 顶部栏 ---------------- */

.topbar {
  flex: none;
  min-height: var(--top-h);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: var(--primary-grad);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 5;
}

.topbar .tb-title {
  flex: 1;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar .tb-sub {
  font-size: 11px;
  opacity: 0.86;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .tb-back {
  width: 32px;
  height: 32px;
  margin-left: -6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}

.topbar .tb-back:active {
  background: rgba(255, 255, 255, 0.18);
}

.topbar .tb-action {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(4px);
}

.topbar .tb-action:active {
  background: rgba(255, 255, 255, 0.32);
}

/* 顶部栏并排两个动作按钮（保存 / 播报）—— 让两个动作之间留点缝 */
.topbar .tb-action + .tb-action {
  margin-left: 8px;
}

/* 菜单页「操作工具栏」—— 重新生成（破坏）+ 载入菜单（恢复）一行并排 */
.menu-toolbar {
  display: flex;
  gap: 8px;
  margin: 8px 2px 18px;
}
.menu-toolbar .btn {
  flex: 1;
  justify-content: center;
}
.menu-toolbar .btn svg {
  width: 14px;
  height: 14px;
}
/* ⚠️ 两个按钮样式必须完全一致（2026-09-30 用户要求）：
   「重新生成」原来单独染了红色边框 + 红字来强调破坏性动作（.menu-toolbar-regen），
   用户要求跟「载入菜单」统一 —— 现在两者都只走 .btn / .btn-line / .btn-sm，
   不要再给其中任何一方加独立的 border-color / color / background。 */

/* 「载入」弹窗里的菜单行 —— 右侧 ▶ 按钮突出一点 */
.saved-menu-row .icon-btn {
  width: 36px;
  height: 36px;
}
.saved-menu-row .icon-btn svg {
  width: 18px;
  height: 18px;
}
.saved-menu-row:active {
  background: rgba(0, 0, 0, 0.04);
}

/* 「我的 → 保存的菜单」列表：菜单多起来要能自己滚，别把弹层撑出屏幕 */
.saved-menu-list {
  max-height: 52vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------------- 内容区 ---------------- */

.screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.screen.has-tabbar {
  padding-bottom: calc(var(--tab-h) + 22px);
}

.screen::-webkit-scrollbar {
  width: 5px;
}

.screen::-webkit-scrollbar-thumb {
  background: #d7dbe0;
  border-radius: 3px;
}

.loading {
  height: 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-3);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------- 底部导航 ---------------- */

.tabbar {
  flex: none;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
}

.tabbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 10.5px;
  transition: color 0.15s;
}

.tabbar button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar button.active {
  color: var(--primary);
  font-weight: 600;
}

.tabbar button:active {
  opacity: 0.7;
}

/* ---------------- 语音播报条 ---------------- */

.voicebar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 12px);
  background: rgba(31, 35, 41, 0.93);
  color: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 8;
  animation: rise 0.24s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.voicebar .vb-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  display: grid;
  place-items: center;
  flex: none;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

.voicebar .vb-text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.voicebar .vb-text b {
  font-weight: 600;
}

.voicebar .vb-btn {
  flex: none;
  font-size: 12px;
  color: #ffd8c2;
  padding: 4px 6px;
}

/* ---------------- 通用卡片 ---------------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.card.tight {
  padding: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.card-title .ct-sub {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--text-3);
  margin-left: auto;
}

.section-label {
  font-size: 12px;
  color: var(--text-3);
  margin: 16px 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-label:first-child {
  margin-top: 2px;
}

/* ---------------- 表单 ---------------- */

.field {
  margin-bottom: 12px;
}

.field > label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}

.input,
textarea.input,
select.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfbfc;
  transition: border-color 0.15s, background 0.15s;
}

textarea.input {
  height: auto;
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.6;
}

.input:focus,
textarea.input:focus {
  border-color: var(--primary);
  background: #fff;
}

.input::placeholder,
textarea.input::placeholder {
  color: #b6bcc4;
}

.row {
  display: flex;
  gap: 10px;
}

/* ---------------- 搜索行：输入框 + 右侧框外的搜索按钮 ----------------
   按钮独立在输入框外面（不叠在框内），比原来的小放大镜大一圈、好点。 */

.search-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.search-row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.search-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 74px;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary-grad);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(244, 81, 30, 0.22);
  transition: transform 0.1s, box-shadow 0.15s;
}

.search-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.search-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(244, 81, 30, 0.2);
}

.row > * {
  flex: 1;
  min-width: 0;
}

/* ---------------- 按钮 ---------------- */

.btn {
  height: 42px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s, transform 0.1s;
  padding: 0 14px;
  cursor: pointer;
  user-select: none;
}

.btn:active {
  transform: scale(0.985);
  opacity: 0.9;
}

.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 6px 14px rgba(255, 112, 67, 0.28);
}

.btn-ghost {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.btn-line {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-2);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 32px;
  font-size: 12.5px;
  border-radius: 8px;
  padding: 0 10px;
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------------- 标签 ---------------- */

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  background: #f2f3f5;
  color: var(--text-2);
  white-space: nowrap;
}

.tag-meal {
  background: #fff4e6;
  color: #d46b08;
}

.tag-season {
  background: #eefaf1;
  color: #237804;
}

.tag-month {
  background: #eef4ff;
  color: #1d39c4;
}

/* 药性标签（多对多，一道菜可以同时挂好几个）
   ⚠️ 选择器必须是完整类名：代码里拼的是 `tag-prop-` + 药性名（如「寒性」），
   以前写成 `.tag-prop-寒` 是匹配不上的，这批颜色一直没生效。 */
.tag-prop-寒性,
.tag-prop-凉性 {
  background: #e8f4ff;
  color: #096dd9;
}

.tag-prop-温性,
.tag-prop-热性 {
  background: #fff1f0;
  color: #cf1322;
}

.tag-prop-平性 {
  background: #f0f5f0;
  color: #389e0d;
}

.tag-prop-大补,
.tag-prop-温补,
.tag-prop-清补,
.tag-prop-平补 {
  background: #f6f0ff;
  color: #722ed1;
}

.tag-prop-月子餐 {
  background: #fff0f6;
  color: #c41d7f;
}

.tag-prop-辛辣 {
  background: #fff7e6;
  color: #d46b08;
}

/* 药性「自定义…」那一行：输入框 + 添加按钮 */
.prop-custom {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.prop-custom .input {
  flex: 1;
  height: 36px;
}

.tag-cat {
  background: #f7f7f9;
  color: #5a6270;
}

.tag-custom {
  background: #fff7e6;
  color: #ad6800;
  border: 1px dashed #ffd591;
}

.badge-role {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.badge-role.dark {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ---------------- 分段控件 ---------------- */

.segmented {
  display: flex;
  background: #eceef1;
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}

.segmented button {
  flex: 1;
  height: 36px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  transition: all 0.18s;
}

.segmented button small {
  font-size: 10px;
  color: var(--text-3);
}

.segmented button.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(31, 35, 41, 0.09);
}

.segmented button.active small {
  color: var(--primary);
}

/* ---------------- 选择块（多选） ---------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f4f5f7;
  color: var(--text-2);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.chip:active {
  opacity: 0.75;
}

.chip.on {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: rgba(255, 122, 69, 0.5);
  font-weight: 600;
}

.chip.mini {
  height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
}

/* 「更多药性…」：把不常用的选项收进下拉，外观跟 mini 芯片对齐、不抢视线 */
.chip-select {
  height: 26px;
  max-width: 132px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fbfbfc;
  color: var(--text-3);
  font-size: 11.5px;
  font-family: inherit;
}

.chip-select:focus {
  outline: none;
  border-color: rgba(255, 122, 69, 0.55);
  color: var(--text-2);
}

/* ---------------- 开关 ---------------- */

.switch {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d9dde2;
  position: relative;
  flex: none;
  transition: background 0.2s;
}

.switch::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch.on {
  background: var(--primary);
}

.switch.on::after {
  transform: translateX(18px);
}

/* ---------------- 数量步进器 ---------------- */

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #f4f5f7;
  border-radius: 10px;
  padding: 3px;
}

.stepper button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.stepper button:active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.stepper .num {
  min-width: 26px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
}

/* ---------------- 用餐卡片 ---------------- */

.meal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.meal-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
}

.meal-head .mh-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--primary-light);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex: none;
}

.meal-head .mh-name {
  font-weight: 600;
  font-size: 14.5px;
}

.meal-head .mh-count {
  font-size: 11.5px;
  color: var(--text-3);
  margin-left: 2px;
}

.meal-head .mh-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  background: #f6f7f9;
}

.icon-btn:active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 「换一道」等后端返回时图标转起来（点了没反应最容易让人重复点） */
.icon-btn.spinning svg {
  animation: spin 0.8s linear infinite;
}

.meal-body {
  padding: 12px 14px 14px;
}

.dish-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 菜品行：行内常驻删除图标 + 左滑露出的「删除」（两层都能删；用户要求每道菜都能直接删） */
.dish-row {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  background: #fafbfc;
}

.dish-row .dish-item {
  position: relative;
  z-index: 1;
  touch-action: pan-y; /* 水平手势留给我们做左滑，垂直滚动仍交给浏览器 */
  transition: transform 0.22s ease;
}

.dish-row.swiped .dish-item {
  transform: translateX(-78px);
}

.dish-del {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 78px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.dish-del:active {
  background: #cf3438;
}

.dish-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: #fafbfc;
  border-radius: 11px;
  border: 1px solid var(--line-2);
}

.dish-item .di-index {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}

.dish-item .di-main {
  flex: 1;
  min-width: 0;
}

.dish-item .di-name {
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
}

.dish-item .di-tags {
  display: flex;
  gap: 5px;
  margin-top: 3px;
  flex-wrap: wrap;
}

/* 行内常驻的删除图标：淡红底色跟其它图标区分开（破坏性动作），但不要抢眼 */
.dish-item .icon-btn.di-del {
  color: var(--red);
  background: #fdeff0;
  flex: none;
}

.dish-item .icon-btn.di-del:active {
  background: #f9dcdd;
  color: #cf3438;
}

.meal-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  background: #fafbfc;
  border-radius: 11px;
  border: 1px dashed #e3e6ea;
}

.meal-foot {
  padding: 0 14px 13px;
}

.add-dish-btn {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px dashed #ffc7a8;
  color: var(--primary-dark);
  background: #fffaf6;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.add-dish-btn:active {
  background: var(--primary-light);
}

/* ---------------- 提示条 ---------------- */

.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e6;
  color: #ad6800;
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.notice.info {
  background: #eef4ff;
  color: #1d39c4;
}

.notice.danger {
  background: #fff1f0;
  color: #cf1322;
}

.notice .n-close {
  margin-left: auto;
  color: inherit;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
}

/* 菜单页的「N 条提醒」折叠块：默认只占一行，点开才展开明细 */
.notice.warn-block {
  display: block;
  padding: 0;
  overflow: hidden;
}

.warn-sum {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: inherit;
  font-size: 12px;
  text-align: left;
}

.warn-sum .warn-txt {
  flex: 1;
  font-weight: 600;
}

.warn-arrow {
  display: inline-flex;
  opacity: 0.55;
  transition: transform 0.18s;
}

.warn-arrow svg {
  width: 14px;
  height: 14px;
}

.warn-arrow.open {
  transform: rotate(90deg);
}

.warn-list {
  border-top: 1px solid rgba(173, 104, 0, 0.16);
}

.warn-item {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  padding: 7px 12px;
  font-size: 11.5px;
  line-height: 1.5;
}

.warn-item + .warn-item {
  border-top: 1px dashed rgba(173, 104, 0, 0.14);
}

/* ---------------- 列表行 ---------------- */

.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line-2);
}

.list-row:last-child {
  border-bottom: none;
}

.list-row .lr-main {
  flex: 1;
  min-width: 0;
}

.list-row .lr-title {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.list-row .lr-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row .lr-arrow {
  color: #c4c9d0;
  flex: none;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 15px;
  flex: none;
}

.empty {
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 28px 10px;
}

.empty .em-icon {
  font-size: 30px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.7;
}

/* ---------------- 统计 ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat {
  background: #fff;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat .s-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}

.stat .s-label {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ---------------- 登录页 ---------------- */

.auth {
  min-height: 100%;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
}

.auth .auth-logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--primary-grad);
  display: grid;
  place-items: center;
  font-size: 34px;
  box-shadow: 0 10px 24px rgba(255, 112, 67, 0.32);
  margin-bottom: 16px;
}

.auth h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.5px;
}

.auth .auth-sub {
  color: var(--text-3);
  font-size: 12.5px;
  margin: 6px 0 22px;
}

.auth .auth-foot {
  margin-top: auto;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  padding-top: 20px;
}

.link {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: none;
}

.invite-box {
  background: var(--primary-light);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.invite-box .ib-code {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary-dark);
  font-family: 'SFMono-Regular', Consolas, monospace;
}

/* ---------------- 底部弹层 ---------------- */

.mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 22, 0.45);
  z-index: 40;
  animation: fade 0.2s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.sheet {
  position: fixed;
  z-index: 41;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  max-height: 84vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 560px) {
  .sheet {
    width: 100vw;
  }
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
  }
}

/* 「紧贴按钮下方」的轻量弹层（载入菜单用）—— 不从屏幕底部弹起，直接锚定到 anchor 下方 */
.popover {
  position: fixed;
  z-index: 41;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 60vh;
  animation: popoverDown 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
@keyframes popoverDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}
.popover-head {
  flex: none;
  padding: 10px 14px 8px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}
.popover-head h3 {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.popover-head .icon-btn {
  width: 28px;
  height: 28px;
}
.popover-head .icon-btn svg {
  width: 16px;
  height: 16px;
}
.popover-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 14px;
}
.popover-foot {
  flex: none;
  padding: 10px 14px;
  border-top: 1px solid #f0f0f0;
}
.popover-foot .btn {
  width: 100%;
  justify-content: center;
}

/* 「换一道」弹层顶部的搜索框（2026-10-13 用户需求）：只在**同类候选**里筛菜名。
   输入时只重画 #swapList，输入框本身不重建 → 光标 / 焦点不会丢。 */
.popover-search {
  padding: 4px 0 6px;
}

.popover-search .input {
  height: 36px;
  font-size: 13.5px;
}

/* 「换一道」弹层里的一行（popover 内）：随机换 / 一道候选菜
   —— 候选行 = 菜名（左边，撑满）+ 喇叭（右边，先听一下再决定） */
.swap-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 6px 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
}
.swap-opt .so-name {
  flex: 1;
  min-width: 0;
  word-break: break-all;
}
/* 「今天已有」小灰字（这道菜今天别的餐次已经上过；换菜允许当天重复，只作提示） */
.swap-opt .so-note {
  flex: none;
  font-size: 11px;
  color: var(--text-2);
}
.swap-opt .so-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--primary-dark);
}
.swap-opt .so-icon svg {
  width: 16px;
  height: 16px;
}
.swap-opt .so-speak {
  flex: none;
}
.swap-opt + .swap-opt {
  margin-top: 2px;
}
.swap-random {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.swap-opt:active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.sheet-head {
  flex: none;
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-2);
}

.sheet-head h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  flex: 1;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.sheet-foot {
  flex: none;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line-2);
  display: flex;
  gap: 10px;
}

.sheet-foot .btn {
  flex: 1;
}

.pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line-2);
}

.pick-item:last-child {
  border-bottom: none;
}

.pick-item .pi-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
}

/* 已经在这一餐菜单里的菜：只读展示，不再给「加入」按钮 */
.pick-item.dim {
  opacity: 0.5;
}

/* ---------------- 对话框 ---------------- */

.dialog-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 18, 22, 0.45);
  animation: fade 0.18s ease;
}

.dialog {
  width: 300px;
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 20px 18px 14px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes pop {
  from {
    transform: scale(0.94);
    opacity: 0;
  }
}

.dialog h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.dialog p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-2);
  white-space: pre-wrap;
  line-height: 1.6;
}

.dialog .dlg-btns {
  display: flex;
  gap: 10px;
}

.dialog .dlg-btns .btn {
  flex: 1;
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  background: rgba(31, 35, 41, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  max-width: 78vw;
  text-align: center;
  line-height: 1.5;
  animation: pop 0.18s ease;
  pointer-events: none;
}

/* ---------------- 杂项 ---------------- */

.muted {
  color: var(--text-3);
}

.small {
  font-size: 11.5px;
}

.strong {
  font-weight: 600;
}

.mt8 {
  margin-top: 8px;
}

.mt12 {
  margin-top: 12px;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.divider {
  height: 1px;
  background: var(--line-2);
  margin: 10px 0;
}

.scroll-x {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.scroll-x::-webkit-scrollbar {
  display: none;
}

.code-pill {
  font-family: 'SFMono-Regular', Consolas, monospace;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ---------------- 图标在各处的具体尺寸 ---------------- */

.topbar .tb-action svg {
  width: 14px;
  height: 14px;
}

.card-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.btn svg {
  width: 15px;
  height: 15px;
}

.list-row .lr-arrow svg {
  width: 15px;
  height: 15px;
}

.voicebar .vb-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.empty .em-icon svg {
  width: 30px;
  height: 30px;
}

/* ---------------- 朗读稿（大字文字版菜单） ---------------- */

.read-panel {
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 17px;
  line-height: 2;
  letter-spacing: 0.4px;
  color: var(--text);
  word-break: break-all;
}

/* ---------------- 菜品自定义语音 ---------------- */

/*
 * 隐藏的 file input：
 * 挂到按钮里之后**铺满按钮**，用户点按钮时点的其实就是这个 input 本身。
 * 这样既不依赖 <label for> 转发（部分 WebView 不认），也不依赖 JS 调 click()（微信里会被忽略）。
 * 注意（前后踩了四次坑，别改）：
 *  - **不能用 opacity 藏**！个别手机浏览器会把 opacity < 1 的 file input 当成"不可见"而拒绝弹窗
 *    （表现：点了只弹 toast、系统界面永远不出来）。这里用「不设 opacity + 文字/背景/边框全透明 +
 *    appearance:none」，对浏览器来说是**实打实可见**的元素，只是视觉上看不见；
 *  - 不能用 display:none，也不能挪到屏幕外（iOS 同样会拒绝唤起选择器）；
 *  - 没挂到按钮上时保持 1px + pointer-events:none，避免它影响页面上的任何点击。
 */

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  font-size: 0;
  pointer-events: none;
  color: transparent;
  background: transparent;
  outline: none;
}

/*
 * 原生「选择文件」控件必须单独隐藏：
 * input[type=file] 内部会渲染一个「选择文件」小按钮（圆角小方框），
 * 只设 color/font-size 是压不住的，会从按钮左上角露出一小块黑框。
 */
.file-input::file-selector-button,
.file-input::-webkit-file-upload-button {
  display: none;
  width: 0;
  height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 0;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* 挂进按钮之后：铺满整个按钮、真正可见（只是视觉透明）、可点击 */
.file-btn .file-input {
  width: 100%;
  height: 100%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 3;
  color: transparent;
  background: transparent;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.voice-box {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fafbfc;
}

.vx-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}

.vx-line svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--primary);
}

.vx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-tip {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
}

/* 菜名后面那个小喇叭标记 */
.voice-tag {
  display: inline-flex;
  align-items: center;
  vertical-align: -2px;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
}

.voice-tag svg {
  width: 13px;
  height: 13px;
}

/* ---------------- 喜爱星数 ---------------- */

/* 菜品表单里可点的五星选择器 */
.stars {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 0;
}

.stars .star-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d8dce2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.stars .star-btn:active {
  background: #f2f4f7;
}

.stars .star-btn svg {
  width: 24px;
  height: 24px;
}

/* 亮着的星要填色 —— 全局 svg 兜底是 fill:none，不写就只剩描边 */
.stars .star-btn.on {
  color: #f5a623;
}

.stars .star-btn.on svg {
  fill: currentColor;
}

.stars .star-word {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-3);
}

/* 菜品池列表里的只读星级（5 颗，亮的是已评的） */
.stars-text {
  flex: none;
  color: #f5a623;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.5px;
}

.stars-text .off {
  color: #e2e6eb;
}

.list-row .lr-title .lr-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 录音中的小红点 */
.rec-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #fff;
  animation: rec-blink 1s infinite;
}

@keyframes rec-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ---------------- 录音兜底面板 / 环境自检 ---------------- */

.dialog-wide {
  width: 340px;
  text-align: left;
}

.dialog-wide h3 {
  text-align: center;
}

.dialog-wide .dlg-body {
  margin-bottom: 16px;
}

.dlg-note {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-2);
  white-space: pre-wrap;
  line-height: 1.65;
}

.dlg-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.dlg-actions .btn {
  width: 100%;
  cursor: pointer;
}

.dlg-tip {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  word-break: break-all;
}

.diag {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.diag-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.diag-row:last-child {
  border-bottom: 0;
}

.diag-row span {
  color: var(--text-2);
  flex: none;
}

.diag-row b {
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.diag-ok {
  color: #0a8f4a;
}

.diag-bad {
  color: #d64545;
}

.voice-https {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 12px;
}

.voice-https span {
  color: var(--text-2);
  flex: none;
}

.voice-https code {
  flex: 1;
  word-break: break-all;
  font-size: 11px;
}

.voice-diag-link {
  margin-top: 8px;
  text-align: center;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.voice-alt {
  margin-top: 6px;
  text-align: center;
}

/* ---------------- 播报固定短句的自定义语音 ---------------- */

.phrase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.phrase-row:last-child {
  border-bottom: 0;
}

.pr-main {
  flex: 1;
  min-width: 0;
}

.pr-text {
  font-size: 15px;
  color: var(--text);
}

.pr-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.pr-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.pr-actions .btn-sm {
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

/* ---------------- 品类数量标记 / 弹窗 ---------------- */

.chip .cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
}

.cnt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
}

/* ---------------- 菜品池：多选 + 批量设置药性（2026-09-30） ---------------- */

/* 多选模式：整行可点，勾选框在左边 */
.list-row.pick {
  cursor: pointer;
}

.list-row.pick.on {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

.pick-box {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid #d6dae0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.list-row.pick.on .pick-box {
  background: var(--primary);
  border-color: var(--primary);
}

.pick-box svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

/* 批量操作栏：跟底部导航一样"贴在手壳底部"（PC 是手机框底部，手机是屏幕底部），
   不随内容滚动，所以它永远在页面底部 */
.pickbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(31, 35, 41, 0.06);
}

/* 底部导航在场时往上让开一层 */
.pickbar.has-tabbar {
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
}

.pickbar .pick-count {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.35;
}

.pickbar .pick-count b {
  color: var(--primary-dark);
  font-size: 15px;
}

.pickbar .pick-count .muted {
  display: block;
  font-size: 11px;
  color: var(--text-3);
}

/* 内容区底部留出操作栏的高度，别让最后一行被盖住 */
.screen.has-pickbar {
  padding-bottom: 84px;
}

.screen.has-pickbar.has-tabbar {
  padding-bottom: calc(var(--tab-h) + 84px);
}

