/* #38 褪黑素剂量计算器 · 夜色药盒说明书风（独立设计系统 mld-） */
.mld-page, .mld-modal, .mld-toast {
    --mld-bg: #faf7f1;
    --mld-surface: #fffdf8;
    --mld-surface-2: #f1ece2;
    --mld-ink: #2d2942;
    --mld-ink-2: #6f6b82;
    --mld-line: #ddd6c8;
    --mld-brand: #4b3d80;
    --mld-brand-2: #7a68bd;
    --mld-gold: #d79a2b;
    --mld-warn: #b6533c;
    --mld-shadow: 0 12px 34px rgba(58, 46, 84, .11);
}
:root[data-theme="dark"] .mld-page,
:root[data-theme="dark"] .mld-modal,
:root[data-theme="dark"] .mld-toast {
    --mld-bg: #131220;
    --mld-surface: #1c1a2e;
    --mld-surface-2: #262239;
    --mld-ink: #efeaf8;
    --mld-ink-2: #afa9c4;
    --mld-line: #3b3554;
    --mld-brand: #b9a7f5;
    --mld-brand-2: #9c8ae8;
    --mld-gold: #f5c76b;
    --mld-warn: #ff9c83;
    --mld-shadow: 0 16px 42px rgba(0, 0, 0, .40);
}
.mld-page [hidden] { display: none !important; }
.mld-page {
    background: var(--mld-bg); color: var(--mld-ink); padding: 28px 0 60px;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
    font-size: 15px; line-height: 1.85;
    background-image: radial-gradient(circle at 12% 4%, rgba(122, 104, 189, .12), transparent 30%),
        radial-gradient(circle at 92% 34%, rgba(215, 154, 43, .10), transparent 28%);
}
.mld-wrap { max-width: 1140px; margin: 0 auto; padding: 0 22px; }
.mld-page b { color: var(--mld-brand); }
.mld-page h1, .mld-page h2, .mld-page h3 { line-height: 1.35; letter-spacing: -.01em; }
.mld-page h2 { font-size: 23px; margin: 0; font-weight: 800; }
.mld-page h3 { font-size: 17px; margin: 0 0 10px; font-weight: 750; }
.mld-page p { margin: 0; }
.mld-page input, .mld-page select, .mld-page textarea {
    font-family: inherit; color: var(--mld-ink); background: var(--mld-surface);
    border: 1px solid var(--mld-line); border-radius: 9px; padding: 9px 11px; font-size: 14px;
    width: 100%; box-sizing: border-box; outline: none;
}
.mld-page input:focus, .mld-page select:focus, .mld-page textarea:focus { border-color: var(--mld-brand-2); box-shadow: 0 0 0 3px rgba(122, 104, 189, .16); }
.mld-page select { cursor: pointer; }

