:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
/* Searchable business selects retain their native form control and validation. */
.select-search {
  position: fixed; z-index: 1200; display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 36px #0005;
  box-sizing: border-box; text-align: left;
}
.select-search input {
  flex: none; width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 16px;
}
.select-search-options { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.select-search [role=option] { padding: 10px; min-height: 44px; box-sizing: border-box; cursor: pointer; overflow-wrap: anywhere; border-radius: 7px; }
.select-search [role=option].active { background: var(--soft); outline: 1px solid var(--accent); outline-offset: -1px; }
.select-search [aria-selected=true] { color: var(--accent); font-weight: 600; }
.select-search > small { flex: none; color: var(--muted); }
button.kpi[data-action=performance-trace] { width: 100%; text-align: left; color: var(--ink); }
button.kpi[data-action=performance-trace]:hover { border-color: var(--accent); }
#modal:has([data-paged-list=performanceTrace]) { width: min(1180px, calc(100% - 24px)); }
[data-paged-list=performanceTrace] :is(td, .m-item) small { display: block; color: var(--muted); margin-top: 3px; }
.trace-steps { min-width: 0; text-align: left; white-space: normal; }
.trace-steps summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); }
.trace-steps summary::before { content: '▸'; margin-right: 6px; }
.trace-steps[open] summary::before { content: '▾'; }
.trace-steps ol { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line-2); }
.trace-steps li { display: grid; gap: 4px; padding: 8px 0 12px 10px; overflow-wrap: anywhere; }
.trace-steps li :is(b, span, time) { min-width: 0; white-space: normal; }
.trace-steps time { font-size: 12px; color: var(--muted); }
@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  [data-paged-list=performanceTrace] .m-item dl > div:has(.trace-steps) { display: block; grid-column: 1 / -1; }
  [data-paged-list=performanceTrace] .m-item dd:has(.trace-steps) { margin: 6px 0 0; width: 100%; text-align: left; }
  [data-paged-list=performanceTrace] .m-item { overflow-wrap: anywhere; }
  [data-paged-list=performanceTrace] [data-list-summary] > .row { flex-wrap: wrap; }
  [data-paged-list=performanceTrace] [data-list-summary] .tag { white-space: normal; }
}
/* The native container already positions the WebView inside all four safe edges. */
:root[data-native-safe-area] {
  --safe-top: 0px;
  --safe-right: 0px;
  --safe-bottom: 0px;
  --safe-left: 0px;
}

