*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 统一屏蔽正文的长按选取、拖拽与触控高亮；编辑控件例外。 */
html.app-interaction-guard,
html.app-interaction-guard body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html.app-interaction-guard img,
html.app-interaction-guard a,
html.app-interaction-guard button,
html.app-interaction-guard canvas,
html.app-interaction-guard svg {
  -webkit-user-drag: none;
  user-drag: none;
}

html.app-interaction-guard input,
html.app-interaction-guard textarea,
html.app-interaction-guard select,
html.app-interaction-guard [contenteditable]:not([contenteditable="false"]) {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

:root {
  color-scheme: light;
  
  /* 空间比例定义 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  
  /* 导航栏高度（全局 toast / fixed 元素安全区） */
  --nav-height: 64px;
  
  /* 品牌基础色值：从饱和正红升级为温润朱砂红 */
  --brand-white: 251 250 247; /* 纸质暖白 */
  --brand-black: 20 22 26;    /* 墨黑（避开死黑） */
  --brand-red: 200 60 45;     /* 朱砂红/陶土红 */

  /* 环境光：提高浓度以显现光影 */
  --light-direct: 215 170 85; /* 暖日光 */
  --light-sky: 100 135 175;   /* 空影蓝 */
  --shadow-air: 36 53 74;

  /* 昼间语义 Token */
  --canvas: rgb(var(--brand-white));
  --ink: rgb(var(--brand-black) / 0.90);
  --ink-muted: rgb(var(--brand-black) / 0.62);
  --line: rgb(var(--brand-black) / 0.08);
  --action-red: rgb(var(--brand-red));
  
  --surface-outline: rgb(var(--brand-black) / 0.04);
  --surface-raised: rgba(255, 255, 255, 0.82);
  --surface-floating: rgba(255, 255, 255, 0.94);

  /* 经典映射（保持向后兼容） */
  --bg: #f3f5f8; /* 偏灰蓝底纸 */
  --bg-soft: var(--canvas);
  --surface: var(--surface-floating);
  --surface-strong: rgb(255 255 255);
  --surface-sunken: #e9edf2; /* 浅色：卡片内“凹陷/内嵌子面”（下沉面/内凹井），用于分段控件轨道、高级参数面板等 */
  --text: var(--ink);
  --muted: var(--ink-muted);
  --focus: var(--action-red);
  --primary: var(--ink);
  --primary-strong: rgb(var(--brand-black));
  
  --success: #15b26b;
  --warning: #ee9b13;
  --danger: var(--action-red);
  --success-ink: #0b6f47;
  --warning-ink: #915500;
  --danger-ink: var(--action-red);

  --hero-glow-a: rgb(var(--light-direct) / 0.12);
  --hero-glow-b: rgb(var(--light-sky) / 0.09);

  /* 字体栈 */
  --font-hei: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --font-song: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", ui-serif, serif;
  --font-song-bold: "Georgia", "Songti SC", "STZhongsong", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", var(--font-hei);
  --font-sans: var(--font-hei);

  --fs-sm: clamp(13px, 0.8vw + 10px, 15px);
  --fs-md: clamp(15px, 1vw + 11px, 17px);
  --fs-lg: clamp(17px, 1.2vw + 13px, 20px);

  /* 形状体系 */
  --radius-none: 0;
  --radius-paper: 2px;
  --radius-surface: 6px;
  --radius-control: 10px;
  --radius-dialog: 14px;
  --radius-app: 20px;    /* 全屏应用大组件专用圆角 */
  --radius-pill: 999px;

  --radius-sm: var(--radius-surface);
  --radius-md: var(--radius-control);
  --radius-lg: var(--radius-dialog);
  --radius-xl: var(--radius-dialog);

  --shadow-sm: 0 4px 16px rgba(var(--shadow-air), 0.04);
  --shadow-md: 0 10px 30px rgba(var(--shadow-air), 0.08);
  --shadow-lg: 0 20px 48px rgba(var(--shadow-air), 0.12);

  --dur-fast: 160ms;
  --dur-med: 260ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: var(--fs-md);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0b0c0f;
  --ink: rgb(255 255 255 / 0.90);
  --ink-muted: rgb(255 255 255 / 0.60);
  --line: rgb(255 255 255 / 0.10);
  --action-red: #e05a47; /* 珊瑚朱红 */
  
  --surface-outline: rgb(255 255 255 / 0.04);
  --surface-raised: rgb(20 22 26 / 0.76);
  --surface-floating: rgb(24 26 31 / 0.92);
  --surface-sunken: rgba(0, 0, 0, 0.30); /* 深色：卡片内“凹陷/内嵌子面”（下沉面/内凹井） */

  --bg: var(--canvas);
  --bg-soft: var(--surface-raised);
  --surface: var(--surface-floating);
  --surface-strong: #16191e;
  --text: var(--ink);
  --muted: var(--ink-muted);
  --focus: var(--action-red);
  --primary: var(--ink);
  --primary-strong: #ffffff;

  --danger: var(--action-red);
  --danger-ink: var(--action-red);

  --hero-glow-a: rgb(var(--light-direct) / 0.07);
  --hero-glow-b: rgb(var(--light-sky) / 0.05);
}



body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-soft), var(--bg) 35%, var(--bg));
  position: relative;
  isolation: isolate;
  transition: background var(--dur-med) var(--ease), color var(--dur-med) var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(45rem 30rem at 10% -5%, var(--hero-glow-a), transparent 75%),
    radial-gradient(45rem 30rem at 100% 5%, var(--hero-glow-b), transparent 75%);
  transform-origin: center;
  animation: glow-breath 8s var(--ease) infinite;
}

