/*! LSS-COPYRIGHT © 2026 Newmeth · 教具工坊 LSS Toolkit Studio
 * 保留所有权利 / All rights reserved. 非开源；授权见 /license.html */

/* DOE 设计器 + 导出台。沿用 studio-v2 的深色控制台语汇（--sv2-*），
 * 但用「编号步骤 + 左侧序号柱」做层级，避免变成一堆等权重的表单行。 */

.doe-designer { display: grid; gap: .9rem; }
.doe-designer__column { display: grid; gap: .9rem; align-content: start; min-width: 0; }

.doe-step { display: grid; grid-template-columns: 2.4rem 1fr; gap: .75rem; align-items: start; }
.doe-step__no { margin: 0; color: var(--sv2-orange); font: 900 1.35rem/1 var(--sv2-mono); letter-spacing: -.04em; opacity: .82; }
.doe-step h4 { margin: 0 0 .18rem; color: var(--sv2-cream); font-size: .92rem; letter-spacing: .01em; }
.doe-hint { margin: 0 0 .45rem; color: var(--sv2-muted); font-size: .74rem; line-height: 1.45; }

/* ── 因子选择 ── */
.doe-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.doe-chip { display: grid; gap: .05rem; padding: .38rem .62rem; border: 1px solid var(--sv2-line);
  border-radius: var(--radius-sm, .35rem); background: rgba(8, 17, 23, .5); cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.doe-chip:hover { border-color: rgba(91, 218, 241, .5); transform: translateY(-1px); }
.doe-chip input { position: absolute; opacity: 0; pointer-events: none; }
.doe-chip b { color: var(--sv2-muted); font-size: .78rem; font-weight: 700; }
.doe-chip i { color: var(--sv2-muted); font-size: .64rem; font-style: normal; opacity: .72; }
.doe-chip.is-on { border-color: var(--sv2-cyan); background: rgba(91, 218, 241, .12); }
.doe-chip.is-on b { color: var(--sv2-cream); }
.doe-chip.is-on i { color: var(--sv2-cyan); opacity: .9; }

/* ── 设计类型 ── */
.doe-radios { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.2rem, 1fr)); gap: .4rem; }
.doe-radios label { display: grid; gap: .1rem; padding: .5rem .6rem; border: 1px solid var(--sv2-line);
  border-radius: var(--radius-sm, .35rem); background: rgba(8, 17, 23, .5); cursor: pointer;
  transition: border-color .16s ease, background .16s ease; }
.doe-radios label:hover { border-color: rgba(91, 218, 241, .45); }
.doe-radios input { position: absolute; opacity: 0; pointer-events: none; }
.doe-radios b { color: var(--sv2-cream); font-size: .8rem; }
.doe-radios i { color: var(--sv2-muted); font-size: .66rem; font-style: normal; line-height: 1.35; }
.doe-radios label.is-on { border-color: var(--sv2-orange); background: rgba(255, 155, 81, .13); }
.doe-radios label.is-off { opacity: .42; cursor: not-allowed; }

/* 别名结构：省次数的代价必须显式写出来，不能藏 */
.doe-alias { margin-top: .55rem; padding: .55rem .7rem; border-left: 2px solid var(--sv2-orange);
  border-radius: 0 var(--radius-sm, .35rem) var(--radius-sm, .35rem) 0; background: rgba(255, 155, 81, .08); }
.doe-alias b { color: var(--sv2-orange); font: 800 .74rem/1.3 var(--sv2-mono); }
.doe-alias span { display: block; margin: .1rem 0 .3rem; color: var(--sv2-muted); font: .68rem/1.4 var(--sv2-mono); }
.doe-alias ul { display: flex; flex-wrap: wrap; gap: .25rem .7rem; margin: 0; padding: 0; list-style: none; }
.doe-alias li { color: var(--sv2-cream); font: .68rem/1.5 var(--sv2-mono); }
.doe-alias p { margin: .35rem 0 0; color: var(--sv2-muted); font-size: .66rem; line-height: 1.45; }

/* ── 参数字段 ── */
.doe-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .45rem; }
.doe-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .2rem .5rem;
  padding: .45rem .6rem; border: 1px solid var(--sv2-line); border-radius: var(--radius-sm, .35rem);
  background: rgba(8, 17, 23, .5); }
.doe-field span { color: var(--sv2-cream); font-size: .76rem; }
.doe-field i { grid-column: 1 / -1; color: var(--sv2-muted); font-size: .64rem; font-style: normal; line-height: 1.4; }
.doe-field input[type="number"] { width: 3.2rem; padding: .18rem .3rem; color: var(--sv2-cream);
  border: 1px solid var(--sv2-line); border-radius: .25rem; background: rgba(4, 10, 14, .7);
  font: 700 .82rem/1 var(--sv2-mono); text-align: center; }
