/* ======================================================================
 * 40 · 常见中药材煎煮与配伍禁忌 —— 「煎药工序台」
 * 视觉：墨绿 + 药柜木色 + 宣纸米黄；工序时间轴 + 药材卡片；
 *       传统药房木质纹理；与其余 29 页不共用配色与构图。
 * ====================================================================== */

.hx.thd {
    --bg: #f4f0e4;
    --bg2: #e9e3d2;
    --card: #fffdf6;
    --card2: #f7f2e4;
    --card3: #eee7d5;
    --ink: #232b22;
    --ink2: #3f4a3d;
    --muted: #79806f;
    --line: #d8d1bd;
    --line2: #e8e2d1;
    --accent: #2f4f3e;
    --accent-ink: #ffffff;
    --accent-soft: #dfe8dd;
    --accent2: #8a5a2b;
    --accent2-soft: #f1e2cd;
    --ok: #2f4f3e;
    --ok-bg: #e2ece0;
    --warn: #8a5a12;
    --warn-bg: #f6ecd3;
    --bad: #9c3324;
    --bad-bg: #f7e2dc;
    --info: #2b5f6b;
    --info-bg: #e0eef0;
    --radius: 5px;
    --radius-sm: 3px;
    --shadow: 0 2px 6px rgba(35, 43, 34, .08), 0 14px 32px rgba(35, 43, 34, .06);
    --thd-wood: #8a5a2b;

    background:
        repeating-linear-gradient(90deg, rgba(138, 90, 43, .05) 0 2px, transparent 2px 46px),
        var(--bg);
    border-top: 5px solid var(--thd-wood);
}
:root[data-theme="dark"] .hx.thd {
    --bg: #14160f;
    --bg2: #1c1f16;
    --card: #1f231a;
    --card2: #262b20;
    --card3: #2f3527;
    --ink: #e9ece2;
    --ink2: #c1c7b6;
    --muted: #8d9483;
    --line: #3b4133;
    --line2: #2e3428;
    --accent: #8ec9a4;
    --accent-ink: #0a1410;
    --accent-soft: #1d3227;
    --accent2: #d9a15f;
    --accent2-soft: #372a17;
    --ok: #8ec9a4;
    --ok-bg: #1d3227;
    --warn: #dcb45f;
    --warn-bg: #342a16;
    --bad: #e5847a;
    --bad-bg: #38211e;
    --info: #62b7d0;
    --info-bg: #182f38;
    --shadow: 0 2px 6px rgba(0, 0, 0, .5), 0 14px 32px rgba(0, 0, 0, .34);
    --thd-wood: #d9a15f;
    background:
        repeating-linear-gradient(90deg, rgba(217, 161, 95, .05) 0 2px, transparent 2px 46px),
        var(--bg);
}

.thd-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.56fr) minmax(258px, .84fr);
    gap: 0;
    margin: 22px 0 26px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.thd-hero-main { padding: 26px 26px 24px; min-width: 0; }
.thd-kicker {
    font: 700 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase;
    color: var(--accent2); margin: 0 0 8px;
}
.thd-hero h1 { font-size: clamp(28px, 3.5vw, 40px); margin-bottom: 10px; }
.thd-lede { font-size: 14.8px; line-height: 1.9; color: var(--ink2); margin: 0 0 18px; max-width: 58em; }
.thd-lede b { color: var(--accent); border-bottom: 2px solid var(--accent-soft); }
:root[data-theme="dark"] .thd-lede b { color: var(--accent2); border-bottom-color: var(--accent2-soft); }

.thd-block { border-top: 1px solid var(--line2); padding-top: 15px; margin-top: 15px; }
.thd-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.thd-block-hd { display: block; font: 700 12.5px var(--font-mono); letter-spacing: .05em; color: var(--accent2); margin-bottom: 10px; }

