/* ============================================================
   melatonin-guide · 褪黑素正确用法
   夜靛紫 #4f46a8 ｜ 居中 24h 环形昼夜钟 / 软圆角卡片 / 圆润字阶
   ============================================================ */
.mlt{
  --ink:#262149; --sub:#706898; --card:#ffffff; --line:#e3ddf3; --pri:#4f46a8; --pri-soft:#f1edfc;
  --ok:#21856d; --warn:#b8791c; --bad:#bd3f68; --bg:#f6f4fd; --on-pri:#ffffff; --kw:#3d3494;
  --night:#312a68; --day:#ded8f5; --ring:#cfc7ee;
  --shadow:0 1px 3px rgba(46,35,105,.06),0 16px 34px -22px rgba(46,35,105,.45);
  --radius:18px;
  max-width:1100px;margin:0 auto;padding:26px 18px 58px;color:var(--ink);
  background:var(--bg);border-radius:22px;font-size:14.5px;line-height:1.8;
}
:root[data-theme="dark"] .mlt{
  --ink:#eae6ff; --sub:#aaa2ce; --card:#1b1832; --line:#352f56; --pri:#ac9dff; --pri-soft:#241f41;
  --ok:#59c9a6; --warn:#e6b35d; --bad:#f085a8; --bg:#100e1e; --on-pri:#100e1e; --kw:#c6baff;
  --night:#0c0a1c; --day:#39325e; --ring:#4a4278;
  --shadow:0 2px 8px rgba(0,0,0,.45),0 20px 36px -22px rgba(0,0,0,.85);
}
.mlt *{box-sizing:border-box;}
.mlt b{color:var(--kw);font-weight:700;}
.mlt h1,.mlt h2,.mlt h3{color:var(--ink);margin:0;}
.mlt input,.mlt select,.mlt textarea,.mlt button{font-family:inherit;}

/* ---------- Hero ---------- */
.mlt-hero{display:grid;grid-template-columns:minmax(0,1.6fr) 240px;gap:24px;align-items:center;
  background:linear-gradient(135deg,var(--card) 0%,var(--pri-soft) 100%);
  border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);
  padding:30px 32px;margin-bottom:18px;}
.mlt-badge{display:inline-block;font-size:11.5px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;
  color:var(--pri);border:1px solid var(--ring);border-radius:999px;padding:5px 14px;background:var(--card);margin-bottom:14px;}
.mlt-hero h1{font-size:32px;line-height:1.3;font-weight:800;letter-spacing:-.01em;margin-bottom:12px;}
.mlt-hero h1 em{display:block;font-style:normal;font-size:16px;font-weight:600;color:var(--sub);letter-spacing:0;margin-top:7px;}
.mlt-hero p{margin:0 0 15px;color:var(--sub);max-width:720px;}
.mlt-hero-meta{display:flex;flex-wrap:wrap;gap:8px;}
.mlt-hero-meta span{font-size:12px;font-weight:700;color:var(--pri);background:var(--card);
  border:1px solid var(--ring);border-radius:999px;padding:5px 13px;}
.mlt-dial{position:relative;width:210px;height:210px;margin:0 auto;border-radius:50%;
  background:conic-gradient(from 0deg,var(--night) 0deg 90deg,var(--day) 90deg 330deg,var(--night) 330deg 360deg);
  box-shadow:inset 0 0 0 10px var(--ring),var(--shadow);}
.mlt-dial-ring{position:absolute;inset:26px;border-radius:50%;background:var(--card);opacity:.94;}
.mlt-dial-core{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;}
.mlt-dial-core b{font-family:ui-monospace,Consolas,monospace;font-size:32px;color:var(--pri);}
.mlt-dial-core small{font-size:11px;color:var(--sub);}
.mlt-dial-lab{position:absolute;font-family:ui-monospace,Consolas,monospace;font-size:10px;font-weight:700;color:var(--pri);}
.mlt-dial-lab.l0{top:4px;left:50%;transform:translateX(-50%);}
.mlt-dial-lab.l6{right:6px;top:50%;transform:translateY(-50%);}
.mlt-dial-lab.l12{bottom:4px;left:50%;transform:translateX(-50%);}
.mlt-dial-lab.l18{left:6px;top:50%;transform:translateY(-50%);}

