/* 更新音色卡片样式 */
.voice-card {
    padding: 12px 24px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, .05);
    background-color: var(--is-surface);
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.tag-pills {
    padding: 5px 0;
    font-size: 10px;
}
.container-fluid.py-4 {
    padding: 15px;
}
.d-flex.justify-content-between.align-items-center.mb-4 {
    padding: 15px;
    background-color: var(--is-surface);
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
@media (max-width: 768px) {
.col-md-8-you {
    width: auto;
}
}
    /* 角标样式 */
.voice-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1;
}

.jb-remen { background: #ff4757; color: white; }
.jb-jingxuan { background: #2ed573; color: white; }
.jb-xiaozhong { background: #1e90ff; color: white; }
.jb-qinggan { background: #ffa502; color: white; }
.jb-jieshuo { background: #7bed9f; color: white; }

.voice-lang, .voice-type {
    font-size: 0.9rem;
    color: #666;
}

.voice-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.tag {
    padding: 0 12px;
    color: #2d3b2f;  /* 深色文字 */
    border-radius: 50rem;
    font-size: 0.85rem;
    margin: 0 8px 8px 0;
    display: inline-block;
}

/* 定义柔和的背景色 */
.tag-green { background: #80ffa4db; color: #05c021; }  /* 深绿色文字 */
.tag-blue { background: #94e8ffba; color: #006fff; }   /* 深蓝色文字 */
.tag-orange { background: #ffc2abb5; color: #ff6500; } /* 深橙色文字 */
.tag-red { background: #ff749e94; color: #e51d08; }    /* 深红色文字 */
.tag-purple { background: #df8dff8f; color: #b505ff; } /* 深紫色文字 */
.tag-yellow { background: #FFF9C4; color: #FBC02D; } /* 深黄色文字 */   

.voice-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 15px;
    background: rgb(187 186 186 / 66%);
    transform: translateY(110%);
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(0,0,0,.05);
}

.voice-card:hover .voice-actions {
    transform: translateY(0);
}

/* 训练中卡片：流光边框 + 常驻状态条（无需 hover） */
.voice-card.is-training,
.voice-card[data-status="training"] {
    position: relative;
    overflow: hidden;
    border-color: transparent;
    animation: training-card-glow 2.4s ease-in-out infinite;
}

.voice-card.is-training::before,
.voice-card[data-status="training"]::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 15px;
    padding: 2px;
    background: linear-gradient(120deg, #007AFF, #34C759, #5AC8FA, #007AFF);
    background-size: 300% 300%;
    animation: training-border-flow 3s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

.voice-card.is-training::after,
.voice-card[data-status="training"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: training-shimmer 2.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.training-status-visible {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(0, 122, 255, 0.1), rgba(52, 199, 89, 0.12), rgba(0, 122, 255, 0.1));
    background-size: 200% 100%;
    animation: training-bg-flow 2s linear infinite;
    color: #007AFF;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    z-index: 3;
}

.voice-card.is-training .voice-content,
.voice-card[data-status="training"] .voice-content {
    position: relative;
    z-index: 3;
}

/* 合成记录「合成中」卡片复用流光边框（圆角与 voice-card 对齐，避免角标被裁切） */
.synthesis-record .card.is-training {
    position: relative;
    overflow: hidden;
    border-radius: 15px !important;
    border-color: transparent !important;
    background-color: var(--is-surface, #fff);
    box-shadow: none !important;
    animation: training-card-glow 2.4s ease-in-out infinite;
    isolation: isolate;
}

.synthesis-record .card.is-training::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 15px;
    padding: 2px;
    background: linear-gradient(120deg, #007AFF, #34C759, #5AC8FA, #007AFF);
    background-size: 300% 300%;
    animation: training-border-flow 3s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

.synthesis-record .card.is-training::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    border-radius: 15px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: training-shimmer 2.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.synthesis-record .card.is-training .card-body {
    position: relative;
    z-index: 3;
}

.synthesis-record .card.is-training:hover {
    transform: none;
    box-shadow: none !important;
}

.synthesis-record .card.is-training .training-status-visible {
    margin-top: 4px;
}

[data-bs-theme="dark"] .training-status-visible {
    color: #5AC8FA;
    background: linear-gradient(90deg, rgba(0, 122, 255, 0.18), rgba(52, 199, 89, 0.15), rgba(0, 122, 255, 0.18));
    background-size: 200% 100%;
}

@keyframes training-border-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes training-shimmer {
    0% { left: -120%; }
    100% { left: 140%; }
}

@keyframes training-bg-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes training-card-glow {
    0%, 100% { box-shadow: 0 4px 12px rgba(0, 122, 255, 0.12); }
    50% { box-shadow: 0 6px 20px rgba(0, 122, 255, 0.22); }
}

/* 添加加载中状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
/* 标签样式 */
.pill-tag {
    border: none;
    background: #f0f2ff;
    color: #4e6ef3;
    padding: 4px 12px;
    border-radius: .35rem;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.pill-tag:hover {
    background: #e0e4ff;
}
.pill-tag.active {
    background: #4e6ef3;
    color: white;
    padding: 4px 12px;
}

/* 音色卡片网格 */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* 音色卡片样式 */


.voice-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,.05);
}

.voice-avatar {
    width: 88px;
    height:88px;
    border-radius: 50%;
    margin-bottom: 16px;
    object-fit: cover;
}

.voice-title {
    padding-bottom: 25px;
}
/* 按钮状态样式 */
.voice-actions {
    display: flex;
    align-items: center;
    gap: 10px; /* 按钮之间的间距 */
    padding: 10px;
}

.preview-btn .fa-stop-circle {
    display: none;
}

.preview-btn.playing .fa-stop-circle {
    display: inline;
}

/* 进度条容器 */
.progress-container {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 0 10px;
    cursor: pointer;
    display: none;
    position: relative;
}

/* 播放时显示进度条 */
.voice-card.playing .progress-container {
    display: block;
}

/* 播放时隐藏使用按钮 */
.voice-card.playing .use-btn {
    display: none;
}

.progress-bar {
    height: 100%;
    background: #007bff;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}
/* 收藏按钮样式 - 与其他按钮保持一致的立体感 */
.favorite-btn {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.favorite-btn:not(.favorited) {
    background: var(--is-surface);
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.favorite-btn:not(.favorited):hover {
    background: #f8f9fa;
    border-color: #ffc107;
    color: #ffc107;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.favorite-btn:not(.favorited):active {
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transform: translateY(1px);
}

.favorite-btn.favorited {
    background: #ffc107;
    border-color: #ffc107;
    color: var(--is-surface);
    box-shadow: 0 2px 4px rgba(255,193,7,0.3);
}

.favorite-btn.favorited:hover {
    background: #ffb300;
    border-color: #ffb300;
    box-shadow: 0 3px 6px rgba(255,193,7,0.4);
}

.favorite-btn.favorited:active {
    box-shadow: 0 1px 2px rgba(255,193,7,0.2);
    transform: translateY(1px);
}

.favorite-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}