/* ==========================================================================
   内酯豆腐比例 · tofu-coagulant-ratio
   独立设计系统「点浆账房」：米白宣纸 / 豆青 / 石膏灰 / 琥珀
   竖排量杯刻度、双向换算账页、温度带标尺、朱印式编号。
   ========================================================================== */
.tcr-page, .tcr-modal, .tcr-sheet, .tcr-toast {
    --tcr-bg: #f7f5ee;
    --tcr-card: #fffef9;
    --tcr-card2: #f2f1e8;
    --tcr-ink: #2f342c;
    --tcr-ink2: #687363;
    --tcr-ink3: #98a194;
    --tcr-line: #dcdfd2;
    --tcr-line2: #eceee3;
    --tcr-bean: #4b7a52;
    --tcr-gray: #6b7280;
    --tcr-amber: #b8861c;
    --tcr-red: #a8453a;
    --tcr-shadow: 0 12px 30px rgba(60, 70, 50, .10);
    --tcr-shadow-s: 0 3px 12px rgba(60, 70, 50, .07);
    --tcr-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --tcr-serif: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
}
:root[data-theme="dark"] .tcr-page,
:root[data-theme="dark"] .tcr-modal,
:root[data-theme="dark"] .tcr-sheet,
:root[data-theme="dark"] .tcr-toast {
    --tcr-bg: #141712;
    --tcr-card: #1d211a;
    --tcr-card2: #252a21;
    --tcr-ink: #e9eee2;
    --tcr-ink2: #aebaa5;
    --tcr-ink3: #7e8b76;
    --tcr-line: #343c2d;
    --tcr-line2: #2a3124;
    --tcr-bean: #8fc790;
    --tcr-gray: #a9b2b9;
    --tcr-amber: #e3bd63;
    --tcr-red: #ff9184;
    --tcr-shadow: 0 12px 30px rgba(0, 0, 0, .42);
    --tcr-shadow-s: 0 3px 12px rgba(0, 0, 0, .32);
}
.tcr-page { background: var(--tcr-bg); color: var(--tcr-ink); font-size: 15px; line-height: 1.85;
    padding-bottom: 60px; -webkit-font-smoothing: antialiased; }
.tcr-page b { color: var(--tcr-bean); }
.tcr-wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.detail-breadcrumb { font-size: 13px; color: var(--tcr-ink2); padding: 18px 0 14px; }
.detail-breadcrumb a { color: var(--tcr-ink2); text-decoration: none; }
.detail-breadcrumb a:hover { color: var(--tcr-bean); }
.detail-breadcrumb .sep { margin: 0 8px; color: var(--tcr-ink3); }
.detail-breadcrumb .current { color: var(--tcr-ink); font-weight: 700; }

/* ---------- 首屏 ---------- */
.tcr-hero { display: grid; grid-template-columns: .68fr 1.32fr; gap: 0;
    background: var(--tcr-card); border: 1px solid var(--tcr-line); box-shadow: var(--tcr-shadow); }
