:root {
  --brand: #2f7d5d;
  --brand-2: #3f9b78;
  --brand-soft: #e6f2ea;
  --accent: #c98b3a;
  --accent-soft: #f8ecdb;
  --bg: #f7f5ef;
  --bg-soft: #efecdf;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #1e2b24;
  --ink-2: #41544a;
  --muted: #7c8c82;
  --line: rgba(30, 43, 36, .10);
  --line-strong: rgba(30, 43, 36, .18);
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(255, 255, 255, .60);
  --wrap: 1220px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
html[data-theme="dark"] {
  --brand: #5cc094;
  --brand-2: #74d3aa;
  --brand-soft: rgba(92, 192, 148, .14);
  --accent: #e0a758;
  --accent-soft: rgba(224, 167, 88, .14);
  --bg: #101612;
  --bg-soft: #16201a;
  --surface: #17221c;
  --surface-2: #1b2721;
  --ink: #e7efe9;
  --ink-2: #c4d2c9;
  --muted: #93a79b;
  --line: rgba(231, 239, 233, .12);
  --line-strong: rgba(231, 239, 233, .22);
  --glass: rgba(23, 34, 28, .72);
  --glass-line: rgba(231, 239, 233, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.75 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  transition: background .45s var(--ease), color .45s var(--ease); overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.4; letter-spacing: -.01em; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand-2); color: #fff; }
.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.section { padding: 0; }

/* 回到顶部 */
.to-top { position: fixed; right: 26px; bottom: 30px; z-index: 50; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; background: var(--surface); color: var(--brand); opacity: 0; pointer-events: none; transition: opacity .35s, transform .35s var(--ease); }
.to-top.is-on { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px) scale(1.05); }

/* 入场动画 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal.is-in img{display:block;width:100%;height:100%;object-fit: cover;}
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } * { animation-duration: .001s !important; } }

/* ======================= 食谱详情专用 ======================= */
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 26px 0 14px; flex-wrap: wrap; }
.crumb a:hover { color: var(--brand); }
.crumb .sep { opacity: .5; }