@keyframes glow-breath {
  0%, 100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

body,
input,
select,
textarea,
button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
}

main,
section,
header,
footer {
  display: block;
}


#logo {
  max-width: 100%;
  height: auto;
  display: block;
}



.wrap {
  width: min(1100px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 0 0 var(--space-7);
}

.page-intro {
  padding-top: var(--space-6);
  margin-bottom: var(--space-5);
}

.title-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.title {
  margin: 0;
  font-family: var(--font-song-bold);
  font-weight: 600;
  font-size: clamp(1.75rem, 2vw + 1.1rem, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.title-small {
  font-size: 1.5rem;
}

.sub {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: var(--fs-md);
  line-height: 1.7;
}

.highlight {
  color: var(--focus);
  font-weight: 700;
}

.grid {
  display: grid;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
}

.card {
  position: relative;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card h2,
.card h3,
.card h4 {
  margin: 0 0 var(--space-3);
}

.card p:last-child {
  margin-bottom: 0;
}

.card.half {
  min-width: 0;
}

@media (min-width: 920px) {
  .grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .card {
    grid-column: span 12;
  }

  .card.half {
    grid-column: span 6;
  }
}

.row {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 860px) {
  .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

@media (max-width: 600px) {
  .action-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.75rem;
  }
  .action-group .btn {
    width: 100%;
    margin-right: 0 !important;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 2.75rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: var(--fs-md);
  font-weight: 700;
  font-family: var(--font-hei);
  background: var(--canvas);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 1px var(--focus),
    0 0 0 4px color-mix(in srgb, var(--focus) 20%, transparent);
}

.btn.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--canvas);
}

.btn.focus {
  border-color: var(--action-red);
  background: var(--action-red);
  color: #ffffff;
}

.btn.ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.btn.tiny {
  min-height: 2.25rem;
  padding: 0.56rem 0.82rem;
  font-size: 0.92rem;
}

html[data-theme="dark"] .btn {
  background: var(--canvas);
  border-color: var(--line);
}



.muted {
  color: var(--muted);
}

.hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.split {
  height: 1px;
  margin: var(--space-4) 0;
  background: var(--line);
}

label {
  display: block;
  margin: 0 0 var(--space-2);
  font-size: 0.92rem;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.78rem 0.9rem;
  background: var(--surface-strong);
  color: var(--text);
  transition:
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

/* Input Suffix Sizing */
.input-wrapper {
  position: relative;
  width: 100%;
}

.input-wrapper input {
  padding-right: 3rem !important; /* Make room for the unit text */
}

.input-wrapper::after {
  content: attr(data-unit);
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
  background: transparent;
}

/* ══════════════════════════════════════════
   RANGE / SLIDER FIELD（拖动设定数值，减少键入）
   ══════════════════════════════════════════ */
.range-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.range-readout {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  align-self: flex-start;   /* 收缩到内容宽度，避免整行空白区都可点 */
  width: max-content;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--text);
}
.range-readout .rv {
  cursor: text;             /* 仅数字本身可点进入键入 */
}
.range-readout .ru {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: default;
}
.range-readout .rv-edit {
  font: inherit;
  font-weight: 700;
  font-size: 1.5rem;
  width: 4.5rem;
  padding: 0;
  margin: 0;
  border: none;
  border-bottom: 2px solid var(--focus);
  background: transparent;
  color: var(--text);
  outline: none;
}
.range-field input[type="range"] {
  width: 100%;
  height: 1.7rem;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  padding: 0 !important;
  margin: 0;
}
/* 轨道：已选部分朱红，未选部分下沉面 */
.range-field input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--focus) 0%,
    var(--focus) var(--pct, 0%),
    var(--surface-sunken) var(--pct, 0%),
    var(--surface-sunken) 100%
  );
}
.range-field input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-sunken);
}
.range-field input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--focus);
}
/* 双色同心圆滑块：朱红中心 + 白色外环 */
.range-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: -0.55rem;
  border-radius: 50%;
  background: var(--focus);
  border: 3px solid var(--surface-strong);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.range-field input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.12);
}
.range-field input[type="range"]::-moz-range-thumb {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--focus);
  border: 3px solid var(--surface-strong);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.copy-fallback {
  display: none;
  margin-top: var(--space-3);
}

.out {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-left: 2px solid var(--action-red);
  border-radius: var(--radius-paper);
  background: var(--surface-floating);
  color: var(--text);
  white-space: pre-line;
  line-height: 1.7;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
  font-size: 0.82rem;
}

.pill.ok {
  color: var(--success-ink);
  border-color: color-mix(in srgb, var(--success) 24%, transparent);
  background: color-mix(in srgb, var(--success) 16%, transparent);
}

.pill.warn {
  color: var(--warning-ink);
  border-color: color-mix(in srgb, var(--warning) 24%, transparent);
  background: color-mix(in srgb, var(--warning) 18%, transparent);
}

.pill.bad {
  color: var(--danger-ink);
  border-color: color-mix(in srgb, var(--danger) 24%, transparent);
  background: color-mix(in srgb, var(--danger) 16%, transparent);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--text);
  font-size: 0.84rem;
  white-space: nowrap;
}

.tag.warn {
  border-color: color-mix(in srgb, var(--warning) 28%, transparent);
  background: color-mix(in srgb, var(--warning) 18%, transparent);
  color: var(--warning-ink);
}

.tag.solid {
  border-color: var(--primary-strong);
  background: var(--ink);
  color: var(--canvas);
}

.hl-ok {
  color: var(--success-ink);
}

.hl-warn {
  color: var(--warning-ink);
}

.bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.82rem;
  line-height: 1.2;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  box-shadow: var(--shadow-sm);
}

.bubble__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.bubble-ok {
  color: var(--success-ink);
  border-color: color-mix(in srgb, var(--success) 22%, transparent);
  background: color-mix(in srgb, var(--success) 16%, transparent);
}

.bubble-warn {
  color: var(--warning-ink);
  border-color: color-mix(in srgb, var(--warning) 22%, transparent);
  background: color-mix(in srgb, var(--warning) 16%, transparent);
}

.bubble-bad {
  color: var(--danger-ink);
  border-color: color-mix(in srgb, var(--danger) 22%, transparent);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}

.site-footer {
  margin-top: var(--space-8);
  padding: var(--space-6) var(--space-4) var(--space-7);
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.site-footer .footer-links {
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.site-footer .footer-legal-links {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.site-footer .footer-links a {
  color: var(--text);
  font-weight: 600;
  transition: color var(--dur-fast) var(--ease);
}

.site-footer .footer-links a:hover {
  color: var(--focus);
}

.site-footer .sep {
  color: var(--line);
  margin: 0 0.2rem;
}

.site-footer .footer-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.site-footer .footer-meta a {
  color: inherit;
  border-bottom: 1px dotted currentColor;
}

.site-footer .footer-meta a:hover {
  color: var(--focus);
}

@media (max-width: 520px) {
  .site-footer {
    padding: var(--space-5) var(--space-3) var(--space-6);
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .site-footer .footer-links {
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
  }

  .site-footer .footer-legal-links {
    white-space: nowrap;
    gap: 0.32rem;
  }

  .site-footer .footer-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    white-space: nowrap;
    font-size: 0.68rem;
  }

  .site-footer .footer-meta .sep { margin: 0; }
  .site-footer .footer-follow-label { display: none; }
  .site-footer .footer-email { border-bottom: 0; font-size: 0; }
  .site-footer .footer-email::after { content: "✉"; font-size: 0.8rem; }
}

.qr-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(10, 12, 16, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease);
}

.qr-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.qr-card {
  width: min(400px, 100%);
  padding: 2.25rem 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-dialog);
  background: var(--surface-floating);
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(16px) scale(0.96);
  transition: transform var(--dur-med) var(--ease);
}

.qr-mask.show .qr-card {
  transform: translateY(0) scale(1);
}

.qr-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  padding: 0;
  line-height: 1;
}

.qr-close-btn:hover {
  background: var(--line);
  color: var(--text);
  transform: scale(1.05);
}

.qr-title {
  font-family: var(--font-song-bold);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem 0;
}

.qr-card .tip {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 1.5rem 0;
}

.qr-image-container {
  background: #ffffff;
  padding: 1.25rem;
  border-radius: var(--radius-control);
  border: 1.5px solid var(--line);
  display: inline-block;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.qr-image-container img {
  width: 180px;
  height: 180px;
  display: block;
}

.qr-email-section {
  border-top: 1px dashed var(--line);
  padding-top: 1.25rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.email-label {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.email-value {
  font-size: 0.95rem;
  color: var(--focus);
  font-weight: 700;
  transition: opacity var(--dur-fast) var(--ease);
  border-bottom: 1px dashed var(--focus);
}

.email-value:hover {
  opacity: 0.8;
}

/* iOS 风格返回按钮 */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
  cursor: pointer;
  padding: 0.5rem 0;
}

.back-btn:hover {
  color: var(--focus);
}

.back-btn .back-icon {
  width: 14px;
  height: 14px;
  transition: transform var(--dur-fast) var(--ease);
}

.back-btn:hover .back-icon {
  transform: translateX(-3px);
}

/* 高级毛玻璃圆形回到顶部 */
.to-top-circle {
  position: fixed;
  right: 2.25rem;
  bottom: 2.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-floating);
  border: 1px solid var(--line);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  box-shadow: var(--shadow-md);
  transition: 
    opacity var(--dur-med) var(--ease),
    transform var(--dur-med) var(--ease),
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0;
  outline: none;
}

.to-top-circle svg {
  width: 18px;
  height: 18px;
  transition: transform var(--dur-fast) var(--ease);
}

.to-top-circle.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.to-top-circle:hover {
  background: var(--bg-soft);
  color: var(--focus);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px) scale(1.02);
}

.to-top-circle:hover svg {
  transform: translateY(-2px);
}

.to-top-circle:active {
  transform: translateY(0) scale(0.98);
}

@media (max-width: 600px) {
  .to-top-circle {
    right: 1.25rem;
    bottom: 1.25rem;
    width: 40px;
    height: 40px;
  }
  .to-top-circle svg {
    width: 16px;
    height: 16px;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.show-on-mobile {
  display: inline;
}

.hide-on-mobile {
  display: none;
}

@media (min-width: 760px) {
  .show-on-mobile {
    display: none;
  }

  .hide-on-mobile {
    display: inline;
  }
}

.page-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-5) 1rem var(--space-7);
}

.camera-feed {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 320px;
  background: color-mix(in srgb, var(--text) 8%, var(--bg-soft));
}

