/**
 * 交互增强层：药瓶旁说明书参数卡、分步过程条、尺寸预设、用量主数值、
 * 情景载入仿真台、轻提示，以及新手引导（发光光圈 + 步骤气泡）。
 * 加载顺序在 app.css / layout.css 之后。
 */

/* ---------- 顶栏动作区 ---------- */
.topbar__acts { flex: none; display: flex; align-items: center; gap: 9px; }
.btn--tour { color: var(--cyan); border-color: rgba(63, 214, 196, .34); }
.btn--tour:hover { background: rgba(63, 214, 196, .12); border-color: rgba(63, 214, 196, .55); }

/* ---------- 药瓶旁：说明书参数卡 ---------- */
.ifu {
  position: absolute;
  z-index: 3;
  width: 218px;
  padding: 9px 11px 8px;
  background: rgba(8, 13, 20, .84);
  border: 1px solid var(--line);
  border-left: 2px solid rgba(63, 214, 196, .75);
  border-radius: 9px;
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
}
.ifu[hidden] { display: none; }
.ifu__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ifu__head b { font-size: 11.5px; color: var(--cyan); letter-spacing: .02em; }
.ifu__tog {
  font: inherit; font-size: 11px; padding: 1px 3px;
  color: var(--muted); background: none; border: 0; cursor: pointer;
}
.ifu__tog:hover { color: var(--txt); }
.ifu__list { list-style: none; margin: 7px 0 0; padding: 0; display: grid; gap: 4px; }
.ifu__list li { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.ifu__list b { font-family: var(--mono); font-weight: 600; color: var(--txt); }
.ifu__foot { margin: 7px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--muted); opacity: .78; }
.ifu.is-collapsed { width: auto; padding: 6px 10px; }
.ifu.is-collapsed .ifu__list, .ifu.is-collapsed .ifu__foot { display: none; }

/* ---------- 药瓶旁：敷药提示胶囊 ---------- */
.bottle-tip {
  position: absolute;
  z-index: 3;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font: inherit; font-size: 12px; cursor: pointer;
  color: var(--cyan);
  background: rgba(63, 214, 196, .1);
  border: 1px solid rgba(63, 214, 196, .42);
  animation: tipPulse 2.6s ease-in-out infinite;
}
.bottle-tip:hover { background: rgba(63, 214, 196, .2); }
.bottle-tip[hidden] { display: none; }
.bottle-tip svg { width: 14px; height: 14px; flex: none; }
.bottle-tip.is-done { color: var(--muted); border-color: var(--line); animation: none; background: rgba(255, 255, 255, .03); }
@keyframes tipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63, 214, 196, .34); }
  50% { box-shadow: 0 0 0 8px rgba(63, 214, 196, 0); }
}
@media (prefers-reduced-motion: reduce) { .bottle-tip, .tour__ring { animation: none; } }

