  /**
   * 画布缩小时抵消 zoom：布局盒为槽位的 vs 宽（vs 为 0.4 时盒更小），再 scale(1/vs) 把图元放大回满槽；
   * 地图坐标系里线宽和字号被放大，再经画布整体 zoom 后屏上仍可读。放大画布时 min(vs,1)=1，等效不补偿。
   */
  --floor-card-vs: 1;

  .pisell-res-floor-room-card__viewport-compensate {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(100% * var(--floor-card-vs, 1));
    height: calc(100% * var(--floor-card-vs, 1));
    transform: scale(calc(1 / var(--floor-card-vs, 1)));
    transform-origin: top left;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 0;
    pointer-events: auto;
  }

  /* ---- 小宽高密度（data-density）---- */
  .rc-shell {
    position: relative;
  }

  /** 未付顶栏不再铺珊瑚底；金额/徽标仍可用 `--rc-pay-unpaid`（见 body、chip）。 */

  .rc-pay-ribbon {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    pointer-events: none;
    background: var(--rc-pay-unpaid);
  }

  .rc-pay-ribbon--circle {
    top: 6%;
    left: 50%;
    right: auto;
    width: 40%;
    height: 4px;
    transform: translateX(-50%);
    border-radius: 2px;
  }

  .rc-pay-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 0 1.5px var(--c-surface, #fff);
  }

  .rc-pay-chip--unpaid {
    background: var(--rc-pay-unpaid);
  }

  .rc-pay-chip--paid {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rc-pay-paid);
    box-shadow: none;
  }

  .rc-pay-chip--corner {
    position: absolute;
    z-index: 3;
    top: 8px;
    right: 6px;
  }

  .rc-pay-chip--corner.rc-pay-chip--paid {
    width: 6px;
    height: 6px;
    top: 9px;
    right: 7px;
  }

  &[data-shape='circle'] .rc-pay-chip--corner {
    top: 14%;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .rc-pay-badge--with-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .rc-icon--yen,
  .rc-icon--check {
    width: 12px;
    height: 12px;
  }

  .rc-multi-micro-summary {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-height: 0;
    flex: 1 1 auto;
  }

  .rc-multi-micro-summary__text {
    font-size: 12px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rc-compact__pay-row .rc-pay-chip--inline {
    margin-right: 4px;
  }

  .rc-amount .rc-pay-chip--inline {
    margin-right: 6px;
  }

  &[data-density='compact'] {
    /** compact：与 mini/micro 一致，标题右侧不展示状态 tag */
    .rc-tag {
      display: none !important;
    }

    .rc-pay-ribbon:not(.rc-pay-ribbon--circle) {
      height: 4px;
    }
  }

  &[data-density='mini'] {
    .rc-capacity {
      display: none;
    }

    /** mini：不展示状态 tag（含原色点形态） */
    .rc-tag {
      display: none !important;
    }

    /** mini 极简正文：时刻较 micro 更大，居中加粗，进度贴底 */
    .rc-body--narrow-mini {
      gap: 0;
    }

    .rc-body__narrow-mini-fill {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .rc-time-row--narrow-mini-centered {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      gap: 4px;
      width: 100%;
      margin: 0;
      font-weight: 700;
      font-size: 15px;
    }

    .rc-body__narrow-mini-progress {
      flex-shrink: 0;
      width: 100%;
    }

    .rc-compact--narrow-mini {
      gap: 0;
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }

    .rc-compact__narrow-mini-fill {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .rc-compact__narrow-mini-progress {
      flex-shrink: 0;
      width: 100%;
    }

    .rc-pay-ribbon:not(.rc-pay-ribbon--circle) {
      height: 5px;
    }
  }

  &[data-density='micro'] {
    .rc-locked-text {
      display: none;
    }

    /** micro：不展示状态 tag；房间名字号沿用全局 `.rc-room-name`，此处不改字号 */
    .rc-tag {
      display: none !important;
    }

    /** micro 极简正文：时刻在剩余区域内水平垂直居中并加粗，进度条贴底不占 flex 生长 */
    .rc-body--narrow-micro {
      gap: 0;
    }

    .rc-body__narrow-micro-fill {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .rc-time-row--narrow-micro-centered {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      gap: 4px;
      width: 100%;
      margin: 0;
      font-weight: 700;
      font-size: 13px;
    }

    .rc-body__narrow-micro-progress {
      flex-shrink: 0;
      width: 100%;
    }

    .rc-compact--narrow-micro {
      gap: 0;
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }

    .rc-compact__narrow-micro-fill {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .rc-compact__narrow-micro-progress {
      flex-shrink: 0;
      width: 100%;
    }

    .rc-pay-ribbon:not(.rc-pay-ribbon--circle) {
      height: 6px;
    }
  }

  /**
   * 非 comfortable：header + body 包在 .rc-unified。
   * 占用态下若 header/body 各自铺 #17503A，两层拼接易产生亚像素「缝」；
   * 改为由 .rc-unified 统一铺色，子区域透明，并去掉纵向 padding 缝隙。
   */
  &[data-density='compact']:not([data-shape='circle']),
  &[data-density='mini']:not([data-shape='circle']),
  &[data-density='micro']:not([data-shape='circle']) {
    .rc > .rc-unified,
    .rc > .rc-tooltip-time-main {
      border-radius: var(--radius-m);
      overflow: hidden;
      gap: 0;
    }

    /** 方桌占用（含需付款/超时）：合并区单色底 */
    .rc.rc--occupied > .rc-unified,
    .rc.rc--occupied > .rc-tooltip-time-main {
      background: #17503a;
    }

    /**
     * 子层透明以便 `.rc-unified` 单色铺底无缝（含未付顶栏，不再单独铺珊瑚）。
     */
    .rc.rc--occupied > .rc-unified > .rc-header,
    .rc.rc--occupied > .rc-unified > .rc-body,
    .rc.rc--occupied > .rc-unified > .rc-compact,
    .rc.rc--occupied > .rc-unified > .rc-multi-list,
    .rc.rc--occupied > .rc-unified > .rc-multi-micro-summary,
    .rc.rc--occupied > .rc-tooltip-time-main > .rc-tooltip-time-root {
      background: transparent !important;
    }

    .rc > .rc-unified > .rc-header {
      border-bottom: none !important;
      border-radius: 0 !important;
      min-height: 0;
      padding-bottom: 0 !important;
    }

    .rc > .rc-unified > .rc-body,
    .rc > .rc-unified > .rc-compact,
    .rc > .rc-unified > .rc-multi-list,
    .rc > .rc-unified > .rc-multi-micro-summary {
      border-radius: 0 !important;
      padding-top: 0 !important;
      margin-top: 0;
    }

    .rc--locked > .rc-unified > .rc-body.rc-body--center {
      padding-top: 6px;
    }
  }

  /**
   * 非 comfortable：正文区纵向更紧（gap / padding / 列表间距），进度条仍贴底由 DOM 顺序保证。
   */
  &[data-density='compact'],
  &[data-density='mini'],
  &[data-density='micro'] {
    .rc-body {
      gap: 3px;
    }

    .rc-contact {
      gap: 5px;
    }

    .rc-time-row {
      gap: 3px;
    }

    .rc-next {
      padding-top: 5px;
      margin-top: 0;
    }

    .rc-progress {
      gap: 2px;
      flex-shrink: 0;
      width: 100%;
    }

    .rc-compact {
      padding: 5px 8px;
      gap: 4px;
    }

    .rc-compact__row {
      gap: 6px;
      min-height: 20px;
    }

    .rc-compact__left {
      gap: 4px;
    }

    .rc-compact__right {
      gap: 4px;
    }

    .rc-compact__pay-row {
      gap: 4px;
    }

    .rc-compact__scroll {
      gap: 4px;
    }

    .rc-compact .rc-progress {
      margin-top: 0;
    }

    .rc-multi-list {
      gap: 5px;
    }

    &[data-shape='circle'] {
      .rc-body {
        gap: clamp(2px, 1cqmin, 5px);
      }

      .rc-multi-list {
        gap: 4px;
      }
    }
  }

  &[data-density='compact']:not([data-shape='circle']),
  &[data-density='mini']:not([data-shape='circle']),
  &[data-density='micro']:not([data-shape='circle']) {
    .rc > .rc-body,
    .rc > .rc-compact,
    .rc > .rc-multi-list {
      padding: 4px;
    }

    .rc > .rc-unified > .rc-body,
    .rc > .rc-unified > .rc-compact,
    .rc > .rc-unified > .rc-multi-list {
      padding-top: 0 !important;
      padding-left: 4px;
      padding-right: 4px;
      padding-bottom: 4px;
    }
  }

  &[data-shape='circle'] {
    &[data-density='compact'],
    &[data-density='mini'],
    &[data-density='micro'] {
      .rc > .rc-unified,
      .rc > .rc-tooltip-time-main {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
      }
    }
  }

  /** 小卡 tooltip：压过合并区 overflow:hidden，使气泡可溢出内容区 */
  &[data-tooltip-time='on'] .rc.rc--tooltip-time > .rc-tooltip-time-main {
    overflow: visible !important;
  }

  /** 方桌：压过 block-part2 中 `.rc { overflow:hidden }`，便于气泡超出卡片框 */
  &[data-tooltip-time='on']:not([data-shape='circle']) .rc.rc--tooltip-time {
    overflow: visible !important;
  }

  /**
   * antd Tooltip 的浮层挂在 `__viewport-compensate` 内（以便随 viewportScale 缩放），
   * 需要把根壳与缩放层的 overflow 一并抬为 visible，避免气泡被裁切在小卡边界内。
   */
  &[data-tooltip-time='on'] {
    overflow: visible !important;
  }

  &[data-tooltip-time='on'] .pisell-res-floor-room-card__viewport-compensate {
    overflow: visible !important;
  }
