/* 跨页导航在途（data-kxed-leaving）：原内容区不再接受操作；同一延时后 runtime 在内容区末尾放一块 .kxed-route-skeleton，原内容随之收起，页内位置回到页首；短于延时的切换看不到变化。 */
[data-livecell-page][data-kxed-leaving] main,
[data-livecell-page][data-kxed-leaving]:not(:has(main)) > * {
  pointer-events: none;
}

:is(main, [data-livecell-page]):has(> .kxed-route-skeleton) > :not(.kxed-route-skeleton) {
  display: none;
}

/* 占位与页面内容区同宽同间距，形状由 runtime 按 data-kxed-skeleton 选定：块的高度取字号与控件高度，卡片外观沿用 data-kxed-surface。所有块共用一条流动的高光（kxed-shimmer），减少动态效果时 --kxed-loop-shimmer 为 0，停在底色。 */
.kxed-route-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--kxed-panel-gap, var(--kxed-space-5));
  max-width: var(--kxed-content-max, 72rem);
  margin-inline: auto;
  animation: kxed-fade var(--kxed-duration-mid) var(--kxed-ease-out);
}

.kxed-route-skeleton.kxed-sk-form {
  max-width: var(--kxed-skeleton-form-width);
}

.kxed-sk-block {
  display: block;
  min-width: 0;
  border-radius: var(--kxed-radius);
  background-color: var(--kxed-skeleton);
  background-image: linear-gradient(90deg, transparent 25%, var(--kxed-skeleton-glow) 37%, transparent 63%);
  background-size: 400% 100%;
  background-position: 100% 50%;
  animation: kxed-shimmer var(--kxed-loop-shimmer) var(--kxed-ease-in-out) infinite;
}

.kxed-sk-head,
.kxed-sk-field {
  display: flex;
  flex-direction: column;
  gap: var(--kxed-space-2);
}

.kxed-sk-title {
  width: 28%;
  height: var(--kxed-font-size-xl);
}

.kxed-sk-sub {
  width: 44%;
  height: var(--kxed-font-size-sm);
}

.kxed-sk-label {
  width: 30%;
  height: var(--kxed-font-size-sm);
}

.kxed-sk-input {
  height: var(--kxed-control-height-md);
}

.kxed-sk-line,
.kxed-sk-cell {
  height: var(--kxed-font-size-sm);
}

.kxed-sk-line:last-child {
  width: 60%;
}

.kxed-sk-card {
  display: flex;
  flex-direction: column;
  gap: var(--kxed-space-4);
  padding: var(--kxed-space-5);
}

.kxed-sk-filters,
.kxed-sk-toolbar,
.kxed-sk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--kxed-space-4);
}

.kxed-sk-filters .kxed-sk-field {
  flex: 1 1 var(--kxed-skeleton-min-width);
}

.kxed-sk-toolbar {
  justify-content: space-between;
}

.kxed-sk-search {
  flex: 0 1 var(--kxed-skeleton-min-width);
  height: var(--kxed-control-height-md);
}

.kxed-sk-button {
  flex: none;
  width: 10%;
  min-width: var(--kxed-control-height-lg);
  height: var(--kxed-control-height-md);
}

.kxed-sk-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kxed-space-4);
}

.kxed-sk-page-head > .kxed-sk-head {
  flex: 1 1 auto;
}

.kxed-sk-page-head .kxed-sk-actions {
  align-items: center;
}

.kxed-sk-filters > .kxed-sk-actions {
  margin-inline-start: auto;
}

.kxed-sk-divider {
  border-top: 1px dashed var(--kxed-divider);
}

.kxed-sk-card.kxed-sk-table {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.kxed-sk-select {
  --kxed-sk-lead: var(--kxed-icon-size-md);
}

.kxed-sk-media {
  --kxed-sk-lead: var(--kxed-control-height-md);
}

.kxed-sk-select.kxed-sk-media {
  --kxed-sk-lead: var(--kxed-icon-size-md) var(--kxed-control-height-md);
}

.kxed-sk-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--kxed-space-3);
}

.kxed-sk-pager > .kxed-sk-sub {
  width: 10%;
}

.kxed-sk-table-row {
  display: grid;
  grid-template-columns: var(--kxed-sk-lead, ) 2fr repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: var(--kxed-space-4);
  padding: var(--kxed-space-3) var(--kxed-space-4);
  border-top: 1px solid var(--kxed-divider);
}

.kxed-sk-table-head {
  border-top: 0;
}

.kxed-sk-check {
  width: var(--kxed-icon-size-md);
  height: var(--kxed-icon-size-md);
}

.kxed-sk-thumb {
  width: var(--kxed-control-height-md);
  height: var(--kxed-control-height-md);
}

.kxed-sk-row {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--kxed-space-4);
  padding-block: var(--kxed-space-2);
  border-top: 1px solid var(--kxed-divider);
}

.kxed-sk-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kxed-sk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--kxed-skeleton-min-width), 1fr));
  gap: var(--kxed-panel-gap, var(--kxed-space-5));
}

.kxed-sk-stat {
  gap: var(--kxed-space-2);
  min-height: var(--kxed-skeleton-stat-height);
}

.kxed-sk-chart {
  min-height: var(--kxed-skeleton-chart-height);
}

.kxed-sk-fill {
  flex: 1 1 auto;
}

.kxed-sk-card-title {
  width: 22%;
  height: var(--kxed-font-size-md);
}

.kxed-sk-value {
  width: 55%;
  height: var(--kxed-font-size-xl);
}

.kxed-sk-foot {
  width: 70%;
}

.kxed-sk-badge {
  width: calc(var(--kxed-control-height-lg) * 2);
  height: var(--kxed-font-size-md);
  border-radius: var(--kxed-radius-pill);
}

.kxed-sk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--kxed-panel-gap, var(--kxed-space-5));
}

.kxed-sk-terms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--kxed-space-4) var(--kxed-space-5);
}

.kxed-sk-note {
  min-height: calc(var(--kxed-control-height-md) * 3);
}

.kxed-sk-tabs {
  display: flex;
  gap: var(--kxed-space-5);
  padding-bottom: var(--kxed-space-3);
  border-bottom: 1px solid var(--kxed-divider);
}

.kxed-sk-tab {
  flex: 0 1 5rem;
  height: var(--kxed-font-size-md);
}

.kxed-sk-area {
  height: calc(var(--kxed-control-height-md) * 4);
}

@media (max-width: 48rem) {
  .kxed-sk-grid,
  .kxed-sk-terms {
    grid-template-columns: minmax(0, 1fr);
  }
}