/* ---------- 分步过程条 ---------- */
.stages {
  display: grid; gap: 7px;
  padding: 8px 10px 9px;
  background: rgba(255, 255, 255, .022);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stages__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.stages__list > li { flex: 1 1 0; min-width: 0; }
.stagepill {
  width: 100%;
  display: flex; align-items: center; gap: 6px;
  font: inherit; font-size: 11.5px; cursor: pointer;
  padding: 5px 8px; border-radius: 7px;
  color: var(--muted); background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  transition: color .15s, background .15s, border-color .15s;
}
.stagepill i {
  flex: none; width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 10px;
  background: rgba(255, 255, 255, .07);
}
.stagepill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stagepill:hover { color: var(--txt); border-color: rgba(63, 214, 196, .4); }
.stagepill.is-done { color: rgba(63, 214, 196, .72); }
.stagepill.is-done i { background: rgba(63, 214, 196, .2); color: var(--cyan); }
.stagepill.is-on {
  color: #04191a; background: var(--cyan); border-color: var(--cyan); font-weight: 600;
}
.stagepill.is-on i { background: rgba(4, 25, 26, .18); color: #04191a; }

.stages__foot { display: flex; align-items: center; gap: 12px; }
.stages__now {
  margin: 0; flex: 1 1 auto; min-width: 0;
  font-size: 12.5px; display: flex; align-items: baseline; gap: 8px;
}
.stages__idx { flex: none; font-family: var(--mono); font-size: 11px; color: var(--cyan); }
.stages__now b { flex: none; color: var(--txt); }
.stages__now > span:last-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stages__acts { flex: none; display: flex; gap: 7px; }
.stages__acts .btn { padding: 5px 12px; font-size: 12.5px; }
.btn--next { color: #04191a; background: var(--cyan); border-color: var(--cyan); font-weight: 600; }
.btn--next:hover { background: #4fe3d1; }
.btn--next[disabled], .stages__acts .btn[disabled] { opacity: .45; cursor: default; }

/* ---------- 尺寸预设 ---------- */
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.preset {
  font: inherit; font-size: 11.5px; cursor: pointer;
  padding: 3px 9px; border-radius: 999px;
  color: var(--muted); background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  transition: color .15s, background .15s, border-color .15s;
}
.preset:hover { color: var(--txt); border-color: rgba(63, 214, 196, .45); }
.preset[aria-pressed="true"] { color: #04191a; background: var(--cyan); border-color: var(--cyan); font-weight: 600; }

/* ---------- 用量测算：单次用量主数值 ---------- */
.dose__list div.is-hero {
  margin: 4px 0;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--cyan-dim);
  border: 1px solid rgba(63, 214, 196, .3);
}
.dose__list div.is-hero dt { color: var(--txt); }
.dose__list div.is-hero dd { color: var(--cyan); font-size: 17px; font-weight: 600; }

/* ---------- 对比页：载入仿真台 ---------- */
.pane__act { margin: 7px 0 0; }
.pane__act .btn { padding: 5px 11px; font-size: 12px; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 95;
  transform: translate(-50%, 14px);
  padding: 9px 16px; border-radius: 9px;
  font-size: 13px; color: var(--txt);
  background: rgba(11, 17, 25, .96);
  border: 1px solid rgba(63, 214, 196, .42);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .48);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  max-width: min(560px, calc(100vw - 32px));
}
.toast[hidden] { display: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 新手引导 ---------- */
.tour { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.tour[hidden] { display: none; }
.tour__shade { position: absolute; background: rgba(3, 5, 8, .74); }
.tour__ring {
  position: absolute; border-radius: 12px;
  border: 2px solid var(--cyan);
  animation: ringPulse 1.9s ease-in-out infinite;
}
@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(63, 214, 196, .4), 0 0 22px 5px rgba(63, 214, 196, .3), inset 0 0 20px rgba(63, 214, 196, .12); }
  50% { box-shadow: 0 0 0 1px rgba(63, 214, 196, .7), 0 0 34px 10px rgba(63, 214, 196, .45), inset 0 0 26px rgba(63, 214, 196, .2); }
}
.tour__ring[hidden] { display: none; }
.tour__card {
  position: absolute; width: 322px;
  padding: 13px 15px 12px;
  pointer-events: auto;
  background: linear-gradient(180deg, #0d1520, #0a1017);
  border: 1px solid rgba(63, 214, 196, .34);
  border-radius: 12px;
  box-shadow: 0 22px 52px rgba(0, 0, 0, .58);
}
.tour__step { font-family: var(--mono); font-size: 11px; color: var(--cyan); letter-spacing: .05em; }
.tour__title { margin: 5px 0 0; font-size: 15px; }
.tour__body { margin: 6px 0 0; font-size: 12.5px; line-height: 1.72; color: var(--muted); }
.tour__body b { color: var(--txt); }
.tour__acts { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour__acts .btn { padding: 5px 12px; font-size: 12.5px; }
.tour__acts .btn[data-a="next"] { color: #04191a; background: var(--cyan); border-color: var(--cyan); font-weight: 600; }
.tour__acts .btn[data-a="next"]:hover { background: #4fe3d1; }
.tour__acts .btn[disabled] { opacity: .4; cursor: default; }
.tour__skip {
  margin-right: auto; padding: 4px 2px;
  font: inherit; font-size: 12px; cursor: pointer;
  color: var(--muted); background: none; border: 0;
}
.tour__skip:hover { color: var(--txt); }
.tour__dots { display: flex; gap: 4px; }
.tour__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.tour__dots i.is-on { background: var(--cyan); }

/* ---------- 小屏 / 矮屏 ---------- */
@media (max-width: 980px), (max-height: 640px) {
  .ifu { display: none; }
  .pane--console .dose__list div.is-hero dd { font-size: 16px; }
  .stages__list { flex-wrap: wrap; }
  .stages__list > li { flex: 1 1 calc(33% - 4px); }
}

@media print {
  .tour, .toast, .ifu, .bottle-tip, .stages, .presets { display: none !important; }
}