/* 首屏：左说明书 / 右标签卡 */
.mld-hero { display: grid; grid-template-columns: 1fr .82fr; gap: 34px; margin-top: 22px; align-items: start; }
.mld-hero-main { min-width: 0; padding-top: 8px; }
.mld-brandline { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--mld-brand); border-bottom: 2px solid var(--mld-gold); padding-bottom: 7px; }
.mld-moon { font-size: 18px; }
.mld-ver { color: var(--mld-ink-2); font-weight: 500; border-left: 1px solid var(--mld-line); padding-left: 9px; letter-spacing: 0; }
.mld-hero h1 { font-size: clamp(34px, 4.5vw, 52px); margin: 20px 0 16px; font-weight: 850; }
.mld-sub { font-size: 17px; line-height: 2; color: var(--mld-ink-2); max-width: 620px; }
.mld-keyline { display: flex; flex-wrap: wrap; gap: 0; margin: 26px 0 20px; max-width: 590px; border-top: 1px solid var(--mld-line); border-bottom: 1px solid var(--mld-line); }
.mld-keyline > div { flex: 1; min-width: 130px; padding: 14px 12px; border-right: 1px solid var(--mld-line); }
.mld-keyline > div:last-child { border-right: 0; }
.mld-keyline b { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }
.mld-keyline span { font-size: 11px; color: var(--mld-ink-2); }
.mld-warnline { font-size: 12px; line-height: 1.9; color: var(--mld-warn); background: rgba(182, 83, 60, .08); border-left: 3px solid var(--mld-warn); padding: 11px 14px; border-radius: 0 8px 8px 0; max-width: 620px; }
.mld-label-card { background: var(--mld-surface); border: 1px solid var(--mld-line); border-radius: 6px 6px 16px 16px; box-shadow: var(--mld-shadow); overflow: hidden; min-width: 0; position: relative; }
.mld-label-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: repeating-linear-gradient(90deg, var(--mld-brand) 0 14px, var(--mld-gold) 14px 22px); }
.mld-label-top { display: flex; justify-content: space-between; padding: 18px 20px 12px; font-size: 10px; letter-spacing: .12em; font-weight: 800; color: var(--mld-ink-2); }
.mld-form-tabs { display: flex; margin: 0 20px; border: 1px solid var(--mld-line); border-radius: 9px; overflow: hidden; }
.mld-form-btn { flex: 1; font-family: inherit; border: 0; background: var(--mld-surface-2); color: var(--mld-ink-2); padding: 10px 4px; font-size: 13px; font-weight: 700; cursor: pointer; }
.mld-form-btn.is-on { background: var(--mld-brand); color: #fff; }
.mld-form-body { padding: 18px 20px 20px; }
.mld-field { display: block; font-size: 12px; font-weight: 750; margin-bottom: 12px; }
.mld-field small { font-weight: 500; color: var(--mld-ink-2); margin-left: 5px; }
.mld-field input, .mld-field select { margin-top: 6px; }
.mld-inline { display: flex; gap: 8px; margin-top: 6px; }
.mld-inline input { margin-top: 0; flex: 1; min-width: 0; }
.mld-inline select { margin-top: 0; width: 110px; flex: none; }
.mld-dose-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 14px; }
.mld-dose-quick button { font-family: inherit; font-size: 11px; font-weight: 700; padding: 5px 9px; border: 1px solid var(--mld-line); background: var(--mld-surface-2); color: var(--mld-ink-2); border-radius: 20px; cursor: pointer; }
.mld-dose-quick button:hover { border-color: var(--mld-brand-2); color: var(--mld-brand); }
.mld-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mld-jet-note { font-size: 11px; line-height: 1.8; color: var(--mld-ink-2); align-self: center; }
.mld-btn-main { display: block; width: 100%; border: 0; border-radius: 9px; padding: 14px; margin-top: 6px; font-family: inherit; font-size: 15px; font-weight: 800; color: #fff; cursor: pointer; background: linear-gradient(100deg, var(--mld-brand), var(--mld-brand-2)); }
.mld-btn-main span { float: right; }
.mld-btn-main:hover { filter: brightness(1.08); }
.mld-form-foot, .mld-note { font-size: 11px; line-height: 1.85; color: var(--mld-ink-2); margin-top: 12px; }
.mld-err { margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--mld-warn); background: rgba(182, 83, 60, .10); padding: 9px 11px; border-radius: 8px; }