.camera-feed video,
.camera-feed canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-feed.mirror video,
.camera-feed.mirror canvas {
  transform: scaleX(-1);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
  color: var(--text);
  background: color-mix(in srgb, var(--surface-strong) 22%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.icon-btn:hover {
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   HOME PAGE
══════════════════════════════════════════ */

/* Nav */
/* Nav */
.home-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px; /* Fixed height to match logo */
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  border-bottom: 1px solid var(--line);
  transition: height 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.home-nav:hover,
.home-nav.active-hover {
  height: 76px;
}

.home-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  height: 100%;
}

.home-nav-inner img {
  height: 60%; /* Adaptive height relative to topbar */
  max-height: 42px;
  width: auto;
  object-fit: contain;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.home-nav:hover .home-nav-inner img,
.home-nav.active-hover .home-nav-inner img {
  transform: translate(-50%, -50%) scale(1.38);
}

/* Nav back button in topbar */
.nav-back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  padding: 0.4rem 0.6rem 0.4rem 0 !important;
  color: var(--muted) !important;
}

.nav-back-btn:hover {
  color: var(--focus) !important;
}

/* Dropdown Menu wrapper */
.nav-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}

.nav-dropdown-wrapper:hover .dropdown-trigger {
  color: var(--text);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface-floating);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.4rem 0;
  min-width: 120px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--dur-fast) var(--ease);
  z-index: 150;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-dropdown a {
  display: block !important;
  padding: 0.5rem 1rem;
  font-size: 0.86rem !important;
  color: var(--muted) !important;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  font-weight: 500 !important;
  text-align: left;
}

.nav-dropdown a:hover {
  background: var(--bg-soft);
  color: var(--focus) !important;
}

.nav-dropdown-wrapper:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.home-nav-links {
  margin-left: auto; /* Push links to the right */
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.home-nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}

.home-nav-links a:hover { color: var(--text); }

@media (max-width: 767px) {
  :root { --nav-height: 56px; }
  .home-nav { height: 56px; padding: 0 1rem; }
  .home-nav:hover,
  .home-nav.active-hover {
    height: 66px;
  }
  .home-nav-inner { flex-direction: row; justify-content: space-between; }
  .home-nav-inner img { 
    position: absolute; 
    left: 50%; 
    top: 50%;
    transform: translate(-50%, -50%) scale(1); 
    height: 32px; 
    max-height: 65%;
  }
  .home-nav:hover .home-nav-inner img,
  .home-nav.active-hover .home-nav-inner img {
    transform: translate(-50%, -50%) scale(1.28);
  }
  .home-nav-links { gap: 0.75rem; }
  .home-nav-links > a,
  .home-nav-links .nav-dropdown-wrapper { display: none; } /* Hide tools/dropdown on mobile */
}

/* Hero */
.home-hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  text-align: center;
}

.home-title {
  margin: 0.5rem 0 1.25rem;
  font-family: var(--font-song-bold);
  font-size: clamp(2.4rem, 6vw + 1rem, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.gradient-text {
  color: var(--action-red);
}

.home-sub {
  margin: 0 auto 2rem;
  max-width: 600px;
  font-family: var(--font-sans);
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.br-pc { display: none; }
@media (min-width: 640px) { .br-pc { display: block; } }

.home-hero-cta {
  justify-content: center;
  margin-bottom: 1.25rem;
}

.btn-lg {
  min-height: 3.2rem;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
}

.btn-sm {
  min-height: 2.25rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
}

.home-hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary-strong);
  font-size: 0.82rem;
  font-weight: 600;
}

html[data-theme="dark"] .badge-chip {
  color: var(--primary);
}

/* Section headings */
.section-eyebrow {
  margin: 0 0 0.4rem;
  color: var(--focus);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-title {
  margin: 0 0 2rem;
  font-family: var(--font-song-bold);
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

/* Tool grid */
.tool-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 3rem;
}

@media (min-width: 640px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tool-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .tool-card--featured {
    grid-column: span 2;
  }
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  position: relative;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--focus);
}

.tool-card--featured {
  border-color: var(--line);
  background: var(--surface);
}

.tool-card--locked {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.tool-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--focus) 10%, transparent);
}

.tool-card-body {
  flex: 1;
  min-width: 0;
}

.tool-card-body h3 {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.tool-card-body p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.tool-tag {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--line);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tool-tag--coming {
  background: color-mix(in srgb, var(--action-red) 10%, transparent);
  color: var(--action-red);
}

html[data-theme="dark"] .tool-tag--coming {
  color: var(--warning);
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tool-chips span {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--muted);
}

.tool-card-arrow {
  font-size: 1.2rem;
  color: var(--focus);
  opacity: 0.7;
  align-self: center;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease);
}

.tool-card:hover .tool-card-arrow { transform: translateX(3px); }

.tool-card-lock {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1rem;
  opacity: 0.5;
}

/* About */
.about-section {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 3rem;
  padding: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

@media (min-width: 800px) {
  .about-section {
    grid-template-columns: 1fr auto;
  }
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.about-stat-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--focus) 5%, var(--surface));
  text-align: center;
  min-width: 120px;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: var(--focus);
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-num--compact {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  white-space: nowrap;
}

.stat-desc {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

body[data-page="gait"] {
  background:
    radial-gradient(1100px 560px at 50% -10%, rgb(var(--light-sky) / 0.035), transparent 54%),
    linear-gradient(180deg, #090a0c, #090a0c 40%, #090a0c);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
}

body[data-page="gait"] #toTop {
  display: none !important;
}

/* ══════════════════════════════════════════
   全屏应用（data-app-mode="fullscreen"）
   全局管理：禁止滚动、跳过常规 topbar 注入
══════════════════════════════════════════ */
[data-app-mode="fullscreen"] {
  overflow: hidden;
}

/* ══════════════════════════════════════════
   MOTION APP（动作检测全屏）
══════════════════════════════════════════ */

.motion-app {
  min-height: 100vh;
  min-height: 100dvh;
}

.motion-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.motion-feed {
  min-height: 100vh;
  min-height: 100dvh;
  aspect-ratio: auto;
  /* 品牌双光源：空影蓝 + 暖日光，无呼吸动画（节省 GPU） */
  background:
    radial-gradient(circle at 60% 15%, rgb(var(--light-sky) / 0.10), transparent 55%),
    radial-gradient(circle at 25% 85%, rgb(var(--light-direct) / 0.06), transparent 50%),
    #050508;
}

.motion-feed video,
.motion-feed canvas {
  object-fit: cover;
}

.motion-topbar,
.motion-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}