/* ---------- 卡片 / 表单 ---------- */
.mlt-card,.mlt-panel,.mlt-legend,.mlt-prose,.mlt-steps,.mlt-faq,.mlt-related{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:22px 24px;margin-bottom:18px;}
.mlt-card-h,.mlt-h2{display:flex;flex-wrap:wrap;align-items:baseline;gap:10px;margin-bottom:16px;}
.mlt-card-h h2,.mlt-h2{font-size:18px;font-weight:800;}
.mlt-card-h span,.mlt-h2 span{font-size:12px;font-weight:500;color:var(--sub);}
.mlt-card-h span{margin-left:auto;}
.mlt-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px;}
.mlt-f{display:flex;flex-direction:column;gap:6px;font-size:12.5px;font-weight:700;color:var(--sub);}
.mlt-f b{color:var(--bad);}
.mlt-f input[type=number],.mlt-f input[type=time],.mlt-f select{
  width:100%;height:42px;border:1px solid var(--line);border-radius:12px;background:var(--pri-soft);
  color:var(--ink);padding:0 12px;font-size:15px;font-weight:700;outline:none;
  font-variant-numeric:tabular-nums;transition:border-color .15s,box-shadow .15s;}
.mlt-f select{font-size:13px;}
.mlt-f input:focus,.mlt-f select:focus,.mlt-ta:focus{border-color:var(--pri);box-shadow:0 0 0 3px rgba(79,70,168,.2);}
.mlt-f i{font-style:normal;font-size:11px;font-weight:500;color:var(--sub);}
.mlt-check{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px;align-self:end;min-height:42px;}
.mlt-check input{width:18px;height:18px;accent-color:var(--pri);}

/* ---------- 按钮 / 提示 ---------- */
.mlt-actions{display:flex;flex-wrap:wrap;gap:10px;}
.mlt-btn{min-height:42px;padding:0 19px;border:1px solid var(--pri);border-radius:999px;background:var(--card);
  color:var(--pri);font-size:13.5px;font-weight:700;cursor:pointer;transition:transform .12s,background .15s,box-shadow .15s;}
.mlt-btn:hover{background:var(--pri-soft);transform:translateY(-2px);box-shadow:var(--shadow);}
.mlt-btn:active{transform:scale(.97);}
.mlt-btn:disabled{opacity:.45;cursor:not-allowed;transform:none;}
.mlt-btn-main{background:var(--pri);color:var(--on-pri);box-shadow:0 8px 18px -10px rgba(79,70,168,.9);}
.mlt-btn-main:hover{background:var(--pri);color:var(--on-pri);filter:brightness(1.12);}
.mlt-btn-ghost{border-color:var(--line);color:var(--sub);}
.mlt-msg{margin:13px 0 0;font-size:12.5px;line-height:1.7;color:var(--sub);}
.mlt-msg.err{color:var(--bad);font-weight:700;}
.mlt-msg.ok{color:var(--ok);font-weight:700;}
.mlt-empty{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:34px 18px;
  margin-bottom:18px;border:1px dashed var(--ring);border-radius:var(--radius);background:var(--pri-soft);}
.mlt-empty span{font-size:32px;}
.mlt-empty b{font-size:15px;}
.mlt-empty em{font-style:normal;font-size:13px;color:var(--sub);max-width:600px;}

/* ---------- KPI ---------- */
.mlt-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:18px;}
.mlt-kpi{display:flex;flex-direction:column;gap:3px;padding:16px 18px;background:var(--card);
  border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);}
