:root {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  --surface: #fff;
  --paper: #f6f8fb;
  --ink: #202833;
  --muted: #707b8b;
  --line: #e8ecf2;
  --brand: #007aff;
  --primary: var(--brand);
  --button: var(--primary);
  --button-foreground: #fff;
  --button-hover: #0066d6;
  --soft: #edf5ff;
  --warning: #ca3a37;
  --green-bg: #edf8f2;
  --green: #208354;
  --warning-bg: #fff1f0;
  --shadow: 0 8px 32px #142b4c12;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --surface: #161c25;
  --paper: #10151d;
  --ink: #e8edf4;
  --muted: #9aa8bb;
  --line: #2a3442;
  --soft: #1c304a;
  --warning: #ff9490;
  --green-bg: #183a2c;
  --green: #80d9aa;
  --warning-bg: #422626;
  --shadow: 0 8px 32px #0004;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --surface: #161c25;
    --paper: #10151d;
    --ink: #e8edf4;
    --muted: #9aa8bb;
    --line: #2a3442;
    --soft: #1c304a;
    --warning: #ff9490;
    --green-bg: #183a2c;
    --green: #80d9aa;
    --warning-bg: #422626;
    --shadow: 0 8px 32px #0004;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button,
input,
textarea {
  border-radius: 0.45rem;
}
button {
  cursor: pointer;
  min-height: 2.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.45;
}
button:hover {
  background: var(--soft);
  border-color: var(--primary);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.primary {
  background: var(--button);
  color: var(--button-foreground);
  border-color: var(--button);
}
button.primary:hover {
  background: var(--button-hover);
  border-color: var(--button-hover);
}
a {
  color: var(--primary);
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 1.5rem;
  line-height: 1.45;
  letter-spacing: -0.025em;
  font-weight: 650;
}
h2 {
  font-size: 1rem;
  font-weight: 600;
}
h3 {
  font-size: 0.95rem;
}
small,
.muted {
  color: var(--muted);
}
svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  vertical-align: middle;
}
.boot,
.empty {
  padding: 4rem 1rem;
  text-align: center;
  color: var(--muted);
}
summary {
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
  background: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #fff;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-mark circle {
  fill: #e2f1ff;
  stroke: none;
}
.brand-copy {
  display: grid;
  gap: 0.05rem;
}
.brand-copy strong {
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.3;
}
.brand-copy strong span {
  font-size: 0.75em;
  letter-spacing: 0.02em;
  margin-left: 0.15rem;
}
.brand-copy small {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}
.shell {
  --sidebar-width: 15rem;
  position: relative;
  display: grid;
  height: 100dvh;
  overflow: hidden;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "brand topbar" "sidebar content";
}
.brand-header {
  grid-area: brand;
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
}
.topbar {
  grid-area: topbar;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}
.topbar-leading,
.header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.header-tools {
  flex-shrink: 0;
  gap: 0.4rem;
}
.icon-button,
.theme-control > summary {
  display: grid;
  place-items: center;
  padding: 0.55rem;
  min-height: 2.35rem;
  min-width: 2.35rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover,
.theme-control > summary:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 0;
}
.breadcrumb strong {
  color: var(--ink);
  font-weight: 500;
}
.breadcrumb-separator {
  opacity: 0.5;
}
.sidebar {
  grid-area: sidebar;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  z-index: 10;
}
.sidebar-brand-mobile {
  display: none;
}
.switcher,
.profile,
.theme-control {
  position: relative;
}
.switcher > summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.65rem;
}
.switcher > summary:hover {
  background: var(--paper);
}
.app-icon {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.5rem;
  color: var(--primary);
  background: var(--soft);
  flex-shrink: 0;
}
.switcher-copy {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
  flex: 1;
}
.switcher-copy small {
  font-size: 0.65rem;
}
.switcher-copy strong {
  font-size: 0.85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.switcher-chevron {
  display: flex;
  color: var(--muted);
}
.switcher-chevron svg {
  width: 0.85rem;
}
.switcher-panel,
.profile-menu,
.theme-options {
  position: absolute;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0.4rem;
  box-shadow: var(--shadow);
}
.switcher-panel {
  top: calc(100% + 0.4rem);
  left: 0;
  width: max(100%, 13rem);
}
.switcher-panel button,
.profile-menu button,
.theme-options button {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 0.6rem;
  border: 0;
  background: transparent;
  font-size: 0.8rem;
}
.switcher-panel button:hover,
.profile-menu button:hover,
.theme-options button:hover {
  background: var(--paper);
}
.switcher-panel button.selected {
  background: var(--soft);
  color: var(--primary);
}
.switch-app-icon {
  display: flex;
}
.selected-check {
  margin-left: auto;
}
.nav-scroll {
  overflow: auto;
  padding: 0.5rem 0.85rem 1rem;
}
.nav-label {
  font-size: 0.65rem;
  color: var(--muted);
  padding: 0.2rem 0.8rem 0.65rem;
}
.nav {
  display: grid;
  gap: 0.35rem;
}
.nav button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  text-align: left;
  border-color: transparent;
  background: transparent;
  font-size: 0.85rem;
  min-width: 0;
  color: var(--muted);
}
.nav button:hover {
  background: var(--paper);
  color: var(--ink);
}
.nav button.active {
  background: var(--soft);
  color: var(--primary);
  font-weight: 600;
}
.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: 0.25rem 0.85rem;
}
.profile > summary {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  border-radius: 0.5rem;
  padding: 0.5rem;
}
.profile > summary:hover {
  background: var(--paper);
}
.sidebar-footer .profile > summary {
  padding-block: 0.125rem;
}
.avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  background: var(--soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 600;
  flex-shrink: 0;
}
.profile-copy {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 0.15rem;
}
.profile-copy strong {
  font-size: 0.8rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.profile-copy small {
  font-size: 0.65rem;
}
.profile > summary > svg {
  width: 0.85rem;
  color: var(--muted);
}
.profile-menu {
  bottom: calc(100% + 0.65rem);
  left: 0;
  width: max(100%, 14rem);
}
.profile-info {
  padding: 0.65rem;
  display: grid;
  gap: 0.3rem;
  justify-items: start;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}
.profile-info strong {
  font-size: 0.85rem;
}
.profile-info small {
  font-size: 0.75rem;
}
.profile-menu button {
  color: var(--warning);
}
.theme-options {
  top: calc(100% + 0.65rem);
  right: 0;
  width: 10rem;
}
.theme-check {
  margin-left: auto;
  visibility: hidden;
}
.theme-options [aria-pressed="true"] {
  color: var(--primary);
}
.theme-options [aria-pressed="true"] .theme-check {
  visibility: visible;
}
.content {
  grid-area: content;
  overflow: auto;
  min-width: 0;
  padding: 1.75rem 2rem 2.5rem;
  scroll-behavior: smooth;
}
.page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.page-title p {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.page-actions {
  display: flex;
  gap: 0.5rem;
}
.page-actions button {
  font-size: 0.8rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  background: var(--soft);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 400;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.badge.green {
  background: var(--green-bg);
  color: var(--green);
}
.badge.gray {
  background: var(--paper);
  color: var(--muted);
}
.badge.warn {
  background: var(--warning-bg);
  color: var(--warning);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.stat,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.stat {
  padding: 1.2rem 1.3rem;
}
.stat p {
  font-size: 0.8rem;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 0.5rem 0 0.3rem;
  overflow-wrap: anywhere;
}
.stat small {
  font-size: 0.7rem;
}
.card {
  overflow: hidden;
}
.card-head {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.card-head > .muted {
  font-size: 0.75rem;
}
.card-head h2 {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.card-body {
  padding: 1.25rem;
}
.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}
.access {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.access p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.35rem 0 1rem;
}
.access button {
  color: var(--primary);
  font-size: 0.8rem;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.toolbar input {
  max-width: 22rem;
  min-width: 0;
  flex: 1;
}
.toolbar button,
.toolbar input {
  font-size: 0.8rem;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}
th {
  background: var(--paper);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
th,
td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: color-mix(in srgb, var(--soft) 40%, transparent);
}
td .sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
td .tags,
.tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  max-width: 28rem;
}
.row-action {
  color: var(--primary);
  padding: 0.25rem 0;
  min-height: 2rem;
  border-color: transparent;
  background: transparent;
  font-size: 0.8rem;
}
.row-action:hover {
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 0.35rem 1.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.pagination > div {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.pagination button {
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
}
.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.field label,
.field > span {
  font-size: 0.8rem;
  font-weight: 550;
}
input,
textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0.65rem 0.8rem;
  line-height: 1.5;
  width: 100%;
  min-width: 0;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.75;
}
input:focus,
textarea:focus {
  border-color: var(--primary);
}
input:not([type="checkbox"]):not([type="radio"]):focus-visible,
textarea:focus-visible {
  outline: none;
}
textarea {
  resize: vertical;
  min-height: 6rem;
}
input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--brand);
  flex-shrink: 0;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
  padding: 0.65rem 0;
  overflow-wrap: anywhere;
}
.check input {
  margin-top: 0.25rem;
}
.error {
  color: var(--warning);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.error:empty {
  display: none;
}
.login-page {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(ellipse at 50% 15%, var(--soft), transparent 65%),
    var(--paper);
}
.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  gap: 1rem;
}
.login-main {
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  place-items: center;
}
.login-card {
  width: min(100%, 26.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 16px 60px #005dcc08;
  padding: 2.25rem;
}
.login-card-heading {
  margin-bottom: 1.8rem;
}
.login-kicker {
  display: block;
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  color: var(--primary);
  margin-bottom: 0.7rem;
}
.login-card h1 {
  font-size: 1.6rem;
}
.login-card-heading p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.input-wrap {
  position: relative;
}
.input-wrap > svg {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0.8rem;
  color: var(--muted);
}
.input-wrap input {
  padding-left: 2.5rem;
  font-size: 0.85rem;
}
.login-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.4rem;
}
.login-help {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.7rem;
}
.login-help svg {
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
}
.login-footer {
  text-align: center;
  padding: 1rem 1.5rem 1.5rem;
  font-size: 0.7rem;
  color: var(--muted);
}
dialog {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0;
  width: min(40rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #101d354d;
  backdrop-filter: blur(3px);
}
dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 2rem);
}
.dialog-head {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-shrink: 0;
}
.dialog-head p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3rem;
  overflow-wrap: anywhere;
}
.text-button {
  border: 0;
  background: transparent;
  padding: 0.25rem;
  min-height: 2rem;
  color: var(--muted);
}
.dialog-body {
  padding: 1.5rem;
  overflow: auto;
  min-height: 0;
}
.dialog-foot {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.7rem;
  background: var(--surface);
  align-items: stretch;
  flex-shrink: 0;
}
.dialog-foot button:first-of-type {
  flex: 1;
}
.dialog-foot .primary {
  flex: 2;
}
.exercise-discard-dialog {
  width: min(27rem, calc(100vw - 2rem));
  padding: 1.5rem;
  overflow-y: auto;
}
.exercise-discard-dialog::backdrop {
  backdrop-filter: blur(2px);
}
.exercise-discard-heading h2 {
  font-size: 1.1rem;
  line-height: 1.5;
}
.exercise-discard-heading p {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
}
.exercise-disable-dialog .exercise-discard-heading h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--warning);
}
.disable-warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 50%;
  background: var(--warning-bg);
}
.exercise-disable-dialog [data-disable] {
  border-color: #c63632;
  background: #c63632;
  color: #fff;
}
.exercise-disable-dialog [data-disable]:hover:not(:disabled) {
  border-color: #af2c29;
  background: #af2c29;
}
.exercise-discard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.75rem;
}
.exercise-discard-actions button {
  flex: 1 1 7rem;
  min-width: 0;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 550;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.permission-box {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  margin: 0.8rem 0;
  min-width: 0;
}
.permission-box h3 {
  font-size: 0.85rem;
}
.permission-box p {
  font-size: 0.75rem;
  color: var(--muted);
}
.note {
  padding: 0.85rem;
  border-radius: 0.5rem;
  background: var(--soft);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.6rem 0 1rem;
}
.notice-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.spacer {
  margin-top: 1.2rem;
}
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.7rem 1.2rem;
  border-radius: 0.5rem;
  color: #fff;
  background: #202833;
  max-width: calc(100vw - 2rem);
  z-index: 50;
  display: none;
}
#toast.visible {
  display: block;
}
.nav-backdrop {
  display: none;
}
.sidebar-edge-toggle {
  display: none;
}
@media (min-width: 901px) {
  .topbar [data-sidebar-toggle] {
    display: none;
  }
  .sidebar-edge-toggle {
    display: grid;
    position: absolute;
    left: var(--sidebar-width);
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    padding: 0.25rem;
    border-radius: 50%;
    border-color: var(--line);
    background: var(--surface);
  }
  .sidebar-edge-toggle svg {
    width: 0.75rem;
    height: 0.75rem;
    stroke-width: 2.6;
    transform: rotate(90deg);
  }
  .is-collapsed .sidebar-edge-toggle svg {
    transform: rotate(-90deg);
  }
  .shell.is-collapsed {
    --sidebar-width: 4.5rem;
  }
  .is-collapsed .brand-header {
    padding: 1rem 0;
    justify-content: center;
  }
  .is-collapsed .brand-copy,
  .is-collapsed .switcher-copy,
  .is-collapsed .switcher-chevron,
  .is-collapsed .nav-label,
  .is-collapsed .nav-text,
  .is-collapsed .profile-copy,
  .is-collapsed .profile > summary > svg {
    display: none;
  }
  .is-collapsed .switcher > summary {
    border-color: transparent;
    padding: 0.4rem 0;
    justify-content: center;
  }
  .is-collapsed .nav-scroll {
    padding: 0.5rem 0.65rem;
  }
  .is-collapsed .nav button {
    justify-content: center;
    padding: 0.7rem 0;
  }
  .is-collapsed .sidebar-footer {
    padding: 0.25rem 0.65rem;
  }
  .is-collapsed .profile > summary {
    justify-content: center;
    padding: 0.125rem 0;
  }
  .is-collapsed .switcher-panel {
    left: calc(100% + 0.5rem);
    top: 0;
  }
  .is-collapsed .profile-menu {
    left: calc(100% + 0.5rem);
    bottom: 0;
  }
}
@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content {
    padding: 1.5rem;
  }
  .breadcrumb-root {
    display: none;
  }
}
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "topbar" "content";
  }
  .brand-header {
    display: none;
  }
  .topbar {
    padding: 0.85rem 1rem;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(18rem, calc(100vw - 2rem));
    grid-template-rows: auto minmax(0, 1fr) auto;
    visibility: hidden;
    transform: translateX(-100%);
  }
  .sidebar-brand-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
    gap: 0.5rem;
  }
  .nav-open .sidebar {
    transform: none;
    visibility: visible;
  }
  .nav-open .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: #101d3566;
    z-index: 9;
  }
  .content {
    padding: 1.3rem 1rem 2rem;
  }
  .breadcrumb {
    gap: 0.4rem;
  }
}
@media (max-width: 700px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .stat {
    padding: 1rem;
  }
  .card-head,
  .card-body {
    padding: 1rem;
  }
  .card-head {
    align-items: flex-start;
  }
  .toolbar {
    width: 100%;
  }
  .toolbar input {
    flex-basis: 100%;
    max-width: none;
  }
  .table-wrap {
    overflow: visible;
  }
  table,
  tbody,
  tr,
  td {
    display: block;
  }
  thead {
    display: none;
  }
  tbody tr {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
  }
  tbody tr:last-child {
    border-bottom: 0;
  }
  td {
    display: grid;
    grid-template-columns: minmax(4rem, 25%) minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.4rem 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
    align-items: start;
  }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
  }
  td > .sub {
    grid-column: 2;
    margin-top: 0;
  }
  td > .badge,
  td > .row-action {
    justify-self: start;
  }
  td[colspan] {
    display: block;
  }
  td[colspan]::before {
    display: none;
  }
  .pagination {
    padding: 1rem;
  }
  .login-header {
    padding: 1.25rem;
  }
  .login-main {
    padding: 1rem 1rem 2rem;
  }
  .login-card {
    padding: 1.75rem;
  }
  .fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .dialog-head,
  .dialog-body {
    padding: 1rem;
  }
  .dialog-foot {
    padding: 0.75rem 0.5rem;
  }
  .dialog-foot button {
    padding: 0.5rem 0.25rem;
  }
}
@media (max-width: 420px) {
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar {
    gap: 0.25rem;
    padding-inline: 0.65rem;
  }
  .topbar-leading {
    gap: 0.35rem;
  }
  .header-tools {
    gap: 0;
  }
  .login-card {
    padding: 1.5rem;
  }
}

