/* HOMA-IR：双指数 + 两条横向刻度，与单结果卡工具区分 */

.hm-copy { min-width: 0; }
.hm-hl { color: var(--dk-accent); }

.hm-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hm-jump a {
    padding: 6px 12px; font-size: 12.5px; color: var(--dk-ink-2); text-decoration: none;
    border: 1px solid var(--dk-line); border-radius: 99px; background: var(--dk-surface);
    transition: color .14s, border-color .14s, background .14s;
}
.hm-jump a:hover { color: var(--dk-accent); border-color: var(--dk-accent-line); background: var(--dk-accent-soft); }

#hmCut, #hmBeta, #hmTrap, #hmFaq { scroll-margin-top: 84px; }

.hm-tool { position: sticky; top: 82px; }

.hm-form {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px; padding: 14px 16px 6px;
}
.hm-field { display: grid; gap: 5px; min-width: 0; }
.hm-field > span:first-child { font-size: 12px; font-weight: 600; color: var(--dk-ink-2); }
.hm-box {
    display: flex; align-items: center; gap: 4px;
    height: 36px; padding: 0 6px 0 9px;
    border: 1px solid var(--dk-line-strong); border-radius: 8px; background: var(--dk-surface);
    transition: border-color .15s, box-shadow .15s;
}
.hm-box:focus-within { border-color: var(--dk-accent); box-shadow: 0 0 0 3px var(--dk-accent-soft); }
.hm-box input {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: none; padding: 0;
    background: transparent; color: var(--dk-ink);
    font-family: var(--dk-mono); font-size: 13.5px;
}
.hm-box select {
    flex: none; max-width: 86px; height: 26px; border: 0; outline: none;
    background: var(--dk-surface-3); color: var(--dk-ink-2);
    font-size: 10.5px; border-radius: 6px; padding: 0 3px; cursor: pointer;
}

.hm-result {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px; margin-top: 12px;
    border-top: 1px solid var(--dk-line); border-bottom: 1px solid var(--dk-line);
    background: var(--dk-line);
}
.hm-cell { display: grid; gap: 2px; padding: 12px 14px; background: var(--dk-surface-2); }
.hm-k { font-size: 10.5px; color: var(--dk-muted); letter-spacing: .02em; }
.hm-cell b {
    font-family: var(--cl-serif); font-size: 28px; line-height: 1.1;
    color: var(--dk-ink); font-variant-numeric: tabular-nums;
}
.hm-cell:first-child b { color: var(--dk-accent); }
.hm-cell em { font-style: normal; font-size: 11.5px; color: var(--dk-muted); }
.hm-cell em.is-ok { color: var(--dk-ok); }
.hm-cell em.is-warn { color: var(--dk-warn); }
.hm-cell em.is-high { color: #c2410c; }
.hm-cell em.is-danger { color: var(--dk-err); font-weight: 700; }

/* 两条刻度 */
.hm-bars { display: grid; gap: 12px; padding: 12px 16px 0; }
.hm-bar-k { font-size: 11px; color: var(--dk-muted); }
.hm-track {
    position: relative; height: 8px; margin-top: 5px;
    border-radius: 99px; background: var(--dk-surface-3); overflow: hidden;
}
.hm-track i {
    position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px;
    background: linear-gradient(90deg, #34d399, #fbbf24 55%, #f97316 80%, #dc2626);
    transition: width .26s ease;
}
.hm-track span {
    position: absolute; top: 50%; width: 3px; height: 14px;
    border-radius: 2px; background: var(--dk-ink);
    transform: translate(-50%, -50%);
    opacity: 0; transition: left .26s ease, opacity .18s;
}
.hm-track span.on { opacity: 1; }
.hm-scale {
    display: flex; justify-content: space-between; margin: 4px 0 0;
    font-family: var(--dk-mono); font-size: 9.5px; color: var(--dk-muted);
}

.hm-say {
    margin: 10px 0 0; padding: 0 16px;
    font-size: 12px; line-height: 1.7; color: var(--dk-ink-2);
}

.hm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px 16px; }
.hm-presets { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.hm-preset {
    border: 1px dashed var(--dk-line-strong); background: transparent;
    color: var(--dk-muted); font-size: 11.5px; padding: 4px 9px; border-radius: 99px; cursor: pointer;
    transition: color .14s, border-color .14s;
}
.hm-preset:hover { color: var(--dk-accent); border-color: var(--dk-accent-line); }

.hm-rel { display: block; }
.hm-rel h3 { font-size: 15.5px; margin-bottom: 6px; }
.hm-rel p { margin: 0; font-size: 13px; color: var(--dk-muted); line-height: 1.65; }

:root[data-theme="dark"] .hm-cell:first-child b,
:root[data-theme="dark"] .hm-jump a:hover,
:root[data-theme="dark"] .hm-preset:hover { color: #6ee7b7; }

@media (max-width: 960px) { .hm-tool { position: static; } }

@media (max-width: 560px) {
    .hm-form { grid-template-columns: 1fr; }
    .hm-cell b { font-size: 24px; }
    .hm-presets { margin-left: 0; }
    .hm-tool .dk-tool-head h2 { min-width: 0; }
    .hm-tool .dk-tool-head > span { flex: none; white-space: nowrap; }
}