.motion-topbar {
  top: 0;
  display: grid;
  gap: 0.65rem;
}

.motion-bottom {
  bottom: 0;
  display: grid;
  gap: 0.85rem;
}

/* 工具栏：新版毛玻璃参数 */
.motion-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem;
  border-radius: var(--radius-app);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.motion-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
}

.motion-nav-cats {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding: 0 0.4rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.motion-nav-cats::-webkit-scrollbar { display: none; }

.nav-cat {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0.2rem 0;
  cursor: pointer;
  position: relative;
  transition: color var(--dur-fast) var(--ease);
}
.nav-cat.is-active {
  color: #ffffff;
}
.nav-cat.is-active::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.80);
}

/* nav-items 胶囊：新版毛玻璃参数 */
.motion-nav-items {
  display: flex;
  overflow-x: auto;
  gap: 0.4rem;
  padding: 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.20);
}
.motion-nav-items::-webkit-scrollbar { display: none; }

.nav-item {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.35rem 0.8rem;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.nav-item.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.20);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* icon-btn 在摄像头暗背景的覆写 */
.motion-feed .icon-btn {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition:
    transform var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.motion-feed .icon-btn:hover,
.motion-feed .icon-btn:active {
  background: rgba(255, 255, 255, 0.20);
  transform: scale(1.06);
}

.motion-headline {
  padding: 0.75rem 0;
  text-align: center;
  opacity: 0;
  transform: translateY(-8px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  transition:
    opacity var(--dur-med) var(--ease),
    transform var(--dur-med) var(--ease);
}

.motion-headline.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.motion-headline.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
}

.motion-headline strong {
  display: block;
  font-size: var(--fs-sm);
  line-height: 1.2;
}

.motion-headline span {
  display: block;
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.motion-guide {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
}

.motion-guide.is-visible {
  opacity: 1;
}

.motion-guide-icon {
  font-size: 2.6rem;
  animation: guide-pulse 2.2s var(--ease) infinite;
}

.motion-guide-text {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.95);
  text-align: center;
  letter-spacing: 0.02em;
  animation: guide-pulse 2.2s var(--ease) infinite;
  animation-delay: 0.1s;
}

.motion-guide-sub {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  text-align: center;
  animation: guide-pulse 2.2s var(--ease) infinite;
  animation-delay: 0.25s;
}

.motion-model-loader { width: min(15rem, 72vw); margin-top: 0.25rem; text-align: center; }
.motion-loader-orbit { position: relative; width: 1.7rem; height: 1.7rem; margin: 0 auto 0.5rem; border: 2px solid rgba(126,240,200,.22); border-top-color: rgba(126,240,200,.98); border-radius: 50%; animation: motion-loader-spin .9s linear infinite; }
.motion-loader-orbit i { position: absolute; width: .28rem; height: .28rem; border-radius: 50%; background: #8affd2; box-shadow: 0 0 8px rgba(138,255,210,.9); }
.motion-loader-orbit i:nth-child(1) { top: -.18rem; left: .56rem; }
.motion-loader-orbit i:nth-child(2) { right: -.12rem; bottom: .17rem; opacity: .7; }
.motion-loader-orbit i:nth-child(3) { left: -.12rem; bottom: .17rem; opacity: .45; }
.motion-loader-track { height: .28rem; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.14); box-shadow: inset 0 1px 2px rgba(0,0,0,.28); }
.motion-loader-track span { display: block; width: 8%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#42d6a3,#b5ffe6); box-shadow: 0 0 10px rgba(81,225,174,.7); transition: width 280ms ease; }
.motion-loader-stage { margin-top: .38rem; color: rgba(255,255,255,.68); font-size: .76rem; }
@keyframes motion-loader-spin { to { transform: rotate(360deg); } }

.motion-start-btn {
  pointer-events: auto;
  margin-top: 0.35rem;
  min-width: 8.5rem;
  min-height: 2.7rem;
  padding: 0.55rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent, #38c89c);
  color: #08251e;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(28, 197, 143, 0.28);
}

.motion-start-btn:disabled {
  opacity: 0.65;
}

@keyframes guide-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.28; }
}

.motion-metrics-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 0.45rem;
}

/* metrics-toggle：整合进 icon-btn 体系，只保留尺寸差异 */
.metrics-toggle {
  width: 2.8rem;
  height: 1.6rem;
  border-radius: var(--radius-pill);
}

.metrics-toggle svg {
  transition: transform var(--dur-med) var(--ease);
}

.motion-metrics {
  border-radius: var(--radius-app);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0 0.45rem;
  transition:
    max-height var(--dur-med) var(--ease),
    opacity var(--dur-med) var(--ease),
    transform var(--dur-med) var(--ease);
  max-height: 200px;
  overflow: hidden;
  opacity: 1;
}