.mlt-kpi.is-hero{background:var(--pri);color:var(--on-pri);border-color:transparent;}
.mlt-kpi.is-hero .k,.mlt-kpi.is-hero .s{color:var(--on-pri);opacity:.9;}
.mlt-kpi .k{font-size:11.5px;font-weight:700;color:var(--sub);}
.mlt-kpi .v{font-family:ui-monospace,Consolas,monospace;font-size:24px;font-weight:800;
  line-height:1.3;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mlt-kpi .s{font-size:11px;color:var(--sub);}

/* ---------- 昼夜钟 ---------- */
.mlt-clock-wrap{display:grid;grid-template-columns:270px minmax(0,1fr);gap:24px;align-items:center;}
.mlt-clock{position:relative;width:250px;height:250px;border-radius:50%;
  background:conic-gradient(from 0deg,var(--night) 0deg 90deg,var(--day) 90deg 330deg,var(--night) 330deg 360deg);
  box-shadow:inset 0 0 0 8px var(--ring),var(--shadow);}
.mlt-clock-face{position:absolute;inset:0;}
.mlt-c-num{position:absolute;font-family:ui-monospace,Consolas,monospace;font-size:11px;font-weight:800;color:var(--pri);}
.mlt-c-num.n0{top:12px;left:50%;transform:translateX(-50%);}
.mlt-c-num.n6{right:14px;top:50%;transform:translateY(-50%);}
.mlt-c-num.n12{bottom:12px;left:50%;transform:translateX(-50%);}
.mlt-c-num.n18{left:14px;top:50%;transform:translateY(-50%);}
.mlt-hand{position:absolute;inset:0;pointer-events:none;}
.mlt-hand::before{content:"";position:absolute;left:calc(50% - 2px);top:12%;width:4px;height:38%;
  border-radius:4px;background:var(--bad);box-shadow:0 0 0 2px var(--card);}
.mlt-hand.sleep::before{background:var(--pri);}
.mlt-clock-core{position:absolute;inset:34%;border-radius:50%;background:var(--card);
  border:1px solid var(--ring);display:flex;flex-direction:column;align-items:center;justify-content:center;
  box-shadow:var(--shadow);}
.mlt-clock-core b{font-family:ui-monospace,Consolas,monospace;font-size:20px;color:var(--pri);}
.mlt-clock-core small{font-size:10px;color:var(--sub);}
.mlt-clock-legend{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;}
.mlt-clock-legend li{display:flex;align-items:center;gap:10px;font-size:13px;}
.mlt-clock-legend li i{width:14px;height:14px;border-radius:50%;flex:none;}
.mlt-clock-legend li i.take{background:var(--bad);}
.mlt-clock-legend li i.sleep{background:var(--pri);}
.mlt-clock-legend li i.night{background:var(--night);border:1px solid var(--ring);}
.mlt-clock-legend li b{min-width:80px;}
.mlt-clock-legend li span{color:var(--sub);font-family:ui-monospace,Consolas,monospace;}
.mlt-clock-legend li.mlt-clock-note{display:block;font-size:12px;line-height:1.75;color:var(--sub);
  padding:10px 12px;background:var(--pri-soft);border-radius:10px;}

/* ---------- 表格 / 计划 ---------- */
.mlt-tw{overflow:auto;}
.mlt-tb{width:100%;border-collapse:collapse;font-size:13px;min-width:560px;}
.mlt-tb th,.mlt-tb td{padding:11px 13px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top;}
.mlt-tb th{font-size:11.5px;font-weight:800;color:var(--sub);background:var(--pri-soft);white-space:nowrap;}
.mlt-tb tr:hover td{background:var(--pri-soft);}
.mlt-tag{display:inline-block;font-size:11px;font-weight:800;border-radius:999px;padding:3px 10px;}
.mlt-tag.ok{color:var(--ok);background:rgba(33,133,109,.12);}
.mlt-tag.warn{color:var(--warn);background:rgba(184,121,28,.14);}
.mlt-tag.bad{color:var(--bad);background:rgba(189,63,104,.13);}
.mlt-plan{list-style:none;counter-reset:mlt;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.mlt-plan li{counter-increment:mlt;position:relative;padding:12px 14px 12px 42px;background:var(--pri-soft);border-radius:12px;font-size:12.5px;line-height:1.7;}
.mlt-plan li::before{content:counter(mlt);position:absolute;left:12px;top:12px;width:22px;height:22px;
  border-radius:50%;background:var(--pri);color:var(--on-pri);font-size:11px;font-weight:800;
  display:flex;align-items:center;justify-content:center;}
.mlt-ta{width:100%;min-height:96px;border:1px solid var(--line);border-radius:12px;background:var(--pri-soft);
  color:var(--ink);padding:11px 13px;font-family:ui-monospace,Consolas,monospace;font-size:12.5px;line-height:1.7;outline:none;resize:vertical;}
.mlt-final{margin:4px 0 22px;}

/* ---------- 底部 ---------- */
.mlt-legend h2,.mlt-prose h2,.mlt-steps h2,.mlt-faq h2,.mlt-related h2{font-size:18px;font-weight:800;margin-bottom:14px;}
.mlt-legend dl{margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.mlt-legend dl>div{padding:13px 15px;background:var(--pri-soft);border-radius:12px;}
.mlt-legend dt{font-size:13px;font-weight:800;margin-bottom:4px;}
.mlt-legend dd{margin:0;font-size:12.5px;line-height:1.75;color:var(--sub);}
.mlt-prose p{color:var(--sub);margin:0 0 12px;}
.mlt-points{padding:14px 16px;border-left:4px solid var(--pri);background:var(--pri-soft);border-radius:0 12px 12px 0;}
.mlt-points h3{font-size:14px;font-weight:800;margin-bottom:8px;}
.mlt-points p{font-size:12.5px;margin:0 0 6px;line-height:1.75;}
.mlt-steps ol{list-style:none;counter-reset:mlts;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.mlt-steps li{counter-increment:mlts;padding:14px;background:var(--pri-soft);border-radius:12px;border-bottom:3px solid var(--pri);}
.mlt-steps li::before{content:"STEP " counter(mlts);display:block;font-family:ui-monospace,Consolas,monospace;font-size:10.5px;font-weight:800;letter-spacing:.08em;color:var(--pri);margin-bottom:6px;}
.mlt-steps li b{display:block;font-size:13px;margin-bottom:4px;}
.mlt-steps li span{font-size:12px;color:var(--sub);line-height:1.7;}
.mlt-faq details{border-bottom:1px solid var(--line);padding:11px 0;}
.mlt-faq details:last-child{border-bottom:0;}
.mlt-faq summary{cursor:pointer;font-size:13.5px;font-weight:700;list-style:none;}
.mlt-faq summary::-webkit-details-marker{display:none;}
.mlt-faq summary::before{content:"✦";display:inline-block;width:22px;color:var(--pri);font-weight:800;}
.mlt-faq details[open] summary::before{content:"✧";}
.mlt-faq details p{margin:8px 0 2px 22px;font-size:12.5px;line-height:1.8;color:var(--sub);}
.mlt-related>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
.mlt-related a{display:flex;flex-direction:column;gap:2px;padding:13px 15px;border:1px solid var(--line);
  border-radius:12px;text-decoration:none;transition:transform .12s,border-color .15s;}
.mlt-related a:hover{transform:translateY(-3px);border-color:var(--pri);}
.mlt-related a span{font-size:20px;}
.mlt-related a b{font-size:13px;color:var(--ink);}
.mlt-related a small{font-size:11.5px;color:var(--sub);}
.mlt-foot{text-align:center;font-size:11.5px;line-height:1.8;color:var(--sub);padding:6px 10px;}

@media (max-width:860px){
  .mlt{padding:16px 12px 40px;}
  .mlt-hero{grid-template-columns:1fr;padding:22px 18px;}
  .mlt-hero h1{font-size:26px;}
  .mlt-dial{width:160px;height:160px;}
  .mlt-dial-ring{inset:20px;}
  .mlt-dial-core b{font-size:24px;}
  .mlt-grid,.mlt-kpis,.mlt-legend dl,.mlt-steps ol,.mlt-plan,.mlt-related>div{grid-template-columns:1fr;}
  .mlt-clock-wrap{grid-template-columns:1fr;justify-items:center;}
  .mlt-clock{width:220px;height:220px;}
  .mlt-card,.mlt-panel,.mlt-legend,.mlt-prose,.mlt-steps,.mlt-faq,.mlt-related{padding:16px;}
  .mlt-card-h span{margin-left:0;}
}