.business-form {
  display: grid;
  gap: 14px;
}
.error:empty {
  display: none;
}
.error {
  color: var(--neg);
}
.empty-state {
  color: var(--muted);
  padding: 22px 12px;
  text-align: center;
  font-size: 13px;
}
.app-stack {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}
.page-body .toolbar {
  flex-wrap: wrap;
}
.page-body .toolbar > label.field {
  display: block;
  margin-bottom: 0;
}
.page-body .toolbar input,
.page-body .toolbar select {
  max-width: 100%;
}
.toolbar input[type='month'] {
  width: auto;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
}
.field input[type='checkbox'] {
  width: auto;
}
.field textarea {
  min-height: 72px;
}
.page-body .card form {
  margin-top: 8px;
}
.field input[type='file'] {
  height: auto;
}
.signin-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.signin-user .avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}
.signin-identity { display: grid; gap: 1px; text-align: left; min-width: 0; }
.signin-role { font-size: 11px; color: var(--muted); }
.signin-name, .signin-role {
  max-width: 10em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-identity { display: none; }
.identity-details { flex-basis: 100%; min-width: 0; overflow-wrap: anywhere; }
.personal-hero .grow { min-width: 0; }
.personal-hero h2 { overflow-wrap: anywhere; }
.identity-reminder { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; }
.identity-reminder > span { flex: 1; min-width: min(240px, 100%); }
.identity-reminder > button { flex: none; }
.notice-shortcut {
  position: relative;
  min-width: 36px;
  flex-shrink: 0;
}
.notice-shortcut > span {
  position: absolute;
  top: -3px;
  right: -5px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--bg);
  font-size: 10px;
  line-height: 15px;
  font-variant-numeric: tabular-nums;
}
.header-approval {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
.approval-icon { position: relative; display: inline-flex; }
.approval-badge {
  position: absolute;
  top: -4px;
  left: 65%;
  min-width: 15px;
  padding: 0 3px;
  border-radius: 9px;
  background: #b62336;
  color: #fff;
  font: 650 10px/15px system-ui, sans-serif;
  text-align: center;
}
.approval-badge[hidden] { display: none; }
.header-approval .approval-icon { gap: 3px; align-items: center; }
.header-approval .approval-badge { position: static; }
.notice-tools, .notice-item { display: flex; align-items: center; gap: 10px; }
.notice-tools { flex-wrap: wrap; color: var(--muted); }
.notice-item {
  width: 100%;
  min-height: 52px;
  justify-content: space-between;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  text-align: left;
}
.notice-copy { display: grid; min-width: 0; gap: 4px; }
.notice-copy b { color: var(--ink); overflow-wrap: anywhere; }
.notice-copy > span { overflow: hidden; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.notice-meta { display: grid; flex-shrink: 0; gap: 4px; text-align: right; color: var(--muted); font-size: 12px; }
.notice-item[data-seen='0'] .notice-meta > span { color: var(--accent); font-weight: 600; }
.notice-detail { white-space: pre-wrap; overflow-wrap: anywhere; }
.field[hidden],
.nav-group[hidden],
.nav-item[hidden] {
  display: none;
}
.action-set {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
dialog .form-grid {
  margin-bottom: 10px;
}
.proof-img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  margin: auto;
}
.form-note {
  font-size: 12px;
  color: var(--muted);
}
.permission-tree {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 12px;
}
.permission-tree fieldset {
  min-width: 0;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.permission-tree legend { padding: 0 4px; font-weight: 600; }
.permission-rule { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.permission-rule label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  cursor: pointer;
}
.permission-rule input { flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.permission-rule .link { flex: none; }
@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  .permission-rule label, .permission-rule .link { min-height: 44px; }
}
.nav-scroll {
  overflow: auto;
}
.field select option {
  background: var(--surface);
  color: var(--ink);
}
.tabbar.fixed {
  padding-bottom: max(7px, var(--safe-bottom));
}
.tabbar[hidden] { display: none; }
.row .grow {
  min-width: 0;
}
.workbench-hero .tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
/* Keep absolutely positioned accessibility labels inside the table scroller. */
.table-wrap { position: relative; }
.quick button {
  min-height: 42px;
}
#modal:has(.hall-destinations) { width: min(380px, calc(100% - 24px)); }
.hall-destinations .quick { display: flex; gap: 10px; }
.hall-destinations .quick button { flex: 1; flex-direction: column; min-height: 80px; }
.mobile-safe {
  padding-top: var(--safe-top);
}
.shop-grid .item-art .cr-thumb {
  transform: scale(1.35);
}
.page-body .card .row:first-child {
  margin-top: 0;
}
.row small,
.field span {
  overflow-wrap: anywhere;
}
.chips {
  flex-wrap: wrap;
}
.shell .main-shell {
  min-width: 0;
  --desktop-gutter: 30px;
  --desktop-bottom: 10px;
}
@media (max-width: 1100px) {
  .shell .main-shell { --desktop-gutter: 22px; --desktop-bottom: 8px; }
}
/* The sidebar owns the outer left edge; the header and content share the right edge. */
.sidebar {
  padding-top: max(22px, var(--safe-top));
  padding-left: max(14px, var(--safe-left));
  padding-bottom: max(16px, var(--safe-bottom));
}
.topbar {
  min-height: 54px;
  padding-block: calc(3px + var(--safe-top)) 3px;
  padding-right: max(var(--desktop-gutter), var(--safe-right));
}
.content-wrap {
  padding-top: 12px;
  padding-right: max(var(--desktop-gutter), var(--safe-right));
  padding-bottom: max(var(--desktop-bottom), var(--safe-bottom));
}
.topbar .page-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1;
  min-width: 0;
  gap: 0;
  align-items: center;
  margin: 0;
}
.page-heading h1, .page-heading [data-network-caption] { grid-area: 1 / 1; }
.page-heading h1 { margin: 0; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.topbar .heading-date { flex: none; }
.entry-banner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(ellipse at center, rgba(217, 178, 108, 0.16), transparent 70%);
  animation: entry-show 0.8s ease-out both;
}
.entry-banner small,
.entry-banner b,
.entry-banner span {
  display: block;
}
.entry-banner small,
.entry-banner div > span {
  color: #c9bca4;
  font-size: 12px;
}
.entry-banner b {
  color: #ffe2a3;
  font-size: 21px;
  margin: 4px 0;
}
.entry-banner .avatar {
  display: grid;
}
.entry-banner .cr-thumb {
  width: 120px;
  height: 100px;
}
@keyframes entry-show {
  from {
    opacity: 0;
    transform: translateX(25%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .entry-banner {
    animation: none;
  }
}
.theme-option {
  display: grid;
  text-align: left;
  gap: 9px;
  padding: 18px;
  min-height: 110px;
}
.theme-option.selected {
  border-color: var(--accent);
}
.theme-option .swatches {
  display: flex;
  gap: 5px;
}
.theme-option .swatches i {
  width: 26px;
  height: 12px;
  border-radius: 6px;
}
.theme-option small {
  color: var(--muted);
}
.doc-preview {
  width: 100%;
  height: 58vh;
}
.gift-art {
  width: 56px;
  height: 56px;
  color: var(--accent);
}
[data-person] .field {
  width: min(26%, 120px);
}
.page-body .m-list .m-item {
  overflow-wrap: anywhere;
}

.native-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}
.native-setting {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  padding: 14px 0;
}
.business-form .dialog-actions {
  margin-top: 4px;
}

/* 业绩上报：同一套字段适配工作台和补报弹窗。 */
.page-body .report-entry form { margin: 0; }
.business-form[data-form='report'] {
  container: report-form / inline-size;
  gap: 12px;
}
.report-jumps { display: none; }
.report-proof { min-width: 0; }
.report-proof [data-file-preview]:empty { display: none; }
.report-proof [data-file-preview] img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.report-proof [data-action='report-remove-file'] { margin-top: 4px; }
.report-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.report-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  line-height: 1.4;
  margin-bottom: 9px;
}
.report-title::before {
  content: '';
  width: 4px;
  height: 15px;
  border-radius: 4px;
  background: var(--grad);
}
.report-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.report-fields, .report-totals, .report-attachments, .report-reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
[data-live-account-fields]:not(:empty) { margin: 8px 0; }
.report-totals { grid-template-columns: repeat(auto-fit, minmax(min(88px, 100%), 1fr)); }
.report-reasons { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
[data-form='report'] .field { min-width: 0; margin: 0; }
[data-form='report'] .field > span { margin-bottom: 3px; }
.report-timing, .report-day-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.report-timing {
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}
.report-timing + .report-title {
  border-top: 1px solid var(--line);
  padding-top: 11px;
  margin-top: 12px;
}
.report-day-actions button[aria-pressed='true'] {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  color: var(--accent);
  background: var(--soft);
}
.report-anchors .anchor-rows {
  --anchor-columns: minmax(0, 1.25fr) 78px repeat(2, minmax(0, 1fr));
  margin: 0;
}
.report-anchors .anchor-rows:has(.anchor-head [hidden]) {
  --anchor-columns: minmax(0, 1.25fr) 78px minmax(0, 1fr);
}
.report-anchors .anchor-head, .report-anchors .anchor-row {
  display: grid;
  grid-template-columns: var(--anchor-columns);
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
}
.report-anchors .anchor-head span:nth-child(2) { text-align: left; }
.report-anchors .anchor-row .who { display: block; line-height: 1.35; overflow-wrap: anywhere; }
.report-anchors .anchor-row select {
  width: 100%;
  min-width: 0;
  padding: 5px 4px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface-2);
  font-size: 13px;
}
.report-anchors .rp-sum { margin: 8px 0 0; gap: 6px; }
.report-anchors .rp-sum div { padding: 5px 8px; overflow-wrap: anywhere; }
.report-anchors .rp-sum span { display: inline-block; margin-right: 6px; }
.report-anchors .rp-sum b { font-size: 16px; }
.report-attachments { border-top: 1px solid var(--line); padding-top: 10px; }
.report-attachments .field > .report-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 5px 10px;
  margin: 0;
  border: 1px dashed var(--line-2);
  border-radius: 9px;
  background: var(--surface-2);
}
.report-upload b { flex: none; color: var(--ink); font-weight: 600; }
.report-upload small {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 400;
}
.report-upload input[type='file'] {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.report-upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-form='report'] .field textarea { height: 40px; min-height: 40px; line-height: 1.45; }
.business-form .report-actions { align-items: center; margin: 0; padding-top: 10px; }
.report-actions .form-note { flex: 1 1 160px; font-size: 13px; }
.report-actions .form-note:empty, [data-form='report'] [hidden] { display: none; }
@container report-form (min-width: 680px) {
  .report-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 22px; }
  .report-anchors { border-left: 1px solid var(--line); padding-left: 20px; }
}
@container report-form (min-width: 680px) and (max-width: 840px) {
  .report-fields .field:has(input[type='datetime-local']) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }
}
@media (min-width: 901px) and (min-height: 541px), (min-width: 901px) and (pointer: fine) {
  .report-entry { padding: 16px 20px; }
  #modal:has([data-form='report']) { width: min(1100px, 94vw); }
  [data-form='report'] .field :is(input, select, textarea, .locked) {
    min-height: 36px;
    padding: 6px 10px;
  }
  [data-form='report'] .field select { padding-right: 30px; }
  .report-day-actions button { min-height: 28px; padding: 4px 9px; }
  .report-anchors .anchor-row :is(input, select) {
    min-height: 32px;
    padding-block: 4px;
    border-radius: 7px;
  }
}
@media (min-width: 901px) and (min-height: 541px) and (max-height: 700px),
       (min-width: 901px) and (pointer: fine) and (max-height: 700px) {
  .main-shell:has(.report-entry) .topbar { min-height: 52px; }
  .content-wrap:has(.report-entry) { padding-top: 6px; }
  .report-entry { padding-block: 12px; }
  .report-attachments .field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }
}
@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  .report-entry { padding: 14px; }
  .report-jumps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding-bottom: 4px;
  }
  .report-jumps button {
    min-height: 44px;
    padding: 3px;
    background: var(--surface-2);
    font-size: 13px;
  }
  [data-form='report'] :is(input, select, textarea, .locked),
  .report-attachments .field > .report-upload,
  .report-actions button, .report-day-actions button,
  .report-proof [data-action='report-remove-file'] { min-height: 44px; }
  .report-anchors .anchor-row select {
    min-height: 44px;
    padding: 6px 25px 6px 9px;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-repeat: no-repeat;
    background-size: 5px 5px;
    background-position: calc(100% - 13px) center, calc(100% - 8px) center;
  }
  .report-anchors .anchor-row input { min-height: 44px; }
  .report-actions { justify-content: stretch; }
  .report-actions .primary { flex: 1 1 100%; }
  [data-form='report'] .field textarea { min-height: 52px; }
  [data-report-section] { scroll-margin-top: calc(var(--mobile-header) + 8px); }
  .dialog-body [data-report-section] { scroll-margin-top: 4px; }
}
@media (max-width: 900px) and (min-height: 540px) {
  .report-jumps {
    position: sticky;
    z-index: 2;
    top: var(--mobile-header);
  }
  .dialog-body .report-jumps { top: 0; }
  [data-form='report'] :is([data-report-section], .field, input, select, textarea) {
    scroll-margin-top: calc(var(--mobile-header) + 56px);
  }
  .dialog-body [data-form='report'] :is([data-report-section], .field, input, select, textarea) {
    scroll-margin-top: 54px;
  }
}
@media (max-width: 520px) {
  .report-attachments, .report-reasons { grid-template-columns: minmax(0, 1fr); }
  .report-fields .field:nth-child(n+3) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 5.5em minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }
  .report-fields .field > span { margin: 0; }
  .report-anchors .anchor-head { display: none; }
  .report-anchors .anchor-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    padding: 10px 12px;
  }
  .report-anchors .anchor-row .who { grid-column: auto; }
  .report-anchors .anchor-row select { justify-self: end; width: auto; }
  .report-anchors .anchor-row[data-played='0'] .ain { display: none; }
  .report-anchors .anchor-row .ain > span {
    display: block;
    color: var(--muted);
    font-size: 12px;
  }
  .report-actions .form-note { flex-basis: 100%; }
}
@media (max-width: 360px) {
  .report-fields .field:nth-child(n+3) { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

.locked {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  opacity: 0.8;
}
.fx-stage .entry-banner .avatar {
  display: grid;
}

.export-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
}
.export-link svg {
  width: 16px;
  height: 16px;
}
.export-link:hover {
  border-color: var(--accent);
}
.business-form[aria-busy='true'] button.primary {
  opacity: 0.7;
  cursor: progress;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.pdf-tools {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px;
  background: var(--card);
}
.doc-surface canvas {
  display: block;
  width: 100%;
  height: auto;
  background: white;
}
.anchor-ranking-page { max-width: 56rem; margin-inline: auto; }
.ranking-filters, .ranking-date { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.ranking-date { gap: 6px; font-size: 13px; }
.ranking-date input { min-height: 44px; max-width: 100%; font-size: 16px; }
.ranking-periods button { min-height: 44px; padding-inline: 16px; }
.ranking-caption { margin: 14px 0 4px; font-size: 13px; color: var(--muted); }
.anchor-ranking-list { list-style: none; margin: 0; padding: 0; }
.anchor-ranking-list .rank-person { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.hall-entry {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
}
.hall-entry[data-entry='x-flow']::after,
.hall-entry[data-entry='x-fire']::after {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, #ffe5a72e 52%, transparent 68%);
  animation: entry-light 2.4s ease-out 1;
}
.hall-entry[data-entry='x-fire']::after {
  background:
    radial-gradient(ellipse at 12% 25%, #ff9a41a3, transparent 18%),
    radial-gradient(ellipse at 90% 36%, #ffc85a88, transparent 21%);
  animation: entry-burst 1.8s ease-out 1;
}
.hall-entry[data-mount='m-tiger'] .entry-banner,
.hall-entry[data-mount='m-dragon'] .entry-banner {
  border: 1px solid var(--accent);
  box-shadow: inset 0 0 20px #a6d6ff43;
}
[data-frame='f-star'] .avatar {
  outline: 2px dotted #f5b74b;
  outline-offset: 2px;
}
[data-frame='f-gold'] .avatar {
  box-shadow:
    0 0 0 2px #a0782b,
    0 0 0 4px #fada8c;
}
@keyframes entry-light {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(110%);
  }
}
@keyframes entry-burst {
  0%,
  100% {
    opacity: 0.1;
  }
  45% {
    opacity: 1;
  }
}
[data-motion='reduce'] .hall-entry::after {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .hall-entry::after {
    animation: none;
  }
}
@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  .tabbar button,
  .mobile-menu,
  .drawer-close,
  .business-form .primary,
  .pdf-tools button {
    min-height: 44px;
  }
  .business-form input:not([type='checkbox']),
  .business-form select,
  .business-form textarea {
    font-size: 16px;
  }
  .dialog-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--card);
  }
  .dialog-body .dialog-actions {
    flex-wrap: wrap;
  }
  .dialog-body .dialog-actions button.primary {
    min-height: 44px;
  }
}

@media (min-width: 355px) and (max-width: 520px) {
  .goal-card .gc-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }
  .goal-card .gc-reward {
    min-width: 0;
    margin: 0;
    text-align: right;
  }
  .goal-card .gc-reward b {
    font-size: 21px;
  }
  .goal-card .gc-reward span {
    font-size: 11px;
  }
  .goal-card .gc-sub {
    line-height: 1.5;
  }
}

dialog:not([open]){display:none}
.legacy-dialog[open]{position:fixed;inset:0;z-index:1000;margin:auto;max-height:90vh;overflow:auto;box-shadow:0 0 0 100vmax #0009}
#app[aria-hidden="true"]{pointer-events:none}

.dossier-section { margin: .75rem 0; border-top: 1px solid var(--line); }
.dossier-section > summary { padding: .65rem 0; font-weight: 600; cursor: pointer; }
.dossier-section .field { min-width: 0; }

.org-layout .card-head {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}
.org-layout .org-tree {
  margin-top: 12px;
  max-height: 65vh;
  overflow: auto;
}
.org-layout .org-node {
  width: calc(100% - var(--org-depth) * 12px);
  margin-left: calc(var(--org-depth) * 12px);
  min-height: 44px;
}
.org-layout .org-node .grow {
  min-width: 0;
  overflow-wrap: anywhere;
}
.org-layout .org-node .grow small {
  display: block;
  margin-left: 0;
}
.org-layout [data-org-detail] {
  min-width: 0;
  scroll-margin-top: 70px;
}
.org-layout .detail-list li > span:last-child {
  flex: 1;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.org-layout .team-role > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  .org-layout .org-tree { max-height: 45vh; }
  .org-layout .small { min-height: 44px; }
}
.superadmin-layout .quick {
  grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
}
.org-layout .team-role small.muted,
.org-layout .team-role .small {
  display: block;
  margin-top: 4px;
}
.term-history {
  max-height: 16rem;
  overflow: auto;
}
.term-history summary {
  cursor: pointer;
  padding: 10px 0;
}

/* The page stays interactive while background reads are in flight. */
#network-status {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  z-index: 1100;
  overflow: hidden;
  pointer-events: none;
  background: var(--soft-2);
}
#network-status::before {
  content: '';
  display: block;
  width: 38%;
  height: 100%;
  background: var(--accent);
  animation: network-travel 1.2s ease-in-out infinite;
}
@keyframes network-travel {
  from { transform: translateX(-100%); }
  to { transform: translateX(265%); }
}
#network-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[data-network-caption] { display: none; }
[data-network-visible] [data-network-caption] {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
[data-network-visible] .page-heading h1 { opacity: 0; }
.business-form .is-loading::before {
  content: '';
  display: inline-block;
  width: .9em;
  height: .9em;
  margin-right: .45em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -.1em;
  animation: load-turn .8s linear infinite;
}
#workspace-error {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
}
#workspace-error[hidden] { display: none; }
[data-motion=reduce] #network-status::before,
[data-motion=reduce] .business-form .is-loading::before,
[data-motion=reduce] .loading-spinner { animation: none; }
@media (prefers-reduced-motion: reduce) {
  #network-status::before, .business-form .is-loading::before, .loading-spinner { animation: none; }
}
@media print {
  .main-shell .topbar { display: flex !important; position: static; background: none; }
  .topbar .mobile-menu, .topbar .top-actions, #network-status, [data-network-caption], #workspace-error { display: none !important; }
  [data-network-visible] .page-heading h1 { opacity: 1; }
}