.motion-metrics.is-hidden {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.motion-metric {
  min-width: 0;
  padding: 0.5rem 0.25rem;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.motion-metric span {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: var(--fs-sm);
}

.motion-metric strong {
  display: block;
  margin-top: 0.2rem;
  font-size: clamp(1rem, 3.2vw, 1.25rem);
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 520px) {
  .motion-toolbar {
    gap: 0.6rem;
    padding: 0.55rem;
  }

  .motion-metrics {
    gap: 0.25rem;
    padding: 0.35rem;
  }

  .motion-metric {
    padding: 0.58rem 0.35rem;
  }
}

.confetti {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1100;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  animation: confetti-fall var(--dur, 1200ms) linear forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.92);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), 120vh, 0) rotate(720deg) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .btn,
  .reveal,
  .to-top-circle {
    transition: none;
  }

  .confetti {
    animation-duration: 1ms !important;
  }
}

/* ══════════════════════════════════════════
   TOOL PAGE LAYOUT（全局工具页双栏布局）
   .tool-split — 左输入 / 右结果并排容器
   .tool-results-stack — 右侧结果卡片纵向堆叠
   断点 920px 与 .grid 对齐，不依赖横屏检测
   ══════════════════════════════════════════ */
.tool-split {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.tool-split > .card,
.tool-results-stack > .card {
  grid-column: auto !important;
}

@media (min-width: 920px) {
  .tool-split {
    grid-template-columns: 1fr 1fr;
  }
}

.tool-results-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.weight-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.metric-block {
  padding: 1.25rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-floating);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease);
}

.metric-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-block .m-label {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
}

.metric-block .m-val {
  display: block;
  font-size: 1.85rem;
  font-weight: 850;
  color: var(--text);
  line-height: 1;
  margin: 0.2rem 0;
}

.metric-block .m-status {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.metric-block .m-unit {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 0.15rem;
}

.weight-details-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 600px) {
  .weight-details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ══════════════════════════════════════════
   INPUT VALIDATION & SHAKE ANIMATION
   ══════════════════════════════════════════ */
input.is-invalid,
select.is-invalid {
  border-color: var(--action-red) !important;
  background-color: color-mix(in srgb, var(--action-red) 4%, transparent) !important;
}

.input-error-msg {
  display: block;
  font-size: 0.74rem;
  color: var(--action-red);
  margin-top: 0.35rem;
  font-weight: 600;
  animation: slideDown 0.2s var(--ease);
}

.shake-anim {
  animation: inputShake 0.4s var(--ease);
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   FORM GROUP & LABELS
   ══════════════════════════════════════════ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 0.45rem;
  letter-spacing: 0.02em;
}

.form-group .hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ══════════════════════════════════════════
   GRADIENT HEALTH SCALES
   ══════════════════════════════════════════ */
.health-scale-container {
  margin-top: 0.75rem;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
}

.health-scale-container.show {
  opacity: 1;
}

.health-scale-bar {
  height: 5px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #5ba4e5 0%, #6bc080 30%, #eb9d4f 68%, #d85c57 100%);
  position: relative;
}

.health-scale-pointer {
  position: absolute;
  top: -1.5px;
  width: 8px;
  height: 8px;
  background: var(--text);
  border: 2px solid var(--canvas);
  border-radius: 50%;
  transform: translateX(-50%);
  transition: left var(--dur-med) var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.health-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 500;
}

/* ══════════════════════════════════════════
   DASHBOARD KEY-VALUE WIDGETS
   ══════════════════════════════════════════ */
.dashboard-output-card {
  padding: 1.25rem 1.5rem;
  background: var(--surface-floating);
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dashboard-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--line);
  transition: color var(--dur-med) var(--ease);
}

.dashboard-row:last-child {
  border-bottom: none;
  padding-bottom: 0.25rem;
}

.dashboard-row:first-child {
  padding-top: 0.25rem;
}

.dashboard-row .d-label {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 500;
}

.dashboard-row .d-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.dashboard-row .d-unit {
  font-size: 0.76rem;
  color: var(--muted);
  margin-left: 0.15rem;
  font-weight: 500;
}

.dashboard-row.highlight-row {
  border-bottom: none;
  background: color-mix(in srgb, var(--focus) 4%, transparent);
  margin: 0.25rem -0.5rem -0.25rem -0.5rem;
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-sm);
}

.dashboard-row.highlight-row .d-label {
  color: var(--text);
  font-weight: 700;
}

.dashboard-row.highlight-row .d-val {
  color: var(--focus);
  font-size: 1.45rem;
}

.dashboard-row.highlight-row .d-unit {
  color: var(--focus);
  font-weight: 700;
}

/* ══════════════════════════════════════════
   SEGMENTED CONTROLS (iOS STYLE)
   ══════════════════════════════════════════ */
.segmented-control {
  display: flex;
  background: var(--surface-sunken);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  margin-bottom: 0.45rem;
  width: 100%;
  box-sizing: border-box;
}

.segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: all var(--dur-fast) var(--ease);
}

.segment-btn:hover {
  color: var(--text);
}

.segment-btn.active {
  background: var(--surface-floating);
  color: var(--focus);
  box-shadow: var(--shadow-sm);
}

/* 两行按钮变体：粗黑体主标题 + 灰色小描述，用于选项文字较长的分段控件（如下拉改按钮） */
.segment-btn--stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  line-height: 1.15;
  padding: 0.5rem 0.4rem;
}
.segment-btn--stacked .seg-main {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.segment-btn--stacked .seg-sub {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.1;
}
.segment-btn--stacked.active .seg-sub {
  color: var(--focus);
}
@media (max-width: 480px) {
  .segment-btn--stacked .seg-main { font-size: 0.76rem; }
  .segment-btn--stacked .seg-sub { font-size: 0.56rem; }
}

/* ══════════════════════════════════════════
   ADVANCED PARAMETERS ACCORDION / TOGGLE
   ══════════════════════════════════════════ */
.advanced-section {
  margin-top: 1.5rem;
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}

.advanced-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: color var(--dur-fast) var(--ease);
}

