/* 动效与 3D 性能设置面板（motion-batch1 样张）。只用 JMOS 语义 token，无新色值。
   ≥600px 居中弹窗；<600px 底部抽屉。尺寸随视口连续变化。 */
.jms-scrim { position: fixed; inset: 0; z-index: 2147483003; display: grid; place-items: center; padding: 24px 16px; background: var(--jmx-scrim);
  opacity: 0; transition: opacity var(--jm-motion-exit) var(--jm-ease-exit-fade); font-family: var(--jm-font-sans); }
.jms-scrim[hidden] { display: none; }
.jms-scrim.on { opacity: 1; transition-duration: var(--jm-motion-enter); transition-timing-function: var(--jm-ease-enter); }
.jms { width: min(560px, 100%); max-height: min(760px, calc(100dvh - 48px)); display: flex; flex-direction: column; background: var(--jm-bg-overlay); color: var(--jm-text-1);
  border: 1px solid var(--jm-border); border-radius: var(--jm-radius-lg); box-shadow: var(--jm-shadow-3); overflow: hidden;
  transform: translateY(var(--jm-motion-shift-in)); transition: transform var(--jm-motion-enter) var(--jm-ease-enter); }
.jms-scrim.on .jms { transform: none; }
.jms-scrim.out .jms { transform: translateY(var(--jm-motion-shift-out)); transition: transform var(--jm-motion-exit) var(--jm-ease-exit); }
.jms-hd { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 12px; padding: clamp(14px, 3vw, 20px) clamp(16px, 4vw, 24px) 12px; border-bottom: 1px solid var(--jm-divider); }
.jms-hd h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.jms-hd p { grid-column: 1; margin: 0; font-size: 12px; line-height: 18px; color: var(--jm-text-3); }
.jms-x { grid-row: 1 / span 2; grid-column: 2; width: 32px; height: 32px; margin: -4px -8px 0 0; display: grid; place-items: center; border: 0; border-radius: var(--jm-radius-control); background: transparent; color: var(--jm-text-2); cursor: pointer; }
.jms-x:hover { background: var(--jm-bg-hover); color: var(--jm-text-1); }
.jms-x svg { width: 16px; height: 16px; }
.jms-bd { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px clamp(16px, 4vw, 24px) 16px; }
.jms-sec { padding: 16px 0 4px; }
.jms-sec + .jms-sec { border-top: 1px solid var(--jm-divider); margin-top: 12px; }
.jms-sec h3 { margin: 0 0 10px; font-size: 14px; line-height: 22px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.jms-sec h3 small { font-size: 12px; font-weight: 400; color: var(--jm-text-3); }
/* 分段选择 */
.jms-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 2px; gap: 2px; background: var(--jm-bg-sunken); border: 1px solid var(--jm-border); border-radius: var(--jm-radius-control); }
.jms-seg button { min-width: 0; height: 32px; padding: 0 8px; border: 0; border-radius: var(--jm-radius-sm); background: transparent; color: var(--jm-text-2); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color var(--jm-motion-feedback) var(--jm-ease-standard), color var(--jm-motion-feedback) var(--jm-ease-standard); }
.jms-seg button:hover { color: var(--jm-text-1); }
.jms-seg button[aria-checked="true"] { background: var(--jm-bg-surface); color: var(--jm-text-1); font-weight: 600; box-shadow: var(--jm-shadow-1); }
.jms-note { margin: 8px 0 0; font-size: 12px; line-height: 18px; color: var(--jm-text-3); }
.jms-note.warn { color: var(--jm-warn-fg); }
/* 分组开关 */
.jms-list { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--jm-border); border-radius: var(--jm-radius-md); overflow: hidden; }
.jms-list li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; cursor: pointer; }
.jms-list li + li { border-top: 1px solid var(--jm-divider); }
.jms-list li:hover { background: var(--jm-bg-hover); }
.jms-list .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jms-list .t b { font-size: 13px; line-height: 20px; font-weight: 500; }
.jms-list .t span { font-size: 12px; line-height: 18px; color: var(--jm-text-3); }
.jms-list li.dis { cursor: default; } .jms-list li.dis:hover { background: transparent; }
.jms-sw { flex: none; position: relative; width: 36px; height: 20px; padding: 0; border: 0; border-radius: var(--jm-radius-full); background: var(--jm-border-strong); cursor: pointer;
  transition: background-color var(--jm-motion-feedback) var(--jm-ease-standard); }
.jms-sw::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--jm-bg-surface); box-shadow: var(--jm-shadow-1);
  transition: transform var(--jm-motion-feedback) var(--jm-ease-standard); }