.profile-image { object-fit: cover; }

#modal:has([data-graph-canvas]) { width:min(1180px,94vw); max-width:94vw; }
.graph-layout { display:grid; grid-template-columns:minmax(0, 2fr) minmax(250px, 1fr); gap:16px; }
[data-graph-canvas] { position:relative; height:min(520px, 58vh); min-height:320px; border-radius:10px; overflow:hidden; background:#f6f8fb; }
[data-graph-properties] { max-height:min(520px, 58vh); overflow:auto; }
[data-graph-properties] fieldset { margin:0; border:1px solid var(--line); padding:12px; border-radius:10px; }
[data-graph-properties] label { min-width:0; }


.worn-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  position: relative;
  vertical-align: middle;
}
.worn-avatar.custom-frame > .avatar {
  outline: 2px double var(--accent);
  outline-offset: 1px;
}
.worn-frame-art {
  position: absolute;
  inset: -7%;
  width: 114%;
  height: 114%;
  max-width: none;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle closest-side, transparent 70%, black 76%);
  mask-image: radial-gradient(circle closest-side, transparent 70%, black 76%);
}

.list-dates, [data-list-controls] { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin:10px 0; }
.list-dates .field { margin:0; min-width:0; width:auto; }
.list-dates input,.list-dates select { max-width:100%; }
.range-caption,[data-list-controls] span { color:var(--muted); font-size:.86rem; }
.list-dates .error:empty { display:none; }
[data-list-controls] { align-items:center; justify-content:flex-end; }
[data-list-page] { width:5em; }
@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  .list-dates { align-items:center; }
  .list-dates .field { flex:1 1 125px; }
  .list-dates .range-caption { flex-basis:100%; }
  [data-list-controls] { justify-content:center; }
  [data-list-controls] button,.list-dates input,.list-dates select,.list-dates button { min-height:44px; }
}

[data-paged-list="boardProgress"]:has([data-inactive-progress]) { display:none; }

