/* ======================================================================
 * 40 · 家庭服药时间轴 · 独立色板「夜靛」+ 视觉母题「24 小时刻度轴 / 钟盘」
 * 首屏 wide：全宽标题，下方一条贯穿整盒的 24 小时刻度带；速算条横排五列。
 * 结果区为「每行一种药」的甘特式时间轴，圆点定位到 0–24h 的百分比位置。
 * ====================================================================== */

.lw--dose {
    --a: #5551c4;
    --a2: #9a8be8;
    --a-soft: #edebfb;
    --a-ink: #ffffff;
}
:root[data-theme="dark"] .lw--dose {
    --a: #a49bf5;
    --a2: #c6bffb;
    --a-soft: #24213c;
    --a-ink: #141127;
}

.hd-hero-box { padding-bottom: 22px; }
.hd-hero-box h1 em { display: block; font-size: .5em; font-weight: 700; margin-top: 9px; line-height: 1.45; }
.hd-hero-box .lw-desc { max-width: 78em; }
.hd-hero-box .lw-tags { margin-top: 16px; }

/* ---------- 24 小时刻度带 ---------- */
.hd-axis { position: relative; margin-top: 26px; height: 46px; }
.hd-axis-line { position: absolute; left: 0; right: 0; top: 15px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--a-soft), var(--a), var(--a2), var(--a-soft)); }
.hd-axis-ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; }
.hd-axis-ticks span { position: relative; flex: 1; font-family: var(--mono); font-size: 10.5px; color: var(--muted); padding-top: 26px; text-align: left; }
.hd-axis-ticks span::before { content: ""; position: absolute; left: 0; top: 9px; width: 1px; height: 12px; background: var(--line); }
.hd-axis-ticks span:last-child { text-align: right; }
.hd-axis-ticks span:last-child::before { left: auto; right: 0; }

.hd-quick { margin-top: 14px; }
.hd-quick-row { display: grid; grid-template-columns: 1.2fr .85fr .9fr 1fr; gap: 12px; }
.hd-quick-btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 9px; }

/* ---------- 多药清单 ---------- */
.hd-param { position: relative; overflow: hidden; }
.hd-param::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--a), var(--a2), transparent); }
.hd-drugs { display: grid; gap: 9px; }
.hd-drug { display: grid; grid-template-columns: 1.3fr .8fr .9fr .9fr 1fr 30px; gap: 9px; align-items: end; padding: 11px 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 11px; }
.hd-drug .lw-field > span { font-size: 11.5px; }
.hd-drug input, .hd-drug select { padding: 7px 9px; font-size: 13px; }
.hd-drug-del { width: 30px; height: 32px; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; font-size: 15px; }
.hd-drug-del:hover { color: var(--bad); border-color: var(--bad); }
.hd-life { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }

/* ---------- 结果时间轴 ---------- */
.hd-panel { border-radius: 16px; }
.hd-clock { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hd-clock-head { display: grid; grid-template-columns: 108px 1fr; background: var(--card-2); border-bottom: 1px solid var(--line); }
.hd-clock-head span { font-size: 11px; color: var(--muted); padding: 7px 0; }
.hd-clock-scale { position: relative; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--muted); padding: 7px 4px; }
.hd-row { display: grid; grid-template-columns: 108px 1fr; align-items: center; border-bottom: 1px solid var(--line-2); min-height: 46px; }
.hd-row:last-child { border-bottom: none; }
.hd-row-name { padding: 0 10px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); word-break: break-all; }
.hd-track { position: relative; height: 46px; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 8 - 1px), var(--line-2) calc(100% / 8 - 1px) calc(100% / 8)); }
.hd-sleep { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--muted) 12%, transparent); pointer-events: none; }
.hd-point { position: absolute; top: 50%; width: 15px; height: 15px; border-radius: 50%; background: var(--a); border: 2px solid var(--card); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px color-mix(in srgb, var(--a) 32%, transparent); }
.hd-point.is-bad { background: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 34%, transparent); }
.hd-point::after { content: attr(data-t); position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 9.5px; color: var(--ink-2); white-space: nowrap; }

@media (max-width: 900px) {
    .hd-quick-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hd-drug { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hd-drug-del { width: 100%; }
    .hd-clock-head, .hd-row { grid-template-columns: 76px 1fr; }
    .hd-row-name { font-size: 11px; }
}
@media (max-width: 520px) {
    .hd-axis-ticks span:nth-child(even) { visibility: hidden; }
    .hd-quick-row { grid-template-columns: 1fr; }
}
