.content-detail-comments {
    margin-top: 20px;
    padding: 24px 20px 18px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(122, 81, 226, 0.28);
    box-sizing: border-box;
}

.comments-section.comments-section--detail {
    margin-top: 0;
    padding-top: 4px;
    border-top: none;
}

.comments-section--detail .comments-section-title {
    margin: 0;
    padding-top: 2px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #b49aff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comments-section--detail .comments-header {
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-top: 2px;
}

.comments-section--detail .comment-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(167, 139, 250, 0.16);
    border-radius: 12px;
    box-sizing: border-box;
    max-width: 100%;
}

.comments-section--detail .comment-input-wrapper {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.comments-section--detail .comment-input {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 36px;
    max-height: 36px;
    height: 36px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.86rem;
    line-height: 1.2;
    resize: none;
    overflow: hidden;
}

.comments-section--detail .comment-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.comments-section--detail .comment-btn,
.comments-section--detail .ai-generate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.comments-section--detail .ai-generate-btn {
    background: rgba(122, 81, 226, 0.18);
    border: 1px solid rgba(167, 139, 250, 0.32);
    color: #d8c4ff;
}

.comments-section--detail .ai-generate-btn:hover {
    background: rgba(122, 81, 226, 0.32);
    border-color: rgba(167, 139, 250, 0.45);
    color: #efe7ff;
    transform: none;
    box-shadow: none;
}

.comments-section--detail .ai-generate-btn:disabled,
.comments-section--detail .comment-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.comments-section--detail .comment-btn {
    background: #7a51e2;
    border: 1px solid rgba(167, 139, 250, 0.4);
    color: #fff;
    min-width: 76px;
}

.comments-section--detail .comment-btn:hover {
    background: #6a41d2;
    transform: none;
    box-shadow: 0 2px 10px rgba(122, 81, 226, 0.28);
}

.comments-section--detail .ai-generate-btn svg,
.comments-section--detail .ai-generate-btn i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.comments-login-hint {
    font-size: 0.84rem;
    color: #8b8ba7;
    margin: 0 0 12px;
}

.comments-login-hint a {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
}

.comments-login-hint a:hover {
    color: #c4b5fd;
}

.comments-section--detail .comments-list {
    max-height: 360px !important;
}

.comments-section--detail .comment-reply-compose {
    flex-wrap: wrap;
}

@media (min-width: 769px) {
    .comments-section--detail .comment-reply-compose {
        flex-wrap: nowrap;
    }
}

@media (max-width: 768px) {
    .content-detail-comments {
        padding: 20px 14px calc(20px + env(safe-area-inset-bottom, 0px));
        margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .comments-section--detail .comments-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .comments-section--detail .comments-count {
        font-size: 0.82rem;
    }

    .comments-section--detail .comments-list-wrapper {
        overflow: visible;
        max-height: none;
    }

    .comments-section--detail .comments-list {
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: hidden;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: auto;
    }

    .comments-section--detail .comment-form {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    .comments-section--detail .comment-input-wrapper {
        width: 100%;
    }

    .comments-section--detail .comment-input {
        min-height: 40px;
        max-height: 88px;
        height: auto;
        overflow-y: auto;
    }

    .comments-section--detail .comment-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .comments-section--detail .comment-btn,
    .comments-section--detail .ai-generate-btn {
        width: 100%;
        min-width: 0;
    }

    .comments-section--detail .comment-reply-compose {
        flex-direction: column;
        align-items: stretch;
    }

    .comments-section--detail .comment-reply-actions {
        width: 100%;
        justify-content: stretch;
    }

    .comments-section--detail .comment-reply-cancel,
    .comments-section--detail .comment-reply-submit {
        flex: 1 1 0;
    }
}