.tcr-cup-box { background: linear-gradient(160deg, #e9eee3, #dfe7d8); border-right: 1px solid var(--tcr-line);
    padding: 26px 24px; display: flex; flex-direction: column; align-items: center; }
:root[data-theme="dark"] .tcr-cup-box { background: linear-gradient(160deg, #25301f, #1c2518); }
.tcr-cup-title { font: 700 10px/1 var(--tcr-mono); letter-spacing: .16em; color: var(--tcr-ink2); margin-bottom: 16px; }
.tcr-cup { width: 116px; height: 172px; border: 3px solid var(--tcr-gray); border-top: none; border-radius: 0 0 12px 12px;
    background: rgba(255,255,255,.55); position: relative; display: flex; align-items: flex-end; overflow: hidden; }
:root[data-theme="dark"] .tcr-cup { background: rgba(255,255,255,.05); }
.tcr-cup-liquid { width: 100%; height: 72%; background: linear-gradient(180deg, #fbfaf0, #e9ead7);
    display: flex; align-items: center; justify-content: center; transition: height .3s; }
:root[data-theme="dark"] .tcr-cup-liquid { background: linear-gradient(180deg, #3b4733, #2e3a28); }
.tcr-cup-liquid span { font: 700 12px/1 var(--tcr-mono); color: var(--tcr-bean); }
.tcr-cup-marks { position: absolute; right: 4px; top: 0; bottom: 0; width: 18px; display: flex; flex-direction: column; justify-content: space-around; }
.tcr-cup-marks i { display: block; width: 12px; height: 1px; background: var(--tcr-gray); opacity: .6; }
.tcr-spoon { display: flex; align-items: center; gap: 10px; margin-top: 18px; background: var(--tcr-card);
    border: 1px solid var(--tcr-line); border-radius: 8px; padding: 9px 14px; }
.tcr-spoon-ico { font-size: 22px; }
.tcr-spoon b { display: block; font: 700 20px/1.2 var(--tcr-mono); color: var(--tcr-amber); }
.tcr-spoon small { font-size: 11px; color: var(--tcr-ink2); }
.tcr-cup-cap { margin-top: 12px; font-size: 11px; color: var(--tcr-ink2); text-align: center; line-height: 1.7; }
.tcr-hero-copy { padding: 40px 42px; display: flex; flex-direction: column; justify-content: center; }
.tcr-kicker { display: inline-block; align-self: flex-start; font: 700 11px/1 var(--tcr-mono); letter-spacing: .12em;
    color: var(--tcr-red); border: 2px solid var(--tcr-red); border-radius: 3px; padding: 6px 10px;
    transform: rotate(-2deg); margin-bottom: 18px; }
.tcr-hero h1 { font: 700 clamp(25px, 2.9vw, 35px)/1.4 var(--tcr-serif); margin: 0 0 14px; }
.tcr-sub { font-size: 14.5px; line-height: 2; color: var(--tcr-ink2); margin: 0 0 22px; }
.tcr-hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tcr-fact { border: 1px solid var(--tcr-line); border-top: 3px solid var(--tcr-gray); border-radius: 6px;
    padding: 12px 14px; background: var(--tcr-card2); }
.tcr-fact.hot { border-top-color: var(--tcr-bean); }
.tcr-fact b { display: block; font: 700 20px/1.3 var(--tcr-mono); color: var(--tcr-ink); }
.tcr-fact.hot b { color: var(--tcr-bean); }
.tcr-fact span { font-size: 11.5px; color: var(--tcr-ink2); }

/* ---------- 操作台 ---------- */
.tcr-console { margin-top: 20px; background: var(--tcr-card); border: 1px solid var(--tcr-line);
    border-radius: 12px; padding: 24px 28px 26px; box-shadow: var(--tcr-shadow-s); }
.tcr-console-head, .tcr-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tcr-console-head h2, .tcr-block-head h2 { font: 700 18px/1.5 var(--tcr-serif); margin: 0; }
.tcr-console-head span, .tcr-block-head p { font-size: 12px; color: var(--tcr-ink3); }
.tcr-dual { display: grid; grid-template-columns: 1fr 42px 1fr; gap: 12px; align-items: center;
    margin: 18px 0 22px; padding: 18px; background: var(--tcr-card2); border: 1px dashed var(--tcr-line); border-radius: 10px; }
.tcr-dual-side { display: grid; gap: 6px; }
.tcr-side-tag { font: 700 10px/1 var(--tcr-mono); letter-spacing: .12em; color: var(--tcr-bean); }
.tcr-dual-side label { font-size: 13px; font-weight: 700; }
.tcr-dual-side label em { font-style: normal; font-weight: 400; color: var(--tcr-ink3); }
.tcr-dual-side input, .tcr-field input, .tcr-table input { width: 100%; box-sizing: border-box;
    border: 1px solid var(--tcr-line); border-radius: 6px; background: var(--tcr-card);
    color: var(--tcr-ink); padding: 9px 11px; font: 15px/1.5 var(--tcr-mono); outline: none; }
.tcr-dual-side input:focus, .tcr-field input:focus { border-color: var(--tcr-bean); box-shadow: 0 0 0 3px rgba(75,122,82,.13); }
.tcr-dual-side.is-primary input { border: 2px solid var(--tcr-bean); }
.tcr-dual-side small, .tcr-field small { font-size: 11.5px; color: var(--tcr-ink3); }
.tcr-dual-arrow { font-size: 22px; text-align: center; color: var(--tcr-amber); cursor: pointer; user-select: none; }
.tcr-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tcr-field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.tcr-field label em { font-style: normal; font-weight: 400; color: var(--tcr-ink3); }
.tcr-field small { display: block; margin-top: 6px; }
.tcr-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--tcr-line); }
.tcr-btn { font: 600 13.5px/1.4 inherit; padding: 10px 18px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--tcr-line); background: var(--tcr-card2); color: var(--tcr-ink); transition: .15s; }
.tcr-btn:hover { border-color: var(--tcr-bean); }
.tcr-btn--main { background: var(--tcr-bean); border-color: var(--tcr-bean); color: #fff; padding: 11px 24px; font-size: 14px; }
:root[data-theme="dark"] .tcr-btn--main { color: #14200f; }
.tcr-btn--ai { border-color: var(--tcr-amber); color: var(--tcr-amber); }
.tcr-btn--ghost { border-style: dashed; }
.tcr-err { margin-top: 12px; padding: 10px 14px; border-radius: 6px; font-size: 13px;
    background: rgba(168,69,58,.09); border: 1px solid var(--tcr-red); color: var(--tcr-red); }
.tcr-ai { margin-top: 16px; border: 1px solid var(--tcr-amber); border-radius: 8px; overflow: hidden; }
.tcr-ai-head { display: flex; justify-content: space-between; padding: 9px 14px; background: rgba(184,134,28,.12); font-size: 13px; }
.tcr-ai-head span { font-size: 12px; color: var(--tcr-ink3); }
.tcr-ai-out { padding: 14px 16px; font-size: 13.5px; line-height: 1.9; white-space: pre-wrap; }

/* ---------- 报告 ---------- */
.tcr-report { display: grid; grid-template-columns: 1.45fr .85fr; gap: 0; margin-top: 20px;
    background: var(--tcr-card); border: 1px solid var(--tcr-line); border-radius: 12px; overflow: hidden; box-shadow: var(--tcr-shadow-s); }
.tcr-report-main { padding: 26px 30px 30px; }
.tcr-report-side { padding: 26px 26px 30px; background: var(--tcr-card2); border-left: 1px dashed var(--tcr-line); }
.tcr-report-no { font: 700 10px/1 var(--tcr-mono); letter-spacing: .18em; color: var(--tcr-amber); }
.tcr-report h2 { font: 700 20px/1.5 var(--tcr-serif); margin: 8px 0; }
.tcr-report-main > p { font-size: 13.5px; color: var(--tcr-ink2); line-height: 1.9; margin: 0 0 20px; }
.tcr-report-side h3 { font: 700 15px/1.5 var(--tcr-serif); margin: 0 0 12px; }
.tcr-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tcr-kpis div { border: 1px solid var(--tcr-line2); border-radius: 6px; padding: 11px 12px; background: var(--tcr-card2); }
.tcr-kpis b { display: block; font: 700 17px/1.35 var(--tcr-mono); color: var(--tcr-bean); }
.tcr-kpis span { font-size: 11.5px; color: var(--tcr-ink2); }
.tcr-tempbar { margin-top: 24px; }
.tcr-tempbar-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--tcr-ink2); }
.tcr-tempbar-label b { color: var(--tcr-bean); }
.tcr-tempbar-track { position: relative; display: grid; grid-template-columns: 37.5% 42.5% 20%; height: 14px;
    border-radius: 8px; overflow: visible; margin-top: 8px; }
.tcr-tempbar-track i { display: block; height: 100%; }
.tcr-tempbar-track i.lo { background: #9bb7c4; border-radius: 8px 0 0 8px; }
.tcr-tempbar-track i.ok { background: var(--tcr-bean); }
.tcr-tempbar-track i.hi { background: #d99a86; border-radius: 0 8px 8px 0; }
.tcr-tempbar-pin { position: absolute; top: -6px; width: 4px; height: 26px; background: var(--tcr-red);
    border-radius: 2px; left: 70%; transition: left .3s; }
.tcr-tempbar-scale { display: flex; justify-content: space-between; font: 10px/1.6 var(--tcr-mono); color: var(--tcr-ink3); margin-top: 5px; }
.tcr-steps { margin: 0; padding-left: 20px; font-size: 12.5px; color: var(--tcr-ink2); line-height: 1.9; }
.tcr-steps li { margin-bottom: 7px; }
.tcr-steps b { color: var(--tcr-ink); }

/* ---------- 失败信号 / 对照 ---------- */
.tcr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tcr-block { margin-top: 20px; background: var(--tcr-card); border: 1px solid var(--tcr-line);
    border-radius: 12px; padding: 22px 26px 26px; box-shadow: var(--tcr-shadow-s); }
.tcr-block-head { border-bottom: 2px solid var(--tcr-bean); padding-bottom: 10px; margin-bottom: 16px; }
.tcr-signals { display: grid; gap: 9px; }
.tcr-signal { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 12px;
    border: 1px solid var(--tcr-line2); border-left: 3px solid var(--tcr-gray); border-radius: 6px; }
.tcr-signal.is-risk { border-left-color: var(--tcr-red); background: rgba(168,69,58,.07); }
.tcr-signal b { font-size: 12.5px; color: var(--tcr-ink); }
.tcr-signal.is-risk b { color: var(--tcr-red); }
.tcr-signal span { font-size: 12px; color: var(--tcr-ink2); line-height: 1.75; }
.tcr-table-scroll { overflow-x: auto; }
.tcr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 420px; }
.tcr-table th { text-align: left; font-size: 11px; color: var(--tcr-ink2); background: var(--tcr-card2);
    padding: 9px 10px; border-bottom: 2px solid var(--tcr-line); white-space: nowrap; }
.tcr-table td { padding: 9px 10px; border-bottom: 1px solid var(--tcr-line2); }
.tcr-table .num { text-align: right; font-family: var(--tcr-mono); }
.tcr-table--batch input { padding: 5px 7px; font-size: 12px; min-width: 70px; }
.tcr-table tfoot td { background: var(--tcr-card2); border-top: 2px solid var(--tcr-line); }
.tcr-fine { font-size: 11.5px; color: var(--tcr-ink3); line-height: 1.8; margin: 12px 0 0; }
.tcr-del { border: none; background: transparent; color: var(--tcr-red); cursor: pointer; font-size: 18px; }
.tcr-batch-actions { margin-top: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tcr-batch-actions span { font-size: 12px; color: var(--tcr-ink3); }

/* ---------- 浮层 ---------- */
.tcr-modal[hidden], .tcr-toast[hidden], .tcr-err[hidden], .tcr-ai[hidden] { display: none !important; }
.tcr-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(28, 34, 24, .62); }
.tcr-sheet { position: relative; width: min(520px, 100%); background: var(--tcr-card); color: var(--tcr-ink);
    border: 1px solid var(--tcr-line); border-radius: 12px; padding: 28px 30px; box-shadow: var(--tcr-shadow); }
.tcr-sheet h3 { font: 700 19px/1.5 var(--tcr-serif); margin: 0 0 8px; }
.tcr-sheet p { font-size: 13px; color: var(--tcr-ink2); line-height: 1.85; margin: 0 0 16px; }
.tcr-code { display: block; font: 12px/1.7 var(--tcr-mono); word-break: break-all; background: var(--tcr-card2);
    border: 1px dashed var(--tcr-line); border-radius: 6px; padding: 11px 13px; color: var(--tcr-bean); }
.tcr-modal-x { position: absolute; right: 14px; top: 10px; border: none; background: transparent;
    font-size: 25px; color: var(--tcr-ink3); cursor: pointer; }
.tcr-sheet-actions { margin-top: 18px; display: flex; justify-content: flex-end; }
.tcr-toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 9100;
    background: #334b36; color: #fff; padding: 11px 20px; border-radius: 8px; font-size: 13px; box-shadow: var(--tcr-shadow); }

@media (max-width: 1000px) {
    .tcr-hero { grid-template-columns: 1fr; }
    .tcr-cup-box { border-right: none; border-bottom: 1px solid var(--tcr-line); }
    .tcr-hero-copy { padding: 28px 24px; }
    .tcr-fields { grid-template-columns: 1fr 1fr; }
    .tcr-report { grid-template-columns: 1fr; }
    .tcr-report-side { border-left: none; border-top: 1px dashed var(--tcr-line); }
    .tcr-cols { grid-template-columns: 1fr; }
    .tcr-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
    .tcr-wrap { padding: 0 12px; }
    .tcr-console, .tcr-report-main, .tcr-block, .tcr-hero-copy { padding-left: 16px; padding-right: 16px; }
    .tcr-hero h1 { font-size: 23px; }
    .tcr-dual { grid-template-columns: 1fr; }
    .tcr-dual-arrow { transform: rotate(90deg); }
    .tcr-fields, .tcr-hero-facts { grid-template-columns: 1fr; }
    .tcr-kpis { grid-template-columns: 1fr 1fr; }
    .tcr-signal { grid-template-columns: 1fr; gap: 3px; }
    .tcr-actions .tcr-btn { flex: 1 1 45%; }
}
@media print { .tcr-page { background: #fff; } .tcr-actions, .tcr-modal, .tcr-toast, .tcr-batch-actions { display: none !important; } }

/* ===== 窄屏溢出兜底：grid/flex 子项 min-width:0，公共推荐位不撑宽页面 ===== */
.tool-rec-item { min-width: 0; max-width: 100%; box-sizing: border-box; }
@media (max-width: 1000px) {
    .tcr-cols > *, .tcr-two-col > *, .tcr-c > *, .tcr-report > *, .tcr-hero > *,
    .tcr-grid-wrap > *, .tcr-console-grid > *, .tcr-dual > *, .tcr-report-grid > * { min-width: 0; }
}
@media (max-width: 620px) {
    .tcr-page, .tcr-wrap, .tcr-block, .tcr-report, .tcr-console, .tcr-hero { max-width: 100%; }
    .tcr-table-scroll { max-width: 100%; }
    .tcr-cols > *, .tcr-two-col > *, .tcr-report > *, .tcr-grid-wrap > *, .tcr-block { min-width: 0; max-width: 100%; }
    .tcr-page .tskb-related .tskb-rel-grid { grid-template-columns: 1fr 1fr; min-width: 0; }
}
