/* =====================================================================
 * 38 · 腰椎睡姿护腰自查 —— 独立皮肤「诊疗清单」
 * 配色：湖蓝 / 炭灰 / 浅灰；布局：左侧步骤竖栏 + 右侧自查面板 + 双列结果；
 * 字体层级：700 标题 + 40px 等宽数据 + 细分割线 + 10px 全大写微标。
 * ===================================================================== */

.hg4-p38 {
    --p38-bg: #f1f5f6;
    --p38-surface: #ffffff;
    --p38-surface2: #e9eff1;
    --p38-ink: #22303a;
    --p38-sub: #52636c;
    --p38-muted: #87979e;
    --p38-line: #d8e2e5;
    --p38-accent: #1d6f7a;
    --p38-accent2: #48a8ad;
    --p38-bad: #b14b3c;
    --p38-soft: rgba(29, 111, 122, .10);
    --p38-badbg: rgba(177, 75, 60, .11);
    --p38-on: #ffffff;
    --p38-shadow: 0 12px 34px rgba(34, 48, 58, .08);
    --p38-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    --p38-sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background: var(--p38-bg); color: var(--p38-ink);
    font-family: var(--p38-sans); font-size: 15px; line-height: 1.84;
    min-height: 60vh; padding: 0 0 72px; -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] .hg4-p38 {
    --p38-bg: #101a1e; --p38-surface: #16242a; --p38-surface2: #1c2e35;
    --p38-ink: #e7f1f3; --p38-sub: #adc2c8; --p38-muted: #79939b;
    --p38-line: #29404a; --p38-accent: #5fc3c9; --p38-accent2: #8fdde0;
    --p38-bad: #ef917f; --p38-soft: rgba(95, 195, 201, .14); --p38-badbg: rgba(239, 145, 127, .14);
    --p38-on: #0d171b; --p38-shadow: 0 12px 34px rgba(0, 0, 0, .38);
}
.hg4-p38 *, .hg4-p38 *::before, .hg4-p38 *::after { box-sizing: border-box; }
.hg4-p38 h1, .hg4-p38 h2, .hg4-p38 h3 { margin: 0; font-weight: 700; letter-spacing: -.012em; line-height: 1.4; }
.hg4-p38 p { margin: 0 0 12px; }
.hg4-p38 strong, .hg4-p38 b { font-weight: 750; color: var(--p38-ink); }
.hg4-p38 a { color: var(--p38-accent); text-decoration: none; }
.hg4-p38 a:hover { text-decoration: underline; }
.hg4-p38 button { cursor: pointer; font-family: inherit; }
.hg4-p38 [hidden] { display: none !important; }
.hg4-p38 img { max-width: 100%; height: auto; }
.p38-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.p38-wrap { max-width: 1220px; margin: 0 auto; padding: 0 24px; }

/* ---------- 首屏 ---------- */
.p38-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 34px; align-items: center; padding: 36px 0 28px; border-bottom: 1px solid var(--p38-line); }
.p38-kicker { display: inline-block; font: 700 10.5px/1.4 var(--p38-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--p38-accent); border-bottom: 1px solid var(--p38-accent2); padding-bottom: 6px; }
.p38-hero h1 { font-size: clamp(29px, 3.4vw, 44px); line-height: 1.26; letter-spacing: -.026em; margin: 16px 0 13px; color: var(--p38-ink); background: none; -webkit-text-fill-color: currentColor; }
.p38-lede { font-size: 15.5px; line-height: 1.95; color: var(--p38-sub); max-width: 62ch; margin: 0 0 16px; }
.p38-points { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; }
.p38-points li { font-size: 12.5px; color: var(--p38-sub); background: var(--p38-surface); border: 1px solid var(--p38-line); border-radius: 4px; padding: 4px 11px; }
.p38-hero-note { font-size: 12.5px; color: var(--p38-muted); margin: 0; }
.p38-figure { background: var(--p38-surface); border: 1px solid var(--p38-line); border-radius: 10px; padding: 12px; }
.p38-spine { display: block; width: 100%; }
.p38-spine .sp-base { stroke: var(--p38-line); }
.p38-spine .sp-spine { stroke: var(--p38-accent); }
.p38-spine .sp-dot { fill: var(--p38-accent2); }
.p38-spine .sp-bed { stroke: var(--p38-line); }
.p38-spine text { fill: var(--p38-muted); font-family: var(--p38-mono); }