.jms-sw::after { content: ''; position: absolute; inset: -12px -6px; }   /* 触控热区 ≥44px */
.jms-sw[aria-checked="true"] { background: var(--jm-brand-solid); }
.jms-sw[aria-checked="true"]::before { transform: translateX(16px); }
.jms-sw[disabled] { opacity: .5; cursor: default; }
/* 3D 档位说明 */
.jms-why { margin-top: 10px; padding: 10px 12px; border-radius: var(--jm-radius-md); background: var(--jm-bg-sunken); border: 1px solid var(--jm-border); font-size: 12px; line-height: 18px; color: var(--jm-text-2); }
.jms-why .h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 13px; line-height: 20px; color: var(--jm-text-1); }
.jms-why .h b { font-weight: 600; }
.jms-why ul { margin: 4px 0 0; padding: 0 0 0 16px; }
.jms-why .dg { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--jm-divider); color: var(--jm-warn-fg); }
.jms-link { border: 0; padding: 0; background: none; font: inherit; font-size: 12px; color: var(--jm-link); cursor: pointer; text-decoration: none; }
.jms-link:hover { text-decoration: underline; color: var(--jm-link-hover); }
.jms-tw { margin-top: 10px; overflow-x: auto; }
.jms-tbl { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; }
.jms-tbl th, .jms-tbl td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--jm-divider); white-space: nowrap; }
.jms-tbl thead th { font-weight: 500; color: var(--jm-text-3); }
.jms-tbl tbody th { font-weight: 400; color: var(--jm-text-2); }
.jms-tbl td { color: var(--jm-text-1); }
.jms-tbl .cur { background: var(--jm-bg-selected); }
.jms-tbl thead .cur { color: var(--jm-text-1); font-weight: 600; }
.jms-tbl tr.na td, .jms-tbl tr.na th { color: var(--jm-text-3); }
.jms-stat { margin: 8px 0 0; font-size: 12px; line-height: 18px; color: var(--jm-text-3); font-variant-numeric: tabular-nums; }
.jms-ft { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px clamp(16px, 4vw, 24px); border-top: 1px solid var(--jm-divider); background: var(--jm-bg-overlay); }
.jms-ft .sp { flex: 1; }
.jms-btn { height: 32px; padding: 0 14px; border-radius: var(--jm-radius-control); border: 1px solid var(--jm-border-strong); background: var(--jm-bg-surface); color: var(--jm-text-1); font: inherit; font-size: 13px; cursor: pointer; }
.jms-btn:hover { background: var(--jm-bg-hover); }
.jms-btn.pri { background: var(--jm-brand-solid); border-color: var(--jm-brand-solid); color: var(--jm-brand-on); }
.jms-btn.pri:hover { background: var(--jm-brand-solid-hover); border-color: var(--jm-brand-solid-hover); }
.jms-btn.pri:active { background: var(--jm-brand-solid-active); }
.jms :focus-visible, [data-jm-settings-entry]:focus-visible { outline: 2px solid var(--jm-focus-ring); outline-offset: 2px; }
[data-jm-settings-entry] { cursor: pointer; }
/* 触控：所有可点目标 ≥ 44px */
@media (pointer: coarse) {
  .jms-seg button { height: 44px; font-size: 14px; }
  .jms-x { width: 44px; height: 44px; }
  .jms-btn { height: 44px; padding: 0 18px; font-size: 14px; }
  .jms-list li { min-height: 56px; }
  .jms-link { min-height: 44px; display: inline-flex; align-items: center; }
}
/* 窄屏：底部抽屉（进 300ms 长位移曲线 / 出 200ms 出场曲线） */
@media (max-width: 599px) {
  .jms-scrim { place-items: end stretch; padding: 0; }
  .jms { width: 100%; max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px)); border-radius: var(--jm-radius-lg) var(--jm-radius-lg) 0 0; border-bottom: 0;
    transform: translateY(100%); transition: transform var(--jm-motion-exit) var(--jm-ease-exit); }
  .jms-scrim.on .jms { transform: none; transition: transform var(--jm-motion-enter) var(--jm-ease-long); }
  .jms-scrim.out .jms { transform: translateY(100%); }
  .jms-hd { position: relative; padding-top: 20px; }
  .jms-hd::before { content: ''; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: var(--jm-radius-full); background: var(--jm-border-strong); }
  .jms-ft { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .jms-ft .jms-btn { flex: 1; }
  .jms-ft .sp { display: none; }
}
/* 面板与弹窗分组关闭：只淡入淡出 */
html[data-jm-motion-off~="surfaces"] .jms-scrim { transition: opacity var(--jm-motion-fade) linear !important; }
html[data-jm-motion-off~="surfaces"] .jms { transform: none !important; transition: none !important; }