.thd-herbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.thd-herb {
    font-size: 13px; color: var(--ink2); background: var(--card2);
    border: 1px solid var(--line2); border-radius: var(--radius-sm); padding: 7px 9px;
    cursor: pointer; text-align: center; transition: .15s;
}
.thd-herb:hover { border-color: var(--accent2); color: var(--accent2); }
.thd-herb.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
:root[data-theme="dark"] .thd-herb.on { color: #0a1410; }
.thd-herb small { display: block; font-size: 10.5px; opacity: .78; margin-top: 2px; }

.thd-custom { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.thd-input {
    flex: 1 1 200px; min-width: 0; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    background: var(--card2); color: var(--ink); font: 500 14.5px/1.6 var(--font-body); padding: 8px 11px; outline: none;
}
.thd-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.thd-picked {
    margin-top: 10px; font-size: 13px; color: var(--ink2); background: var(--card2);
    border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 9px 12px; line-height: 1.8;
}
.thd-picked b { color: var(--accent2); }

.thd-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.thd-fields .hx-label { font-size: 12.5px; }
select.thd-input { cursor: pointer; }

.thd-side { background: var(--card2); border-left: 1px solid var(--line); padding: 22px 18px; display: flex; flex-direction: column; gap: 8px; }
.thd-side-hd { font: 700 11px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.thd-meth { border-radius: var(--radius-sm); padding: 9px 12px; background: var(--card); border-left: 4px solid var(--line); }
.thd-meth b { display: block; font-size: 14px; }
.thd-meth span { display: block; font-size: 11.5px; color: var(--muted); margin: 1px 0 2px; }
.thd-meth em { font-style: normal; font: 700 11.5px var(--font-mono); color: var(--accent2); }
.thd-meth.is-a { border-left-color: #8a5a2b; }
.thd-meth.is-b { border-left-color: #2f4f3e; }
.thd-meth.is-c { border-left-color: #2b5f6b; }
.thd-meth.is-d { border-left-color: #7a3b5c; }
.thd-meth.is-e { border-left-color: #4a5a2f; }
.thd-side-note { margin-top: auto; border-top: 1px solid var(--line); padding-top: 11px; }
.thd-side-note b { display: block; font-size: 13px; margin-bottom: 5px; color: var(--accent); }
.thd-side-note p { font-size: 12.3px; line-height: 1.8; color: var(--ink2); margin: 0; }

/* 结果 */
.thd-result { display: none; }
.thd-result.is-on { display: block; }
.thd-steps { display: grid; gap: 0; margin-bottom: 16px; }
.thd-step { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line2); }
.thd-step:last-child { border-bottom: 0; }
.thd-step-k { font: 800 12px var(--font-mono); color: var(--accent2); letter-spacing: .04em; }
.thd-step-v { font-size: 13.8px; line-height: 1.85; color: var(--ink2); }
.thd-step-v b { color: var(--ink); }
.thd-step-v .thd-tag {
    display: inline-block; font: 700 11px var(--font-mono); border-radius: 3px; padding: 1px 7px;
    background: var(--accent-soft); color: var(--accent); margin-right: 7px;
}
.thd-step-v .thd-tag.is-warn { background: var(--warn-bg); color: var(--warn); }
.thd-step-v .thd-tag.is-bad { background: var(--bad-bg); color: var(--bad); }

.thd-classify { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 12px; margin-bottom: 16px; }
.thd-classcard { background: var(--card2); border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: var(--radius-sm); padding: 13px 14px; }
.thd-classcard h4 { font-size: 14.5px; margin-bottom: 5px; }
.thd-classcard p { font-size: 12.6px; line-height: 1.74; color: var(--ink2); margin: 0 0 6px; }
.thd-classcard .thd-list { font-size: 12.4px; color: var(--accent2); line-height: 1.8; }

.hx.thd .hx-table th { background: var(--accent-soft); color: var(--accent); }
.hx.thd .hx-table tbody tr { cursor: pointer; }
.hx.thd .hx-table tbody tr:hover { background: var(--card2); }
.thd-method { font: 700 12px var(--font-mono); color: var(--accent2); }

.thd-warns { display: grid; grid-template-columns: repeat(auto-fit, minmax(252px, 1fr)); gap: 12px; }
.thd-warn-card { background: var(--warn-bg); border: 1px solid var(--warn); border-radius: var(--radius-sm); padding: 13px 15px; }
.thd-warn-card h4 { font-size: 14px; color: var(--warn); margin-bottom: 7px; }
.thd-warn-card ul { margin: 0; padding-left: 19px; }
.thd-warn-card li { font-size: 12.8px; line-height: 1.78; color: var(--ink2); margin-bottom: 4px; }
.thd-warn-card.is-bad { background: var(--bad-bg); border-color: var(--bad); }
.thd-warn-card.is-bad h4 { color: var(--bad); }
.thd-warn-card.is-info { background: var(--info-bg); border-color: var(--info); }
.thd-warn-card.is-info h4 { color: var(--info); }

@media (max-width: 1000px) {
    .thd-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .thd-hero { grid-template-columns: minmax(0, 1fr); }
    .thd-side { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
    .thd-hero-main { padding: 20px 15px; }
    .thd-fields { grid-template-columns: minmax(0, 1fr); }
    .thd-step { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
