/* ========== 评论弹窗 - 玻璃水晶透明风格 ========== */

/* 弹窗遮罩 */
.comment-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    animation: commentFadeIn 0.3s ease;
}

@keyframes commentFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 弹窗主体 - 玻璃水晶风格 */
.comment-modal {
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05),
        0 0 80px rgba(102, 126, 234, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: commentSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.comment-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.comment-modal::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(102, 126, 234, 0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(118, 75, 162, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

@keyframes commentSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 弹窗头部 */
.comment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.comment-modal-title {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-modal-title svg {
    opacity: 0.7;
}

.comment-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.comment-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

/* 弹窗内容区 */
.comment-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    position: relative;
    z-index: 1;
    min-height: 200px;
    max-height: 55vh;
}

.comment-modal-body::-webkit-scrollbar {
    width: 4px;
}

.comment-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.comment-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.comment-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 弹窗底部分页 */
.comment-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.comment-page-info {
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
}

.comment-page-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.comment-page-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.comment-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 评论条目 */
.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
    animation: commentItemIn 0.3s ease backwards;
}

.comment-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

@keyframes commentItemIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-item:nth-child(1) { animation-delay: 0.02s; }
.comment-item:nth-child(2) { animation-delay: 0.04s; }
.comment-item:nth-child(3) { animation-delay: 0.06s; }
.comment-item:nth-child(4) { animation-delay: 0.08s; }
.comment-item:nth-child(5) { animation-delay: 0.1s; }

.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.comment-avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.comment-nick {
    font-weight: 500;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.comment-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    word-break: break-word;
}

.comment-likes {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
}

/* 加载/空状态 */
.comment-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    gap: 16px;
    color: rgba(255, 255, 255, 0.4);
}

.comment-loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(102, 126, 234, 0.7);
    border-radius: 50%;
    animation: commentSpin 0.8s linear infinite;
}

@keyframes commentSpin {
    to { transform: rotate(360deg); }
}

.comment-empty {
    text-align: center;
    padding: 50px 20px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
}

.comment-error {
    color: rgba(231, 76, 60, 0.8);
}

/* 播放栏评论按钮 */
.mini-btn-comment {
    position: relative;
}

.mini-btn-comment::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-light);
    opacity: 0;
    transition: opacity 0.2s;
}

.mini-btn-comment:hover::after {
    opacity: 1;
}

/* 亮色主题适配 */
[data-theme="light"] .comment-modal {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 0 80px rgba(102, 126, 234, 0.06);
}

[data-theme="light"] .comment-modal::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

[data-theme="light"] .comment-modal-title {
    background: linear-gradient(135deg, #1a1a2e 0%, rgba(0,0,0,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .comment-modal-close {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .comment-modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .comment-modal-header,
[data-theme="light"] .comment-modal-footer {
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .comment-item {
    border-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .comment-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .comment-nick {
    color: rgba(0, 0, 0, 0.85);
}

[data-theme="light"] .comment-time {
    color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .comment-text {
    color: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] .comment-likes {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .comment-avatar {
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .comment-page-info {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .comment-page-btn {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .comment-empty {
    color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .comment-loading {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .comment-loading-spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: rgba(102, 126, 234, 0.7);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .comment-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .comment-modal {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        border-radius: 20px 20px 0 0;
        animation: commentSlideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .comment-modal-header {
        padding: 16px 18px 12px;
        flex-shrink: 0;
    }
    
    .comment-modal-body {
        max-height: calc(88vh - 120px);
        -webkit-overflow-scrolling: touch;
    }
    
    .comment-item {
        padding: 12px 18px;
    }
    
    .comment-modal-footer {
        padding: 12px 18px;
        flex-shrink: 0;
    }
    
    .comment-modal-close {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

@keyframes commentSlideUpMobile {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