/* Business pages share this layout in the mobile browser and both app WebViews. */
@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  :root {
    --page-gutter: clamp(10px, 2.6vw, 18px);
    --section-gap: clamp(10px, 1.6vw, 14px);
    --card-padding: clamp(11px, 2.8vw, 16px);
    --mobile-header: calc(49px + var(--safe-top));
    --mobile-footer: calc(48px + max(3px, var(--safe-bottom)));
  }
  .topbar, .content-wrap, .tabbar.fixed {
    padding-left: max(var(--page-gutter), var(--safe-left));
    padding-right: max(var(--page-gutter), var(--safe-right));
  }
  .topbar {
    gap: 4px;
    padding-block: calc(2px + var(--safe-top)) 2px;
    min-height: var(--mobile-header);
  }
  .top-actions { gap: 4px; min-width: 0; }
  .topbar .heading-date, .topbar .header-approval { display: none; }
  .page-heading h1 { font-size: clamp(16px, 4.4vw, 20px); line-height: 1.15; letter-spacing: 0; }
  .topbar .icon-btn { width: 44px; height: 44px; }
  .signin-user { min-height: 44px; gap: 5px; padding: 2px 6px; font-size: 12px; }
  .sidebar {
    padding-top: max(12px, var(--safe-top));
    padding-bottom: max(10px, var(--safe-bottom));
    padding-left: max(12px, var(--safe-left));
  }
  .drawer-close { top: max(12px, var(--safe-top)); }
  .content-wrap {
    padding-top: 6px;
    padding-bottom: calc(var(--mobile-footer) + var(--section-gap));
  }
  .tabbar.fixed { padding-block: 3px max(3px, var(--safe-bottom)); }
  .tabbar button { flex: 1; min-width: 0; align-content: center; gap: 1px; padding: 2px; }
  #toast { bottom: calc(var(--mobile-footer) + 8px); }

  .card, .panel { padding: var(--card-padding); }
  .card-head { gap: 6px 8px; margin-bottom: 8px; }
  .grid, .app-stack, .theme-grid { gap: var(--section-gap); }
  .grid > *, .field { min-width: 0; }
  .mb, .toolbar, .kpis, .role-hero, .goal-card, .pts-card, .hall-hero { margin-bottom: var(--section-gap); }
  .grid > .mb, .grid > div > .mb:last-child, .app-stack > .mb, .page-body > .mb:last-child { margin-bottom: 0; }
  .empty-state { padding: 12px 8px; }
  .row { gap: 8px; padding-block: 7px; }
  .row .row-icon { width: 32px; height: 32px; }
  .detail-list li { padding-block: 7px; }
  .notice-item { padding-block: 6px; }
  .toolbar { gap: 6px; }
  .toolbar:empty, [data-list-controls]:empty { display: none; }
  .chips {
    max-width: 100%;
    margin: 0;
    padding: 2px 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
  }
  .chips .chip { min-height: 44px; padding: 5px 11px; }
  .chips .chip:focus-visible { outline-offset: -2px; }
  .list-dates input[type='date'], .field input[type='date'], .field input[type='datetime-local'] {
    -webkit-appearance: none;
    appearance: none;
    min-inline-size: 0;
    max-inline-size: 100%;
    inline-size: 100%;
    box-sizing: border-box;
  }
  .list-dates input::-webkit-date-and-time-value,
  .field input::-webkit-date-and-time-value { min-width: 0; text-align: left; }
  .list-dates, [data-list-controls] { gap: 4px 8px; margin-block: 8px; }
  .list-dates .field > span { margin-bottom: 3px; }

  .role-hero, .goal-card, .pts-card, .hall-hero { padding: var(--card-padding); }
  .goal-card .gc-top { gap: 8px; }
  .goal-card .gc-big { margin-top: 2px; font-size: clamp(26px, 6vw, 32px); overflow-wrap: anywhere; }
  .goal-card .gc-reward { min-width: 0; }
  .goal-card .gc-reward b { font-size: 21px; overflow-wrap: anywhere; }
  .goal-card .gc-tip { padding: 6px 8px; margin-top: 6px; margin-bottom: 0; }
  .goal-card .tier-track {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 8px;
    margin: 6px 2px;
    padding: 6px 0 0;
  }
  .goal-card .tt-bar { width: 100%; height: 6px; }
  .goal-card .tier-track .tt-mark { position: static; transform: none; width: auto; max-width: 100%; align-items: start; }
  .goal-card .tt-mark::before { position: absolute; left: var(--threshold-position); top: 4px; height: 10px; }
  .goal-card .tt-mark :is(b, small) { margin: 0; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
  .role-hero { gap: 10px; }
  .role-hero h2 { font-size: 20px; margin: 0; }
  .role-hero .avatar.lg { width: 42px; height: 42px; }
  .workbench-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0 8px;
  }
  .workbench-hero > :first-child { grid-area: 1 / 1 / 3 / 2; }
  .workbench-hero .grow { display: contents; }
  .workbench-hero .grow .eyebrow { grid-area: 1 / 2; align-self: end; }
  .workbench-hero .grow h2 { grid-area: 2 / 2; align-self: start; overflow-wrap: anywhere; }
  .workbench-hero > button { grid-area: 1 / 3 / 3 / 4; width: auto; min-height: 44px; padding: 5px 8px; }
  .workbench-hero .grow p { grid-area: 3 / 1 / 4 / -1; gap: 4px 6px; margin-top: 6px; }
  .role-hero p, .kpi-foot { line-height: 1.4; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 7px; }
  :is([data-paged-list='signoff-list'], [data-paged-list='verification-verify-reports']) .kpis {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  }
  .kpi { padding: 9px 10px; }
  .kpi-value, .kpi.featured .kpi-value {
    margin: 4px 0 2px;
    font-size: clamp(21px, 5.6vw, 27px);
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .kpi-label .icon { width: 23px; height: 23px; padding: 5px; }
  .quick, .superadmin-layout .quick {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
    gap: 6px;
  }
  .quick button { flex-direction: row; align-items: center; gap: 6px; padding: 6px; min-height: 44px; }
  .quick button .icon { width: 26px; height: 26px; padding: 5px; }

  .business-form { gap: 9px; }
  .business-form .field, .form-grid .field { margin: 0; }
  .business-form .field > span { margin-bottom: 3px; }
  .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); gap: 8px; }
  .form-grid > .field:has(textarea, input[type='file'], input[type='datetime-local']) { grid-column: 1 / -1; }
  dialog .form-grid { margin: 0; }
  .business-form :is(.field input:not([type='checkbox']), .field select) { min-height: 44px; }
  .business-form .dialog-actions { gap: 6px; margin-top: 0; padding-top: 8px; }
  .report-columns { gap: 12px; }
  [data-list-summary] > .grid:last-child { margin-bottom: var(--section-gap); }
  dialog[open] {
    display: flex;
    flex-direction: column;
    inset: max(8px, var(--safe-top)) max(8px, var(--safe-right))
      max(8px, var(--safe-bottom)) max(8px, var(--safe-left));
    margin: auto;
    width: min(46rem, calc(100% - max(8px, var(--safe-left)) - max(8px, var(--safe-right))));
    max-height: calc(100dvh - max(8px, var(--safe-top)) - max(8px, var(--safe-bottom)));
  }
  .dialog-head { flex: none; padding: 3px var(--card-padding); }
  .dialog-head button { min-height: 44px; }
  .dialog-body { min-height: 0; max-height: none; padding: var(--card-padding); }

  .business-records { container: records / inline-size; }
  .m-item { padding-block: 9px; }
  .m-item .between { gap: 6px; flex-wrap: wrap; }
  .m-item dl {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
    align-items: start;
    gap: 3px 10px;
    margin: 5px 0 0;
    line-height: 1.45;
  }
  .m-item dl > div, .m-item dd:has(button) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
  .m-item :is(h3, dd) { max-width: 100%; overflow-wrap: anywhere; }
  .m-item button { width: auto; min-height: 44px; padding-inline: 8px; }
  @container records (max-width: 660px) {
    .table-wrap.d-only { display: none; }
    .m-list { display: block; }
  }

  .hall-hero { gap: 8px; }
  .hh-stats { margin-top: 6px; }
  .hall-hero .fx-stage:not(.fx-static) { height: clamp(100px, 22vw, 132px); }
  .pts-card { gap: 10px; }
  .plv-track { grid-template-columns: repeat(auto-fit, minmax(min(100%, 3rem), 1fr)); margin-bottom: 0; gap: 4px; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.6rem), 1fr)); gap: 8px; }
  .item-art { height: 86px; }
  .shop-grid .item-art .cr-thumb { height: 80px; max-width: 100%; transform: none; }
  .item-art > img { height: 100%; width: 100%; object-fit: contain; }
  .item-body { padding: 8px; }
  .item-body > small { min-height: 0; }
  .item-foot { flex-wrap: wrap; gap: 4px; }
  .theme-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
  .theme-card { flex-direction: row; align-items: stretch; }
  .theme-card .tp { flex: 0 0 24%; height: auto; padding: 8px 4px 8px 0; gap: 4px; }
  .tp-side { width: 20%; padding: 8px 3px; gap: 4px; }
  .tp-main { gap: 4px; }
  .tp-cards { gap: 2px; }
  .tp-cards i { height: 18px; }
  .tp-chart { height: 26px; }
  .theme-body { flex: 1; min-width: 0; padding: 10px; }
  .theme-body h3 { font-size: 17px; margin: 0; }
  .theme-body p { min-height: 0; margin-block: 4px; }
  .theme-body .swatches { gap: 2px; margin: 0; }
  .theme-body .swatches i { width: 10px; height: 10px; }

  @container page (min-width: 42rem) {
    .g-main:not(.superadmin-layout), .g-main-r, .g-2, .hall-hero, .pts-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .superadmin-layout { grid-template-columns: minmax(0, 1fr); }
  }
  @supports not (container-type: inline-size) {
    .g-main, .g-main-r, .g-2 { grid-template-columns: minmax(0, 1fr); }
    .table-wrap.d-only { display: none; }
    .m-list { display: block; }
  }
}
@media (max-width: 520px) {
  /* Each active performer owns a name/status column and one column per visible score. */
  .report-anchors .anchor-row:not([data-played='0']) {
    grid-template-columns: minmax(5.25rem, 1fr);
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 2px 7px;
    padding: 6px 8px;
  }
  .report-anchors .anchor-row:not([data-played='0']) .who { grid-area: 1 / 1; }
  .report-anchors .anchor-row:not([data-played='0']) select { grid-area: 2 / 1; justify-self: start; }
  .report-anchors .anchor-row:not([data-played='0']) .ain { grid-row: 1 / span 2; }
}
@media (min-width: 740px) and (max-width: 900px) and (max-height: 540px),
       (min-width: 740px) and (pointer: coarse) and (max-height: 540px) {
  .workbench-overview {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
    gap: var(--section-gap);
    margin-bottom: var(--section-gap);
  }
  .workbench-overview > * { min-width: 0; margin-bottom: 0; }
  .workbench-hero .tag { white-space: normal; }
}
@media (max-width: 560px) {
  /* The bottom navigation already provides the personal page on small phones. */
  .topbar .signin-user, .unit-pick > span { display: none; }
  .mobile-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; width: 100%; min-height: 44px; margin-bottom: 6px; padding: 5px 8px; text-align: left; font-size: 12px; }
  .mobile-identity strong { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .mobile-identity span, .mobile-identity small { color: var(--muted); overflow-wrap: anywhere; }
  .topbar .top-actions { gap: 2px; }
  .unit-pick .segmented { padding: 0; gap: 0; border: 0; }
  .unit-pick .segmented button { min-width: 44px; min-height: 44px; padding: 0; }
}
@media (max-height: 480px) and (max-width: 900px), (pointer: coarse) and (max-height: 480px) {
  .topbar { position: static; }
  .tabbar button { display: flex; align-items: center; justify-content: center; gap: 5px; }
  .tabbar .approval-icon { gap: 3px; align-items: center; }
  .tabbar .approval-badge { position: static; }
}