/* 运营工作台：固定框架、轻量信息层级与真实数据图表。 */
:root {
  --sidebar: #fbfcfe;
}
:root[data-theme="dark"] {
  --sidebar: #151b24;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --sidebar: #151b24;
  }
}
.sidebar,
.brand-header {
  background: var(--sidebar);
}
.global-nav {
  padding-bottom: 1rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.nav-label {
  letter-spacing: 0.04em;
}
.page-title {
  align-items: center;
}
.page-actions {
  align-items: center;
  flex-wrap: wrap;
}
.page-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.live-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.live-status::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  background: var(--green);
  border-radius: 50%;
}
.table-count {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  background: var(--paper);
  color: var(--muted);
}
.table-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.range-control {
  display: flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  flex-wrap: wrap;
}
.range-control button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 2rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 0.3rem;
}
.range-control [aria-pressed="true"] {
  background: var(--soft);
  color: var(--primary);
  font-weight: 600;
}
.sort-control {
  background: var(--paper);
  border: 0;
}
.sort-control button {
  min-height: 1.75rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
}
.sort-control [aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px #182b4512;
}
.stat {
  padding: 1.35rem 1.5rem;
}
.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.stat-label > svg {
  color: var(--muted);
  width: 1rem;
  opacity: 0.7;
}
.stat strong {
  font-size: 2.15rem;
  margin-top: 0.65rem;
  margin-bottom: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(17rem, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.4rem;
}
.section-note {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 400;
  margin-top: 0.25rem;
}
.chart-legend {
  display: flex;
  gap: 1.5rem;
  color: var(--muted);
  font-size: 0.7rem;
  margin-bottom: 1rem;
}
.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.chart-legend span::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brand);
}
.chart-legend .legend-new::before {
  background: #87bde9;
}
.activity-chart {
  width: 100%;
  height: auto;
  display: block;
  min-height: 10rem;
}
.chart-grid {
  stroke: var(--line);
  stroke-dasharray: 3 4;
}
.chart-tick {
  font-family: inherit;
  font-size: 10px;
  fill: var(--muted);
}
.chart-area {
  fill: var(--soft);
  opacity: 0.7;
}
.chart-training {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.chart-new {
  fill: none;
  stroke: #87bde9;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
.chart-point {
  fill: var(--surface);
  stroke: var(--brand);
  stroke-width: 1.5;
}
.chart-records {
  margin-top: 0.6rem;
  font-size: 0.7rem;
  color: var(--muted);
}
.chart-records summary {
  display: inline-block;
  padding: 0.25rem 0;
}
.chart-records-scroll {
  max-height: 15rem;
  overflow: auto;
  margin-top: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
}
.engagement-body {
  padding: 1.5rem;
  display: grid;
  gap: 1.3rem;
  justify-items: center;
}
.activity-ring {
  width: 9.5rem;
  height: 9.5rem;
  position: relative;
}
.activity-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.activity-ring circle {
  fill: none;
  stroke-width: 7;
}
.ring-track {
  stroke: var(--line);
}
.ring-value {
  stroke: var(--brand);
  stroke-linecap: round;
}
.activity-ring > div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.activity-ring strong {
  font-size: 1.8rem;
  font-weight: 650;
  line-height: 1.3;
}
.activity-ring strong small {
  font-size: 0.85rem;
  color: var(--ink);
  padding-left: 0.1rem;
}
.activity-ring span {
  font-size: 0.65rem;
  color: var(--muted);
}
.engagement-metrics {
  display: grid;
  gap: 0.6rem;
  width: 100%;
}
.engagement-metrics > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
}
.engagement-metrics span {
  color: var(--muted);
}
.engagement-metrics strong {
  font-weight: 550;
}
.analytics-note {
  border-top: 1px solid var(--line);
  padding: 0.8rem 1.25rem;
  color: var(--muted);
  font-size: 0.7rem;
}
.ranked-exercise {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.rank-number {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  font-size: 0.75rem;
}
.rank-top {
  color: var(--primary);
}
.usage-meter {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 10rem;
}
.usage-meter strong {
  min-width: 1.5rem;
  font-weight: 550;
}
.usage-meter svg {
  width: 5rem;
  height: 0.25rem;
}
.meter-track {
  fill: var(--line);
}
.meter-fill {
  fill: var(--brand);
}
.content.table-page {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  padding-bottom: 1.5rem;
  min-height: 0;
}
.data-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}
.data-card .table-wrap {
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}
.data-card th {
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px var(--line);
}
.data-card td {
  padding-block: 1rem;
}
.data-card table {
  min-width: 56rem;
}
.data-card:has([data-exercise]) table {
  min-width: 65rem;
}
.data-card .pagination {
  background: var(--surface);
}
.date-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.metric-number {
  color: var(--ink);
  font-weight: 600;
}
.metric-unit {
  color: var(--muted);
  font-size: 0.7rem;
  margin-left: 0.3rem;
}
.profile-ready-control .sub {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.4rem;
}
.custom-choice {
  position: relative;
}
.custom-choice summary {
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.65rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}
.custom-choice summary svg {
  width: 0.85rem;
}
.choice-popover {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}
.choice-popover [hidden] {
  display: none !important;
}
.choice-search-wrap {
  position: relative;
  padding: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.choice-search-wrap > svg {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  width: 0.85rem;
  height: 0.85rem;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.choice-search-wrap input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.6rem 0.5rem 2rem;
  font-size: 0.8rem;
  background: var(--paper);
}
.choice-options {
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.35rem;
}
.choice-empty {
  margin: 0;
  padding: 0.8rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}
.choice-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font-size: 0.85rem;
}
.choice-option-group + .choice-option-group {
  margin-top: 0.85rem;
  padding-top: 0.5rem;
}
.choice-options button + button {
  margin-top: 0.3rem;
}
.choice-options button {
  padding-block: 0.6rem;
}
.choice-group-label {
  position: sticky;
  top: 0;
  margin-bottom: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
}
.choice-options button[aria-pressed="true"] {
  background: var(--soft);
  color: var(--primary);
}
.choice-selected {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
  color: var(--primary);
  font-size: 0.65rem;
  visibility: hidden;
}
.choice-selected svg { width: 0.85rem; height: 0.85rem; }
.choice-options button[aria-pressed="true"] .choice-selected { visibility: visible; }
.choice-options button:hover {
  background: var(--soft);
}
.form-section-note {
  margin-bottom: 1rem;
}
.advanced-fields {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  margin-block: 0.5rem 1rem;
  padding: 0.85rem;
}
.advanced-fields > summary {
  font-size: 0.8rem;
  font-weight: 550;
}
.advanced-fields[open] > summary {
  margin-bottom: 1rem;
}
.import-editor {
  width: min(52rem, calc(100vw - 1.5rem));
}
.import-guide {
  border: 1px dashed var(--line);
  background: var(--paper);
  border-radius: 0.6rem;
  padding: 1.1rem;
  margin-bottom: 1.25rem;
}
.import-guide > strong,
.import-preview-heading > strong {
  font-size: 0.85rem;
  font-weight: 600;
}
.import-guide > p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-block: 0.4rem 1rem;
}
.import-file-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.import-file-row input {
  min-width: 0;
  width: auto;
  flex: 1;
  padding: 0;
  border: 0;
  font-size: 0.75rem;
}
.import-file-row input::file-selector-button {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  color: var(--ink);
  margin-right: 0.5rem;
  cursor: pointer;
}
.import-file-row button {
  font-size: 0.75rem;
}
#import-source {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  min-height: 11rem;
}
.import-check-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.import-check-row button {
  color: var(--primary);
  font-size: 0.8rem;
}
.import-check-row > span {
  font-size: 0.7rem;
}
.import-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 0.5rem;
}
.import-preview-scroll {
  max-height: 17rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  margin-top: 0.75rem;
}
.import-preview-scroll th {
  position: sticky;
  top: 0;
}
@media (min-width: 901px) {
  .is-collapsed .global-nav {
    padding-bottom: 0.75rem;
  }
}
@media (max-width: 1100px) {
  .analytics-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .engagement-body {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
  }
}
@media (max-width: 700px) {
  .page-title {
    align-items: flex-start;
    gap: 0.75rem;
  }
  .page-actions {
    width: 100%;
  }
  .content.table-page {
    padding-bottom: 0.75rem;
  }
  .table-page .page-title p {
    display: none;
  }
  .table-page .page-title {
    margin-bottom: 0.9rem;
  }
  .table-page .page-actions {
    gap: 0.5rem;
  }
  .data-card .card-head {
    padding: 0.85rem;
    gap: 0.65rem;
  }
  .data-card .table-heading {
    width: 100%;
    gap: 0.65rem;
    justify-content: space-between;
  }
  .data-card table {
    min-width: 0;
  }
  .data-card:has([data-exercise]) table {
    min-width: 0;
  }
  .data-card .toolbar {
    flex-wrap: nowrap;
  }
  .data-card .toolbar input {
    flex-basis: auto;
  }
  .data-card .toolbar button {
    flex-shrink: 0;
    padding-inline: 0.65rem;
  }
  .data-card td {
    padding-block: 0.35rem;
  }
  .data-card .pagination {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }
  .data-card .pagination > div {
    flex-wrap: wrap;
  }
  .table-page .data-card tbody tr {
    padding: 0.85rem;
  }
  .table-page .data-card td > .metric-unit {
    grid-column: 2;
  }
  .engagement-body {
    gap: 1rem;
    padding: 1rem;
  }
  .activity-ring {
    width: 7rem;
    height: 7rem;
  }
  .engagement-metrics > div {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .stat {
    padding: 1.1rem;
  }
  .activity-chart {
    min-height: 8rem;
  }
  .usage-meter svg {
    width: 3rem;
  }
  .ranked-exercise {
    gap: 0.6rem;
  }
  .analytics-note {
    padding: 0.85rem 1rem;
  }
  .import-preview-scroll table {
    min-width: 30rem;
    display: table;
  }
  .import-preview-scroll thead {
    display: table-header-group;
  }
  .import-preview-scroll tbody {
    display: table-row-group;
  }
  .import-preview-scroll tr {
    display: table-row;
    border: 0;
    padding: 0;
  }
  .import-preview-scroll td {
    display: table-cell;
    padding: 0.7rem;
  }
  .import-preview-scroll td::before {
    display: none;
  }
}
@media (max-width: 420px) {
  .engagement-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .engagement-metrics {
    max-width: 18rem;
  }
  .table-page .page-actions button {
    flex: 1;
  }
}
/* 小屏将筛选收起为面板，避免放大字号后挤占记录区。 */
.list-controls {
  flex: 1;
  min-width: min(100%, 20rem);
}
.list-controls > summary {
  display: none;
}
.filter-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.pagination button > svg {
  display: none;
  width: 1rem;
  height: 1rem;
}
.page-number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pager-previous svg {
  transform: rotate(180deg);
}
@media (max-width: 700px) {
  .topbar {
    padding-block: 0.5rem;
  }
  .breadcrumb {
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .breadcrumb > span {
    display: none;
  }
  .breadcrumb strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .page-actions button > svg,
  .desktop-only {
    display: none !important;
  }
  .table-page .page-actions button {
    padding: 0.45rem 0.5rem;
    font-size: 0.75rem;
  }
  .data-card .card-head {
    flex-wrap: nowrap;
    padding: 0.65rem;
    position: relative;
  }
  .data-card .card-head > h2 {
    font-size: 0.9rem;
    flex-wrap: wrap;
    min-width: 0;
  }
  .list-controls {
    flex: 0 0 auto;
    min-width: 0;
  }
  .list-controls > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    gap: 0.3rem;
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--line);
    border-radius: 0.4rem;
    font-size: 0.7rem;
    color: var(--muted);
  }
  .list-controls > summary svg {
    width: 0.9rem;
    height: 0.9rem;
  }
  .list-controls[open] > summary {
    color: var(--primary);
    background: var(--soft);
  }
  .list-controls .filter-panel {
    position: absolute;
    z-index: 5;
    top: calc(100% - 0.3rem);
    left: 0.5rem;
    right: 0.5rem;
    padding: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 0.5rem;
    max-height: 45dvh;
    overflow: auto;
    justify-content: flex-start;
    gap: 0.75rem;
  }
  .data-card .toolbar {
    width: 100%;
    flex-wrap: wrap;
  }
  .data-card .toolbar input {
    flex-basis: 100%;
  }
  .sort-control {
    width: 100%;
  }
  .data-card .pagination {
    justify-content: center;
    padding: 0.5rem;
    gap: 0.4rem;
  }
  .pagination-summary {
    width: 100%;
    font-size: 0.65rem;
    text-align: center;
  }
  .page-size,
  .pager-label {
    display: none;
  }
  .pagination button > svg {
    display: block;
  }
  .pagination > div {
    justify-content: center;
  }
  .pagination button {
    min-height: 1.8rem;
    min-width: 2rem;
    padding: 0.35rem;
  }
  .page-number {
    font-size: 0.7rem;
  }
}
.import-mode {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0 0 1.25rem;
}
.import-mode legend {
  font-size: 0.8rem;
  font-weight: 550;
  padding: 0;
  margin-bottom: 0.6rem;
}
.import-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.import-mode-options label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.85rem;
  cursor: pointer;
}
.import-mode-options label:has(:checked) {
  border-color: var(--primary);
  background: var(--soft);
}
.import-mode-options input {
  width: 1rem;
  height: 1rem;
  margin: 0.2rem 0 0;
  flex-shrink: 0;
  accent-color: var(--brand);
}
.import-mode-options span {
  display: grid;
  gap: 0.25rem;
}
.import-mode-options strong {
  font-size: 0.8rem;
  font-weight: 550;
}
.import-mode-options small,
.import-mode > p {
  font-size: 0.7rem;
  color: var(--muted);
}
.import-mode > p {
  margin-top: 0.6rem;
}
@media (max-width: 700px) {
  .import-mode-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

.filter-mobile-heading {
  display: none;
}
@media (max-width: 700px) {
  .list-controls .filter-panel {
    position: fixed;
    top: auto;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    max-height: 70dvh;
    z-index: 20;
  }
  .filter-mobile-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    position: sticky;
    top: -0.85rem;
    z-index: 1;
    background: var(--surface);
    padding-block: 0.25rem 0.5rem;
  }
  .filter-mobile-heading strong {
    font-size: 0.8rem;
  }
  .filter-mobile-heading button {
    min-height: 2rem;
    padding: 0.35rem 0.6rem;
    color: var(--primary);
    font-size: 0.75rem;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  .table-page .page-title > div:first-child {
    display: none;
  }
  .table-page .page-title:not(:has(.page-actions)) {
    display: none;
  }
}

.brand-switcher {
  width: 100%;
  min-width: 0;
}
.brand-switcher > summary {
  border: 0;
  padding: 0;
  border-radius: 0.5rem;
}
.brand-switcher > summary:hover {
  background: var(--soft);
}
.brand-switcher > summary > .brand {
  flex: 1;
}
.brand-switcher .switcher-panel {
  top: calc(100% + 1rem);
}
.sidebar-brand-mobile .brand-switcher {
  flex: 1;
}
@media (min-width: 901px) {
  .is-collapsed .brand-switcher > summary {
    padding: 0;
  }
  .is-collapsed .brand-switcher > summary > .brand {
    flex: 0;
  }
  .is-collapsed .brand-switcher .switcher-panel {
    top: 0;
  }
}
.brand-copy {
  min-width: 0;
}
@media (max-width: 900px) {
  .sidebar-brand-mobile {
    padding: 0.65rem;
    gap: 0.35rem;
  }
  .sidebar-brand-mobile .brand-switcher > summary,
  .sidebar-brand-mobile .brand {
    gap: 0.35rem;
  }
  .sidebar-brand-mobile .brand-mark {
    width: 36px;
    height: 36px;
  }
  .sidebar-brand-mobile .switcher-chevron svg {
    width: 14px;
    height: 14px;
  }
  .sidebar-brand-mobile > .icon-button {
    min-width: 36px;
    min-height: 36px;
    padding: 8px;
  }
  .sidebar-brand-mobile > .icon-button svg {
    width: 18px;
    height: 18px;
  }
}

/* 所有管理操作直接进入最上方顶栏，表格不再单独占用工具栏区域。 */
.topbar {
  flex-wrap: wrap;
}
.brand-header {
  align-items: flex-start;
}
.topbar-page-tools {
  flex: 1 1 28rem;
  min-width: 0;
}
.topbar-page-tools:empty {
  display: none;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
}
.table-total {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}
.table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.table-actions button {
  font-size: 0.8rem;
  padding-inline: 0.75rem;
}
.topbar-page-tools .list-controls {
  min-width: min(100%, 18rem);
}
.topbar-page-tools .filter-panel {
  gap: 0.5rem;
}
.topbar-page-tools .toolbar input {
  max-width: 14rem;
}
.topbar-page-tools .toolbar button {
  padding-inline: 0.65rem;
}
.content.table-page {
  padding: 0;
}
.table-page .data-card {
  border: 0;
  border-radius: 0;
}
.data-card.unpaged {
  grid-template-rows: minmax(0, 1fr);
}
@media (max-width: 700px) {
  .topbar-leading {
    order: 1;
    flex: 1;
  }
  .header-tools {
    order: 2;
  }
  .topbar-page-tools {
    order: 3;
    flex-basis: 100%;
  }
  .topbar-page-tools .table-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
  }
  .table-toolbar > .table-tools {
    display: contents;
  }
  .topbar-page-tools .list-controls {
    grid-column: 2;
    grid-row: 1;
  }
  .table-toolbar .table-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  .table-actions button {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.5rem;
    font-size: 0.75rem;
  }
  .topbar-page-tools .toolbar {
    width: 100%;
  }
  .topbar-page-tools .toolbar input {
    max-width: none;
  }
}

