/* Spec v1 (2026-10-23): only recipe detail and plan; historical list stays scoped out. */
.recipe-detail,.recipe-plan-dialog{
 --recipe-body:.875rem;--recipe-body-line:1.375rem;--recipe-small:.75rem;--recipe-small-line:1.125rem;
 --recipe-pad:20px;--recipe-section:24px;--recipe-control:44px;
 font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans SC",sans-serif;
 font-size:var(--recipe-body);line-height:var(--recipe-body-line);font-weight:400;letter-spacing:0;color:#f2f1ed;
}
.recipe-detail-active .app-scroll{padding-left:20px;padding-right:20px}
.recipe-detail-active .recipes-page{padding-bottom:24px}
.recipe-detail *,.recipe-plan-dialog *{box-sizing:border-box}
.recipe-detail h1,.recipe-detail h2,.recipe-detail h3,.recipe-plan-dialog h2,.recipe-plan-dialog h3{letter-spacing:0;font-weight:600}
.recipe-detail h1{font-size:1.375rem;line-height:1.875rem;margin:0 0 8px}
.recipe-detail h2,.recipe-detail h3,.recipe-plan-dialog h3{font-size:1rem;line-height:1.5rem}
.recipe-detail p,.recipe-plan-dialog p{margin:0}
.recipe-detail .recipe-toolbar{min-height:44px;margin:0 0 8px;padding-top:env(safe-area-inset-top,0px);border:0;background:#0e0f11}
.recipe-detail .recipe-toolbar button{min-height:44px;gap:8px;font-size:.875rem;line-height:1.25rem}
.recipe-detail .recipe-overview{margin:0 0 24px}
.recipe-detail .recipe-meta{gap:8px;font-size:.75rem;line-height:1.125rem}
.recipe-detail .recipe-meta svg{width:16px;height:16px}
.recipe-detail .recipe-cover-detail{width:100%;max-width:none;margin:16px 0 0}
.recipe-detail .recipe-cover-detail img{display:block;width:100%;height:auto;aspect-ratio:2.15;object-fit:cover;object-position:center 30%;border-radius:12px}
.recipe-detail .recipe-cover-detail figcaption{display:flex;flex-wrap:wrap;gap:4px 12px;margin:8px 0 0;font-size:.75rem;line-height:1.125rem}
.recipe-detail .recipe-cover-detail figcaption a{max-width:100%;min-height:44px;display:flex;align-items:center;overflow-wrap:anywhere}
.recipe-detail .recipe-nutrient-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:0;align-items:start}
.recipe-detail .recipe-nutrient-grid>div{text-align:left;display:grid;gap:4px;min-width:0;border:0}
.recipe-detail .recipe-nutrient-label{display:flex;align-items:center;gap:8px;font-size:.75rem;line-height:1.125rem;color:#a4a5ad;white-space:nowrap}
.recipe-detail .recipe-nutrient-value{display:flex;align-items:baseline;gap:4px;white-space:nowrap;font-variant-numeric:tabular-nums}
.recipe-detail .recipe-nutrient-value b{font-size:1.375rem;line-height:1.75rem;font-weight:500}
.recipe-detail .recipe-nutrient-value small{font-size:.75rem;line-height:1.125rem;color:#a4a5ad}
.recipe-detail .recipe-ingredients,.recipe-detail .recipe-steps{margin:24px 0 0;padding:0;border:0}
.recipe-detail .recipe-section-title,.recipe-plan-dialog .recipe-section-title{margin:0 0 8px;gap:12px;align-items:center}
.recipe-detail .recipe-section-title>span,.recipe-plan-dialog .recipe-section-title>span{font-size:.75rem;line-height:1.125rem;color:#a4a5ad}
.recipe-detail .recipe-section-title:has(.recipe-ingredient-tabs){flex-wrap:wrap;margin-bottom:12px}
.recipe-detail .recipe-ingredient-tabs,.recipe-plan-dialog .recipe-ingredient-tabs{display:flex;gap:16px;margin:0;align-items:center}
.recipe-detail .recipe-ingredient-tabs button,.recipe-plan-dialog .recipe-ingredient-tabs button{min-height:44px;padding:0 12px;border:0;border-radius:8px;font-size:1rem;line-height:1.5rem;font-weight:400;color:#a4a5ad}
.recipe-detail .recipe-ingredient-tabs button[aria-pressed=true],.recipe-plan-dialog .recipe-ingredient-tabs button[aria-pressed=true]{color:#f2f1ed;background:#2b2c31;font-weight:600}
/* Compact field groups: shared name starts, left-aligned values, whole-pair spans. */
.recipe-detail .recipe-ingredient-grid{display:block;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.recipe-detail .recipe-ingredient-grid:focus-visible{outline:1px solid #a4a5ad;outline-offset:4px}
.recipe-detail .recipe-ingredient-list{display:grid;grid-template-columns:1fr;gap:12px 24px;width:100%;align-items:baseline}
.recipe-detail .recipe-ingredient{display:grid;grid-template-columns:var(--ingredient-name-width,max-content) max-content;align-items:baseline;justify-content:start;gap:8px;min-height:0;padding:0;border:0;min-width:max-content}
.recipe-detail .recipe-ingredient>span{display:inline-flex;align-items:baseline;gap:8px;flex:none;min-width:max-content;max-width:none;white-space:nowrap;overflow-wrap:normal}
.recipe-detail .recipe-ingredient-name{justify-self:start}
.recipe-detail .recipe-ingredient b{font-size:.875rem;line-height:1.375rem;font-weight:400;white-space:nowrap}
.recipe-detail .recipe-ingredient small{font-size:.75rem;line-height:1.125rem;white-space:nowrap}
.recipe-detail .recipe-ingredient .recipe-ingredient-quantity{display:block;justify-self:start;font-size:.875rem;line-height:1.375rem;color:#f2f1ed;white-space:nowrap;overflow-wrap:normal;margin:0;text-align:left;font-variant-numeric:tabular-nums}
.recipe-detail .recipe-steps ol{display:grid;gap:16px;padding:0;margin:0;list-style:none}
.recipe-detail .recipe-steps li{display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:start;margin:0;padding:0}
.recipe-detail .recipe-steps li>span{display:block;width:24px;min-width:24px;height:24px;margin:0;padding:0;background:none;border-radius:0;font-size:.875rem;line-height:1.375rem;text-align:left;color:#f2f1ed}
.recipe-detail .recipe-steps p{font-size:.875rem;line-height:1.375rem;font-weight:400;overflow-wrap:anywhere}
.recipe-detail .recipe-steps small{font-size:.75rem;line-height:1.125rem;margin-top:4px}
.recipe-detail .recipe-primary,.recipe-plan-dialog .recipe-primary{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;padding:12px;border:0;border-radius:8px;background:#f2f1ed;color:#0e0f11;font-family:inherit;font-size:.875rem;line-height:1.25rem;font-weight:500}
.recipe-detail .recipe-detail-add{margin:16px 0 24px}
.recipe-detail .recipe-disclosure{margin:0;border:0;font-size:.75rem;line-height:1.125rem}
.recipe-detail .recipe-disclosure summary{min-height:44px;font-size:.75rem;line-height:1.125rem;gap:8px}
.recipe-detail .recipe-disclosure>div{font-size:.875rem;line-height:1.375rem;padding:8px 0 16px}
.recipe-detail .recipe-disclosure p+p{margin-top:8px}
.recipe-detail .recipe-small{font-size:.75rem;line-height:1.125rem;padding:0}
.recipe-detail .recipe-tips{margin:24px 0}
.recipe-detail .recipe-tips h2{margin:0 0 8px}
.recipe-detail .recipe-tips p{font-size:.875rem;line-height:1.375rem;color:#a4a5ad}
.recipe-detail .recipe-tips p+p{margin-top:8px}
.recipe-detail .recipe-table-wrap{font-size:.75rem;max-width:100%}
.recipe-detail .recipe-table-wrap table{font-size:.75rem;line-height:1.125rem}
/* Plan modal: one scrollable body and a reachable, non-overlapping footer. */
.recipe-plan-dialog{background:#0e0f11;border:0;border-radius:12px 12px 0 0;width:min(100%,560px);max-width:560px;max-height:calc(100dvh - 16px);overflow:hidden;box-shadow:0 12px 48px #0004;container-type:normal}
.recipe-plan-dialog .recipe-dialog-head{padding:16px var(--recipe-pad) 12px;background:#0e0f11}
.recipe-plan-dialog .recipe-dialog-head>i{display:none}
.recipe-plan-dialog .recipe-dialog-head>div{min-height:44px;gap:12px}
.recipe-plan-dialog .recipe-dialog-head h2{font-size:1.375rem;line-height:1.875rem;font-weight:600}
.recipe-plan-dialog .recipe-dialog-head button{margin:0;width:44px;height:44px;flex:none;color:#f2f1ed}
.recipe-plan-dialog .recipe-dialog-head button svg{width:20px;height:20px}
.recipe-plan-dialog .recipe-dialog-scroll{padding:0 var(--recipe-pad);overflow-x:hidden;overflow-y:auto;scroll-padding-block:16px;flex:0 1 auto;min-height:0}
.recipe-plan-dialog .recipe-dialog-footer{padding:16px var(--recipe-pad) calc(16px + env(safe-area-inset-bottom,0px));border:0;background:#0e0f11}
.recipe-plan-dialog .recipe-plan-totals{padding:0;margin:0;border:0}
.recipe-plan-dialog .recipe-plan-summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;margin-bottom:16px;align-items:start}
.recipe-plan-dialog .recipe-plan-energy{display:grid;justify-content:start;gap:4px;margin:0;min-width:0}
.recipe-plan-dialog .recipe-plan-energy>span{font-size:.875rem;line-height:1.375rem;color:#a4a5ad}
.recipe-plan-dialog .recipe-plan-energy p{display:flex;align-items:baseline;gap:4px;margin:0;white-space:nowrap;font-variant-numeric:tabular-nums}
.recipe-plan-dialog .recipe-plan-energy b{font-size:2rem;line-height:2.5rem;font-weight:500}
.recipe-plan-dialog .recipe-plan-energy small{font-size:.75rem;line-height:1.125rem;color:#a4a5ad}
.recipe-plan-dialog .recipe-plan-energy .recipe-energy-total{font-size:.75rem;line-height:1.125rem;overflow-wrap:anywhere}
.recipe-plan-dialog .recipe-goal-line{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0;font-size:.75rem;line-height:1.125rem;color:#a4a5ad}
.recipe-plan-dialog .recipe-goal-line b{font-size:1rem;line-height:1.5rem;font-weight:500;color:#f2f1ed;white-space:nowrap}
.recipe-plan-dialog .recipe-goal-line small{font-size:.75rem;font-weight:400}
.recipe-plan-dialog .recipe-goal-line button{display:flex;align-items:center;gap:8px;min-height:44px;padding:0;font-size:.75rem;line-height:1.125rem}
.recipe-plan-dialog .recipe-progress{display:flex;width:100%;height:6px;background:#2b2c31;border-radius:3px;overflow:hidden;outline:none}
.recipe-plan-dialog .recipe-progress span,.recipe-plan-dialog .recipe-progress i{display:block;height:100%;flex:0 0 auto}
.recipe-plan-dialog .recipe-progress span{background:#a4a5ad}
.recipe-plan-dialog .recipe-progress i{background:#f2f1ed}
.recipe-plan-dialog .recipe-plan-legend{display:flex;gap:16px;margin:8px 0 24px;font-size:.75rem;line-height:1.125rem}
.recipe-plan-dialog .recipe-plan-legend>span{gap:8px}
.recipe-plan-dialog .recipe-plan-legend i{width:8px;height:8px;background:#a4a5ad}
.recipe-plan-dialog .recipe-plan-legend>span:last-child:not(:first-child) i{background:#f2f1ed}
.recipe-plan-dialog .recipe-plan-macros{display:grid;grid-template-columns:1fr;gap:8px;margin:0}
.recipe-plan-dialog .recipe-plan-macros>div,.recipe-plan-dialog .recipe-plan-macros.has-target>div{display:grid;grid-template-columns:4.75rem minmax(0,1fr) 7rem;gap:0 12px;min-height:32px;align-items:center;padding:0;border:0}
.recipe-plan-dialog .recipe-plan-macros>div>span{display:flex;align-items:center;gap:8px;font-size:.875rem;line-height:1.375rem;grid-column:1;grid-row:1;color:#f2f1ed;white-space:nowrap}
.recipe-plan-dialog .recipe-plan-macros p{grid-column:3;grid-row:1;text-align:right;margin:0;font-size:.875rem;line-height:1.375rem;white-space:nowrap;font-variant-numeric:tabular-nums}
.recipe-plan-dialog .recipe-plan-macros b{font-size:.875rem;line-height:1.375rem;font-weight:500}
.recipe-plan-dialog .recipe-plan-macros small{font-size:.75rem;line-height:1.125rem;color:#a4a5ad}
.recipe-plan-dialog .recipe-plan-macros .recipe-progress{grid-column:2;grid-row:1;height:6px;min-width:0}
.recipe-plan-dialog .recipe-plan-macros em{grid-column:2/-1;grid-row:2;margin-top:4px;font-size:.75rem;line-height:1.125rem;text-align:right;color:#a4a5ad;font-style:normal}
.recipe-plan-dialog .recipe-plan-macros:not(.has-target)>div{grid-template-columns:1fr auto}
.recipe-plan-dialog .recipe-plan-macros:not(.has-target) p{grid-column:2}
.recipe-plan-dialog .recipe-adjust{padding:0;margin-top:24px}
.recipe-plan-dialog .recipe-adjust>.recipe-section-title{display:flex;margin:0 0 12px;gap:12px;flex-wrap:wrap}
.recipe-plan-dialog .recipe-section-title>button{min-height:44px;font-size:.75rem;line-height:1.125rem}
.recipe-plan-dialog .recipe-weight{display:grid;grid-template-columns:minmax(0,1fr) 7rem;gap:12px;align-items:center;min-height:56px;padding:6px 0;margin:0;justify-content:normal;border:0}
.recipe-plan-dialog .recipe-weight>span:first-child{font-size:.875rem;line-height:1.375rem;font-weight:400;overflow-wrap:anywhere;min-width:0}
.recipe-plan-dialog .recipe-weight-input{display:flex;align-items:center;gap:4px;width:100%;height:auto;min-height:44px;padding:8px 12px;background:#202125;border:1px solid #2b2c31;border-radius:8px;min-width:0}
.recipe-plan-dialog .recipe-weight-input input{width:100%;height:1.5rem;min-height:24px;min-width:0;padding:0;font-family:inherit;font-size:1rem;line-height:1.5rem;font-weight:500;text-align:right;color:#f2f1ed;font-variant-numeric:tabular-nums;appearance:textfield;outline:none}
.recipe-plan-dialog .recipe-weight-input>span{font-size:.75rem;line-height:1.125rem;color:#a4a5ad;flex:none}
.recipe-plan-dialog .recipe-weight-input:focus-within{border-color:#a4a5ad}
.recipe-plan-dialog .recipe-weight-input:has(input:focus-visible){outline:2px solid #f2f1ed;outline-offset:2px}
.recipe-plan-dialog .recipe-weight-input:has(input[aria-invalid=true]){border-color:#a4a5ad}
.recipe-plan-dialog .recipe-field-error,.recipe-plan-dialog .recipe-inline-error{margin:4px 0 8px;font-size:.75rem;line-height:1.125rem;color:#f2f1ed}
.recipe-plan-dialog .recipe-goal-form{padding:0;margin:24px 0;border:0}
.recipe-plan-dialog .recipe-goal-form>p{font-size:.75rem;line-height:1.125rem;margin:0 0 12px}
.recipe-plan-dialog .recipe-goal-form>div{gap:12px;margin-bottom:16px}
.recipe-plan-dialog .recipe-goal-form label{font-size:.875rem;line-height:1.375rem;gap:8px;min-width:0}
.recipe-plan-dialog .recipe-goal-form input{font-size:1rem;line-height:1.5rem;min-height:44px}
.recipe-plan-dialog .recipe-goal-form small{font-size:.75rem}
.recipe-plan-dialog .recipe-text-button{font-size:.875rem;line-height:1.25rem;min-height:44px}
.recipe-plan-dialog .recipe-planned{padding:0;margin:24px 0 0}
.recipe-plan-dialog .recipe-plan-item{padding:4px 0;border:0}
.recipe-plan-dialog .recipe-plan-item>button:first-child{font-size:.875rem;line-height:1.375rem;gap:4px}
.recipe-plan-dialog .recipe-plan-item small,.recipe-plan-dialog .recipe-plan-empty{font-size:.75rem;line-height:1.125rem}
.recipe-plan-dialog .recipe-save-status{margin:0 0 16px;padding:8px 12px;border:0;border-radius:8px;font-size:.875rem;line-height:1.375rem}
@media(min-width:601px){.recipe-plan-dialog{inset:auto 0 16px;width:min(560px,calc(100% - 32px));border-radius:12px;max-height:calc(100dvh - 32px)}}
@media(max-width:360px){
 .recipe-detail-active .app-scroll{padding-left:16px;padding-right:16px}
 .recipe-detail,.recipe-plan-dialog{--recipe-pad:16px}
 .recipe-plan-dialog .recipe-weight{grid-template-columns:minmax(0,1fr) 6.5rem}
 .recipe-plan-dialog .recipe-plan-macros>div,.recipe-plan-dialog .recipe-plan-macros.has-target>div{grid-template-columns:4.75rem minmax(0,1fr) 6.5rem;column-gap:8px}
 .recipe-plan-dialog .recipe-plan-macros:not(.has-target)>div{grid-template-columns:1fr auto}
}
@media(prefers-reduced-motion:reduce){.recipe-plan-dialog[open]{animation:none}}

.recipe-detail .recipe-nutrition-caption{font-size:.75rem;line-height:1.125rem;color:#a4a5ad;margin:0 0 8px}
.recipe-plan-dialog .recipe-plan-macros.has-target>div.is-unset{grid-template-columns:1fr auto}
.recipe-plan-dialog .recipe-plan-macros.has-target>div.is-unset p{grid-column:2;grid-row:1}

/* Intrinsic wrapping follows actual text size; no fixed-height clipping. */
.recipe-detail .recipe-nutrient-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,4rem),1fr))}
.recipe-plan-dialog .recipe-plan-summary{display:flex;flex-wrap:wrap;gap:12px}
.recipe-plan-dialog .recipe-plan-energy{flex:1 1 9.5rem;max-width:100%}
.recipe-plan-dialog .recipe-goal-line{flex:0 1 auto;max-width:100%}
.recipe-plan-dialog .recipe-plan-macros.has-target>div{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center}
.recipe-plan-dialog .recipe-plan-macros.has-target>div>span{flex:0 0 4.75rem}
.recipe-plan-dialog .recipe-plan-macros.has-target .recipe-progress{flex:1 1 2rem;min-width:2rem}
.recipe-plan-dialog .recipe-plan-macros.has-target p{flex:0 1 7rem;max-width:100%;margin-left:auto;white-space:normal;overflow-wrap:anywhere}
.recipe-plan-dialog .recipe-plan-macros.has-target p b{white-space:nowrap}
.recipe-plan-dialog .recipe-plan-macros.has-target em{flex:1 0 100%;max-width:100%;overflow-wrap:anywhere}
.recipe-plan-dialog .recipe-plan-macros.has-target>div.is-unset{display:flex}
.recipe-plan-dialog .recipe-goal-form>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr))}
@media(max-width:360px){.recipe-plan-dialog .recipe-plan-macros.has-target>div{column-gap:8px}.recipe-plan-dialog .recipe-plan-macros.has-target p{flex-basis:6.5rem}}
@media(max-width:360px){.recipe-detail .recipe-nutrient-grid{column-gap:4px}}

/* 2026-10-23: approved reference detail. Reference values are copied verbatim;
   scope and scroll containment adapt it to the existing app shell. */
.app-shell.recipe-detail-active{background:#0e0e10}
.recipe-detail-active .app-scroll{padding:0;background:#0e0e10}
.recipe-detail-active .bottom-nav{display:none}
.recipe-detail-active .recipes-page{padding:0}
.recipe-detail-reference{
 --bg:#0e0e10;--surface:#1a1a1d;--surface-2:#26262a;--line:#2c2c31;
 --text:#f2f2f0;--text-2:#a1a1a6;--text-3:#6e6e74;--accent:#f2f1ec;--pad:18px;
 color:var(--text);background:var(--bg);
 font-family:-apple-system,"PingFang SC","Noto Sans CJK SC","Microsoft YaHei",sans-serif;
 font-size:16px;line-height:normal;font-weight:400;letter-spacing:normal;
 -webkit-font-smoothing:antialiased;
 max-width:560px;margin:0 auto;padding-bottom:calc(96px + env(safe-area-inset-bottom));
}
.recipe-detail-reference *{box-sizing:border-box;margin:0;padding:0;letter-spacing:normal}
.recipe-detail-reference button{font-family:Arial;font-size:13.3333px;font-weight:400;line-height:normal;min-height:0;box-shadow:none;transform:none}
.recipe-detail-reference h1,.recipe-detail-reference h2{line-height:normal;letter-spacing:normal}
.recipe-detail-reference .recipe-back{min-height:0;gap:normal;padding:0;border-radius:0;position:static}
  .rd-num { font-variant-numeric: tabular-nums; }

  /* 顶栏：返回箭头与正文同一左边距 */
  .rd-nav {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; gap: 6px;
    height: 48px; padding: 0 var(--pad);
    background: rgba(14,14,16,.92); backdrop-filter: blur(12px);
  }
  .rd-nav button {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; margin-left: -6px;
    background: none; border: 0; color: var(--text); cursor: pointer;
  }
  .rd-nav h1 { font-size: 17px; font-weight: 600; }

  .recipe-detail-reference > section { padding: 0 var(--pad); margin-top: 28px; }
  .rd-sec-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
  }
  .rd-sec-head h2 { font-size: 20px; font-weight: 700; }
  .rd-sec-meta { font-size: 13px; color: var(--text-2); }

  /* 份数步进器：全页唯一的份数来源 */
  .rd-stepper {
    display: flex; align-items: center;
    background: var(--surface); border-radius: 999px; padding: 3px;
  }
  .rd-stepper button {
    width: 28px; height: 28px; border-radius: 50%;
    border: 0; background: var(--surface-2); color: var(--text);
    font-size: 16px; line-height: 1; cursor: pointer;
  }
  .rd-stepper button:disabled { opacity: .35; cursor: default; }
  .rd-stepper span { min-width: 52px; text-align: center; font-size: 14px; }

  /* 营养：口径写明 */
  .rd-nutri {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    background: var(--surface); border-radius: 16px; padding: 16px 14px;
  }
  .rd-nutri .rd-label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); }
  .rd-nutri .rd-label svg { width: 14px; height: 14px; flex: none; }
  .rd-nutri .rd-val { margin-top: 6px; font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
  .rd-nutri .rd-val small { margin-left: 2px; font-size: 12px; font-weight: 400; color: var(--text-2); letter-spacing: 0; }
  .rd-nutri-note { margin-top: 8px; font-size: 12px; color: var(--text-3); }

  /* 分段控件：降为二级 */
  .rd-seg {
    display: inline-flex; background: var(--surface); border-radius: 10px; padding: 3px;
    margin-bottom: 6px;
  }
  .rd-seg button {
    border: 0; background: none; color: var(--text-2);
    font-size: 14px; padding: 6px 16px; border-radius: 8px; cursor: pointer;
  }
  .rd-seg button[aria-selected="true"] {
    background: var(--surface-2); color: var(--text); font-weight: 600;
    box-shadow: inset 0 0 0 1px #3a3a40;
  }
  .rd-seg button .rd-cnt { margin-left: 4px; font-size: 12px; color: var(--text-3); }

  /* 用料：两列，每项 名称左 / 用量右，数字右对齐 */
  .rd-items { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .rd-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--line);
    font-size: 15px;
  }
  .rd-item .rd-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rd-item .rd-amt { flex: none; text-align: right; }
  .rd-item .rd-amt b { font-weight: 500; }
  .rd-item .rd-amt small { margin-left: 3px; font-size: 13px; color: var(--text-2); }
  .rd-placeholder-note { margin-top: 10px; font-size: 12px; color: var(--text-3); }

  /* 做法：序号收紧，用量随份数联动 */
  .rd-steps { list-style: none; counter-reset: s; }
  .rd-steps li {
    counter-increment: s;
    display: grid; grid-template-columns: 24px 1fr; column-gap: 12px;
    padding: 10px 0; font-size: 16px; line-height: 1.65;
  }
  .rd-steps li::before {
    content: counter(s);
    width: 24px; height: 24px; margin-top: 2px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); color: var(--text-2);
    font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  }
  .rd-q { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

  .rd-row-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 0; border-top: 1px solid var(--line);
    color: var(--text-2); font-size: 15px; text-decoration: none;
  }

  /* 主操作：吸底 */
  .rd-cta-bar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
    padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 70%, rgba(14,14,16,0));
  }
  .rd-cta-bar button {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; max-width: 524px; margin: 0 auto; height: 50px;
    border: 0; border-radius: 14px; background: var(--accent); color: #111;
    font-size: 16px; font-weight: 600; cursor: pointer;
  }
  .rd-cta-bar button .rd-sub { font-weight: 400; color: #555; font-size: 14px; }

.recipe-detail-reference .rd-item-wide{grid-column:1/-1}
.recipe-detail-reference .rd-item-wide .rd-name{overflow:visible;text-overflow:clip}
.recipe-detail-reference .rd-step-note{display:block;font-size:13px;color:var(--text-2);line-height:1.65;margin-top:4px}
/* Narrow phones keep nutrient labels together without shrinking the type. */
@media(max-width:360px){.recipe-detail-reference .rd-nutri .rd-label{white-space:nowrap}}

/* Keep the recipe identity above the approved nutrition/ingredients/steps. */
.recipe-detail-reference .rd-hero{padding:0 var(--pad);margin-top:16px}
.recipe-detail-reference .rd-hero h2{font-size:22px;font-weight:600;line-height:1.4}
.recipe-detail-reference .rd-hero .recipe-cover{width:100%;max-width:none;margin-top:16px}
.recipe-detail-reference .rd-hero .recipe-cover img{display:block;width:100%;height:auto;aspect-ratio:2.15;object-fit:cover;object-position:center 30%;border-radius:12px}
.recipe-detail-reference .rd-hero figcaption{margin-top:8px;font-size:12px;line-height:1.5;color:var(--text-2)}
.recipe-detail-reference .rd-hero figcaption a{color:inherit;text-decoration:none}

/* 2026-10-24 local profile (no login) + interaction fixes */
.recipe-local-note{font-size:11px;color:#6f7077;margin-top:4px}
.recipe-intro .recipe-local-note{margin-top:4px}
.recipe-open-tip{display:flex;align-items:flex-start;gap:8px;padding:10px 6px 10px 12px;margin:0 0 14px;background:#1a1a1d;border:1px solid #2c2c31;border-radius:8px;font-size:12px;line-height:18px;color:#c5c6cc}
.recipe-open-tip p{flex:1;margin:0}
.recipe-open-tip b{font-weight:500;color:#f2f1ed}
.recipe-open-tip button{flex:none;width:32px;height:32px;display:grid;place-items:center;color:#a4a5ad}
.recipe-storage-warning{padding:10px 12px;margin:0 0 14px;border-radius:8px;background:#2a2113;color:#f0c27a;font-size:12px;line-height:18px}
.recipe-setup-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.recipe-onboarding-choices button[aria-invalid=true]:not([aria-pressed=true]),.recipe-onboarding input[aria-invalid=true]{border-color:#f0a35e}
.recipe-onboarding .recipe-hours{flex-wrap:wrap}
.recipe-onboarding .recipe-hours>button{flex:1 1 calc(33% - 8px)}
@media(max-width:380px){.recipe-onboarding-choices>.recipe-hours{grid-template-columns:1fr 1fr 1fr}.recipe-onboarding .recipe-hours>button{font-size:13px;padding:0 2px}}
.recipe-custom-note{font-size:12px;line-height:18px;color:#a4a5ad;margin:0 0 10px}
.recipe-custom .recipe-mode-tabs{margin-bottom:12px}
.recipe-calc-note{margin-top:10px}
.recipe-target-preview .recipe-calc-note summary{min-height:28px}
.recipe-clear-link{display:block;margin-top:12px}
.recipe-dialog-actions{display:flex;gap:10px}
.recipe-dialog-actions>*{flex:1}
.recipe-danger{background:#f0a35e!important;color:#0e0f11!important}
.recipe-calc-save-note{font-size:11px;color:#a4a5ad;margin:8px 0 0;text-align:center}
.recipe-over-alert{margin:0 0 12px;padding:8px 12px;border-radius:8px;background:#2a2113;color:#f0c27a;font-size:.8125rem;line-height:1.25rem}
.recipe-plan-dialog .recipe-progress{position:relative}
.recipe-progress .rp-over{position:absolute;top:0;bottom:0;background:#f0a35e}
.recipe-progress .rp-limit{position:absolute;top:-2px;bottom:-2px;width:2px;margin-left:-1px;background:#0e0f11}
.recipe-progress.is-over{outline:none}
.recipe-plan-legend .is-over i{background:#f0a35e!important}
.recipe-plan-macros .is-over em,.recipe-plan-macros .is-over p b{color:#f0c27a}
.recipe-local-footer{font-size:.75rem;color:#6f7077;margin:20px 0 8px;text-align:center}
.recipe-local-footer button{text-decoration:underline;color:#a4a5ad;min-height:32px}
.recipe-intro p.recipe-local-note{font-size:11px;line-height:16px;color:#6f7077;margin-top:4px}
.recipe-plan-dialog .recipe-over-alert{margin-bottom:16px}
.recipe-target-preview .recipe-calc-note summary::after{content:"＋";margin-left:6px}.recipe-target-preview .recipe-calc-note[open] summary::after{content:"－"}

/* 2026-10-24 round 2: servings stepper top-right, usage list always open */
.recipe-dialog-head button:focus:not(:focus-visible),html[data-recipe-input=pointer] .recipe-dialog-head button:focus-visible{outline:none}
.recipe-plan-dialog .recipe-plan-summary.has-servings{display:grid;grid-template-columns:minmax(0,1fr) auto;flex-wrap:nowrap;align-items:center;gap:10px;margin-bottom:6px}
.recipe-plan-dialog .recipe-plan-summary.has-servings .recipe-plan-energy{min-width:0}
.recipe-plan-servings{flex:none;background:#1a1a1d;padding:4px;white-space:nowrap}
.recipe-plan-servings button{width:36px;height:36px;min-height:36px;background:#26262a;color:#f2f2f0;font-size:18px;display:grid;place-items:center}
.recipe-plan-servings span{min-width:48px;font-size:.875rem}
.recipe-plan-servings b{font-weight:600}
@media(max-width:360px){.recipe-plan-servings button{width:32px;height:32px;min-height:32px}.recipe-plan-servings span{min-width:42px}.recipe-plan-dialog .recipe-plan-summary.has-servings .recipe-plan-energy b{font-size:1.75rem}}
.recipe-reference-line{font-size:.75rem;line-height:1.125rem;color:#a4a5ad;margin:0 0 14px;display:flex;align-items:center;flex-wrap:wrap;gap:0 4px}
.recipe-reference-line b{font-weight:500;color:#f2f1ed}
.recipe-reference-line button{min-height:32px;padding:0;text-decoration:underline;color:#c5c6cc;font-size:.75rem}
.recipe-plan-dialog .recipe-usage-title{display:flex;justify-content:space-between;align-items:center;margin:0 0 8px;padding-top:16px;border-top:1px solid #2b2c31}
.recipe-plan-dialog .recipe-usage-title h3{font-size:1rem;line-height:1.5rem;font-weight:600}
.recipe-plan-dialog .recipe-adjust>.recipe-ingredient-tabs{margin-bottom:8px}
.recipe-weight-adjusted{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin:-4px 0 6px;font-size:.75rem;line-height:1.125rem}
.recipe-weight-adjusted span{padding:1px 6px;border-radius:4px;background:#2a2113;color:#f0c27a}
.recipe-plan-dialog .is-adjusted .recipe-weight-input{border-color:#6b5530}

/* 2026-10-24 round 4: servings recompute overwrites manual grams */
.recipe-plan-servings-box{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none}
.recipe-manual-note{margin:0;font-size:.6875rem;line-height:1rem;color:#f0c27a;white-space:nowrap}
.recipe-sheet-toast{position:absolute;left:50%;bottom:calc(96px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:5;padding:10px 16px;border-radius:10px;background:#f2f1ed;color:#0e0f11;font-size:.8125rem;line-height:1.25rem;white-space:nowrap;box-shadow:0 4px 16px rgba(0,0,0,.4);pointer-events:none}

/* 2026-10-24 round 5: list sorting */
.recipe-filterbar-actions{display:flex;align-items:center;gap:14px;min-width:0}
.recipe-filterbar .recipe-sort-button{white-space:nowrap}
.recipe-sort-dialog .recipe-dialog-scroll{padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))}
.recipe-sort-options{list-style:none;margin:0;padding:0}
.recipe-sort-options li{border-bottom:1px solid #2b2c31}
.recipe-sort-options li:last-child{border-bottom:0}
.recipe-sort-options button{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:0;font-size:.9375rem;color:#c5c6cc;text-align:left}
.recipe-sort-options button[aria-pressed=true]{color:#f2f1ed;font-weight:600}
.recipe-sort-name{flex:1}
.recipe-sort-dir{font-size:.8125rem;color:#a4a5ad;font-weight:400}
.recipe-sort-options button[aria-pressed=true] .recipe-sort-dir{color:#f2f1ed}
.recipe-sort-hint{margin:-8px 0 10px;font-size:.75rem;color:#a4a5ad}
.recipe-sort-note{margin:12px 0 0;font-size:.75rem;line-height:1.125rem;color:#6f7077}
.recipe-card-macros .is-sorted,.recipe-card-macros .is-sorted b{color:#f2f1ed}
.recipe-card-time.is-sorted{display:inline-flex;align-items:center;gap:4px;color:#f2f1ed;font-weight:600}

/* 2026-10-24 round 6: list header layout + filter sheet */
.recipe-reference-card{display:flex;align-items:center;gap:12px;width:100%;margin:0 0 14px;padding:14px 16px;border:1px solid #2b2c31;border-radius:16px;background:#18191c;color:#f2f1ed;text-align:left;min-height:72px}
.rrc-copy{flex:1;min-width:0;display:grid;gap:2px}
.rrc-label{font-size:.75rem;line-height:1.125rem;color:#a4a5ad}
.rrc-value{font-size:.75rem;color:#a4a5ad;white-space:nowrap}
.rrc-value b{font-size:1.5rem;line-height:1.875rem;font-weight:600;color:#f2f1ed;font-variant-numeric:tabular-nums;margin-right:2px}
.rrc-title{font-size:1rem;line-height:1.5rem;font-weight:600}
.rrc-sub{font-size:.75rem;line-height:1.125rem;color:#a4a5ad;overflow-wrap:anywhere}
.rrc-action{flex:none;display:flex;align-items:center;gap:2px;font-size:.8125rem;color:#c5c6cc}
.recipe-reference-card.is-empty .rrc-action{color:#f2f1ed;font-weight:500}
.recipe-filterbar-actions{gap:16px;flex:none}
.recipe-filterbar .recipe-filter-button,.recipe-filterbar .recipe-sort-button{white-space:nowrap;gap:5px}
@media(max-width:360px){.recipe-filterbar-actions{gap:10px}.recipe-filterbar{font-size:11.5px}}
.recipe-active-filters{display:flex;flex-wrap:wrap;gap:8px;margin:-4px 0 14px}
.recipe-active-filters button{display:inline-flex;align-items:center;gap:4px;min-height:32px;padding:0 10px;border-radius:16px;background:#26262a;color:#f2f1ed;font-size:.75rem}
.recipe-active-filters button svg{color:#a4a5ad}
.recipe-filter-group{border:0;padding:0;margin:4px 0 18px;min-width:0}
.recipe-filter-group legend{font-size:.875rem;font-weight:600;color:#f2f1ed;margin-bottom:10px;padding:0}
.recipe-filter-group legend small{font-weight:400;font-size:.75rem;color:#6f7077;margin-left:8px}
.recipe-filter-group>div{display:flex;flex-wrap:wrap;gap:8px}
.recipe-filter-group button{min-height:40px;padding:0 14px;border:1px solid #34353b;border-radius:20px;font-size:.875rem;color:#c5c6cc;background:transparent}
.recipe-filter-group button[aria-pressed=true]{background:#f2f1ed;border-color:#f2f1ed;color:#0e0f11;font-weight:500}
.recipe-filter-dialog .recipe-dialog-scroll{padding-bottom:12px}
.recipe-filter-dialog .recipe-dialog-actions{display:flex;gap:10px}
.recipe-filter-dialog .recipe-filter-reset{flex:0 0 30%}
.recipe-filter-dialog .recipe-filter-reset:disabled{opacity:.4}
.recipe-filter-dialog .recipe-primary{flex:1}
.recipe-reference-card:not(.is-empty) .rrc-sub{white-space:nowrap}
@media(max-width:360px){.recipe-reference-card:not(.is-empty){position:relative;padding-right:16px}.recipe-reference-card:not(.is-empty) .rrc-action{position:absolute;top:14px;right:14px}.recipe-reference-card:not(.is-empty) .rrc-sub{font-size:.71875rem}}

/* 2026-10-25 round 7: long-wait dishes (overnight marinating) */
.recipe-card-open{position:relative}
.recipe-advance-badge{position:absolute;top:8px;left:8px;z-index:2;display:inline-flex;align-items:center;gap:3px;padding:3px 8px;border-radius:6px;background:#f0a35e;color:#0e0f11;font-size:11px;line-height:16px;font-weight:600;box-shadow:0 2px 8px rgba(0,0,0,.35);max-width:calc(100% - 16px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.recipe-advance-note{margin:0;padding:10px 12px;border-radius:8px;background:#2a2113;color:#f0c27a;font-size:13px;line-height:20px;border:1px solid #5a4422}
.recipe-detail-reference .rd-advance{margin:0 0 12px;font-size:13px;line-height:20px}
.recipe-plan-dialog .recipe-plan-advance{margin:0 0 12px}
.recipe-detail-reference .rd-times{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0 0 16px;padding:12px;border-radius:10px;background:var(--surface)}
.recipe-detail-reference .rd-times dt{font-size:12px;color:var(--text-2);margin-bottom:4px}
.recipe-detail-reference .rd-times dd{font-size:13px;line-height:18px;color:var(--text);font-weight:500;overflow-wrap:anywhere}
.recipe-detail-reference .rd-prep-tag{display:inline-block;margin:0 6px 4px 0;padding:1px 6px;border-radius:4px;background:#2a2113;color:#f0c27a;font-size:12px;font-weight:600}
/* Room below the list so the floating 今日计划 button never covers the last row */
.recipes-page{padding-bottom:calc(140px + env(safe-area-inset-bottom,0px))}
.recipe-detail-reference .rd-nowrap{white-space:nowrap}
.recipe-detail-reference .rd-times dd{min-width:0}
@media(max-width:400px){.recipe-detail-reference .rd-times{grid-template-columns:1fr;gap:6px}.recipe-detail-reference .rd-times>div{display:flex;justify-content:space-between;align-items:baseline;gap:12px}.recipe-detail-reference .rd-times dt{margin:0;flex:none}.recipe-detail-reference .rd-times dd{text-align:right}}

/* 2026-10-25 round 9: visible "看原片" entries */
.recipe-detail-reference .rd-hero figcaption{display:flex;align-items:center;justify-content:space-between;gap:12px}
.recipe-detail-reference .rd-hero figcaption>a:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.recipe-detail-reference .rd-hero figcaption .rd-source-link{flex:none;display:inline-flex;align-items:center;gap:2px;min-height:36px;padding-left:8px;font-size:14px;font-weight:600;color:var(--text);white-space:nowrap}
.recipe-detail-reference .rd-step-time{display:block;margin-top:4px;font-size:12px;color:var(--text-3);font-variant-numeric:tabular-nums}
.recipe-detail-reference .rd-source-button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;margin:20px 0 4px;padding:0 16px;border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--text-2);font-size:14px;text-decoration:none}
.recipe-detail-reference .rd-source-button .rd-source-by{color:var(--text-3);font-size:12px;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* 2026-10-25 round 10: list thumbnails — blurred tiny preview, then fade in */
.recipe-card .recipe-cover-queued{position:relative;overflow:hidden;background:#202125}
.recipe-card .recipe-cover-queued::before{content:'';position:absolute;inset:-12px;background:var(--recipe-blur,none) center/cover no-repeat;filter:blur(12px);transform:scale(1.08)}
.recipe-card .recipe-cover-queued img{position:relative;opacity:0;transition:opacity .45s ease}
.recipe-card .recipe-cover-queued.is-shown img{opacity:1}
@media(prefers-reduced-motion:reduce){.recipe-card .recipe-cover-queued img{transition:none}}