/* 通用区块 */
.mld-sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.mld-sec-head > span { font-size: 11px; font-weight: 800; color: var(--mld-gold); letter-spacing: .14em; border: 1px solid var(--mld-gold); border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mld-sec-head p { font-size: 12px; color: var(--mld-ink-2); }
.mld-page section.mld-ticket, .mld-page section.mld-plan, .mld-page section.mld-prose, .mld-page section.mld-batch, .mld-page section.mld-sharebar { margin-top: 46px; }
.mld-card, .mld-blister, .mld-clock-card, .mld-table-card, .mld-check-card {
    background: var(--mld-surface); border: 1px solid var(--mld-line); border-radius: 14px; padding: 22px; box-shadow: var(--mld-shadow); min-width: 0;
}
.mld-card h3 small, .mld-table-card h3 small, .mld-check-card h3 small { font-size: 11px; font-weight: 500; color: var(--mld-ink-2); margin-left: 8px; }
.mld-scroll { width: 100%; overflow-x: auto; }
.mld-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
.mld-table th, .mld-table td { padding: 10px 12px; border-bottom: 1px solid var(--mld-line); text-align: left; }
.mld-table th { font-size: 11px; color: var(--mld-ink-2); background: var(--mld-surface-2); font-weight: 700; }
.mld-table tr.is-bad td { color: var(--mld-warn); }
.mld-table tr.is-on td { background: rgba(122, 104, 189, .10); font-weight: 800; }

/* 换算标签 */
.mld-ticket-grid { display: grid; grid-template-columns: 1fr 1.12fr; gap: 18px; }
.mld-blister-title, .mld-clock-title { font-size: 10px; letter-spacing: .14em; font-weight: 800; color: var(--mld-brand); }
.mld-big { font-size: 52px; font-weight: 850; line-height: 1.15; margin: 12px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.mld-big em { font-size: 20px; font-style: normal; color: var(--mld-ink-2); }
.mld-big-sub { font-size: 13px; color: var(--mld-ink-2); margin-bottom: 16px; }
.mld-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.mld-pill { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--mld-brand-2), var(--mld-brand)); box-shadow: inset -2px -2px 4px rgba(0, 0, 0, .18); }
.mld-pill.half { border-radius: 24px 4px 4px 24px; width: 13px; }
.mld-pill.empty { background: transparent; border: 1px dashed var(--mld-line); box-shadow: none; }
.mld-conv-list { border-top: 1px dashed var(--mld-line); padding-top: 12px; }
.mld-conv-list > div { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.mld-conv-list span { color: var(--mld-ink-2); }
.mld-conv-list b { font-variant-numeric: tabular-nums; }
.mld-clock-row { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; flex-wrap: wrap; }
.mld-time { background: var(--mld-surface-2); border-radius: 10px; padding: 12px 16px; text-align: center; min-width: 100px; }
.mld-time b { display: block; font-size: 25px; font-variant-numeric: tabular-nums; }
.mld-time span { font-size: 11px; color: var(--mld-ink-2); }
.mld-arrow { font-size: 11px; color: var(--mld-ink-2); flex: 1; text-align: center; min-width: 90px; }
.mld-arrow b { font-variant-numeric: tabular-nums; }
.mld-clock-note { font-size: 12px; color: var(--mld-ink-2); line-height: 1.85; }
.mld-kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.mld-kpi-row > div { background: var(--mld-surface-2); border-radius: 9px; padding: 10px 12px; }
.mld-kpi-row span { display: block; font-size: 11px; color: var(--mld-ink-2); }
.mld-kpi-row b { font-size: 15px; }
.mld-alert { margin-top: 14px; font-size: 12px; line-height: 1.9; }
.mld-alert > div { border-left: 3px solid var(--mld-warn); background: rgba(182, 83, 60, .09); padding: 9px 12px; border-radius: 0 8px 8px 0; margin-bottom: 8px; }
.mld-alert > div.ok { border-left-color: #3d9a70; background: rgba(61, 154, 112, .09); }
.mld-table-card { margin-top: 18px; }

/* 排程 */
.mld-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* 文章 */
.mld-article { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mld-article article { background: var(--mld-surface); border-top: 4px solid var(--mld-brand-2); border-radius: 4px 4px 14px 14px; padding: 20px; box-shadow: var(--mld-shadow); min-width: 0; }
.mld-article h3 { font-size: 16px; }
.mld-article p { font-size: 13px; line-height: 2.05; color: var(--mld-ink-2); }
.mld-check-card { margin-top: 18px; }
.mld-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mld-checks label { display: flex; align-items: center; gap: 8px; font-size: 12px; background: var(--mld-surface-2); border-radius: 8px; padding: 9px 11px; cursor: pointer; min-width: 0; }
.mld-checks input { width: 15px; height: 15px; flex: none; }
.mld-check-out { margin-top: 14px; font-size: 12px; line-height: 1.9; color: var(--mld-warn); }

/* 批量 / 分享 */
.mld-batch-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; }
.mld-batch-grid textarea { resize: vertical; font-size: 13px; line-height: 1.9; }
.mld-btns { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.mld-btn-sub, .mld-btn-ghost { font-family: inherit; font-size: 13px; font-weight: 750; padding: 10px 16px; border-radius: 9px; cursor: pointer; border: 1px solid var(--mld-brand); background: var(--mld-brand); color: #fff; }
.mld-btn-ghost { background: transparent; color: var(--mld-brand); border-color: var(--mld-line); }
.mld-btn-ghost:hover { border-color: var(--mld-brand); }
.mld-sharebar { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; border: 1px dashed var(--mld-gold); border-radius: 14px; background: var(--mld-surface); padding: 22px 26px; }
.mld-sharebar h2 { font-size: 19px; }
.mld-sharebar p { font-size: 12px; color: var(--mld-ink-2); margin-top: 6px; max-width: 600px; }
.mld-sharebar .mld-btns { margin-top: 0; }
.mld-modal { position: fixed; inset: 0; z-index: 9000; background: rgba(22, 18, 38, .66); display: flex; align-items: center; justify-content: center; padding: 18px; }
.mld-modal[hidden] { display: none !important; }
.mld-modal-box { position: relative; width: min(460px, 100%); max-height: 88vh; overflow-y: auto; background: var(--mld-surface); color: var(--mld-ink); border-radius: 14px; padding: 26px; box-shadow: var(--mld-shadow); }
.mld-modal-x { position: absolute; right: 12px; top: 8px; border: 0; background: transparent; font-size: 24px; color: var(--mld-ink-2); cursor: pointer; line-height: 1; }
.mld-modal-kicker { font-size: 10px; letter-spacing: .14em; font-weight: 800; color: var(--mld-brand); }
.mld-modal-box h3 { font-size: 21px; margin: 8px 0 14px; }
.mld-modal-result { background: var(--mld-surface-2); border-radius: 10px; padding: 14px; font-size: 13px; line-height: 1.9; margin-bottom: 16px; }
.mld-modal-box .mld-field input { font-size: 12px; }
.mld-toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 9500; background: var(--mld-ink); color: var(--mld-surface); padding: 11px 20px; border-radius: 9px; font-size: 13px; box-shadow: var(--mld-shadow); }
.mld-toast[hidden] { display: none !important; }

@media (max-width: 900px) {
    .mld-hero, .mld-ticket-grid, .mld-plan-grid, .mld-batch-grid { grid-template-columns: 1fr; }
    .mld-article { grid-template-columns: 1fr; }
    .mld-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .mld-wrap { padding: 0 14px; }
    .mld-page { padding-top: 16px; font-size: 14px; }
    .mld-hero h1 { font-size: 30px; }
    .mld-sub { font-size: 15px; }
    .mld-keyline > div { min-width: 100px; }
    .mld-big { font-size: 40px; }
    .mld-checks, .mld-two, .mld-kpi-row { grid-template-columns: 1fr; }
    .mld-page section.mld-ticket, .mld-page section.mld-plan, .mld-page section.mld-prose, .mld-page section.mld-batch, .mld-page section.mld-sharebar { margin-top: 30px; }
    .mld-card, .mld-blister, .mld-clock-card, .mld-table-card, .mld-check-card { padding: 16px; }
    .mld-table { min-width: 440px; }
}