.advanced-trigger:hover {
  color: var(--text);
}

.advanced-trigger .arrow {
  font-size: 0.75rem;
  display: inline-block;
}

.advanced-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  padding-inline: var(--space-3, 0.75rem);
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
}

.advanced-content.show {
  max-height: 800px;
  opacity: 1;
  visibility: visible;
}

/* ══════════════════════════════════════════
   INFO TOOLTIPS
   ══════════════════════════════════════════ */
.label-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.label-wrapper label {
  margin-bottom: 0 !important;
}

.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 0.65rem;
  font-weight: bold;
  color: var(--muted);
  border: 1.2px solid var(--line);
  border-radius: 50%;
  cursor: help;
  position: relative;
  transition: all var(--dur-fast) var(--ease);
}

.info-tip:hover {
  color: var(--focus);
  border-color: var(--focus);
  background: color-mix(in srgb, var(--focus) 4%, transparent);
}

.info-tip::after {
  display: none;
}

.info-tooltip-popover {
  position: fixed;
  z-index: 1300;
  width: max-content;
  max-width: min(17rem, calc(100vw - 24px));
  background: var(--text);
  color: var(--canvas);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  line-height: 1.4;
  white-space: normal;
  text-wrap: pretty;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  box-shadow: var(--shadow-md);
  text-align: left;
  font-weight: normal;
}

.info-tooltip-popover.is-visible {
  opacity: 0.95;
  transform: translateY(0);
}

.info-tip:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════════
   扩展色彩工具类
══════════════════════════════════════════════════════════════ */
.hl-bad {
  color: var(--danger-ink);
}

/* ══════════════════════════════════════════════════════════════
   动作检测扩展：人形轮廓引导
══════════════════════════════════════════════════════════════ */
.pose-silhouette {
  width: min(82px, 20vw);
  pointer-events: none;
  animation: guide-pulse 2.2s var(--ease) infinite;
  animation-delay: 0.15s;
  margin-bottom: -0.2rem;
}

.pose-silhouette svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ══════════════════════════════════════════════════════════════
   步态波形柱状图
══════════════════════════════════════════════════════════════ */
.cycle-chart-wrap {
  padding: 0.35rem 0.5rem 0.25rem;
  border-radius: var(--radius-surface);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cycle-chart-legend {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
}

.cycle-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cycle-legend-left  { background: rgba(245, 224, 218, 0.92); }
.cycle-legend-right { background: rgba(210, 70, 52, 0.95); }

.cycle-legend-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.40);
  margin-right: 0.55rem;
}

#cycleChart {
  display: block;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   训练徽章
══════════════════════════════════════════════════════════════ */
.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.28em 0.8em;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-excellent {
  background: rgba(255, 215, 0, 0.18);
  color: #f5c518;
  border: 1px solid rgba(255, 215, 0, 0.32);
}

.badge-good {
  background: rgba(200, 60, 45, 0.18);
  color: #f3a294;
  border: 1px solid rgba(226, 91, 72, 0.32);
}

.badge-ok {
  background: rgba(255, 250, 247, 0.12);
  color: #fff0eb;
  border: 1px solid rgba(255, 240, 235, 0.30);
}

.badge-poor {
  background: rgba(255, 110, 110, 0.14);
  color: #ff7a7a;
  border: 1px solid rgba(255, 110, 110, 0.22);
}

.badge-sm {
  font-size: 0.68rem;
  padding: 0.15em 0.5em;
}

/* ══════════════════════════════════════════════════════════════
   训练汇总浮层
══════════════════════════════════════════════════════════════ */
.session-summary {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
  pointer-events: none;
}

.session-summary.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.session-summary-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}

.session-summary-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 390px;
  border-radius: var(--radius-app);
  background: rgba(12, 14, 18, 0.94);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.60);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  transform: scale(0.93) translateY(12px);
  transition: transform var(--dur-med) var(--ease);
}

.session-summary.is-visible .session-summary-card {
  transform: scale(1) translateY(0);
}

.session-summary-header {
  text-align: center;
}

.session-summary-icon {
  font-size: 2.4rem;
  margin-bottom: 0.45rem;
  line-height: 1;
}

.session-summary-mode {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.22rem;
}

.session-summary-duration {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.50);
}

.session-summary-badge-wrap {
  text-align: center;
}

.session-summary-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.summary-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.48rem 0.75rem;
  border-radius: var(--radius-surface);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.summary-metric-label {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.52);
}

.summary-metric-value {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #ffffff;
}

.summary-metric-value.hl-ok   { color: #f3a294; }
.summary-metric-value.hl-warn { color: #fff0eb; }
.summary-metric-value.hl-bad  { color: #ff7a7a; }

.session-summary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 0.5rem;
}

.session-btn {
  padding: 0.65rem 0.4rem;
  border-radius: var(--radius-control);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-btn-secondary {
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.session-btn-secondary:hover,
.session-btn-secondary:active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.session-btn-primary {
  background: rgb(var(--brand-red));
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(200, 60, 45, 0.38);
}

.session-btn-primary:hover,
.session-btn-primary:active {
  background: #e05a47;
  transform: scale(1.02);
}

/* ══════════════════════════════════════════════════════════════
   历史记录抽屉
══════════════════════════════════════════════════════════════ */
.history-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
  pointer-events: none;
}

.history-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.history-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
}

.history-panel-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78vh;
  border-radius: var(--radius-app) var(--radius-app) 0 0;
  background: rgba(10, 12, 16, 0.97);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--dur-med) var(--ease);
  padding-bottom: env(safe-area-inset-bottom);
}