/* ---------- 自查台：步骤竖栏 + 面板 ---------- */
.p38-console { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; padding: 26px 0 30px; border-bottom: 1px solid var(--p38-line); }
.p38-steps { align-self: start; }
.p38-steps h2 { font: 700 10.5px/1.5 var(--p38-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--p38-muted); margin-bottom: 12px; }
.p38-step { border-left: 3px solid var(--p38-line); padding: 9px 0 9px 13px; margin-bottom: 4px; }
.p38-step.is-on { border-left-color: var(--p38-accent); }
.p38-step b { font: 700 11px/1.4 var(--p38-mono); color: var(--p38-accent); }
.p38-step span { display: block; font-size: 14px; font-weight: 700; margin: 2px 0 1px; }
.p38-step small { display: block; font-size: 11.5px; color: var(--p38-muted); }
.p38-steps-note { font-size: 12px; color: var(--p38-muted); line-height: 1.85; margin: 16px 0 0; border-top: 1px solid var(--p38-line); padding-top: 12px; }
.p38-form { background: var(--p38-surface); border: 1px solid var(--p38-line); border-radius: 12px; box-shadow: var(--p38-shadow); padding: 20px 22px 22px; }
.p38-form-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--p38-line); padding-bottom: 12px; margin-bottom: 4px; }
.p38-form-head b { font: 700 11px/1.4 var(--p38-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--p38-accent); }
.p38-form-head span { font-size: 11px; color: var(--p38-muted); }
.p38-block { padding: 16px 0; border-bottom: 1px solid var(--p38-line); }
.p38-block:last-of-type { border-bottom: 0; }
.p38-block h3 { font-size: 15px; margin-bottom: 12px; }
.p38-block h3 small { display: block; font-size: 11.5px; font-weight: 400; color: var(--p38-muted); margin-top: 3px; }
.p38-block--alert { background: var(--p38-surface2); border-radius: 9px; padding: 15px 16px; margin-top: 14px; }
.p38-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.p38-field { display: block; font-size: 12.5px; font-weight: 700; color: var(--p38-ink); }
.p38-field > span { display: block; margin-bottom: 5px; }
.p38-field i { font-style: normal; font-weight: 400; font-size: 11px; color: var(--p38-muted); margin-left: 4px; }
.p38-input { width: 100%; font-family: inherit; font-size: 14px; color: var(--p38-ink); background: var(--p38-surface2); border: 1px solid var(--p38-line); border-radius: 7px; padding: 9px 11px; outline: none; }
.p38-input:focus { border-color: var(--p38-accent); box-shadow: 0 0 0 3px var(--p38-soft); }
.p38-textarea { resize: vertical; min-height: 106px; line-height: 1.7; }
.p38-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.p38-checks label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--p38-sub); background: var(--p38-surface2); border: 1px solid var(--p38-line); border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.p38-checks input { accent-color: var(--p38-accent); }
.p38-console-btns, .p38-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.p38-btn { appearance: none; border: 1px solid var(--p38-line); background: var(--p38-surface2); color: var(--p38-ink); font-size: 13.5px; font-weight: 700; border-radius: 7px; padding: 9px 16px; transition: transform .14s, filter .14s; }
.p38-btn:hover { transform: translateY(-1px); border-color: var(--p38-accent); }
.p38-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.p38-btn--main { background: var(--p38-accent); color: var(--p38-on); border-color: var(--p38-accent); }
:root[data-theme="dark"] .p38-btn--main { color: #0d171b; }
.hg4-err.p38-err { font-size: 12.5px; color: var(--p38-bad); min-height: 0; margin: 8px 0 0; }
.hg4-err.p38-err:empty { display: none; }
.p38-scope { margin: 18px 0 0; padding: 13px 16px; border-left: 3px solid var(--p38-accent2); background: var(--p38-surface); border-radius: 0 8px 8px 0; font-size: 13px; line-height: 1.9; color: var(--p38-sub); }

/* ---------- 结果 ---------- */
.p38-result, .p38-ai, .p38-extra, .p38-content { padding: 28px 0; border-bottom: 1px solid var(--p38-line); }
.p38-sec-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.p38-sec-no { font: 700 10px/1 var(--p38-mono); letter-spacing: .16em; color: var(--p38-accent); border: 1px solid var(--p38-accent); border-radius: 4px; padding: 5px 7px; }
.p38-sec-head h2 { font-size: 21px; }
.p38-sec-head small { font-size: 12px; color: var(--p38-muted); font-weight: 400; }
.p38-empty { display: flex; align-items: center; gap: 16px; background: var(--p38-surface); border: 1px dashed var(--p38-line); border-radius: 12px; padding: 26px 22px; color: var(--p38-muted); font-size: 14px; }
.p38-empty b { font-size: 34px; font-weight: 400; }
.p38-alert { background: var(--p38-badbg); border: 1px solid var(--p38-bad); border-left: 5px solid var(--p38-bad); border-radius: 8px; padding: 14px 17px; margin-bottom: 16px; font-size: 13.5px; line-height: 1.9; color: var(--p38-sub); }
.p38-alert strong { color: var(--p38-bad); }
.p38-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.p38-score { background: var(--p38-surface); border: 1px solid var(--p38-line); border-radius: 10px; padding: 15px 17px; }
.p38-score--hi { background: var(--p38-accent); border-color: var(--p38-accent); }
:root[data-theme="dark"] .p38-score--hi { background: #1d4a51; }
.p38-score span { display: block; font: 700 10px/1.5 var(--p38-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--p38-muted); }
.p38-score--hi span { color: var(--p38-on); opacity: .8; }
.p38-score b { display: block; font: 700 40px/1.3 var(--p38-mono); color: var(--p38-ink); font-variant-numeric: tabular-nums; }
.p38-score--hi b { color: var(--p38-on); }
.p38-score em { font-size: 11.5px; font-style: normal; color: var(--p38-muted); }
.p38-score--hi em { color: var(--p38-on); opacity: .8; }
.p38-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.p38-panel { background: var(--p38-surface); border: 1px solid var(--p38-line); border-radius: 10px; padding: 16px 18px; }
.p38-panel h3 { font-size: 15.5px; margin-bottom: 10px; }
.p38-list { list-style: none; margin: 0; padding: 0; }
.p38-list li { position: relative; padding: 8px 0 8px 20px; font-size: 13.5px; line-height: 1.88; color: var(--p38-sub); border-bottom: 1px solid var(--p38-line); }
.p38-list li:last-child { border-bottom: 0; }
.p38-list li::before { content: "—"; position: absolute; left: 0; color: var(--p38-accent); font-family: var(--p38-mono); }
.p38-list strong { color: var(--p38-ink); }
.p38-subh { font-size: 16px; margin: 24px 0 11px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.p38-subh small { font-size: 11.5px; font-weight: 400; color: var(--p38-muted); }
.p38-chip { font: 700 11px/1.5 var(--p38-mono); background: var(--p38-soft); color: var(--p38-accent); border-radius: 4px; padding: 3px 9px; }
.p38-stretch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.p38-stretch-item { background: var(--p38-surface2); border-radius: 9px; padding: 12px 14px; }
.p38-stretch-item b { display: block; font: 700 10px/1.5 var(--p38-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--p38-accent); margin-bottom: 5px; }
.p38-stretch-item h4 { font-size: 13.5px; margin: 0 0 5px; }
.p38-stretch-item p { font-size: 12.5px; line-height: 1.78; color: var(--p38-sub); margin: 0; }
.p38-table-scroll { overflow-x: auto; border: 1px solid var(--p38-line); border-radius: 9px; }
.p38-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 680px; }
.p38-table th, .p38-table td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--p38-line); }
.p38-table th { background: var(--p38-surface2); font-size: 12px; color: var(--p38-sub); font-weight: 700; white-space: nowrap; }
.p38-table tr:last-child td { border-bottom: 0; }
.p38-disclaimer { margin: 20px 0 0; padding: 13px 16px; border-left: 3px solid var(--p38-bad); background: var(--p38-surface2); border-radius: 0 9px 9px 0; font-size: 13px; line-height: 1.9; color: var(--p38-sub); }

