/* ============================================================
   homemade-yogurt · 自制酸奶指南
   莓紫奶白 #7b4b8a ｜ 内联 SVG 温度时间曲线 / 发酵罐示意 / 失败排查卡
   ============================================================ */
.ygt{
  --ink:#3b2b45; --sub:#7d6c88; --card:#fffdfd; --line:#ebdcee; --pri:#7b4b8a; --pri-soft:#f7edfa;
  --ok:#3f7a5d; --warn:#c07a1f; --bad:#b2405c; --bg:#faf6fb; --on-pri:#ffffff; --kw:#6a3a79;
  --shadow:0 1px 3px rgba(84,45,95,.06),0 14px 30px -22px rgba(84,45,95,.4);
  --radius:16px;
  max-width:1120px;margin:0 auto;padding:24px 18px 56px;color:var(--ink);
  background:var(--bg);border-radius:18px;font-size:14.5px;line-height:1.8;
}
:root[data-theme="dark"] .ygt{
  --ink:#f1e6f5; --sub:#b9a4c3; --card:#221828; --line:#3f2c48; --pri:#c795dd; --pri-soft:#2e2038;
  --ok:#79c9a0; --warn:#e8b45c; --bad:#f08bab; --bg:#140e19; --on-pri:#140e19; --kw:#d9a9ea;
  --shadow:0 2px 8px rgba(0,0,0,.45),0 20px 36px -22px rgba(0,0,0,.85);
}
.ygt *{box-sizing:border-box;}
.ygt b{color:var(--kw);font-weight:700;}
.ygt h1,.ygt h2,.ygt h3{color:var(--ink);margin:0;}
.ygt input,.ygt select,.ygt textarea,.ygt button{font-family:inherit;}

/* ---------- Hero ---------- */
.ygt-hero{display:grid;grid-template-columns:minmax(0,1.75fr) 190px;gap:22px;align-items:center;
  background:var(--card);border:1px solid var(--line);border-top:5px solid var(--pri);
  border-radius:var(--radius);box-shadow:var(--shadow);padding:26px 28px;margin-bottom:18px;}
.ygt-badge{display:inline-block;font-size:11px;font-weight:800;letter-spacing:.15em;color:var(--on-pri);
  background:var(--pri);border-radius:999px;padding:5px 13px;margin-bottom:14px;}
.ygt-hero h1{font-size:31px;line-height:1.32;font-weight:800;margin-bottom:12px;}
.ygt-hero h1 em{display:block;font-style:normal;font-size:16px;font-weight:600;color:var(--sub);margin-top:6px;}
.ygt-hero p{margin:0 0 15px;color:var(--sub);max-width:740px;}
.ygt-hero-meta{display:flex;flex-wrap:wrap;gap:8px;}
.ygt-hero-meta span{font-size:11.5px;font-weight:700;color:var(--pri);background:var(--pri-soft);
  border:1px solid var(--line);border-radius:999px;padding:4px 12px;}
.ygt-jar{display:flex;flex-direction:column;align-items:center;gap:8px;}
.ygt-jar-lid{width:96px;height:14px;border-radius:6px 6px 3px 3px;background:var(--pri);}
.ygt-jar-body{position:relative;width:88px;height:112px;border:3px solid var(--pri);border-radius:10px 10px 18px 18px;
  background:var(--card);overflow:hidden;}
.ygt-jar-milk{position:absolute;left:0;right:0;bottom:0;height:72%;
  background:linear-gradient(180deg,rgba(123,75,138,.18),rgba(123,75,138,.42));}
.ygt-jar>span{font-family:ui-monospace,Consolas,monospace;font-size:10.5px;font-weight:800;color:var(--pri);}

/* ---------- 表单 ---------- */
.ygt-card,.ygt-panel,.ygt-legend,.ygt-prose,.ygt-steps,.ygt-faq,.ygt-related{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:20px 22px;margin-bottom:18px;}
.ygt-card-h,.ygt-h2{display:flex;flex-wrap:wrap;align-items:baseline;gap:10px;margin-bottom:16px;}
.ygt-card-h h2,.ygt-h2{font-size:18px;font-weight:800;}
.ygt-card-h span,.ygt-h2 span{font-size:12px;font-weight:500;color:var(--sub);}
.ygt-card-h span{margin-left:auto;}
.ygt-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px;}
.ygt-f{display:flex;flex-direction:column;gap:6px;font-size:12.5px;font-weight:700;color:var(--sub);}
.ygt-f>span>b{color:var(--bad);}
.ygt-f input,.ygt-f select{width:100%;height:40px;border:1px solid var(--line);border-radius:10px;
  background:var(--pri-soft);color:var(--ink);padding:0 10px;font-size:14.5px;font-weight:700;outline:none;
  font-variant-numeric:tabular-nums;transition:border-color .15s,box-shadow .15s;}