/* 业务工作台登录页：舞台背景由 login-stage.js 绘制，桌面与移动客户端共用表单。 */
.login-stage {
  --panel-w: clamp(400px, 35vw, 540px);
  --stage-ink: #fff6e8;
  --stage-dim: rgba(255, 244, 226, .74);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: radial-gradient(120% 90% at 32% 78%, #241a30 0%, #0c0911 55%, #050407 100%);
  color: var(--stage-ink);
}
.login-stage[data-paused] { --studio-play-state: paused; }
.stage-canvas, .stage-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.stage-canvas canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
/* 舞者画布单独做景深模糊，灯光层保持清晰；支持画布滤镜时由脚本逐人模糊，这里只补一层柔焦 */
.stage-troupe { filter: blur(3.5px) saturate(1.2); }
.login-stage[data-depth] .stage-troupe { filter: blur(1.2px) saturate(1.12); }
/* 胶片颗粒让绘制的人物更接近摄像机画面 */
.stage-grain {
  position: absolute;
  inset: -50%;
  opacity: .1;
  mix-blend-mode: overlay;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stage-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5,4,8,.8) 0%, rgba(5,4,8,0) 24%, rgba(5,4,8,0) 68%, rgba(5,4,8,.78) 100%),
    linear-gradient(90deg, rgba(5,4,8,.7) 0%, rgba(5,4,8,.18) 34%, rgba(5,4,8,0) 52%),
    radial-gradient(150% 110% at 38% 58%, transparent 52%, rgba(3,2,5,.7) 100%);
}
.stage-haze {
  position: absolute;
  inset: -20% -12%;
  background:
    radial-gradient(38% 30% at 30% 66%, rgba(181,140,255,.12), transparent 70%),
    radial-gradient(34% 26% at 62% 58%, rgba(217,178,108,.09), transparent 70%);
}
.stage-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -140px;
  height: 140px;
  opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(255,240,214,.03) 80%, rgba(255,240,214,.12) 99%, transparent);
}

.login-scene {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  --scene-gutter: clamp(26px, 3.6vw, 64px);
  padding: max(clamp(16px, 2.4vh, 28px), var(--safe-top)) var(--scene-gutter)
    max(clamp(24px, 3.6vh, 44px), var(--safe-bottom)) max(var(--scene-gutter), var(--safe-left));
}
.login-scene-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.login-scene .brand { width: fit-content; padding: 0; }
.login-scene .brand-mark {
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #bd9a64, 0 0 28px -6px rgba(217,178,108,.65);
}
.login-scene .brand-name { color: #fff4dd; }
.login-scene .brand-en { color: #f4deb7; opacity: .8; }
.stage-status { display: flex; align-items: center; gap: 12px; }
.stage-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 11px 0 9px;
  border: 1px solid rgba(255,107,122,.42);
  border-radius: 999px;
  background: rgba(255,77,94,.14);
  color: #ffdfe2;
  font: 700 11px/1 var(--num);
  letter-spacing: .18em;
}
.stage-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4d5e;
  box-shadow: 0 0 10px #ff4d5e;
}
.stage-clock {
  min-width: 8ch;
  color: var(--stage-dim);
  font: 500 13px/1 var(--num);
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}
.stage-meter { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.stage-meter i {
  width: 3px;
  height: 100%;
  border-radius: 1px;
  background: linear-gradient(0deg, var(--accent), #b58cff);
  transform-origin: bottom;
  transform: scaleY(.45);
}
.stage-meter i:nth-child(2) { transform: scaleY(.85); }
.stage-meter i:nth-child(4) { transform: scaleY(.65); }
.login-motion-control {
  display: none;
  position: relative;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff8eb;
  background: transparent;
}
.login-motion-control::before, .login-motion-control::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.login-motion-control::before {
  inset: 4px;
  border: 1px solid rgba(255,248,235,.5);
  border-radius: inherit;
  background: rgba(26,20,32,.55);
}
.login-motion-control::after {
  width: 10px;
  height: 12px;
  border-inline: 3px solid currentColor;
}
.login-motion-control:hover:not(:disabled), .login-motion-control:focus-visible { color: #fff; }
.login-motion-control:focus-visible { outline-color: #fff8eb; }
.login-stage[data-paused] .login-motion-control::after {
  width: 0;
  height: 0;
  margin-left: 3px;
  border: solid transparent;
  border-width: 7px 0 7px 10px;
  border-left-color: currentColor;
}

.login-pitch { margin-top: clamp(16px, 3vh, 36px); max-width: 680px; }
.login-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-hi);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .34em;
}
.login-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.login-slogan {
  margin-top: 16px;
  color: #fff8ee;
  font: 700 clamp(42px, 4.6vw, 84px)/1.14 var(--serif);
  letter-spacing: .06em;
  text-shadow: 0 4px 36px rgba(0,0,0,.6);
}
.login-slogan span {
  display: block;
  background: linear-gradient(100deg, #fff1d2 0%, var(--accent-hi) 28%, var(--accent) 52%, #fff6e2 72%, var(--accent-hi) 100%) 0 0 / 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 4px 22px rgba(0,0,0,.45));
}
.login-lede {
  max-width: 31em;
  margin-top: 18px;
  color: var(--stage-dim);
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.75;
  text-shadow: 0 1px 12px rgba(0,0,0,.6);
}
/* 舞者站位区：login-stage.js 读取它的尺寸排布舞者，四角做取景框 */
.stage-frame {
  --corner: rgba(255,240,215,.42);
  position: relative;
  flex: 1 1 auto;
  min-height: 170px;
  margin: 20px 0 16px;
  pointer-events: none;
  background:
    linear-gradient(var(--corner), var(--corner)) left top / 22px 2px,
    linear-gradient(var(--corner), var(--corner)) left top / 2px 22px,
    linear-gradient(var(--corner), var(--corner)) right top / 22px 2px,
    linear-gradient(var(--corner), var(--corner)) right top / 2px 22px,
    linear-gradient(var(--corner), var(--corner)) left bottom / 22px 2px,
    linear-gradient(var(--corner), var(--corner)) left bottom / 2px 22px,
    linear-gradient(var(--corner), var(--corner)) right bottom / 22px 2px,
    linear-gradient(var(--corner), var(--corner)) right bottom / 2px 22px;
  background-repeat: no-repeat;
}
.stage-frame::before {
  content: 'CAM 01 · STAGE';
  position: absolute;
  left: 12px;
  top: 10px;
  color: rgba(255,240,215,.5);
  font: 600 10px/1 var(--num);
  letter-spacing: .22em;
}

.login-features { display: grid; gap: 14px; min-width: 0; }
.login-feature-detail {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-height: 1.7em;
  color: var(--stage-dim);
  font-size: 15px;
  text-shadow: 0 1px 10px rgba(0,0,0,.7);
}
.login-feature-detail b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-hi);
  font-weight: 650;
  letter-spacing: .08em;
}
.login-feature-detail b::before {
  content: 'NOW';
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255,77,94,.85);
  color: #fff;
  font: 700 10px/1 var(--num);
  letter-spacing: .16em;
}
.login-feature-track { min-width: 0; }
.login-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.login-feature-list[aria-hidden] { display: none; }
.login-feature-list li {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px 0 12px;
  overflow: hidden;
  border: 1px solid rgba(255,244,226,.14);
  border-radius: 999px;
  background: rgba(10,8,14,.55);
  color: rgba(255,244,226,.74);
  font-size: 14px;
  white-space: nowrap;
  transition: color .35s, border-color .35s, background-color .35s, box-shadow .35s;
}
.login-feature-list li .icon { width: 16px; height: 16px; color: var(--accent); }
.login-feature-list li b { font-weight: 550; }
.login-feature-list li.is-active {
  border-color: var(--accent);
  background: rgba(217,178,108,.16);
  background: color-mix(in srgb, var(--accent) 18%, rgba(10,8,14,.6));
  color: #fff8ee;
  box-shadow: 0 0 30px -8px var(--glow), inset 0 1px 0 rgba(255,255,255,.08);
}
.login-feature-list li.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--grad);
  transform-origin: left;
}