/* ---------- AI ---------- */
.p38-ai-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.p38-ai-head h2 { font-size: 18px; }
.p38-ai-head h2 small { font-size: 11.5px; font-weight: 600; color: var(--p38-accent); background: var(--p38-soft); border-radius: 4px; padding: 3px 8px; margin-left: 7px; }
.p38-ai-head > span { font-size: 12px; color: var(--p38-muted); }
.p38-ai { border: 1px solid var(--p38-line); border-left: 4px solid var(--p38-accent2); border-radius: 0 10px 10px 0; padding-left: 20px; padding-right: 20px; }
.p38-ai-box { background: var(--p38-surface2); border-radius: 8px; padding: 14px 16px; font-size: 13.5px; line-height: 1.9; color: var(--p38-sub); max-height: 260px; overflow: auto; white-space: pre-wrap; }
.p38-ai-box b { color: var(--p38-ink); }
.p38-ai-btns { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.p38-ai-status { font: 12px/1.7 var(--p38-mono); color: var(--p38-muted); margin: 10px 0 0; }

/* ---------- 批量 / 内容 ---------- */
.p38-extra-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.p38-card { background: var(--p38-surface); border: 1px solid var(--p38-line); border-radius: 10px; padding: 17px 18px; }
.p38-card h3 { font-size: 15.5px; margin-bottom: 10px; }
.p38-hint { font-size: 12.5px; color: var(--p38-muted); line-height: 1.8; margin: 8px 0 12px; }
.p38-card-text { font-size: 13.5px; line-height: 1.95; color: var(--p38-sub); }
.p38-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 17px; }
.p38-tab { border: 1px solid var(--p38-line); background: var(--p38-surface); color: var(--p38-sub); font-size: 13.5px; font-weight: 700; border-radius: 7px; padding: 8px 15px; }
.p38-tab.is-on { background: var(--p38-ink); color: var(--p38-on); border-color: var(--p38-ink); }
:root[data-theme="dark"] .p38-tab.is-on { background: var(--p38-accent); color: #0d171b; border-color: var(--p38-accent); }
.p38-prose { max-width: 84ch; }
.p38-prose h3 { font-size: 17px; margin: 22px 0 9px; }
.p38-prose h3:first-child { margin-top: 0; }
.p38-prose p { font-size: 14.5px; line-height: 2; color: var(--p38-sub); margin: 0 0 15px; }
.p38-figure-img { display: block; width: 100%; max-width: 720px; border: 1px solid var(--p38-line); border-radius: 9px; margin: 6px 0 18px; }
.p38-faq details { border: 1px solid var(--p38-line); background: var(--p38-surface); border-radius: 8px; margin-bottom: 8px; }
.p38-faq summary { cursor: pointer; font-size: 14.5px; font-weight: 700; padding: 12px 16px; }
.p38-faq details > div { padding: 0 16px 14px; font-size: 14px; line-height: 1.96; color: var(--p38-sub); }
.p38-faq details > div strong { color: var(--p38-ink); }
.p38-boundary { margin: 24px 0 18px; padding: 14px 17px; border: 1px solid var(--p38-line); border-radius: 9px; background: var(--p38-surface2); font-size: 13px; line-height: 1.9; color: var(--p38-sub); }
.p38-related { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.p38-related a { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--p38-surface); border: 1px solid var(--p38-line); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; font-weight: 700; color: var(--p38-ink); }
.p38-related a:hover { border-color: var(--p38-accent); text-decoration: none; }
.p38-related a span { color: var(--p38-accent); }

@media (max-width: 980px) {
    .p38-console { grid-template-columns: 1fr; }
    .p38-steps { display: flex; flex-wrap: wrap; gap: 10px; }
    .p38-step { flex: 1 1 160px; border-left: 0; border-top: 3px solid var(--p38-line); padding: 9px 0 0; }
    .p38-step.is-on { border-top-color: var(--p38-accent); }
    .p38-steps-note { flex-basis: 100%; }
    .p38-stretch { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .p38-hero, .p38-two, .p38-extra-grid { grid-template-columns: 1fr; }
    .p38-figure { display: none; }
    .p38-related { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .p38-wrap { padding: 0 16px; }
    .p38-fields, .p38-checks, .p38-scores { grid-template-columns: 1fr; }
    .p38-stretch, .p38-related { grid-template-columns: 1fr; }
}