.ygt-f select{font-size:12.5px;}
.ygt-f input:focus,.ygt-f select:focus,.ygt-ta:focus{border-color:var(--pri);box-shadow:0 0 0 3px rgba(123,75,138,.2);}
.ygt-f i{font-style:normal;font-size:11px;font-weight:500;color:var(--sub);}
.ygt-check{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px;align-self:end;min-height:40px;}
.ygt-check input{width:18px;height:18px;accent-color:var(--pri);}
.ygt-actions{display:flex;flex-wrap:wrap;gap:10px;}
.ygt-btn{min-height:40px;padding:0 18px;border:1px solid var(--pri);border-radius:999px;background:var(--card);
  color:var(--pri);font-size:13.5px;font-weight:700;cursor:pointer;transition:transform .12s,background .15s,filter .15s;}
.ygt-btn:hover{background:var(--pri-soft);transform:translateY(-2px);}
.ygt-btn:active{transform:scale(.97);}
.ygt-btn:disabled{opacity:.45;cursor:not-allowed;transform:none;}
.ygt-btn-main{background:var(--pri);color:var(--on-pri);}
.ygt-btn-main:hover{background:var(--pri);color:var(--on-pri);filter:brightness(1.12);}
.ygt-btn-ghost{border-color:var(--line);color:var(--sub);}
.ygt-msg{margin:13px 0 0;font-size:12.5px;line-height:1.7;color:var(--sub);}
.ygt-msg.err{color:var(--bad);font-weight:700;}
.ygt-msg.ok{color:var(--ok);font-weight:700;}
.ygt-empty{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:32px 18px;
  margin-bottom:18px;border:1px dashed var(--pri);border-radius:var(--radius);background:var(--pri-soft);}
.ygt-empty span{font-size:30px;}
.ygt-empty b{font-size:15px;}
.ygt-empty em{font-style:normal;font-size:13px;color:var(--sub);max-width:600px;}

/* ---------- KPI / banner ---------- */
.ygt-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px;}
.ygt-kpi{display:flex;flex-direction:column;gap:3px;padding:15px 16px;background:var(--card);
  border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);}
