/* =====================================================================
 * 第 4 组｜健康·体检·母婴·疗养 —— 公共外壳 shell.css
 *
 * 本文件【只做三件公共的事】，不含任何工具 UI：
 *   ① 公共头部/尾部之间的面包屑皮肤（.hg4-crumb）；
 *   ② 操作后汇总弹窗 / 轻提示 / 复制成功反馈（默认全部隐藏，仅用户点击后出现）；
 *   ③ 打印与深浅主题的基础令牌。
 *
 * 十个工具的配色、栅格、字体层级、首屏结构、卡片与表格，
 * 全部在 public/css/health_g4/{slug}.css 里各写各的，互不复用视觉皮肤。
 *
 * 深色/浅色：完全由公共导航 #themeToggle 写 <html data-theme="dark">
 * 与 localStorage.theme 驱动，本文件只读，不自建第二套开关。
 * ===================================================================== */

:root {
    --hg-shell-bg: #ffffff;
    --hg-shell-bg2: #f4f7f8;
    --hg-shell-ink: #1a2530;
    --hg-shell-sub: #5a6b79;
    --hg-shell-line: #dfe7eb;
    --hg-shell-accent: #0f766e;
    --hg-shell-shadow: 0 18px 54px rgba(18, 38, 48, .16);
}
:root[data-theme="dark"] {
    --hg-shell-bg: #121b23;
    --hg-shell-bg2: #182530;
    --hg-shell-ink: #e9f1f5;
    --hg-shell-sub: #9eb0bd;
    --hg-shell-line: #2a3b49;
    --hg-shell-accent: #63d3c5;
    --hg-shell-shadow: 0 18px 54px rgba(0, 0, 0, .48);
}

/* ---------- 公共面包屑：首页 › 工具箱 › 分类 › 当前工具 ---------- */
.hg4-crumb {
    background: var(--hg-shell-bg);
    border-bottom: 1px solid var(--hg-shell-line);
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}
.hg4-crumb-in {
    max-width: 1220px;
    margin: 0 auto;
    padding: 11px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    line-height: 1.6;
    letter-spacing: .01em;
    color: var(--hg-shell-sub);
}
.hg4-crumb a {
    color: var(--hg-shell-sub);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .16s, border-color .16s;
}
.hg4-crumb a:hover { color: var(--hg-shell-accent); border-bottom-color: var(--hg-shell-accent); }
.hg4-crumb-sep { color: var(--hg-shell-line); font-size: 12px; user-select: none; }
.hg4-crumb-cur { color: var(--hg-shell-ink); font-weight: 700; }

/* ---------- 轻提示：仅用户操作后触发 ---------- */
.hg4-toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translate(-50%, 14px);
    z-index: 99990;
    max-width: min(88vw, 520px);
    padding: 11px 20px;
    border-radius: 10px;
    background: #16242e;
    color: #f2f8fa;
    font: 600 13.5px/1.6 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    box-shadow: var(--hg-shell-shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s, transform .22s;
}
:root[data-theme="dark"] .hg4-toast { background: #e9f1f5; color: #14212b; }
.hg4-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 操作后汇总弹窗：默认 hidden，禁止加载即弹 ---------- */
.hg4-modal[hidden] { display: none !important; }
.hg4-modal {
    position: fixed;
    inset: 0;
    z-index: 99980;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(9, 20, 27, .58);
    backdrop-filter: blur(3px);
}
.hg4-modal-card {
    width: min(640px, 100%);
    max-height: 82vh;
    overflow: auto;
    background: var(--hg-shell-bg);
    color: var(--hg-shell-ink);
    border: 1px solid var(--hg-shell-line);
    border-radius: 16px;
    box-shadow: var(--hg-shell-shadow);
    padding: 22px 24px 20px;
    font: 14px/1.8 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.hg4-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.hg4-modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.hg4-modal-x {
    flex: none;
    width: 32px; height: 32px;
    border: 1px solid var(--hg-shell-line);
    border-radius: 8px;
    background: var(--hg-shell-bg2);
    color: var(--hg-shell-sub);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.hg4-modal-x:hover { color: var(--hg-shell-ink); }
.hg4-modal-body { color: var(--hg-shell-sub); }
.hg4-modal-body strong, .hg4-modal-body b { color: var(--hg-shell-ink); font-weight: 750; }
.hg4-modal-body ul { margin: 8px 0; padding-left: 20px; }
.hg4-modal-body li { margin: 4px 0; }
.hg4-modal-foot { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 公共样式隔离 ----------
 * site-refresh.css 有全局 h1~h5 { color: var(--c-text) } 与
 * strong,b { color: var(--c-text) }，会把本组各页独立设计的标题色
 * 染成同一套蓝灰。这里用容器级规则显式交还给各页自己的设计令牌，
 * 各页更具体的 .pXX-* 规则仍然优先生效。 */
.hg4 h1, .hg4 h2, .hg4 h3, .hg4 h4, .hg4 h5 { color: inherit; }
.hg4 strong, .hg4 b { color: inherit; }

/* ---------- 通用可访问性 ---------- */
.hg4 button, .hg4 input, .hg4 select, .hg4 textarea { font: inherit; }
.hg4 [hidden] { display: none !important; }
.hg4 :focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.hg4-visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- 主题切换平滑过渡（不影响 prefers-reduced-motion 用户） ---------- */
@media (prefers-reduced-motion: no-preference) {
    .hg4, .hg4-crumb { transition: background-color .22s, color .22s, border-color .22s; }
}

/* ---------- 打印：只留结果，去掉导航/按钮/弹窗 ---------- */
@media print {
    .nav-header, footer, .hg4-crumb, .site-btt, .hg4-toast, .hg4-modal,
    .hg4-no-print, .hg4-actions, .hg4-tabs { display: none !important; }
    .hg4 { background: #fff !important; color: #000 !important; padding: 0 !important; }
    .hg4 * { box-shadow: none !important; }
    .hg4 a { color: #000 !important; text-decoration: none !important; }
}