.login-panel {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: start center;
  min-width: 0;
  padding: max(clamp(24px, 8vh, 80px), var(--safe-top)) max(clamp(24px, 3.4vw, 64px), var(--safe-right))
    max(clamp(28px, 4vh, 56px), var(--safe-bottom)) 0;
}
.login-box {
  position: relative;
  width: min(100%, 420px);
  padding: clamp(30px, 3.2vw, 44px) clamp(26px, 2.6vw, 40px);
  border: 1px solid rgba(217,178,108,.24);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line-2));
  border-radius: 22px;
  background: rgba(19,19,22,.8);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink);
  box-shadow: 0 50px 100px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.07);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
}
.login-box::before {
  content: '';
  position: absolute;
  left: 28px;
  right: 28px;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.login-welcome {
  margin-bottom: 12px;
  color: var(--accent);
  font: 600 11px/1 var(--num);
  letter-spacing: .34em;
}
.login-box h1 {
  font-size: clamp(28px, 2.3vw, 36px);
  line-height: 1.25;
  letter-spacing: .03em;
}
.login-intro { display: grid; margin: 10px 0 28px; color: var(--muted); font-size: 15px; }
.login-intro > span { grid-area: 1 / 1; align-self: center; }
[data-network-visible] .login-guidance { visibility: hidden; }
.login-notice {
  margin-bottom: 14px;
  border-inline-start: 2px solid var(--accent);
  padding: 8px 12px;
  background: var(--soft);
  color: var(--ink-2);
  font-size: 14px;
}
.login-box form { gap: 20px; }
.login-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}
.login-control { position: relative; }
.login-control > .icon {
  position: absolute;
  inset: 50% auto auto 15px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: color .2s;
}
.login-control input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 14px 0 44px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.login-control input::placeholder { color: var(--muted); }
.login-control input:focus {
  border-color: var(--accent);
  outline: 2px solid var(--soft-2);
  outline-offset: 1px;
  box-shadow: 0 0 24px -6px var(--glow);
}
.login-control:focus-within > .icon { color: var(--accent); }
.login-control input[name=password] { padding-right: 50px; }
.login-reveal {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.login-reveal:active:not(:disabled) { transform: translateY(-50%); }
.login-reveal[aria-pressed=true] { color: var(--accent); }
.login-reveal[aria-pressed=true]::after {
  content: '';
  position: absolute;
  width: 23px;
  height: 2px;
  border-block-end: 1px solid var(--surface-2);
  background: currentColor;
  transform: rotate(45deg);
}
.login-box .dialog-actions { margin: 4px 0 0; border: 0; padding: 0; }
.login-box .primary {
  position: relative;
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 42px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--grad);
  color: var(--on-accent);
  font-size: 16px;
  letter-spacing: .3em;
  box-shadow: 0 16px 34px -16px var(--glow);
}
.login-box .primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255,255,255,.5) 50%, transparent 68%);
  transform: translateX(-120%);
  pointer-events: none;
}
.login-box .primary::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 17px;
  height: 14px;
  transform: translateY(-50%);
  background: currentColor;
  clip-path: polygon(0 45%, 83% 45%, 50% 6%, 58% 0, 100% 50%, 58% 100%, 50% 94%, 83% 55%, 0 55%);
}
.login-box .primary:hover:not(:disabled) { color: var(--on-accent); }
.login-activation:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.login-activation .link { min-height: 44px; font-size: inherit; }
.login-box .native-settings {
  margin-top: 20px;
  padding-top: 3px;
  border-top: 1px solid var(--line-2);
}
.login-box .native-setting { text-underline-offset: 3px; color: var(--ink-2); }
.login-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12.5px;
}
.login-footnote .icon { width: 15px; height: 15px; color: var(--accent); }
[data-theme=ivory] .login-stage { --muted: #71675a; --accent: #86652f; }
[data-theme=ivory] .login-box {
  border-color: rgba(167,128,61,.3);
  background: rgba(255,253,249,.94);
  box-shadow: 0 50px 100px -40px rgba(0,0,0,.75);
}

@keyframes stage-live { 0% { box-shadow: 0 0 0 0 rgba(255,77,94,.7); } 70%, 100% { box-shadow: 0 0 0 7px rgba(255,77,94,0); } }
@keyframes stage-meter { 0%, 100% { transform: scaleY(.3); } 30% { transform: scaleY(1); } 60% { transform: scaleY(.55); } }
@keyframes stage-scan { 0% { transform: translateY(0); opacity: 0; } 8% { opacity: 1; } 85% { opacity: .8; } 100% { transform: translateY(calc(100vh + 140px)); opacity: 0; } }
@keyframes stage-grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(3%, 1%); } }
@keyframes stage-haze { from { transform: translate3d(-4%, 2%, 0) scale(1); } to { transform: translate3d(5%, -3%, 0) scale(1.08); } }
@keyframes stage-shine { 0%, 100% { background-position: 0 0; } 50% { background-position: 100% 0; } }
@keyframes login-feature-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes login-detail-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes login-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes login-shine { 0%, 64% { transform: translateX(-120%); } 84%, 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion=reduce]) .login-motion-control { display: grid; }
  html:not([data-motion=reduce]) .stage-live i { animation: stage-live 1.6s ease-out infinite; }
  html:not([data-motion=reduce]) .stage-meter i { animation: stage-meter 1.03s ease-in-out infinite; }
  html:not([data-motion=reduce]) .stage-meter i:nth-child(2) { animation-delay: -.4s; }
  html:not([data-motion=reduce]) .stage-meter i:nth-child(3) { animation-delay: -.75s; }
  html:not([data-motion=reduce]) .stage-meter i:nth-child(4) { animation-delay: -.2s; }
  html:not([data-motion=reduce]) .stage-meter i:nth-child(5) { animation-delay: -.6s; }
  html:not([data-motion=reduce]) .stage-scan { animation: stage-scan 8s linear infinite; }
  html:not([data-motion=reduce]) .stage-haze { animation: stage-haze 16s ease-in-out infinite alternate; }
  html:not([data-motion=reduce]) .stage-grain { animation: stage-grain .9s steps(5) infinite; }
  html:not([data-motion=reduce]) .login-slogan span { animation: stage-shine 8s ease-in-out infinite; }
  html:not([data-motion=reduce]) .login-feature-list li.is-active::after {
    animation: login-feature-progress var(--feature-duration, 4.1s) linear both;
  }
  html:not([data-motion=reduce]) .login-feature-detail.is-swap { animation: login-detail-in .5s ease-out both; }
  html:not([data-motion=reduce]) .login-box .primary::before { animation: login-shine 5s ease-in-out 1.5s infinite; }
  html:not([data-motion=reduce]) :is(.stage-live i, .stage-meter i, .stage-scan, .stage-haze, .stage-grain, .login-slogan span,
    .login-feature-list li.is-active::after, .login-box .primary::before) {
    animation-play-state: var(--studio-play-state, running);
  }
}
html[data-motion=reduce] .login-feature-list li.is-active::after { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .login-feature-list li.is-active::after { transform: none; }
}

@media (max-width: 1180px) {
  .stage-meter { display: none; }
  .login-lede { max-width: 26em; }
}
@media (max-width: 900px), (max-width: 1000px) and (max-height: 540px), (pointer: coarse) and (max-height: 540px) {
  .login-stage {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #07060a;
  }
  .stage-troupe { filter: blur(2px) saturate(1.15); }
  .login-stage[data-depth] .stage-troupe { filter: blur(.8px) saturate(1.1); }
  .stage-overlay::before {
    background:
      linear-gradient(180deg, rgba(5,4,8,.82) 0%, rgba(5,4,8,.1) 26%, rgba(5,4,8,0) 60%, rgba(5,4,8,.55) 100%),
      radial-gradient(140% 90% at 50% 45%, transparent 55%, rgba(3,2,5,.7) 100%);
  }
  .login-scene {
    flex: none;
    padding: max(8px, var(--safe-top)) max(20px, var(--safe-right)) 12px max(20px, var(--safe-left));
  }
  .login-scene .brand-mark { width: 36px; height: 36px; }
  .login-scene .brand-mark span { font-size: 22px; }
  .login-scene .brand-name { font-size: 17px; }
  .login-scene .brand-en { font-size: 8px; letter-spacing: 1.8px; }
  .stage-status { gap: 8px; }
  .stage-live { height: 24px; padding: 0 9px 0 8px; font-size: 10px; }
  .stage-clock { font-size: 12px; }
  .login-pitch { margin-top: 10px; }
  .login-eyebrow { font-size: 11px; letter-spacing: .26em; gap: 9px; }
  .login-eyebrow::before { width: 20px; }
  .login-slogan { margin-top: 8px; font-size: clamp(25px, 7vw, 40px); letter-spacing: .04em; }
  .login-slogan span { display: inline; }
  .login-lede { display: none; }
  .stage-frame { min-height: clamp(80px, 13vh, 128px); margin: 8px 0; background: none; }
  .stage-frame::before { display: none; }
  .login-features {
    margin-inline: calc(-1 * max(20px, var(--safe-left))) calc(-1 * max(20px, var(--safe-right)));
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  }
  .login-feature-detail { display: none; }
  .login-feature-track { display: flex; width: max-content; }
  .login-feature-list { flex-wrap: nowrap; gap: 8px; padding-right: 8px; }
  .login-feature-list li { height: 32px; padding: 0 12px 0 10px; font-size: 13px; }
  .login-feature-list li .icon { width: 14px; height: 14px; }
  .login-panel {
    display: block;
    flex: 1 0 auto;
    padding: 20px max(22px, var(--safe-right)) max(22px, var(--safe-bottom)) max(22px, var(--safe-left));
    border-radius: 24px 24px 0 0;
    background: var(--surface);
    box-shadow: 0 -30px 60px -30px rgba(0,0,0,.95);
  }
  .login-panel::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: min(60%, 260px);
    height: 2px;
    transform: translateX(-50%);
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
  }
  .login-stage .login-box {
    width: min(100%, 440px);
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .login-box::before, .login-welcome, .login-footnote { display: none; }
  .login-box h1 { font-size: 26px; }
  .login-intro { margin: 6px 0 20px; font-size: 14px; }
  .login-box form { gap: 16px; }
}
@media (max-width: 900px) and (prefers-reduced-motion: no-preference) {
  html:not([data-motion=reduce]) .login-feature-list[aria-hidden] { display: flex; }
  html:not([data-motion=reduce]) .login-feature-track {
    animation: login-marquee 30s linear infinite;
    animation-play-state: var(--studio-play-state, running);
  }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .login-features { overflow-x: auto; }
}
@media (max-width: 900px) {
  html[data-motion=reduce] .login-features { overflow-x: auto; }
}
@media (max-width: 420px) {
  .stage-clock { display: none; }
}
@media (max-width: 900px) and (max-height: 700px) {
  .login-eyebrow { display: none; }
  .stage-frame { min-height: 80px; margin: 6px 0; }
  .login-intro { margin-bottom: 16px; }
}
@media (max-width: 900px) and (max-height: 590px) {
  .stage-frame, .login-features { display: none; }
  .login-slogan { font-size: 22px; }
  .login-box form { gap: 12px; }
}
@media (orientation: landscape) and (min-width: 540px) and (max-width: 1000px) and (max-height: 540px),
       (orientation: landscape) and (min-width: 540px) and (pointer: coarse) and (max-height: 540px) {
  .login-stage { display: grid; grid-template: 1fr / minmax(0, .95fr) minmax(0, 1fr); }
  .login-scene {
    min-height: 0;
    padding: max(14px, var(--safe-top)) 20px max(14px, var(--safe-bottom)) max(20px, var(--safe-left));
  }
  .login-scene-header { flex-wrap: wrap; }
  .login-eyebrow, .login-lede, .login-features { display: none; }
  .login-pitch { margin-top: 10px; }
  .login-slogan { font-size: clamp(24px, 3.6vw, 34px); }
  .login-slogan span { display: block; }
  .stage-frame { display: block; min-height: 90px; margin: 8px 0 0; }
  .login-panel {
    grid-column: 2;
    display: grid;
    padding: max(4vh, 12px, var(--safe-top)) max(20px, var(--safe-right)) max(12px, var(--safe-bottom)) 20px;
    border-radius: 0;
    box-shadow: none;
  }
  .login-panel::before { display: none; }
  .login-box h1 { font-size: 24px; }
  .login-intro { margin: 5px 0 12px; }
  .login-box form { gap: 10px; }
  .login-control input, .login-box .primary { height: 44px; min-height: 44px; }
  .login-box .native-settings, .login-activation:not(:empty) { margin-top: 5px; }
}
@media (orientation: landscape) and (max-width: 740px) and (max-height: 540px) {
  .stage-clock { display: none; }
}

