/* ==========================================================
   漫希的工作台 — 弹层内部组件（双端共用）
   ========================================================== */

.hint { font-size: 11.5px; color: var(--text-3); line-height: 1.55; }
.hint b { color: var(--text-2); font-weight: 600; }
.cl-late  { color: var(--late-text);  font-weight: 600; }
.cl-early { color: var(--early-text); font-weight: 600; }

/* 睡眠录入预览条 */
.sp-box {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; background: var(--surface-3);
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--text-2);
}
.sp-box b { color: var(--text); }

/* 睡眠详情 */
.sd-hero {
  display: flex; align-items: center; gap: 10px;
  padding: 17px 18px; border-radius: var(--r-md); border: 1px solid;
}
.sd-hero.early { background: var(--early-bg); border-color: var(--early-line); }
.sd-hero.late  { background: var(--late-bg);  border-color: var(--late-line); }
.sd-c { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sd-c span { font-size: 10.5px; letter-spacing: .06em; opacity: .72; font-weight: 600; }
.sd-c b { font-size: 20px; letter-spacing: -.02em; }
.sd-hero.early .sd-c { color: var(--early-text); }
.sd-hero.late  .sd-c { color: var(--late-text); }
.sd-a { font-size: 15px; opacity: .4; margin: 0 -4px; }
.sd-meta { display: flex; flex-direction: column; gap: 9px; }
.sd-meta > div { display: flex; gap: 14px; font-size: 13px; align-items: baseline; }
.sd-meta span { color: var(--text-3); flex: none; width: 34px; font-size: 12px; }
.sd-meta b { font-weight: 500; color: var(--text); }

/* 习惯预设 / 图标 / 颜色选择 */
.preset-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.preset {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 11px; border-radius: var(--r-full);
  background: var(--surface-3); font-size: 12.5px; color: var(--text-2);
  transition: all .15s var(--ease);
}
.preset:hover { background: var(--brand-soft); color: var(--brand); }
.icon-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.ico-b {
  width: 34px; height: 34px; border-radius: 9px; font-size: 17px;
  background: var(--surface-3); display: grid; place-items: center;
  transition: all .14s var(--ease); border: 1.5px solid transparent;
}
.ico-b:hover { transform: scale(1.1); }
.ico-b.on { background: var(--brand-soft); border-color: var(--brand); }
.color-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.col-b {
  width: 28px; height: 28px; border-radius: 50%;
  transition: all .14s var(--ease); border: 2.5px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.col-b:hover { transform: scale(1.13); }
.col-b.on { border-color: var(--text); transform: scale(1.13); }

/* 习惯月历 */
.hm-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.hm-c {
  aspect-ratio: 1; border-radius: 8px; background: var(--surface-3);
  border: 1px solid transparent;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600;
  color: var(--text-3); font-family: var(--font-num);
  cursor: pointer; transition: all .14s var(--ease);
}
.hm-c:hover { transform: scale(1.08); }
.hm-c.void { background: transparent; pointer-events: none; }
.hm-c.on { color: #fff; }
.hm-c.td { box-shadow: 0 0 0 2px var(--text-4); }
.hm-c.fu { opacity: .35; }
.hm-stat {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 10px;
  margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line);
}
.hm-stat > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hm-stat b { font-size: 19px; }
.hm-stat span { font-size: 11px; color: var(--text-3); }

/* 食谱详情 */
.rd-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-anti .lb { font-size: 11.5px; font-weight: 600; color: var(--text-3); letter-spacing: .04em; }
.rd-sec h4 { font-size: 13px; margin-bottom: 9px; display: flex; align-items: center; gap: 7px; color: var(--text); }
.rd-sec h4::before { content: ''; width: 3px; height: 13px; background: var(--brand); border-radius: 2px; }
.ing { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; }
.ing li {
  font-size: 12.8px; color: var(--text-2); padding-left: 13px; position: relative; line-height: 1.5;
}
.ing li::before {
  content: ''; position: absolute; left: 2px; top: 8px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--brand-line);
}
.rd-tip {
  background: var(--brand-softer); border: 1px solid var(--brand-line);
  border-radius: var(--r-md); padding: 13px 15px;
}
.rd-tip b { font-size: 12px; color: var(--brand); display: block; margin-bottom: 5px; }
.rd-tip p { font-size: 12.8px; line-height: 1.7; color: var(--text-2); }
.macro { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.macro > div {
  background: var(--surface-3); border-radius: var(--r-sm);
  padding: 11px 8px; text-align: center;
}
.macro b { display: block; font-size: 17px; }
.macro span { font-size: 11px; color: var(--text-3); }

/* 运动选择 */
.wt-group { margin-bottom: 11px; }
.wt-gl { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .05em; display: block; margin-bottom: 6px; }
.wt-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.wt-b {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 12px; border-radius: var(--r-full);
  background: var(--surface-3); font-size: 12.5px; color: var(--text-2);
  border: 1.5px solid transparent; transition: all .15s var(--ease);
}
.wt-b:hover { background: var(--brand-softer); }
.wt-b.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.kcal-pv {
  padding: 11px 14px; background: var(--c-fitness-soft);
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--text-2);
  border: 1px solid var(--brand-line);
}
.kcal-pv b { font-size: 16px; color: var(--brand); }

/* 云同步 */
.cloud-tip {
  background: var(--brand-softer); border: 1px solid var(--brand-line);
  border-radius: var(--r-md); padding: 12px 14px;
  font-size: 12.5px; line-height: 1.7; color: var(--text-2);
}
.sql-box { background: var(--surface-3); border-radius: var(--r-sm); padding: 11px 13px; }
.sql-box summary { font-size: 12.5px; cursor: pointer; color: var(--brand); font-weight: 500; user-select: none; }
.sql-box pre {
  margin: 11px 0 9px; font-size: 11px; line-height: 1.62;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xs); padding: 11px; overflow-x: auto;
  font-family: var(--font-num); color: var(--text-2); white-space: pre-wrap; word-break: break-all;
}
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch span {
  width: 40px; height: 23px; border-radius: var(--r-full);
  background: var(--line-2); position: relative; transition: background .22s var(--ease); flex: none;
}
.switch span::after {
  content: ''; position: absolute; top: 2.5px; left: 2.5px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: var(--sh-1); transition: transform .22s var(--ease);
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(17px); }

/* 手机端弹层 → 底部抽屉 */
@media (max-width: 720px) {
  .mask { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 90vh; animation: up .3s var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
  }
  @keyframes up { from { transform: translateY(100%) } }
  .modal-h { padding: 16px 18px 12px; }
  .modal-b { padding: 16px 18px; }
  .modal-f { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1; height: 42px; }
  .modal-f .btn[data-close] { flex: 0 0 88px; }
  .ing { grid-template-columns: 1fr; }
  #toast-wrap { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
