.turn-message-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
}

/* 主题模式：旧的气泡内朗读/翻译入口让位给统一操作栏；时间落到分隔线下，和动作同层。 */
#character-chat-screen:not(.chat-ui-mode-chatgpt):not(.chat-ui-mode-claude) .chat-tts-play-btn,
#character-chat-screen:not(.chat-ui-mode-chatgpt):not(.chat-ui-mode-claude) .chat-translate-btn {
    display: none !important;
}

#character-chat-screen:not(.chat-ui-mode-chatgpt):not(.chat-ui-mode-claude) .turn-message-actions .turn-message-time {
    display: block !important;
    flex: 0 0 auto;
    margin: 0 2px 0 auto !important;
    padding-left: 10px;
    color: inherit;
    font-size: .72rem !important;
    line-height: 30px;
    text-align: right !important;
    white-space: nowrap;
    opacity: .52 !important;
}

.turn-message-action {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font-size: inherit;
    opacity: .48;
    cursor: pointer;
    touch-action: manipulation;
    transition: opacity .15s, background .15s;
}

.turn-message-action:hover,
.turn-message-action:focus-visible,
.turn-message-action[aria-expanded="true"] {
    opacity: .88;
    background: color-mix(in srgb, var(--text) 7%, transparent);
    outline: none;
}

.turn-message-action svg {
    /* 动作图标跟随角色的气泡字号：17px 气泡时仍为原基准 17px。 */
    width: 1em;
    height: 1em;
    pointer-events: none;
}

.turn-snapshot-panel {
    margin-top: 8px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card-bg) 94%, var(--accent) 6%);
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    overflow: hidden;
}

.turn-snapshot-panel[hidden] { display: none !important; }

.turn-snapshot-panel.is-open {
    animation: turn-snapshot-open .18s ease-out both;
}

@keyframes turn-snapshot-open {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.turn-snapshot-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
}

.turn-snapshot-header strong { font-size: 14px; letter-spacing: .08em; }
.turn-snapshot-header span { opacity: .58; font-size: 11px; }

.turn-snapshot-section { margin-top: 12px; }
.turn-snapshot-section h4 {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .08em;
    opacity: .58;
}

.turn-snapshot-row {
    display: grid;
    grid-template-columns: minmax(68px, 86px) minmax(0, 1fr);
    gap: 10px;
    padding: 2px 0;
}

.turn-snapshot-key { opacity: .62; }
.turn-snapshot-value { overflow-wrap: anywhere; }
.turn-snapshot-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.turn-snapshot-chip {
    display: inline-flex;
    padding: 1px 6px;
    border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
    border-radius: 999px;
    font-size: 11px;
}

.turn-scope-activation {
    display: grid;
    grid-template-columns: minmax(68px, 86px) minmax(72px, 1fr) 18px;
    align-items: center;
    gap: 8px;
    min-height: 24px;
}

.turn-scope-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-scope-track {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text) 11%, transparent);
}
.turn-scope-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}
.turn-scope-score { text-align: right; font-variant-numeric: tabular-nums; opacity: .7; }

.chat-ui-mode-chatgpt .turn-message-actions {
    border-top: 0;
    padding-top: 2px;
    margin-left: -7px;
}

.chat-ui-mode-chatgpt .turn-snapshot-panel {
    background: var(--bg);
    border-color: color-mix(in srgb, var(--text) 14%, transparent);
    box-shadow: none;
}

@media (max-width: 520px) {
    .turn-snapshot-panel { width: min(82vw, 360px); padding: 12px; }
    .turn-snapshot-header { align-items: flex-start; flex-direction: column; gap: 2px; }
    .turn-message-action { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    .turn-snapshot-panel.is-open { animation: none; }
}