/* ============ 界面润色：PC、手机网页与两端 App 共用 ============ */
/* 触控：去掉 WebView 点按灰块与双击缩放延迟 */
html { -webkit-tap-highlight-color: transparent; }
button, a, label, select, summary, input[type='checkbox'], input[type='radio'] { touch-action: manipulation; }

/* 切页后标题获得焦点，仅供读屏定位，不再显示白色焦点框 */
.page-heading h1:focus { outline: none; }

/* 切换页面时内容淡入；保存后的刷新不重复播放 */
.content-wrap.page-enter { animation: page-enter .26s ease-out; }
@keyframes page-enter { from { opacity: 0; } to { opacity: 1; } }

/* 卡片标题：多个操作按钮靠右成组，换行后同样靠右 */
.card-head { justify-content: flex-end; }
.card-head > h2 { margin-right: auto; }

/* 空状态：图标 + 说明，避免整块留白 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 12px 24px;
  line-height: 1.5;
}
.empty-state::before {
  content: '';
  width: 30px;
  height: 30px;
  flex: none;
  background: var(--accent);
  opacity: .5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h5l2 3h4l2-3h5'/%3E%3Cpath d='M3 13l3-8h12l3 8v6H3z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13h5l2 3h4l2-3h5'/%3E%3Cpath d='M3 13l3-8h12l3 8v6H3z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.nav-scroll .empty-state::before, td .empty-state::before { display: none; }

/* 分页信息：弱化为页脚，和列表内容分隔 */
.paged-results > [data-list-controls]:not(:empty) {
  margin-bottom: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.paged-results > [data-list-controls] > span:first-child { font-variant-numeric: tabular-nums; }

/* 列表首次加载：骨架占位，避免空白跳动 */
[data-paged-list][aria-busy='true'] > [data-list-rows]:empty {
  min-height: 132px;
  border-radius: 12px;
  background:
    linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--ink) 6%, transparent) 50%, transparent 70%) -150% 0 / 200% 100% no-repeat,
    repeating-linear-gradient(180deg, var(--surface-2) 0 36px, transparent 36px 48px);
  animation: list-skeleton-in .2s .15s both, list-skeleton 1.3s linear infinite;
}
@keyframes list-skeleton-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes list-skeleton { to { background-position: 250% 0, 0 0; } }

/* 表格：行悬停过渡，操作列按钮不换行 */
tbody tr { transition: background .15s; }
td .action-set { flex-wrap: nowrap; }

/* 排行条：名称列放宽，数值列固定，长团名和千万级数字不挤压 */
.bar { grid-template-columns: 5.6em minmax(0, 1fr) 7.6em; }
.bar > span { overflow: hidden; text-overflow: ellipsis; }
.bar > b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar .track i { transition: width .5s ease-out; }

/* 常用功能：按可用宽度自动排列，避免窄列里文字逐字换行 */
.quick { grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.4rem), 1fr)); }
.quick button { padding: 14px; gap: 10px; line-height: 1.35; }
.quick button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.quick button:hover:not(:disabled) .icon { background: var(--soft-2); }

/* 提示条：成功、提醒、错误分色并带图标 */
#toast .toast-content { align-items: center; }
#toast .toast-content .icon { margin-top: 0; }
#toast[data-tone='success'] { border-color: color-mix(in srgb, var(--pos) 42%, var(--line-2)); }
#toast[data-tone='warn'] { border-color: color-mix(in srgb, var(--warn) 42%, var(--line-2)); }
#toast[data-tone='warn'] .icon { color: var(--warn); }
#toast[data-tone='error'] { border-color: color-mix(in srgb, var(--neg) 48%, var(--line-2)); }

/* 弹窗与抽屉：轻微进场动效 */
dialog[open] { animation: dialog-in .22s cubic-bezier(.2, .8, .2, 1); }
dialog[open]::backdrop { animation: fade-in .22s ease-out; }
.nav-backdrop { animation: fade-in .2s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }

/* 积分商城：价格与按钮对齐到卡片底部 */
.item-body { display: flex; flex-direction: column; }
.item-body > .item-foot { margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.item-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.item-short { color: var(--warn); font-size: 12px; }

/* 侧栏分组：折叠箭头与计数 */
.nav-group { gap: 6px; }
.nav-group .lbl { flex: 1; text-align: left; }
.nav-group:hover:not(:disabled) { opacity: .9; }

/* 手机端底部导航：当前项顶部高亮，点按回弹 */
.tabbar button { position: relative; transition: color .16s; }
.tabbar button .icon { transition: transform .12s; }
.tabbar button:active .icon { transform: scale(.88); }
.tabbar button.selected::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 22px;
  height: 3px;
  margin-left: -11px;
  border-radius: 0 0 3px 3px;
  background: var(--grad);
  box-shadow: 0 0 10px var(--glow);
}

/* 上报表单：分段按钮跟随当前填写位置 */
.report-jumps button[aria-current] {
  color: var(--accent-hi);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2));
  background: var(--soft-2);
  font-weight: 650;
}
[data-theme=ivory] .report-jumps button[aria-current] { color: var(--accent-lo); }

@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  /* 记录卡片：操作按钮独占一行并靠右，不再显示「操作」标签 */
  .m-item { padding-block: 11px; }
  .m-item dl > .m-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed var(--line);
  }
  .m-item dl > .m-actions > dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .m-item dl > .m-actions > dd { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .m-item dl > .m-actions .action-set { justify-content: flex-end; }

  /* 排行条：名称与数值同行，进度条另起一行 */
  .bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'label value' 'track track';
    gap: 4px 10px;
    font-size: 13px;
  }
  .bar > span { grid-area: label; color: var(--ink-2); }
  .bar > b { grid-area: value; font-size: 13px; }
  .bar > .track { grid-area: track; height: 7px; }
  .bars { gap: 11px; }

  /* 筛选标签：横向滑动时按标签吸附，隐藏滚动条 */
  .chips { scroll-snap-type: x proximity; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chips .chip { flex: none; white-space: nowrap; scroll-snap-align: start; }

  /* 积分商城：按钮铺满卡片宽度，方便单手点按 */
  .item-body > .item-foot { flex-direction: column; align-items: stretch; gap: 6px; }
  .item-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-left: 0; }
  .item-actions:empty { display: none; }
  .item-actions > button { width: 100%; min-height: 40px; }
  .item-actions > .tag { justify-content: center; }

  .quick button { padding: 6px; }
  .empty-state { padding: 18px 8px 16px; }
  .empty-state::before { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .content-wrap.page-enter, dialog[open], dialog[open]::backdrop, .nav-backdrop,
  [data-paged-list][aria-busy='true'] > [data-list-rows]:empty { animation: none; }
  .bar .track i, .tabbar button .icon { transition: none; }
}
html[data-motion=reduce] :is(.content-wrap.page-enter, dialog[open], .nav-backdrop, [data-paged-list][aria-busy='true'] > [data-list-rows]:empty) { animation: none; }
html[data-motion=reduce] dialog[open]::backdrop { animation: none; }