.doe-field input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--sv2-cyan); cursor: pointer; }
.doe-field input:focus-visible { outline: 2px solid var(--sv2-cyan); outline-offset: 1px; }
.doe-field.is-off { opacity: .45; }
/* 名册要占满一行：一串人名换行折断比数字框难读得多 */
.doe-field--wide { grid-column: 1 / -1; grid-template-columns: 1fr; }
.doe-field--wide input[type="text"] { width: 100%; padding: .26rem .45rem; color: var(--sv2-cream);
  border: 1px solid var(--sv2-line); border-radius: .25rem; background: rgba(4, 10, 14, .7);
  font: 500 .78rem/1.3 var(--font-body, inherit); }
.doe-field--wide input::placeholder { color: var(--sv2-muted); opacity: .6; }

/* ── 汇总条：运行次数是这一屏最该被看见的数 ── */
.doe-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem;
  padding: .6rem .85rem; border: 1px solid rgba(91, 218, 241, .32); border-radius: var(--radius-sm, .35rem);
  background: linear-gradient(120deg, rgba(91, 218, 241, .12), rgba(8, 17, 23, .6)); }
.doe-summary__runs { margin: 0; color: var(--sv2-muted); font-size: .74rem; }
.doe-summary__runs b { color: var(--sv2-cyan); font: 900 1.6rem/1 var(--sv2-mono); letter-spacing: -.04em; }
.doe-summary__break { flex: 1 1 8rem; margin: 0; color: var(--sv2-muted); font-size: .7rem; line-height: 1.4; }
.doe-summary.is-error { border-color: rgba(255, 120, 90, .5); background: rgba(255, 120, 90, .1); }
.doe-summary__err { margin: 0; color: #ffb0a0; font-size: .76rem; line-height: 1.45; }
.doe-generate { padding: .5rem 1.05rem; color: #06121a; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--sv2-cyan), #8ef0c9); font: 800 .82rem/1 var(--font-body, inherit);
  cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.doe-generate:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(91, 218, 241, .28); }
.doe-generate:active { transform: translateY(0); }

/* ── 导出台 ── */
.doe-export { display: grid; gap: .5rem; }
.doe-export__tabs { display: flex; flex-wrap: wrap; gap: .25rem; }
.doe-export__tabs button { padding: .34rem .68rem; color: var(--sv2-muted); border: 1px solid var(--sv2-line);
  border-radius: 999px; background: transparent; font-size: .73rem; cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease; }
.doe-export__tabs button:hover { color: var(--sv2-cream); border-color: rgba(91, 218, 241, .45); }
.doe-export__tabs button.is-on { color: #06121a; border-color: transparent; background: var(--sv2-cyan); font-weight: 700; }
.doe-export__hint { margin: 0; color: var(--sv2-muted); font-size: .7rem; line-height: 1.5; }
.doe-export__notes { margin: 0; padding-left: 1rem; color: var(--sv2-orange); font-size: .68rem; line-height: 1.5; }
.doe-export__drop { margin: 0; color: var(--sv2-orange); font-size: .68rem; }
.doe-export__preview { max-height: 13rem; overflow: auto; border: 1px solid var(--sv2-line);
  border-radius: var(--radius-sm, .35rem); background: rgba(4, 10, 14, .55); }
.doe-export__preview table { width: 100%; border-collapse: collapse; font: .68rem/1.6 var(--sv2-mono); }
.doe-export__preview th { position: sticky; top: 0; padding: .3rem .5rem; color: var(--sv2-cyan);
  background: rgba(6, 14, 19, .97); text-align: left; white-space: nowrap; }
.doe-export__preview td { padding: .22rem .5rem; color: var(--sv2-cream); border-top: 1px solid rgba(178, 211, 220, .09); white-space: nowrap; }
.doe-export__more { margin: .3rem .5rem; color: var(--sv2-muted); font-size: .66rem; }
.doe-export__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.doe-export__spacer { flex: 1 1 auto; }
.doe-btn { padding: .42rem .8rem; color: var(--sv2-cream); border: 1px solid var(--sv2-line);
  border-radius: 999px; background: rgba(8, 17, 23, .6); font-size: .76rem; cursor: pointer;
  transition: border-color .16s ease, color .16s ease, transform .16s ease; }
.doe-btn:hover { border-color: rgba(91, 218, 241, .5); transform: translateY(-1px); }
.doe-btn--primary { color: #06121a; border-color: transparent; background: linear-gradient(135deg, var(--sv2-cyan), #8ef0c9); font-weight: 800; }
.doe-btn--ghost { color: var(--sv2-muted); }
.doe-btn--danger { color: #ffb0a0; border-color: rgba(255, 120, 90, .38); }
.doe-btn--danger:hover { border-color: rgba(255, 120, 90, .7); }

/* ── toast ── */
.doe-toast { position: fixed; left: 50%; bottom: 1.6rem; z-index: 9999; padding: .5rem 1rem;
  color: #06121a; border-radius: 999px; background: var(--sv2-cyan); font: 700 .78rem/1 var(--font-body, inherit);
  transform: translateX(-50%); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: opacity .24s ease, transform .24s ease; }
.doe-toast.is-error { color: #2a0a06; background: #ff9b81; }
.doe-toast.is-out { opacity: 0; transform: translate(-50%, .5rem); }

@media (prefers-reduced-motion: reduce) {
  .doe-chip, .doe-radios label, .doe-generate, .doe-btn, .doe-toast { transition: none; }
  .doe-chip:hover, .doe-generate:hover, .doe-btn:hover { transform: none; }
}

@media (max-width: 720px) {
  .doe-step { grid-template-columns: 1.7rem 1fr; gap: .5rem; }
  .doe-step__no { font-size: 1.05rem; }
  .doe-fields, .doe-radios { grid-template-columns: 1fr; }
  .doe-export__preview { max-height: 9.5rem; }
}

/* 高度封顶：设计器内容会随因子数增长，面板一旦撑过舞台就会盖住主行动按钮
   （真浏览器实测：.doe-fields 拦截了发射按钮的指针事件）。 */
.doe-designer { max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; padding-right: .2rem; }
.doe-designer::-webkit-scrollbar { width: 6px; }
.doe-designer::-webkit-scrollbar-thumb { border-radius: 3px; background: rgba(178, 211, 220, .25); }
@media (max-width: 720px) { .doe-designer { max-height: 38vh; } }

/* ── 舞台运行条 ──────────────────────────────────────────────────────────────
   位置刻意贴顶栏下方、水平居中：主行动按钮在底部，两者不会打架
   （primary-overlap-check 是这条规则的机械门禁）。 */
/* 位置由 JS 实测主行动按钮后贴上去（DoeStudio.anchorToPrimary）：
   套用与点火是每一发连着做的一对动作，隔着半个屏幕就是每发多走一趟。
   这里只给"贴不上时"的兜底位置。 */
.v3-runstrip { position: absolute; bottom: 6.4rem; right: 1rem; z-index: 6; display: flex; align-items: center;
  gap: .55rem; max-width: min(92vw, 30rem); padding: .4rem .45rem .4rem .8rem;
  border: 1px solid rgba(255, 155, 81, .38); border-radius: 999px;
  background: rgba(6, 14, 19, .82); backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .34); }
.v3-runstrip.is-ready { border-color: rgba(91, 218, 241, .5); }
.v3-runstrip > .v3-next, .v3-runstrip > #doe-next { display: grid; gap: 0; min-width: 0; margin: 0;
  padding: 0; border: 0; background: none; }
.v3-runstrip #doe-next span { color: var(--sv2-orange); font: 800 .56rem/1.2 var(--sv2-mono); letter-spacing: .12em; }
.v3-runstrip #doe-setting { overflow: hidden; color: var(--sv2-cream); font-size: .8rem; font-weight: 700;
  white-space: nowrap; text-overflow: ellipsis; }
.v3-runstrip #doe-meta { color: var(--sv2-muted); font-size: .62rem; white-space: nowrap; }
.v3-runstrip #doe-apply { flex: 0 0 auto; padding: .38rem .85rem; color: #06121a; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--sv2-orange), #ffd166); font: 800 .74rem/1 var(--font-body, inherit);
  cursor: pointer; transition: transform .16s ease; }
.v3-runstrip.is-ready #doe-apply { background: linear-gradient(135deg, var(--sv2-cyan), #8ef0c9); }
.v3-runstrip #doe-apply:hover { transform: translateY(-1px); }
.v3-runstrip #doe-apply[hidden] { display: none; }
@media (max-width: 720px) {
  .v3-runstrip { max-width: 94vw; padding-left: .6rem; }
  .v3-runstrip #doe-setting { font-size: .72rem; }
}
@media (prefers-reduced-motion: reduce) { .v3-runstrip #doe-apply { transition: none; } }

/* 大炮的运行条还带联锁状态行（四项设置是否匹配），比共享外壳多一行 */
.cannon-runstrip { flex-wrap: wrap; max-width: min(94vw, 38rem); }
.cannon-runstrip #doe-lock { flex: 1 0 100%; margin: .1rem 0 0; padding: 0 .2rem;
  color: var(--sv2-muted); font-size: .62rem; line-height: 1.4; }
.cannon-runstrip #doe-lock.is-ready { color: #8ef0c9; }
.cannon-runstrip #doe-lock.is-locked { color: var(--sv2-orange); }

/* ── 环视开关 ────────────────────────────────────────────────────────────────
   位置：舞台右侧垂直居中。主行动在底部居中、运行条在顶部居中，三者互不重叠
   （primary-overlap-check 会机械校验这一点）。 */
.doe-orbit { position: absolute; right: .9rem; top: 50%; z-index: 6; display: grid; justify-items: center;
  gap: .12rem; padding: .5rem .45rem; color: var(--sv2-muted); border: 1px solid var(--sv2-line);
  border-radius: 999px; background: rgba(6, 14, 19, .74); backdrop-filter: blur(12px);
  transform: translateY(-50%); cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease; }
.doe-orbit svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.doe-orbit b { font: 700 .58rem/1 var(--font-body, inherit); letter-spacing: .04em; }
.doe-orbit:hover { color: var(--sv2-cream); border-color: rgba(91, 218, 241, .5); }
.doe-orbit.is-on { color: #06121a; border-color: transparent;
  background: linear-gradient(135deg, var(--sv2-cyan), #8ef0c9); }
.doe-orbit:focus-visible { outline: 2px solid var(--sv2-cyan); outline-offset: 2px; }
@media (max-width: 720px) { .doe-orbit { right: .5rem; padding: .42rem .38rem; } .doe-orbit b { font-size: .52rem; } }
@media (prefers-reduced-motion: reduce) { .doe-orbit { transition: none; } }

/* ── 开场标题收起 ────────────────────────────────────────────────────────────
   用户反馈：「有一些文字有点喧宾夺主」。开场那块大标题占掉舞台左三分之一，
   立招牌是对的；一旦学员开始动手，舞台就该还给教具。
   只收标题与说明，状态行保留 —— 学员仍要看得到系统在说什么。
   动的是 opacity / transform / max-height（合成器友好），不动布局属性。 */
.mission-hud.is-settled h1,
.v3-mission.is-settled h1 {
  max-height: 0; margin: 0; opacity: 0; transform: translateY(-.35rem) scale(.96);
  overflow: hidden; pointer-events: none;
  transition: opacity .32s var(--ease-out-expo, cubic-bezier(.16,1,.3,1)),
              transform .32s var(--ease-out-expo, cubic-bezier(.16,1,.3,1)),
              max-height .32s ease, margin .32s ease;
}
.mission-hud.is-settled #mission-copy,
.v3-mission.is-settled #result,
.v3-mission.is-settled p:last-child {
  font-size: .78rem; opacity: .74;
  transition: font-size .28s ease, opacity .28s ease;
}
@media (prefers-reduced-motion: reduce) {
  .mission-hud.is-settled h1, .v3-mission.is-settled h1,
  .mission-hud.is-settled #mission-copy, .v3-mission.is-settled p:last-child { transition: none; }
}

/* ── 这个设计能做什么分析 ────────────────────────────────────────────────────
   起因：用户加了中心点却做不出响应曲面，只能自己去猜为什么。
   2 水平 + 中心点只能**检验**曲率、不能**拟合**曲面 —— 这是统计学事实，
   但学员没有义务自己推出来。把结论摆在生成运行表之前。 */
.doe-capability { padding: .55rem .75rem; border: 1px solid var(--sv2-line);
  border-left: 2px solid var(--sv2-cyan); border-radius: 0 var(--radius-sm, .35rem) var(--radius-sm, .35rem) 0;
  background: rgba(8, 17, 23, .55); }
.doe-capability__title { margin: 0 0 .3rem; color: var(--sv2-cream); font: 700 .74rem/1 var(--font-body, inherit); }
.doe-capability ul { display: flex; flex-wrap: wrap; gap: .18rem .8rem; margin: 0; padding: 0; list-style: none; }
.doe-capability li { font: .68rem/1.55 var(--font-body, inherit); }
.doe-capability li.is-on { color: #8ef0c9; }
.doe-capability li.is-off { color: var(--sv2-muted); opacity: .72; }
.doe-capability__warn { margin: .4rem 0 0; padding-top: .35rem; border-top: 1px solid rgba(255, 155, 81, .25);
  color: var(--sv2-orange); font-size: .66rem; line-height: 1.55; }
.doe-capability__hint { margin: .35rem 0 0; color: var(--sv2-muted); font-size: .66rem; line-height: 1.5; }

/* 套用按钮靠右：运行条的右边缘与主行动对齐，套用推到右端就正好落在点火正上方。
   实测大炮 1440px 下，套用→点火中心距离 247px → 靠右后大幅缩短。 */
.v3-runstrip #doe-apply { margin-left: auto; }
