/* 双人节拍 2.0 统一沉浸舞台，循环动画只操作 transform / opacity。 */
@layer room {
  .room:has(.v2-room) {
    margin-top: 0;
  }
  #room.v2-active > :not(.v2-room) {
    display: none;
  }
  .room-head-actions {
    align-items: center;
  }
  .room-head-actions .button {
    margin: 0;
    min-height: 42px;
    padding: 0 15px;
    font-size: 13.5px;
    line-height: 1;
  }
  .v2-room {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    height: calc(100dvh - var(--header-h) - 12px - env(safe-area-inset-bottom));
    min-height: 490px;
    max-width: 980px;
    margin-inline: auto;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  /* 顶部搭档与安全条 */
  .v2-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 4px 2px;
  }
  .v2-conn-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px 4px 12px;
    border: 1px solid var(--hair-2);
    border-radius: var(--r-2);
    background: var(--panel-solid);
    color: var(--text);
    font-size: 13px;
  }
  .v2-partner {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
  .v2-partner-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--soft);
  }
  .v2-partner-name {
    font-weight: 650;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .v2-role-tag {
    font-size: 11.5px;
    padding: 1px 8px;
    border-radius: var(--r-pill);
    background: var(--veil-2);
    color: var(--gold-2);
    flex: none;
  }
  .v2-partner-heat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--dim);
  }
  .v2-partner-bar {
    flex: 1 1 auto;
    max-width: 140px;
    height: 6px;
    border-radius: var(--r-pill);
    background: var(--veil-2);
    overflow: hidden;
  }
  .v2-partner-bar i {
    display: block;
    height: 100%;
    width: var(--peer-heat, 0%);
    background: linear-gradient(90deg, var(--slow), var(--go));
    transition: width .3s var(--out);
  }
  .v2-strip-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
  }
  .v2-mini-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0 11px;
    border-radius: var(--r-pill);
    background: var(--veil);
    border: 1px solid var(--hair);
    color: var(--soft);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }
  .v2-mini-btn[data-variant="safe"] {
    background: #e6e0ea1c;
    border-color: #e6e0ea44;
    color: var(--safe);
  }
  .v2-mini-btn[data-variant="danger"] {
    background: #ff5c6c1f;
    border-color: #ff7a8238;
    color: #ffd0d5;
  }
  .v2-mini-btn[data-active="true"] {
    background: #ff5a9333;
    border-color: var(--go);
    color: var(--text);
  }
  @media (max-width: 440px) {
    .v2-partner {
      flex-basis: 64px;
      min-width: 32px;
    }
    .v2-role-tag {
      flex-shrink: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .v2-strip-actions {
      flex: 0 1 auto;
      flex-wrap: wrap;
      justify-content: flex-end;
      min-width: 0;
      gap: 3px;
    }
    .v2-strip-actions .v2-mini-btn {
      min-width: 38px;
      padding: 0 8px;
      font-size: 12.5px;
    }
  }

  /* 舞台主体网格（手机单屏 / 宽屏左右分栏） */
  .v2-grid {
    position: relative;
    min-height: 0;
    display: grid;
    gap: 8px 10px;
    grid-template-columns: minmax(0, 1fr) 56px;
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "stage heat"
      "talk heat"
      "dock dock";
  }
  @media (min-width: 900px) {
    .v2-grid {
      grid-template-columns: minmax(0, 1.35fr) 64px minmax(260px, .85fr);
      grid-template-rows: minmax(0, 1fr) auto;
      grid-template-areas:
        "stage heat talk"
        "dock dock talk";
      gap: 12px 16px;
    }
  }

  /* 中央无盒子大字舞台 */
  .v2-stage {
    grid-area: stage;
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 4px;
    gap: 6px;
    overflow: hidden;
  }
  .v2-clock {
    font-family: var(--serif);
    font-size: clamp(16px, 2.5dvh, 21px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .08em;
    color: var(--soft);
  }
  .v2-clock[data-urgent="true"] {
    color: var(--gold-2);
  }
  .v2-word-wrap {
    position: relative;
    display: grid;
    place-items: center;
    min-height: clamp(64px, 12dvh, 116px);
    width: 100%;
  }
  .v2-cue-word {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(50px, min(14vw, 11.5dvh), 108px);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: .06em;
    color: #fff;
    text-shadow: 0 0 22px var(--cue-glow, #ff5a93cc);
    transition: transform .26s var(--spring), opacity .22s var(--out);
  }
  .v2-cue-word.v2-ghost {
    position: absolute;
    pointer-events: none;
    animation: v2-ghost-out .34s var(--out) forwards;
  }
  @keyframes v2-ghost-out {
    to { opacity: 0; transform: translateY(-14px) scale(.94); }
  }
  .v2-room[data-cue="fast"] { --cue-color: var(--go); --cue-glow: #ff5a93d4; }
  .v2-room[data-cue="slow"] { --cue-color: var(--slow); --cue-glow: #ffa66ecc; }
  .v2-room[data-cue="stop"] { --cue-color: var(--stop); --cue-glow: #a99bffd4; }
  .v2-room[data-cue="grant"] { --cue-color: var(--grant); --cue-glow: #f4d284d4; }
  .v2-room[data-cue="paused"] { --cue-color: var(--safe); --cue-glow: #e6e0ea88; }
  .v2-room[data-sprint="true"] .v2-cue-word {
    animation: v2-sprint-shake .18s ease-in-out infinite alternate;
  }
  @keyframes v2-sprint-shake {
    from { transform: translate3d(-1.5px, 0, 0); }
    to { transform: translate3d(1.5px, 0, 0); }
  }

  /* 4 拍节拍灯（图形样式区分快/慢/停，色盲友好） */
  .v2-metro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 18px;
  }
  .v2-metro i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff28;
    transition: transform .12s var(--out), opacity .12s;
  }
  .v2-metro i:first-child { width: 11px; height: 11px; }
  .v2-room[data-cue="slow"] .v2-metro i { width: 16px; height: 5px; border-radius: var(--r-pill); }
  .v2-room[data-cue="stop"] .v2-metro i { width: 10px; height: 10px; background: transparent; border: 1.5px solid #a99bff66; }
  .v2-metro i[data-on="true"] {
    background: var(--cue-color, var(--go));
    transform: scale(1.38);
  }

  .v2-stage-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    font-size: 13px;
    color: var(--soft);
  }
  .v2-bpm {
    font-family: var(--serif);
    font-weight: 800;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
  }
  .v2-pips {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .v2-pips i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff24;
  }
  .v2-pips i[data-on="true"] {
    background: var(--cue-color, var(--go));
  }
  .v2-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: var(--r-pill);
    background: var(--veil);
    border: 1px solid var(--hair);
    font-size: 12px;
    color: var(--soft);
  }
  .v2-sheet-section {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
  }
  .v2-sheet-section h3 {
    margin: 0;
    font-size: 14px;
    color: var(--text);
  }
  .v2-sheet-note {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--dim);
  }
  #stage-more {
    margin-top: 10px;
    display: grid;
    gap: 10px;
  }
  #stage-more .v2-sheet-section {
    margin-top: 0;
    border-bottom: 1px solid var(--hair);
    padding-bottom: 10px;
  }
  #stage-more .v2-sheet-section .dialog-actions {
    margin-top: 2px;
  }
  #stage-more .v2-sheet-note {
    margin: 0;
  }
  #stage-more-chat .chat-log {
    max-height: min(7.5rem, 22dvh);
  }
  #stage-more-chat p {
    margin: 4px 0;
  }
  #stage-more-chat .chat-compose input {
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    border: 1px solid var(--hair-2);
    background: var(--ink-0);
    color: var(--text);
    font-size: 14px;
  }
  #stage-more-chat .chat-compose input::placeholder {
    color: var(--dim);
  }
  #stage-more-chat .chat-compose input:focus-visible {
    outline: 2px solid var(--go);
    outline-offset: 1px;
  }
  .v2-sheet-form {
    display: flex;
    gap: 8px;
  }
  .v2-sheet-form input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: var(--r-1);
    border: 1px solid var(--hair-2);
    background: var(--ink-1);
    color: var(--text);
    font-size: 14px;
  }
  .v2-sheet-scroll {
    max-height: 46dvh;
    overflow-y: auto;
    display: grid;
    gap: 12px;
    padding-inline-end: 4px;
  }
  .v2-sheet-deck-group {
    min-width: 0;
  }
  .v2-sheet-deck-group h4 {
    margin: 2px 0 6px;
    color: var(--soft);
    font-size: .8125rem;
  }
  .v2-sheet-deck-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .v2-sheet-deck-cards .button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .v2-instruction {
    margin: 4px 0 0;
    max-width: 24em;
    font-family: var(--hand);
    font-size: clamp(16px, 4.3vw, 22px);
    line-height: 1.4;
    color: var(--gold-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .v2-grant-banner {
    margin-top: 4px;
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: #f4d28426;
    border: 1px solid #f4d28466;
    color: #fff2d1;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  /* 右侧垂直互动热度光柱 */
  .v2-heat-slot {
    grid-area: heat;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
  }
  .v2-heat-caption {
    font-size: 11px;
    color: var(--dim);
    text-align: center;
    white-space: nowrap;
  }
  .v2-heat-track {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-width: 48px;
    min-height: 110px;
    border-radius: var(--r-pill);
    background: var(--panel-solid);
    border: 1px solid var(--hair-2);
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }
  .v2-heat-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--heat-pct, 4%);
    border-radius: inherit;
    background: linear-gradient(0deg, #ff9f66 0%, #ff6393 52%, #ff2c68 88%, #ffeaf0 100%);
    transition: height .28s var(--out);
  }
  .v2-heat-edge-line {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 10%;
    height: 1px;
    background: #ffffff66;
    pointer-events: none;
  }
  .v2-heat-edge-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, transparent 35%, #ffffff66);
    opacity: 0;
    pointer-events: none;
  }
  .v2-heat-slot[data-zone="edge"] .v2-heat-edge-glow {
    animation: v2-edge-pulse .55s ease-in-out infinite alternate;
  }
  @keyframes v2-edge-pulse {
    from { opacity: .08; }
    to { opacity: .68; }
  }
  .v2-heat-pct {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    text-align: center;
    font-family: var(--serif);
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 1px 6px #000000bb;
    pointer-events: none;
  }
  .v2-heat-combo {
    position: absolute;
    right: calc(100% + 8px);
    bottom: 42%;
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 900;
    color: var(--gold-2);
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s var(--spring);
  }
  .v2-heat-combo[data-show="true"] {
    opacity: 1;
    transform: translateY(0);
  }

  /* 公屏时间线与快捷轨 */
  .v2-talk {
    grid-area: talk;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .v2-feed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 76px;
    overflow-y: auto;
    padding-inline: 2px;
  }
  @media (min-width: 900px) {
    .v2-feed {
      flex: 1 1 auto;
      max-height: none;
      background: var(--panel-solid);
      border: 1px solid var(--hair);
      border-radius: var(--r-2);
      padding: 12px;
    }
  }
  .v2-feed-line {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--soft);
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--panel-solid);
    align-self: flex-start;
    max-width: 100%;
    word-break: break-word;
  }
  .v2-feed-line[data-tone="fast"] { border-inline-start: 3px solid var(--go); }
  .v2-feed-line[data-tone="slow"] { border-inline-start: 3px solid var(--slow); }
  .v2-feed-line[data-tone="stop"] { border-inline-start: 3px solid var(--stop); }
  .v2-feed-line[data-tone="grant"] { border-inline-start: 3px solid var(--grant); color: #fff0cb; }
  .v2-rail {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }
  @media (min-width: 900px) {
    .v2-rail {
      flex-wrap: wrap;
      overflow-x: visible;
    }
  }
  .v2-chip {
    flex: none;
    min-height: 44px;
    padding: 0 13px;
    border-radius: var(--r-pill);
    background: var(--panel-solid);
    border: 1px solid var(--hair-2);
    color: var(--soft);
    font-size: 13px;
    white-space: nowrap;
  }
  .v2-chip[data-accent="gold"] {
    border-color: #f4d28466;
    color: #ffe9b8;
  }

  /* 底部角色操控坞 */
  .v2-dock {
    grid-area: dock;
    display: grid;
    gap: 8px;
  }
  .v2-paused-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .v2-cues {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .v2-cue-btn {
    min-height: 52px;
    padding: 6px 8px;
    border-radius: var(--r-2);
    font-family: var(--serif);
    font-size: clamp(16px, 4.4vw, 20px);
    font-weight: 800;
    background: var(--panel-solid);
    border: 1.5px solid var(--hair-2);
    color: var(--text);
    transition: transform .18s var(--spring), background-color .18s, border-color .18s;
  }
  .v2-cue-btn:active { transform: scale(.95); }
  .v2-cue-btn[data-cue-kind="fast"][aria-pressed="true"] { background: #ff5a9333; border-color: var(--go); color: #fff; }
  .v2-cue-btn[data-cue-kind="slow"][aria-pressed="true"] { background: #ffa66e30; border-color: var(--slow); color: #fff; }
  .v2-cue-btn[data-cue-kind="stop"][aria-pressed="true"] { background: #a99bff33; border-color: var(--stop); color: #fff; }

  .v2-tempo-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: var(--r-2);
    background: var(--panel-solid);
    border: 1px solid var(--hair);
  }
  .v2-tempo-row input[type="range"] {
    width: 100%;
    min-height: 44px;
    accent-color: var(--go);
  }
  .v2-sprint-btn {
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--r-pill);
    background: #ff5a9328;
    border: 1px solid #ff5a9366;
    color: #ffd5e4;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }
  .v2-sprint-btn[aria-pressed="true"] {
    background: var(--go);
    color: #fff;
  }

  .v2-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .v2-tile {
    min-height: 46px;
    padding: 6px 4px;
    border-radius: var(--r-1);
    background: var(--panel-solid);
    border: 1px solid var(--hair);
    color: var(--soft);
    font-size: clamp(11.5px, 3vw, 13px);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .v2-tile[data-gold="true"] {
    background: #f4d28422;
    border-color: #f4d28466;
    color: #ffefc8;
  }

  /* 跟随方底栏双键 */
  .v2-follow-dock {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }
  .v2-follow-sub {
    min-height: 54px;
    padding: 0 14px;
    border-radius: var(--r-pill);
    background: var(--panel-solid);
    border: 1px solid var(--hair-2);
    color: var(--soft);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
  }
  .v2-follow-main {
    min-height: 54px;
    padding: 0 18px;
    border-radius: var(--r-pill);
    font-family: var(--serif);
    font-size: clamp(17px, 4.5vw, 20px);
    font-weight: 800;
    background: var(--rose-grad);
    color: var(--gold-ink);
    box-shadow: 0 8px 26px #ff5a9344;
    transition: transform .2s var(--spring);
  }
  .v2-follow-main:active { transform: scale(.97); }
  .v2-follow-main[data-mode="grant"] { background: var(--grant-grad); color: #2b1a09; }
  .v2-follow-main[data-mode="held"] { background: linear-gradient(135deg, #c6beff, #9184f8); color: #161036; }

  /* 抢占决策层 & 裁决面板 & 抽屉 */
  .v2-overlay {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: grid;
    place-items: safe center;
    overflow: auto;
    padding: 20px;
    background: #140611eb;
  }
  .v2-overlay-card {
    width: min(420px, 100%);
    display: grid;
    gap: 14px;
    padding: 22px 18px;
    border-radius: var(--r-3);
    background: var(--panel-strong);
    border: 1px solid #ff8fb155;
    text-align: center;
  }
  .v2-overlay-card h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(22px, 6vw, 30px);
    color: var(--text);
  }
  .v2-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .v2-choice-grid button {
    min-height: 48px;
    padding: 8px 10px;
    border-radius: var(--r-2);
    background: var(--veil-2);
    border: 1px solid var(--hair-2);
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
  }
  .v2-choice-grid button[data-tone="stop"] { border-color: var(--stop); }
  .v2-choice-grid button[data-tone="sprint"] { border-color: var(--go); background: #ff5a9326; }
  .v2-choice-grid button[data-tone="grant"] { border-color: var(--grant); background: #f4d28424; color: #ffefc8; }

  /* 同意双点指示器（你 · TA） */
  .v2-consent-dots {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .v2-consent-dot {
    font-size: 11.5px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    background: var(--veil);
    border: 1px solid var(--hair);
    color: var(--dim);
  }
  .v2-consent-dot[data-on="true"] {
    background: #89e0d326;
    border-color: var(--mint);
    color: #d7fbf5;
  }

  .stage-content:has(.v2-curve-card) {
    width: 100%;
    min-width: 0;
  }
  .v2-curve-card {
    width: min(100%, 540px);
    min-width: 0;
    margin-top: 20px;
    padding: clamp(12px, 3vw, 18px);
    border: 1px solid #d29cce40;
    border-radius: 18px;
    background: radial-gradient(ellipse at 16% 0%, #36203f 0%, #1c1429 70%);
    text-align: start;
  }
  .v2-echo-card {
    display: grid;
    width: min(100%, 540px);
    min-width: 0;
    gap: 12px;
    margin-block-start: 16px;
    padding: clamp(12px, 3vw, 18px);
    border: 1px solid var(--hair-2);
    border-radius: var(--r-2);
    background: radial-gradient(ellipse at top left, var(--panel-elev), var(--panel-solid) 75%);
    text-align: start;
    overflow-wrap: anywhere;
  }
  .v2-echo-card header, .v2-echo-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
  }
  .v2-echo-card h3 { margin: 0; color: var(--text); font: 700 1rem/1.35 var(--serif); }
  .v2-echo-ended {
    padding: 4px 8px;
    border: 1px solid var(--hair-2);
    border-radius: var(--r-pill);
    color: var(--gold-2);
    font-size: .75rem;
  }
  .v2-echo-recent:empty { display: none; }
  .v2-echo-recent ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
  .v2-echo-recent li {
    padding: 7px 10px;
    border-inline-start: 2px solid var(--gold);
    background: var(--veil);
  }
  .v2-echo-recent, .v2-echo-card small, .v2-echo-card label { color: var(--soft); font-size: .8125rem; }
  #round-echo-form:not([hidden]) { display: grid; gap: 7px; min-width: 0; }
  #round-echo-form textarea {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid var(--hair-2);
    border-radius: var(--r-1);
    background: var(--veil);
    color: var(--text);
    font: inherit;
    resize: vertical;
  }
  #round-echo-form button { min-height: 44px; max-width: 100%; white-space: normal; }
  .v2-curve-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 16px;
  }
  .v2-curve-head h3 {
    margin: 0;
    color: #fff1f8;
    font-size: 16px;
    line-height: 1.35;
  }
  .v2-curve-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
  }
  .v2-curve-actions .button {
    min-height: 36px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.3;
    white-space: normal;
  }
  .v2-curve-svg {
    display: block;
    width: 100%;
    height: auto;
    margin-block: 3px 10px;
  }
  .v2-curve-sprint { fill: #ffbd6c24; }
  .v2-curve-baseline { stroke: #d5a5ca32; }
  .v2-curve-threshold {
    stroke: #e7abd080;
    stroke-dasharray: 3 5;
  }
  .v2-curve-stroke {
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: v2-curve-draw 1.35s cubic-bezier(.3, .55, .35, 1);
  }
  @keyframes v2-curve-draw {
    from { stroke-dasharray: var(--curve-len); stroke-dashoffset: var(--curve-len); }
    to { stroke-dasharray: var(--curve-len); stroke-dashoffset: 0; }
  }
  .v2-curve-svg.is-resetting .v2-curve-stroke,
  [data-lite] .v2-curve-stroke { animation: none; }
  @media (prefers-reduced-motion: reduce) {
    .v2-curve-stroke { animation: none; }
  }
  .v2-curve-edge circle {
    fill: #392344;
    stroke: #ffd1e9;
  }
  .v2-curve-edge text {
    fill: #fff4fa;
    font-size: 7.5px;
    font-weight: 700;
  }
  .v2-curve-grant path {
    stroke: #ffce97;
    stroke-dasharray: 2 4;
    opacity: .7;
  }
  .v2-curve-grant rect { fill: #ffce97; }
  .v2-curve-clock {
    fill: #dec4df;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
  }
  .v2-curve-card .v2-curve-summary {
    margin: 0;
    color: #edd2e7;
    font-size: 13px;
    line-height: 1.55;
  }
  .v2-curve-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid #d29cce32;
  }
  .v2-curve-stats dt {
    color: #d9b9d3;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  .v2-curve-stats dd {
    margin: 3px 0 0;
    color: #fff1f8;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  #dialog:has(.v2-curve-share) {
    width: 640px;
    max-width: calc(100vw - 28px);
  }
  .v2-curve-share canvas {
    display: block;
    width: 100%;
    height: auto;
    margin-block: 16px 12px;
    border: 1px solid #d29cce40;
    border-radius: 12px;
  }
  .v2-curve-share-toggle {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .v2-curve-share-toggle input {
    margin: 0;
    flex: none;
    accent-color: #ed9bc7;
  }
  .v2-curve-share textarea {
    width: 100%;
    resize: vertical;
  }

  /* 矮屏保护（320×568 / 360×640） */
  @media (max-height: 650px) {
    .v2-room { gap: 4px; min-height: 440px; }
    .v2-cue-word { font-size: clamp(40px, 9.5dvh, 66px); }
    .v2-feed { max-height: 48px; }
    .v2-cue-btn { min-height: 46px; }
  }
}