/* 桌面身份区与分页或编辑操作区共用同一条网格行，保证上下边线对齐。 */
@media (min-width: 901px) {
  .shell {
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand topbar" "sidebar content" "identity content";
  }
  .shell.has-pagination {
    grid-template-areas: "brand topbar" "sidebar content" "identity pagination";
  }
  .shell > .sidebar {
    grid-template-rows: minmax(0, 1fr);
  }
  .shell > .sidebar-footer {
    grid-area: identity;
    display: flex;
    align-items: center;
    min-width: 0;
    border-right: 1px solid var(--line);
    background: var(--sidebar);
    z-index: 10;
  }
  .shell > .sidebar-footer .profile {
    width: 100%;
  }
  .shell > .pagination {
    grid-area: pagination;
    background: var(--surface);
  }
}
@media (max-width: 900px) {
  .sidebar-brand-mobile .switcher-panel,
  .sidebar .profile-menu {
    width: 100%;
    min-width: 0;
  }
  .sidebar-brand-mobile .switcher-panel {
    padding: 0.25rem;
  }
  .sidebar-brand-mobile .switcher-panel button {
    padding: 0.5rem 0.35rem;
    gap: 0.35rem;
  }
  .sidebar-brand-mobile .switch-app-icon svg {
    width: 18px;
    height: 18px;
  }
}