.history-panel.is-visible .history-panel-sheet {
  transform: translateY(0);
}

.history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.history-panel-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: #ffffff;
}

.history-panel-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.history-panel-list::-webkit-scrollbar { display: none; }

.history-panel-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  gap: 0.55rem;
}

.history-empty-icon {
  font-size: 2.6rem;
  opacity: 0.45;
}

.history-empty-text {
  font-size: var(--fs-md);
  color: rgba(255, 255, 255, 0.58);
  font-weight: 600;
}

.history-empty-sub {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.32);
  text-align: center;
}

.history-card {
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: background var(--dur-fast) var(--ease);
}

.history-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.history-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.history-card-icon {
  font-size: 1.55rem;
  flex-shrink: 0;
  line-height: 1;
}

.history-card-info {
  flex: 1;
  min-width: 0;
}

.history-card-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #ffffff;
}

.history-card-date {
  font-size: 0.73rem;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 0.12rem;
}

.history-card-metrics {
  font-size: 0.73rem;
  color: rgba(255, 255, 255, 0.42);
  padding-left: 2.2rem;
}

/* ══════════════════════════════════════════════════════════════
   顶栏双按钮组
══════════════════════════════════════════════════════════════ */
.motion-toolbar-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   训练保存轻提示 Toast（非阻塞，底部浮现）
══════════════════════════════════════════════════════════════ */
.motion-toast {
  position: fixed;
  bottom: calc(7rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(12, 14, 20, 0.90);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  color: rgba(255, 255, 255, 0.88);
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.40);
  opacity: 0;
  pointer-events: none;
  z-index: 400;
  white-space: nowrap;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.motion-toast.motion-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.motion-toast.motion-toast-hide {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

/* ══════════════════════════════════════════
   易正动作检测色系：墨黑 / 暖白 / 朱砂红
══════════════════════════════════════════ */
.motion-feed {
  background:
    radial-gradient(circle at 72% 12%, rgba(200, 60, 45, 0.24), transparent 46%),
    radial-gradient(circle at 18% 88%, rgba(255, 250, 247, 0.08), transparent 46%),
    #0b0c0f;
}

.motion-toolbar,
.motion-nav-items {
  background: rgba(15, 16, 19, 0.72);
  border-color: rgba(255, 246, 242, 0.14);
}

.nav-cat.is-active { color: #fff8f5; }
.nav-cat.is-active::after { background: rgb(var(--brand-red)); }
.nav-item.is-active {
  color: #fffaf7;
  background: rgba(200, 60, 45, 0.78);
  box-shadow: 0 3px 12px rgba(200, 60, 45, 0.32);
}

.motion-feed .icon-btn:hover,
.motion-feed .icon-btn:active { background: rgba(200, 60, 45, 0.64); }
.motion-headline strong { color: #fff8f5; }
.motion-headline span,
.motion-metric span { color: rgba(255, 240, 235, 0.62); }

.motion-loader-orbit { border-color: rgba(224, 90, 71, 0.25); border-top-color: rgb(var(--brand-red)); }
.motion-loader-orbit i { background: #f2a091; box-shadow: 0 0 8px rgba(224, 90, 71, 0.9); }
.motion-loader-track span { background: linear-gradient(90deg, #b92f25, #f0a092); box-shadow: 0 0 10px rgba(200, 60, 45, 0.7); }
.motion-start-btn { background: rgb(var(--brand-red)); color: #fffaf7; box-shadow: 0 8px 22px rgba(200, 60, 45, 0.34); }

.motion-metric strong { color: #fffaf7; }
.motion-feed .hl-ok { color: #f2a091; }
.motion-feed .hl-warn { color: #fff0eb; }
.motion-feed .hl-bad { color: #e86150; }

.cycle-chart-wrap { background: rgba(23, 18, 19, 0.74); border-color: rgba(224, 90, 71, 0.22); }
.cycle-legend-left { background: rgba(245, 224, 218, 0.92); }
.cycle-legend-right { background: rgba(210, 70, 52, 0.95); }
.cycle-legend-label { color: rgba(255, 240, 235, 0.58); }

.badge-excellent,
.badge-good { background: rgba(200, 60, 45, 0.20); color: #f3a294; border-color: rgba(226, 91, 72, 0.42); }
.badge-ok { background: rgba(255, 250, 247, 0.12); color: #fff0eb; border-color: rgba(255, 240, 235, 0.30); }
.badge-poor { background: rgba(155, 34, 29, 0.30); color: #ff9183; border-color: rgba(232, 91, 72, 0.34); }

.session-summary-card,
.history-panel-sheet,
.motion-toast { background: rgba(15, 16, 19, 0.96); }
.session-summary-card { border-color: rgba(226, 91, 72, 0.30); box-shadow: 0 28px 72px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(200, 60, 45, 0.06); }
.summary-metric-row,
.history-card { background: rgba(255, 248, 245, 0.05); border-color: rgba(255, 240, 235, 0.10); }
.summary-metric-value.hl-ok { color: #f3a294; }
.summary-metric-value.hl-warn { color: #fff0eb; }
.summary-metric-value.hl-bad { color: #e86150; }
.session-btn-primary { background: rgb(var(--brand-red)); box-shadow: 0 4px 16px rgba(200, 60, 45, 0.38); }
.session-btn-primary:hover,
.session-btn-primary:active { background: #e05a47; }
.history-panel-header { border-bottom-color: rgba(226, 91, 72, 0.18); }
.motion-toast { border-color: rgba(226, 91, 72, 0.28); }
