/* 资源评论区语音留言 */
.voice-composer {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 11px;
    background: var(--surface-2);
}
.voice-composer__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.voice-composer__record {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 34px; padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
    border-radius: 9px; background: var(--surface); color: var(--brand);
    font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.voice-composer__record small { color: var(--muted-2); font-size: 9px; font-weight: 400; }
.voice-composer__record:hover { border-color: var(--brand); }
.voice-composer__record.is-recording { border-color: #d45454; background: #fff2f1; color: #b43a3a; animation: voice-pulse 1.1s ease-in-out infinite; }
.voice-composer__record.is-recording small { color: #b43a3a; }
.voice-composer__timer { color: var(--muted-2); font-family: ui-monospace, monospace; font-size: 10px; }
.voice-composer__upload { margin-left: auto; padding: 0; border: 0; background: none; color: var(--muted-2); font: inherit; font-size: 10px; text-decoration: underline; cursor: pointer; }
.voice-composer__upload:hover { color: var(--brand); }
.voice-composer__preview { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.voice-composer__preview[hidden] { display: none; }
.voice-composer__preview audio { width: min(100%, 330px); height: 34px; }
.voice-composer__preview [data-voice-preview-time] { color: var(--muted-2); font-size: 10px; }
.voice-composer__status { margin-top: 7px; color: var(--muted-2); font-size: 9px; line-height: 1.6; }
.voice-composer__status.is-error { color: #b43a3a; }
.voice-composer__status.is-ok { color: var(--brand); }
.voice-composer.is-busy { opacity: .7; pointer-events: none; }

.voice-comment {
    display: flex; align-items: center; gap: 8px;
    width: min(100%, 440px); margin-top: 2px; padding: 7px 9px;
    border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
    border-radius: 10px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 5%, var(--surface)), var(--surface));
}
.voice-comment__toggle {
    flex: none; display: grid; place-items: center;
    width: 31px; height: 31px; padding: 0;
    border: 0; border-radius: 50%;
    background: var(--brand); color: #fff;
    font: inherit; font-size: 11px; cursor: pointer;
    box-shadow: 0 3px 9px rgba(20, 90, 55, .2);
}
.voice-comment__toggle:hover { background: var(--brand-2); }
.voice-comment__wave { display: flex; align-items: center; gap: 2px; flex: 1; height: 30px; min-width: 0; overflow: hidden; }
.voice-comment__wave i { display: block; flex: 1; min-width: 1px; max-width: 4px; border-radius: 2px; background: color-mix(in srgb, var(--brand) 36%, var(--line)); transition: background .15s ease; }
.voice-comment.is-playing .voice-comment__wave i.is-played { background: var(--brand); }
.voice-comment__time { flex: none; color: var(--muted-2); font-family: ui-monospace, monospace; font-size: 9px; }
.voice-comment__tag { display: none; }
.voice-comment audio { display: none; }
.voice-comment.is-playing .voice-comment__toggle { background: var(--ink); }

.admin-voice-comment { display: grid; gap: 5px; min-width: 220px; }
.admin-voice-comment > span { color: var(--muted-2); font-size: 9px; }
.admin-voice-comment audio { width: 240px; max-width: 100%; height: 30px; }
@keyframes voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(212, 84, 84, .15); } 50% { box-shadow: 0 0 0 5px rgba(212, 84, 84, .03); } }
@media (max-width: 600px) {
    .voice-composer { padding: 9px 10px; }
    .voice-composer__upload { margin-left: 0; }
    .voice-composer__preview audio { width: 100%; }
    .voice-comment { width: 100%; }
    .voice-comment__wave { gap: 1px; }
}


/* 聊天室语音 */
.chat-voice-composer {
    margin: 8px 12px 0;
    padding: 9px 10px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}
.chat-voice-composer .voice-composer__bar { gap: 6px; }
.chat-voice-composer .voice-composer__record { min-height: 31px; padding: 0 9px; font-size: 10px; }
.chat-voice-composer .voice-composer__record small { display: none; }
.chat-voice-composer .voice-composer__timer { font-size: 9px; }
.chat-voice-composer .voice-composer__upload { font-size: 9px; }
.chat-voice-composer .voice-composer__preview audio { width: 100%; max-width: 260px; height: 32px; }
.chat-voice-composer .voice-composer__status { margin-top: 5px; font-size: 8px; }
.chat-bubble.chat-bubble--voice { padding: 0; border: 0; background: transparent; box-shadow: none; max-width: min(100%, 390px); }
.voice-comment--chat { margin-top: 0; width: min(100%, 360px); }
.voice-comment--chat .voice-comment__toggle { width: 29px; height: 29px; }
.voice-comment--chat .voice-comment__wave { height: 28px; }
.voice-comment--chat .voice-comment__time { font-size: 8px; }
@media (max-width: 600px) {
    .chat-voice-composer { margin: 6px 8px 0; padding: 8px; }
    .voice-comment--chat { width: 100%; }
}