.ygt-kpi.is-hero{background:var(--pri);border-color:transparent;color:var(--on-pri);}
.ygt-kpi.is-hero .k,.ygt-kpi.is-hero .s{color:var(--on-pri);opacity:.9;}
.ygt-kpi .k{font-size:11.5px;font-weight:700;color:var(--sub);}
.ygt-kpi .v{font-family:ui-monospace,Consolas,monospace;font-size:20px;font-weight:800;
  line-height:1.35;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ygt-kpi .s{font-size:11px;color:var(--sub);}
.ygt-banner{padding:14px 18px;border-radius:10px;margin-bottom:18px;font-size:13.5px;line-height:1.8;
  border-left:5px solid var(--warn);background:var(--pri-soft);color:var(--ink);}
.ygt-banner.is-bad{border-left-color:var(--bad);background:rgba(178,64,92,.09);}
.ygt-banner.is-ok{border-left-color:var(--ok);background:rgba(63,122,93,.09);}
.ygt-banner b{color:inherit;}

/* ---------- SVG 曲线 ---------- */
.ygt-chart{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px;}
.ygt-chart svg{display:block;width:100%;height:auto;}
.ygt-safe{fill:var(--pri-soft);}
.ygt-axis{stroke:var(--line);stroke-width:2;}
.ygt-svg-tx{fill:var(--sub);font-size:11px;font-family:ui-monospace,Consolas,monospace;}
.ygt-temp-line{fill:none;stroke:var(--warn);stroke-width:3;stroke-linejoin:round;}
.ygt-set-line{fill:none;stroke:var(--pri);stroke-width:3;stroke-dasharray:7 5;stroke-linejoin:round;}
.ygt-plan-mark{stroke:var(--bad);stroke-width:2;stroke-dasharray:4 4;}
.ygt-chart-legend{display:flex;flex-wrap:wrap;gap:18px;margin-top:8px;font-size:11.5px;color:var(--sub);}
.ygt-chart-legend span{display:flex;align-items:center;gap:7px;}
.ygt-chart-legend i{width:16px;height:3px;display:inline-block;border-radius:2px;}
.ygt-chart-legend i.t{background:var(--warn);}
.ygt-chart-legend i.s{background:var(--pri);}
.ygt-chart-legend i.p{background:var(--bad);}
.ygt-note{margin:12px 0 0;font-size:12.5px;line-height:1.75;color:var(--sub);}

/* ---------- 表格 / 失败排查 ---------- */
.ygt-tw{overflow:auto;}
.ygt-tb{width:100%;border-collapse:collapse;font-size:13px;min-width:570px;}
.ygt-tb th,.ygt-tb td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top;}
.ygt-tb th{font-size:11.5px;font-weight:800;color:var(--sub);background:var(--pri-soft);white-space:nowrap;}
.ygt-tb tr:hover td{background:var(--pri-soft);}
.ygt-tag{display:inline-block;font-size:11px;font-weight:800;border-radius:999px;padding:2px 9px;}
.ygt-tag.ok{color:var(--ok);background:rgba(63,122,93,.12);}
.ygt-tag.warn{color:var(--warn);background:rgba(192,122,31,.14);}
.ygt-tag.bad{color:var(--bad);background:rgba(178,64,92,.13);}
.ygt-fail{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.ygt-fail-card{padding:13px 15px;border:1px solid var(--line);border-left:4px solid var(--warn);
  border-radius:10px;background:var(--card);}
.ygt-fail-card.hi{border-left-color:var(--bad);background:var(--pri-soft);}
.ygt-fail-card h3{font-size:13px;font-weight:800;margin-bottom:5px;}
.ygt-fail-card p{margin:0;font-size:12px;line-height:1.75;color:var(--sub);}
.ygt-ta{width:100%;min-height:96px;border:1px solid var(--line);border-radius:10px;background:var(--card);
  color:var(--ink);padding:10px 12px;font-family:ui-monospace,Consolas,monospace;font-size:12.5px;line-height:1.7;outline:none;resize:vertical;}
.ygt-final{margin:4px 0 22px;}

/* ---------- 底部 ---------- */
.ygt-legend h2,.ygt-prose h2,.ygt-steps h2,.ygt-faq h2,.ygt-related h2{font-size:18px;font-weight:800;margin-bottom:14px;}
.ygt-legend dl{margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.ygt-legend dl>div{padding:12px 14px;background:var(--pri-soft);border-radius:10px;border-left:3px solid var(--pri);}
.ygt-legend dt{font-size:13px;font-weight:800;margin-bottom:4px;}
.ygt-legend dd{margin:0;font-size:12.5px;line-height:1.75;color:var(--sub);}
.ygt-prose p{color:var(--sub);margin:0 0 12px;}
.ygt-points{padding:14px 16px;background:var(--pri-soft);border-radius:10px;}
.ygt-points h3{font-size:14px;font-weight:800;margin-bottom:8px;}
.ygt-points p{font-size:12.5px;margin:0 0 6px;line-height:1.75;}
.ygt-steps ol{list-style:none;counter-reset:ygt;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.ygt-steps li{counter-increment:ygt;padding:14px;background:var(--card);border:1px solid var(--line);border-radius:10px;}
.ygt-steps li::before{content:counter(ygt);display:flex;align-items:center;justify-content:center;width:24px;height:24px;
  border-radius:50%;background:var(--pri);color:var(--on-pri);font-size:12px;font-weight:800;margin-bottom:8px;}
.ygt-steps li b{display:block;font-size:13px;margin-bottom:4px;}
.ygt-steps li span{font-size:12px;color:var(--sub);line-height:1.7;}
.ygt-faq details{border-bottom:1px solid var(--line);padding:10px 0;}
.ygt-faq details:last-child{border-bottom:0;}
.ygt-faq summary{cursor:pointer;font-size:13.5px;font-weight:700;list-style:none;}
.ygt-faq summary::-webkit-details-marker{display:none;}
.ygt-faq summary::before{content:"✳";display:inline-block;width:20px;color:var(--pri);font-weight:800;}
.ygt-faq details[open] summary::before{content:"✡";}
.ygt-faq details p{margin:8px 0 2px 20px;font-size:12.5px;line-height:1.8;color:var(--sub);}
.ygt-related>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
.ygt-related a{display:flex;flex-direction:column;gap:2px;padding:12px 14px;border:1px solid var(--line);
  border-radius:10px;text-decoration:none;transition:transform .12s,border-color .15s;}
.ygt-related a:hover{transform:translateY(-3px);border-color:var(--pri);}
.ygt-related a span{font-size:20px;}
.ygt-related a b{font-size:13px;color:var(--ink);}
.ygt-related a small{font-size:11.5px;color:var(--sub);}
.ygt-foot{text-align:center;font-size:11.5px;line-height:1.8;color:var(--sub);padding:6px 10px;}

@media (max-width:860px){
  .ygt{padding:16px 12px 40px;}
  .ygt-hero{grid-template-columns:1fr;padding:20px 18px;}
  .ygt-hero h1{font-size:26px;}
  .ygt-jar{flex-direction:row;justify-content:flex-start;}
  .ygt-grid,.ygt-kpis,.ygt-fail,.ygt-legend dl,.ygt-steps ol,.ygt-related>div{grid-template-columns:1fr;}
  .ygt-card,.ygt-panel,.ygt-legend,.ygt-prose,.ygt-steps,.ygt-faq,.ygt-related{padding:16px;}
  .ygt-card-h span{margin-left:0;}
}