.reward-progress {
  min-width: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: normal;
}
.goal-card > .reward-progress { margin-top: .35rem; }
.reward-progress summary {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-content: center; align-items: center;
  gap: .1rem .6rem; min-height: 44px; padding: .18rem 0; cursor: pointer; list-style: none;
  line-height: 1.35; overflow-wrap: anywhere; border-radius: .3rem;
}
.reward-progress summary::-webkit-details-marker { display: none; }
.reward-summary-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: .15rem .65rem; min-width: 0; }
.reward-summary-line strong { font-size: .86rem; }
.reward-hint, .reward-caption, .reward-empty, .reward-values { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.reward-toggle { display: inline-flex; align-items: center; gap: .2rem; color: var(--accent); font-size: .8rem; white-space: nowrap; }
.reward-toggle .icon { width: .9rem; height: .9rem; }
.reward-toggle .when-open, [data-reward-details][open] > summary .when-closed { display: none; }
[data-reward-details][open] > summary .when-open { display: inline; }
[data-reward-details][open] > summary .reward-toggle .icon { transform: rotate(180deg); }
.reward-meter { grid-column: 1 / -1; display: flex; gap: .55rem; align-items: center; }
.reward-meter > span { font: 600 .73rem/1.25 var(--num); color: var(--ink-2); white-space: nowrap; }
.reward-meter progress {
  flex: 1 1 0; min-width: 0; height: .43rem; appearance: none; overflow: hidden;
  border: 0; border-radius: 1rem; background: var(--surface-3); color: var(--accent);
}
.reward-meter progress::-webkit-progress-bar { background: var(--surface-3); }
.reward-meter progress::-webkit-progress-value { background: var(--accent); }
.reward-meter progress::-moz-progress-bar { background: var(--accent); }
.reward-details-body { display: grid; gap: .35rem; padding: .5rem 0 .3rem; border-top: 1px solid var(--line-2); }
.reward-details-body ol {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,8.25rem),1fr));
  gap: .4rem; margin: 0; padding: 0; list-style: none;
}
.reward-details-body li {
  display: grid; align-content: start; justify-items: start; gap: .12rem; min-width: 0;
  padding: .45rem .55rem; border: 1px solid var(--line-2); border-radius: .55rem;
  color: var(--ink-2); overflow-wrap: anywhere; font-size: .85rem;
}
.reward-status { font-size: .74rem; color: var(--muted); }
.reward-details-body li[data-reward-state=reached] { border-color: var(--accent); }
.reward-details-body li[data-reward-state=next] { border-style: dashed; border-color: var(--accent); }
.reward-details-body li small { color: var(--ink-2); }
.reward-segment { margin-top: .5rem; }
.reward-period, .reward-calculation > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; font-size: .8rem; }
.reward-period { margin: .45rem 0; }
.reward-calculation { margin: .45rem 0; }
.reward-calculation dd { margin: 0; }
.reward-segment h3 { font-size: .85rem; }
.team-reward-list, .team-reward-list > div { display: grid; gap: .15rem; }
.team-reward-list { gap: .5rem; }
.table-wrap td .reward-progress { width: 15rem; }
.table-wrap td li[data-reward-state] { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
.table-wrap td li[data-reward-state] .reward-status { grid-column: 2; grid-row: 1 / span 2; }
.table-wrap td li[data-reward-state] :is(b,small) { grid-column: 1; }
.reward-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(12rem,.9fr); gap: 0 .8rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.reward-row:last-child { border-bottom: 0; }
.reward-row > .row { padding: 0; border: 0; min-width: 0; }
.m-item dl > div:has(.reward-progress) { grid-column: 1 / -1; }
.m-item dd:has(.reward-progress) { display: block; flex: 1 1 100%; }
.pts-card .reward-progress { --ink: #f7f0e2; --ink-2: #eadfca; --muted: #c4b79f; --surface-3: rgba(255,255,255,.12); --line-2: rgba(255,255,255,.2); }
@container page (max-width: 620px) {
  .reward-row { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 620px) {
  .reward-row { grid-template-columns: minmax(0,1fr); }
}

/* Role manual and contextual help share the same reading layout. */
.sidebar .guide-shortcut {
  width: 100%; text-align: left; font-size: 12px;
  background: transparent; border: 0; color: var(--nav-ink);
}
.nav-help { margin: 14px 8px 8px; padding-top: 8px; border-top: 1px solid var(--nav-line); }
.setup-guide { margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); line-height: 1.7; }
.setup-guide p { margin: 0 0 6px; }
.setup-guide summary { cursor: pointer; color: var(--muted); }
.setup-guide ol { padding-left: 1.5em; margin: 8px 0; }
.scheme-step { min-width: 0; margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.scheme-step legend { padding: 0 6px; font-weight: 650; }
.scheme-step p, .scheme-hint { color: var(--muted); font-size: 13px; line-height: 1.7; }
.scheme-hint { display: block; margin: 4px 0 10px; }
.scheme-step [hidden] { display: none !important; }
.scheme-tier { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 10px 0; }
.scheme-tier header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.scheme-tier .form-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.scheme-trial { padding: 12px; background: var(--surface); border-radius: 8px; line-height: 1.7; }
.scheme-trial p { margin: 6px 0; }
.scheme-trial strong { font-size: 18px; }
@media (max-width: 620px) {
  .scheme-tier .form-grid { grid-template-columns: minmax(0,1fr); }
  .scheme-step { padding: 10px; }
}
.guide-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.guide-head h2 { margin: 0; font-size: 22px; }
.guide-head p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.guide-search { display: flex; align-items: center; gap: 8px; width: min(100%, 320px); color: var(--muted); }
.guide-search input { min-width: 0; flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.guide-search input::placeholder { color: var(--muted); }
.guide-layout { display: grid; grid-template-columns: minmax(175px, 230px) minmax(0, 1fr); gap: 14px; align-items: start; }
.guide-index.card { padding: 10px; }
.guide-index summary { cursor: pointer; padding: 8px; font-weight: 650; }
.guide-index summary small { color: var(--muted); margin-left: 5px; font-weight: 400; }
.guide-index nav { display: grid; margin-top: 8px; gap: 3px; max-height: 66vh; overflow-y: auto; }
.guide-index nav button { display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent; color: var(--ink); text-align: left; min-height: 38px; }
.guide-index nav button[aria-current] { border-color: var(--accent); color: var(--accent); font-weight: 650; }
.guide-reader { min-width: 0; }
.guide-reader header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.guide-reader h2 { margin: 0; font-size: 21px; }
.guide-reader h2, .guide-lesson h3 { scroll-margin-top: 80px; }
.guide-lesson { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; overflow-wrap: anywhere; }
.guide-context .guide-lesson:first-child { margin-top: 0; border: 0; padding-top: 0; }
.guide-lesson h3 { margin: 0 0 10px; color: var(--ink); font-size: 16px; }
.guide-lesson ol { padding-left: 1.7em; margin: 0; line-height: 1.85; max-width: 82ch; }
.guide-lesson li { padding-left: .25em; margin-bottom: .45em; }
.guide-lesson li::marker { font-weight: 650; color: var(--accent); }
.guide-check { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-left: 2px solid var(--accent); background: var(--surface); line-height: 1.65; }
.guide-check .icon { flex: none; margin-top: 3px; color: var(--accent); }
.guide-check strong { margin-right: .4em; }
@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  .guide-layout { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .guide-head { gap: 10px; }
  .guide-search { width: 100%; }
  .guide-index nav { grid-template-columns: repeat(2,minmax(0,1fr)); max-height: 32vh; }
  .guide-index nav button { min-height: 44px; }
}

.guide-photo { margin: 14px 0; }
.guide-photo summary { display: grid; justify-items: start; gap: 6px; cursor: zoom-in; color: var(--muted); font-size: 14px; line-height: 1.5; }
.guide-photo summary::-webkit-details-marker { display: none; }
.guide-photo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 250px; border: 1px solid var(--line); border-radius: 6px; }
.guide-photo .photo-caption::after { content: ' · 放大'; color: var(--accent); }
.guide-photo .photo-pan { display: block; min-width: 0; max-width: 100%; }
.guide-photo[open] .photo-pan { width: 100%; overflow-x: auto; }
.guide-photo[open] img { max-height: none; max-width: none; min-width: min(145%, 920px); }
.guide-photo[open] summary { cursor: zoom-out; }
.guide-photo[open] .photo-caption::after { content: ' · 收起'; }

.account-profile { margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.kpis.kpis-fluid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
/* Keep every digit and its unit visible for large company and team totals. */
.kpi { container-type: inline-size; }
.kpi-value, .kpi.featured .kpi-value, .kpis.k6 .kpi-value, .kpis.k6 .kpi.featured .kpi-value {
  white-space: normal;
  overflow-wrap: anywhere;
}
.kpi-number { font-size: min(1em, calc(155cqi / var(--kpi-digits, 10))); }
.staff-search .field { width: min(100%, 24rem); }
.ranking-date.field { margin-bottom: 0; }
.ranking-date.field > span { margin-bottom: 0; }
.ranking-date.field input { width: auto; }
@media (max-width: 540px) {
  .kpis.kpis-fluid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis-fluid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.account-profile[hidden] { display: none; }
.field > span:has(> .field-requirement) { display: flex; align-items: baseline; gap: 6px; }
.field > span > [data-field-label] { min-width: 0; }
.field > span > .field-requirement { display: inline; flex: none; white-space: nowrap; margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.field > span > .field-requirement[data-required="true"] { color: var(--accent); font-weight: 650; }
:is([data-form='staff'], [data-form='staffEdit']) { gap: 10px; }
:is([data-form='staff'], [data-form='staffEdit']) .form-grid { gap: 8px 12px; margin: 0; }
:is([data-form='staff'], [data-form='staffEdit']) .field { margin: 0; }
:is([data-form='staff'], [data-form='staffEdit']) .field > span { margin-bottom: 4px; }
:is([data-form='staff'], [data-form='staffEdit']) .dossier-section { margin: 0; }
:is([data-form='staff'], [data-form='staffEdit']) .dossier-section > summary { padding: 8px 0; }
:is([data-form='staff'], [data-form='staffEdit']) > .form-note { margin: 0; }
.business-form .field[hidden] { display: none; }
.account-editor-tools, .account-profile-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-profile-actions { justify-content: flex-end; }
.account-profile textarea { resize: vertical; }
.account-profile .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 540px) {
  .account-profile { padding: 10px; }
  .account-profile .form-grid { grid-template-columns: minmax(0, 1fr); }
}