/* 后台外层锁定视口，只允许业务内容与弹层内部滚动。 */
html:has(.console-view),
body:has(.console-view) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body:has(.console-view),
.console-view {
  height: 100dvh;
  overflow: hidden;
}
.shell {
  overscroll-behavior: none;
}
.content,
.table-wrap,
.nav-scroll,
.dialog-body,
.filter-panel {
  overscroll-behavior: contain;
}
.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding-block: 0.45rem;
  max-width: 100%;
  cursor: pointer;
}
.status-switch > input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 2.5rem;
  height: 1.4rem;
  min-width: 2.5rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 2rem;
  background: #bcc6d3;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.status-switch > input::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: calc(1.4rem - 6px);
  height: calc(1.4rem - 6px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0002;
  transition: transform 0.15s;
}
.status-switch > input:checked {
  background: var(--primary);
}
.status-switch > input:checked::after {
  transform: translateX(1.1rem);
}
.status-switch > input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.status-switch > input[aria-busy="true"] {
  opacity: 0.65;
  cursor: wait;
}
.status-switch > span {
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.status-switch > input:disabled + span {
  color: var(--muted);
}
td .status-switch {
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .status-switch > input,
  .status-switch > input::after {
    transition: none;
  }
}

/* 动作资料按区块组织，保存入口固定，内容独立滚动。 */
.exercise-editor {
  width: min(52rem, calc(100vw - 1.5rem));
}
.exercise-editor form {
  height: min(48rem, calc(100dvh - 2rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.exercise-editor [hidden] {
  display: none !important;
}

.exercise-section h3 {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
}
.exercise-section > h3:not(:first-child) {
  padding-top: 0.6rem;
  margin-top: 0.4rem;
  border-top: 1px solid var(--line);
}
.exercise-section .field {
  margin-bottom: 1rem;
}
.exercise-section textarea {
  min-height: 4.5rem;
  resize: vertical;
}
.exercise-section input[readonly] {
  color: var(--muted);
  background: var(--paper);
}
.array-field {
  margin-bottom: 1.2rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.array-heading {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.array-heading h4 {
  font-size: 0.8rem;
  margin: 0;
}
.array-heading > span,
.array-empty {
  color: var(--muted);
  font-size: 0.7rem;
}
.array-add,
.array-remove {
  font-size: 0.7rem;
  padding: 0.4rem 0.6rem;
  min-height: 2rem;
}
.array-row {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.array-index {
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 0.6rem;
  text-align: center;
}
.array-row textarea,
.array-row input {
  width: 100%;
  min-width: 0;
}
.array-row textarea {
  min-height: 4rem;
}
.array-remove {
  color: var(--muted);
}
.array-field.step-field {
  padding: 0;
  border: 0;
}
.step-field .array-row {
  display: block;
}
.array-field > .array-add {
  margin-top: 0.6rem;
}
.exercise-flags {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}
@media (max-width: 700px) {
  .exercise-editor .dialog-head,
  .exercise-editor .dialog-body,
  .exercise-editor .fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .array-field {
    padding: 0.6rem;
  }
  .array-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
  }
  .array-index {
    display: none;
  }
}

/* 计量配置按记录方式显示，不能被表单网格样式覆盖隐藏状态。 */
.exercise-editor .field[hidden] {
  display: none;
}
.exercise-flag-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding-block: 0.85rem;
}
.exercise-flag-row + .exercise-flag-row {
  border-top: 1px solid var(--line);
}
.exercise-flag-copy h4 {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.exercise-flag-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}
.exercise-flag-row .status-switch > span {
  display: none;
}

/* 独立动作编辑页沿用控制台布局，页内滚动，导航与操作区保持可见。 */
.exercise-editor.exercise-page {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.exercise-editor.exercise-page form {
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}

.exercise-page .dialog-body {
  min-height: 0;
  overflow-y: auto;
}
.exercise-page [data-sex-defaults] {
  margin-top: 1rem;
}
.content.exercise-content {
  padding: 1.25rem;
  overflow: hidden;
}

@media (max-width: 700px) {
  .content.exercise-content {
    padding: 0.4rem;
  }
}

/* 工具按钮保留可访问名称，仅在实际刷新请求期间旋转图标。 */
.refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.refresh-button svg {
  width: 1rem;
  height: 1rem;
  stroke-width: 1.8;
}
.refresh-button:hover,
.refresh-button:focus-visible {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary);
}
.refresh-button:active {
  background: var(--line);
}
.refresh-button.is-refreshing svg {
  animation: refresh-spin 0.8s linear infinite;
}
.refresh-button:disabled {
  opacity: 1;
  cursor: progress;
}
@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .refresh-button.is-refreshing svg {
    animation: none;
  }
}

/* 编辑菜单直接切换区块，整份表单统一保存。 */
.exercise-breadcrumb .breadcrumb-separator {
  display: inline;
}
.exercise-breadcrumb strong {
  white-space: normal;
  overflow-wrap: anywhere;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--primary);
}
.exercise-page-layout {
  display: grid;
  grid-template-columns: min(32%, 14rem) minmax(0, 1fr);
  gap: 1.25rem;
  min-height: 0;
}
.exercise-editor-navigation {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
}
.exercise-editor-workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1rem;
  min-width: 0;
  min-height: 0;
}
.exercise-editor-menu {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  flex: 1;
  min-height: 0;
  gap: 0.25rem;
  max-height: 100%;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--surface);
}
.exercise-editor-menu button {
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: left;
  overflow-wrap: anywhere;
}
.exercise-editor-menu button[aria-selected="true"] {
  background: var(--soft);
  color: var(--primary);
  font-weight: 600;
}
.exercise-page-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 5rem;
  gap: 0.5rem 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
}
.exercise-page-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 1.5rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: normal;
}
.exercise-page-footer [data-close] {
  min-width: 4.5rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.75rem;
  border-color: var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  font-size: 0.8rem;
  letter-spacing: normal;
}
.exercise-page-footer [data-close]:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--soft);
}
.exercise-page-footer .primary {
  grid-column: 3;
  min-height: 2.75rem;
}
.exercise-page-footer .exercise-save-state {
  grid-column: 2;
  text-align: right;
  overflow-wrap: anywhere;
}
.exercise-editor-menu .has-unsaved-changes::after {
  content: "";
  display: inline-block;
  width: 0.3rem;
  height: 0.3rem;
  margin-left: 0.45rem;
  border-radius: 50%;
  background: var(--primary);
  vertical-align: middle;
}
.exercise-save-state {
  align-self: center;
  color: var(--muted);
  font-size: 0.75rem;
}
.exercise-save-state.is-error {
  color: var(--warning);
}
.exercise-page .dialog-body {
  min-width: 0;
  padding: 0;
}
.exercise-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.exercise-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
}
.exercise-section-body {
  padding: 1rem;
}
.exercise-form-group > header {
  margin-bottom: 0.85rem;
}
.exercise-form-group > header h3 {
  margin: 0;
  font-size: 0.9rem;
}
.exercise-form-group > header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.exercise-form-group + .exercise-form-group {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
.exercise-page .field-limit {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 400;
}
.exercise-page .note {
  margin: 0.35rem 0 0.75rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
}
.exercise-page-error {
  margin: 0 0 0.75rem;
  color: var(--warning);
}
.exercise-page-error:empty {
  display: none;
}
.exercise-array-grid,
.sex-defaults-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
}
.exercise-page .array-field {
  margin-bottom: 0.85rem;
  padding: 0.75rem;
}
.exercise-page .step-field {
  padding: 0;
}
.exercise-page .array-empty {
  display: none;
}
.exercise-page .exercise-array-grid .array-field {
  margin-bottom: 0;
}
.exercise-page .list-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.list-field > [data-array-rows] {
  flex: 1;
}
.exercise-page .array-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  gap: 0.35rem;
  min-height: 2.5rem;
  margin: 0.85rem 0 0 1.8rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
}
.exercise-page .step-field > .array-add {
  margin-left: 0;
}
.exercise-page .array-add:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--soft);
}
.exercise-page .array-row {
  align-items: center;
}
.exercise-page .array-index {
  padding-top: 0;
}
.exercise-page .exercise-cues-grid {
  margin-bottom: 1rem;
}
.sex-defaults-card {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
.exercise-page .exercise-flags {
  margin-bottom: 0.65rem;
}
.exercise-page .fields {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.75rem 1rem;
}
.exercise-page .exercise-identity-fields {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.exercise-page .recording-controls .fields {
  grid-template-columns: minmax(0, 1fr);
}
.exercise-page .field {
  margin-bottom: 0.65rem;
}
.recommendation-section {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.recommendation-section .exercise-section-body {
  display: grid;
  gap: 1rem;
  padding: 0;
}
.recommendation-section .exercise-form-group {
  min-width: 0;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
}
.recommendation-section .exercise-form-group > header {
  margin-bottom: 1.25rem;
}
.recommendation-section h4 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
}
.recording-settings-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
}
.recording-controls {
  display: grid;
  gap: 1rem;
}
.recommendation-volume-setting {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.recommendation-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1.25rem;
}
.recommendation-setting-copy {
  min-width: 0;
}
.recommendation-setting-copy .note {
  margin: 0.3rem 0 0;
}
.recommendation-setting-row .status-switch {
  margin: 0;
}
.recommendation-setting-row .status-switch > span {
  display: none;
}
.recording-preview-panel {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
}
.recording-preview-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.recording-preview-panel > header h3 { margin: 0; }
.recording-preview-panel > header > span {
  color: var(--muted);
  font-size: 0.7rem;
}
.recording-preview-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--paper);
}
.recording-preview-title,
.recording-preview-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  overflow-wrap: anywhere;
}
.recording-preview-title strong { font-size: 0.85rem; }
.recording-preview-title > span {
  padding: 0.25rem 0.5rem;
  border-radius: 0.35rem;
  background: var(--soft);
  color: var(--primary);
  font-size: 0.65rem;
}
.recording-preview-summary {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.7rem;
}
.recording-preview-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 6rem), 1fr));
  align-items: start;
  gap: 0.75rem;
  margin-top: 1rem;
}
.recording-preview-field { min-width: 0; text-align: center; }
.recording-preview-field > span,
.recording-preview-field > small { color: var(--muted); font-size: 0.7rem; }
.recording-preview-value {
  margin-block: 0.4rem;
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.recording-preview-volume {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
}
.recording-preview-volume strong { color: var(--ink); }
.recording-preview-panel > .note { margin-bottom: 0; }
.recommendation-common > h4 {
  margin-bottom: 0.85rem;
}
.recommendation-section .recommendation-fields {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.75rem 1rem;
}
.recommendation-section .field {
  margin: 0;
}
.recommendation-section input[type="number"] {
  font-variant-numeric: tabular-nums;
}
.recommendation-section .recommendation-common > .note {
  margin: 0.85rem 0 0;
}
.recommendation-sex-setting {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.recommendation-sex-setting [data-sex-default-toggle] {
  justify-self: end;
}
@media (max-width: 700px) {
  .recommendation-sex-setting [data-weight-sex-label] {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: 100%;
    box-sizing: border-box;
  }
}
.recommendation-section .sex-defaults-card {
  padding: 1rem;
  background: var(--paper);
}
.sex-defaults-card > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.sex-defaults-card > header span {
  color: var(--muted);
  font-size: 0.65rem;
}
.recommendation-section .sex-defaults-card .recommendation-fields {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
}
@media (max-width: 700px) {
  .exercise-page-footer button {
    min-width: 0;
    padding-inline: 0.8rem;
    letter-spacing: normal;
  }
  .exercise-section-body {
    padding: 0.75rem;
  }
  .exercise-page .fields,
  .exercise-page .recording-controls .fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  .exercise-page-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
  }
  .exercise-editor-navigation,
  .exercise-editor-workspace {
    display: contents;
  }
  .exercise-editor-menu {
    grid-column: 1 / -1;
    grid-row: 1;
    flex-direction: row;
    height: auto;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
  }
  .exercise-editor-menu button {
    flex: none;
    white-space: nowrap;
  }
  .exercise-page .dialog-body {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .exercise-page-footer button {
    min-width: 0;
    white-space: normal;
  }
  .exercise-page-footer {
    grid-column: 1;
    grid-row: 3;
    gap: 0.25rem 0.75rem;
  }
}

@media (max-width: 700px) {
  .exercise-page-footer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
  .exercise-page-footer [data-close] {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    padding-inline: 0.5rem;
  }
  .exercise-page-footer .exercise-save-state {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .exercise-page-footer .primary {
    grid-column: 2;
    grid-row: 1;
  }
  .exercise-page .array-add {
    margin-left: 0;
  }
}

/* 动作库搜索紧邻列表名称，默认参数类型在对应列筛选。 */
.table-tools > .toolbar {
  flex: 1 1 12rem;
  justify-content: flex-start;
}
.topbar-page-tools .table-tools > .toolbar input {
  flex: 1;
  width: 100%;
  max-width: none;
}
.table-tools > .list-controls { flex: 0 1 auto; min-width: 0; }
.table-tools > .list-controls .filter-panel { justify-content: flex-start; }
.exercise-column-filter { min-width: 9rem; }
.exercise-column-filter > summary {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.exercise-column-filter .choice-popover { min-width: 13rem; left: auto; right: 0; text-align: left; }
.exercise-column-filter.is-mobile { display: none; }
@media (max-width: 700px) {
  .exercise-column-filter.is-mobile { display: block; }
  .exercise-column-filter.is-mobile > summary { padding: 0.6rem; }
  .table-tools > .toolbar { flex-basis: 100%; }
}

.recording-preview-sex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.recording-preview-sex button {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  text-align: center;
}
.recording-preview-sex button[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary);
}
.weight-sex-label {
  padding: 0.3rem 0.5rem;
  border-radius: 0.35rem;
  background: var(--soft);
  color: var(--primary);
  font-size: 0.7rem;
}
.sex-defaults-card > header .is-pending {
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  background: var(--warning-bg);
  color: var(--warning);
}

.exercise-list-topbar .topbar-leading { display: none; }
@media (max-width: 900px) {
  .exercise-list-topbar .topbar-leading { display: flex; flex: 0 0 auto; }
  .exercise-list-topbar .breadcrumb:empty { display: none; }
}