/* 食谱头 —— 品牌渐变横幅卡 */
.recipe-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 380px; gap: 36px; align-items: center; padding: 40px 42px; background: linear-gradient(128deg, #eaf4ec 0%, #f6faf2 52%, #f7ecda 100%);}
html[data-theme="dark"] .recipe-hero { background: linear-gradient(128deg, #182a21 0%, #1d2e25 52%, #241f14 100%); }
/* 装饰：点阵纹理 */
.recipe-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(47, 125, 93, .12) 1.5px, transparent 1.5px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(115deg, rgba(0,0,0,.85), transparent 58%); mask-image: linear-gradient(115deg, rgba(0,0,0,.85), transparent 58%); pointer-events: none; }
/* 装饰：右上暖色光晕 */
.recipe-hero::after { content: ""; position: absolute; width: 360px; height: 360px; right: -110px; top: -140px; background: radial-gradient(circle at 38% 38%, rgba(201, 139, 58, .18), transparent 66%); pointer-events: none; }
.recipe-hero__body { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 15px; }
.recipe-hero .badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: rgba(255, 255, 255, .72); color: var(--brand); font-size: 12.5px; font-weight: 600; width: max-content; backdrop-filter: blur(6px); }
html[data-theme="dark"] .recipe-hero .badge { background: rgba(47, 125, 93, .22); }
.recipe-hero .badge::before { content: ""; width: 7px; height: 7px; background: var(--brand-2); }
.recipe-hero h1 { font-size: clamp(30px, 3.6vw, 42px); letter-spacing: -.02em; line-height: 1.25; }
.recipe-hero h1 em { font-style: normal; color: var(--brand); background: linear-gradient(transparent 72%, rgba(201, 139, 58, .38) 72%); padding: 0 2px; }
.recipe-hero__desc { color: var(--ink-2); font-size: 15px; line-height: 1.9; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.recipe-tags a { font-size: 12.5px; padding: 4px 13px; background: rgba(255, 255, 255, .78); border: 1px solid rgba(47, 125, 93, .18); color: var(--ink-2); transition: .25s; backdrop-filter: blur(4px); }
.recipe-tags a:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: translateY(-2px); }
html[data-theme="dark"] .recipe-tags a { background: rgba(29, 46, 37, .6); }
.recipe-meta { display: flex; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.recipe-meta span { position: relative; padding: 0 16px; }
.recipe-meta span + span::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 12px; background: var(--line-strong); }
.recipe-meta span b { color: var(--ink-2); font-weight: 600; }

/* 封面图（SVG 占位，零外链） */
.recipe-cover { position: relative; z-index: 1; overflow: hidden; background: linear-gradient(160deg, #ffffff 0%, #eef6ef 55%, #f8ecdb 100%); border: 1px solid rgba(255, 255, 255, .65); height:248px;}
html[data-theme="dark"] .recipe-cover { background: linear-gradient(160deg, #2a3d33, #1d2e25 55%, #2a2419); }
html[data-theme="dark"] .recipe-cover::after { background: rgba(47, 125, 93, .3); color: #d8efe2; }
.recipe-cover svg { width: 64%; height: auto; transition: transform .5s var(--ease); }
.recipe-cover:hover svg { transform: scale(1.04) rotate(-1deg); }

/* 两栏布局 */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; padding:42px 0;}
.col-main { min-width: 0; }
.col-side { position: sticky; top: 92px; display: grid; gap: 20px;}

/* 区块标题 */
.block-head { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 18px; flex-wrap: wrap; }
.block-head h2 { font-size: 22px; position: relative; padding-left: 15px; }
.block-head h2::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 4px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.block-head p { color: var(--muted); font-size: 13.5px; }

/* 信息卡 6 宫格 */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-cell { padding: 16px 18px; background: var(--surface); transition: transform .3s var(--ease), border-color .3s; }
.info-cell:hover { transform: translateY(-3px); border-color: var(--brand-2); }
.info-cell .k { font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.info-cell .v { font-size: 14.5px; color: var(--ink); font-weight: 600; line-height: 1.5; }
.info-cell .v small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 食谱补充说明 */
.recipe-extra { display: grid; gap: 16px; }
.recipe-extra > p {
  margin: 0; padding: 16px 20px;
  background: var(--surface); border-left: 4px solid var(--brand);
  font-size: 14.5px; color: var(--ink-2); line-height: 1.95;
}
.recipe-extra > p:nth-of-type(2) { border-left-color: #c8503a; }
.recipe-extra > p > strong { color: var(--brand); font-weight: 700; }
.recipe-extra > p:nth-of-type(2) > strong { color: #c8503a; }
.recipe-materials { margin-top: 2px; }
.recipe-materials ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.recipe-materials li { padding: 11px 14px; background: var(--surface); transition: transform .3s var(--ease), border-color .3s; text-align: center;}
.recipe-materials li:hover { transform: translateY(-3px); border-color: var(--brand-2); }
.recipe-materials li p { font-size: 14px; color: var(--ink); }
.recipe-materials li strong { color: var(--brand); font-weight: 700; display:block;font-size:18px;}

/* 做法步骤 */
.recipe-steps { display: grid; gap: 16px; }
.recipe-step {
  display: grid; grid-template-columns: 1fr 240px; gap: 18px; align-items: center;
  background: var(--surface);
  padding: 16px 18px;
  transition: transform .3s var(--ease), border-color .3s;
}
.recipe-step:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.recipe-step > p:first-child { font-size: 14.5px; color: var(--ink-2); line-height: 1.9; }
.recipe-step > p:first-child strong { color: var(--brand); font-size: 17px; margin-right: 4px; }
.recipe-step > p:last-child { margin: 0; background: linear-gradient(140deg, var(--brand-soft), var(--accent-soft)); display: grid; place-items: center; overflow: hidden; }
html[data-theme="dark"] .recipe-step > p:last-child { background: linear-gradient(140deg, #1d2e25, #2a2419); }
.recipe-step > p:last-child svg { width: 62%; height: auto; opacity: .9; }
.recipe-step p img{display:block;width:100%;height:100%;object-fit: cover;}

/* 功效解读 */
.benefit-grid { display: grid; gap: 14px; }
.benefit { display: flex; gap: 14px; padding: 16px 18px; background: var(--surface-2); }
.benefit__ico { flex: 0 0 40px; height: 40px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.benefit h4 { font-size: 15px; margin-bottom: 3px; }
.benefit p { font-size: 13.5px; color: var(--ink-2); }
.note { margin: 14px 0 4px; padding: 14px 18px; background: var(--accent-soft); font-size: 14px; color: var(--ink-2); }
.note b { color: var(--brand); }
.note--warn { background: rgba(201, 80, 58, .08); border-color: rgba(201, 80, 58, .25); }
.note--warn b { color: #c8503a; }

/* 侧栏卡片 */
.side-card { background: var(--surface); padding: 18px 20px; }
.side-card__title { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 14px; }
.side-card__title .bar { width: 4px; height: 16px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.side-rel a { display: flex; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); }
.side-rel a:first-of-type { border-top: 0; }
.side-rel .thumb { flex: 0 0 52px; height: 52px; background: linear-gradient(140deg, var(--brand-soft), var(--accent-soft)); display: grid; place-items: center; font-size: 22px; }
html[data-theme="dark"] .side-rel .thumb { background: linear-gradient(140deg, #1d2e25, #2a2419); }
.side-rel .meta b { display: block; font-size: 14px; color: var(--ink); transition: color .25s; }
.side-rel a:hover .meta b { color: var(--brand); }
.side-rel .meta span { font-size: 12px; color: var(--muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { font-size: 12.5px; padding: 5px 12px; background: var(--surface-2); color: var(--ink-2); transition: .25s; }
.tag-cloud a:hover { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.cat-nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; font-size: 14px; color: var(--ink-2); transition: .25s; }
.cat-nav a:hover { background: var(--brand-soft); color: var(--brand); }
.cat-nav a .cnt { font-size: 12px; color: var(--muted); }

@media (max-width: 1024px) {
  .recipe-hero { grid-template-columns: 1fr; padding: 28px 26px; }
  .recipe-cover { min-height: 210px; }
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; grid-template-columns: 1fr 1fr; }
  .recipe-cover{height:auto;}
}
@media (max-width: 860px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
  .col-side { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .recipe-hero { padding: 24px 20px; gap: 22px; }
  .recipe-meta span { padding: 0 10px; }
  .info-grid { grid-template-columns: 1fr; }
  .recipe-materials ul { grid-template-columns: 1fr 1fr; }
  .recipe-step { grid-template-columns: 1fr; }
  .recipe-step > p:last-child { aspect-ratio: 16/9; }
  .to-top { right: 14px; bottom: 18px; }
}