/* 业余无线电主题评论模块样式 */

/* ========================================
   1. 评论区块容器
   ======================================== */
.comment-section {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--comment-bg, #ffffff);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--comment-border, #e2e8f0);
}

.comment-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--comment-text, #2d3748);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-title i {
    color: var(--comment-primary, #1a5f7a);
    font-size: 1.75rem;
}

.comment-count {
    font-size: 0.95rem;
    color: var(--comment-text-light, #718096);
    font-weight: 500;
    background: var(--comment-bg-light, #f7fafc);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* ========================================
   2. 评论列表
   ======================================== */
.comment-list {
    margin-bottom: 2rem;
}

.comment-list > .comment,
.comment-list > .pingback,
.comment-list > .trackback {
    margin-bottom: 1.5rem;
}

/* ========================================
   3. 单条评论样式
   ======================================== */
.comment {
    background: linear-gradient(145deg, #ffffff, #fafbfc);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--comment-border, #e2e8f0);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.comment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--comment-primary, #1a5f7a), var(--comment-secondary, #e8a838));
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comment:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.comment:hover::before {
    opacity: 1;
}

/* 评论头部 */
.comment-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* 头像样式 */
.comment-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--comment-primary, #1a5f7a);
    box-shadow: 0 4px 12px rgba(26, 95, 122, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.comment:hover .comment-avatar {
    transform: scale(1.08);
    border-color: var(--comment-secondary, #e8a838);
}

/* 评论元信息 */
.comment-meta {
    flex: 1;
    min-width: 0;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--comment-text, #2d3748);
}

.author-badge {
    background: linear-gradient(135deg, var(--comment-primary, #1a5f7a), var(--comment-info, #3498db));
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 500;
}

.comment-time {
    font-size: 0.875rem;
    color: var(--comment-text-light, #718096);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* 评论内容 */
.comment-body {
    margin: 1rem 0;
    line-height: 1.8;
    color: var(--comment-text, #2d3748);
}

.comment-body p {
    margin-bottom: 0.75rem;
}

.comment-body p:last-child {
    margin-bottom: 0;
}

.comment-body a {
    color: var(--comment-primary, #1a5f7a);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.comment-body a:hover {
    border-bottom-color: var(--comment-primary, #1a5f7a);
}

/* ========================================
   4. 评论操作按钮
   ======================================== */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--comment-border, #e2e8f0);
    flex-wrap: wrap;
}

.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 24px;
    background: rgba(26, 95, 122, 0.06);
    color: var(--comment-secondary, #e8a838);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.comment-like-btn i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

.comment-like-btn:hover {
    background: rgba(26, 95, 122, 0.12);
    transform: scale(1.05);
}

.comment-like-btn:hover i {
    animation: heartBeat 0.6s ease;
}

.comment-like-btn.liked {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.comment-like-btn.liked i {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 回复按钮 */
.comment-reply-link,
.comment-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 24px;
    background: rgba(232, 168, 56, 0.06);
    color: var(--comment-text-light, #718096);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.comment-reply-link:hover,
.comment-edit-link:hover {
    background: rgba(232, 168, 56, 0.15);
    color: var(--comment-secondary, #e8a838);
    text-decoration: none;
}

/* ========================================
   5. 嵌套回复结构
   ======================================== */
.comment-replies {
    margin-top: 1.5rem;
    margin-left: 60px;
    padding-left: 24px;
    border-left: 3px solid var(--comment-border, #e2e8f0);
    position: relative;
}

.comment-replies::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, 
        var(--comment-primary, #1a5f7a), 
        var(--comment-secondary, #e8a838)
    );
    border-radius: 3px;
}

/* 不同层级的视觉区分 */
.comment-replies.level-1 { border-left-color: #e8a838; }
.comment-replies.level-2 { border-left-color: #27ae60; }
.comment-replies.level-3 { border-left-color: #9b59b6; }
.comment-replies.level-4 { border-left-color: #e74c3c; }

/* 子评论样式调整 */
.comment-children .comment {
    background: var(--comment-bg-light, #fafbfc);
    padding: 1.25rem;
    border-radius: 12px;
}

.comment-children .comment-avatar {
    width: 48px;
    height: 48px;
}

.comment-children .comment-body {
    font-size: 0.95rem;
}

/* ========================================
   6. 空状态和关闭状态
   ======================================== */
.comment-empty,
.comment-closed {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--comment-text-light, #718096);
}

.comment-empty i,
.comment-closed i {
    font-size: 4rem;
    color: var(--comment-border, #e2e8f0);
    margin-bottom: 1rem;
}

.comment-empty p,
.comment-closed p {
    font-size: 1.1rem;
    margin: 0;
}

/* ========================================
   7. 评论表单
   ======================================== */
.comment-form-wrapper {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--comment-border, #e2e8f0);
}

.comment-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--comment-text, #2d3748);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-form-title i {
    color: var(--comment-primary, #1a5f7a);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-form-comment textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--comment-border, #e2e8f0);
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--comment-text, #2d3748);
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 120px;
}

.comment-form-comment textarea:focus {
    outline: none;
    border-color: var(--comment-primary, #1a5f7a);
    box-shadow: 0 0 0 4px rgba(26, 95, 122, 0.1);
}

.comment-form-comment textarea::placeholder {
    color: var(--comment-text-light, #718096);
}

/* 作者信息字段 */
.comment-form-author,
.comment-form-email,
.comment-form-url {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    align-items: center;
}

.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
    font-weight: 600;
    color: var(--comment-text, #2d3748);
}

.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--comment-border, #e2e8f0);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--comment-text, #2d3748);
    transition: all 0.3s ease;
}

.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    outline: none;
    border-color: var(--comment-primary, #1a5f7a);
    box-shadow: 0 0 0 4px rgba(26, 95, 122, 0.1);
}

/* 提交按钮 */
.submit-btn {
    background: linear-gradient(135deg, var(--comment-primary, #1a5f7a), var(--comment-primary-dark, #134b5f));
    color: white;
    padding: 12px 32px;
    border: none;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(26, 95, 122, 0.3);
    align-self: flex-start;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 95, 122, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* 取消回复链接 */
.cancel-comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--comment-danger, #e74c3c);
    text-decoration: none;
    font-size: 0.95rem;
    margin-left: 1rem;
    transition: all 0.3s ease;
}

.cancel-comment-reply-link:hover {
    text-decoration: underline;
}

/* ========================================
   8. 分页导航
   ======================================== */
.comment-pagination {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--comment-border, #e2e8f0);
}

.comment-pagination .pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comment-pagination a,
.comment-pagination .current {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.comment-pagination a {
    background: var(--comment-bg-light, #f7fafc);
    color: var(--comment-text, #2d3748);
    border: 1px solid var(--comment-border, #e2e8f0);
}

.comment-pagination a:hover {
    background: var(--comment-primary, #1a5f7a);
    color: white;
    border-color: var(--comment-primary, #1a5f7a);
}

.comment-pagination .current {
    background: var(--comment-primary, #1a5f7a);
    color: white;
}

/* ========================================
   9. 响应式设计
   ======================================== */

/* 平板适配 */
@media (max-width: 992px) {
    .comment-section {
        padding: 1.5rem;
    }
    
    .comment-avatar {
        width: 48px;
        height: 48px;
    }
    
    .comment-replies {
        margin-left: 48px;
        padding-left: 20px;
    }
    
    .comment-form-author,
    .comment-form-email,
    .comment-form-url {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* 手机适配 */
@media (max-width: 768px) {
    .comment-section {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .comment-title {
        font-size: 1.25rem;
    }
    
    .comment {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .comment-avatar {
        width: 44px;
        height: 44px;
    }
    
    .comment-author {
        font-size: 1rem;
    }
    
    .comment-body {
        font-size: 0.95rem;
        margin: 0.75rem 0;
    }
    
    .comment-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .comment-like-btn,
    .comment-reply-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .comment-replies {
        margin-left: 24px;
        padding-left: 16px;
        border-left-width: 2px;
    }
    
    .comment-form-comment textarea {
        padding: 0.75rem;
        min-height: 100px;
    }
    
    .submit-btn {
        width: 100%;
        text-align: center;
    }
}

/* 超小屏幕 */
@media (max-width: 576px) {
    .comment-section {
        padding: 0.75rem;
        border-radius: 12px;
    }
    
    .comment-avatar {
        width: 40px;
        height: 40px;
    }
    
    .comment-author-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .comment-like-btn,
    .comment-reply-link {
        justify-content: center;
    }
    
    .comment-replies {
        margin-left: 16px;
        padding-left: 12px;
    }
    
    .comment-children .comment-avatar {
        width: 36px;
        height: 36px;
    }
}

/* ========================================
   10. 动画效果
   ======================================== */

/* 加载动画 */
@keyframes commentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment {
    animation: commentFadeIn 0.5s ease forwards;
}

/* 悬停特效 */
.comment::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(26, 95, 122, 0.03), 
        rgba(232, 168, 56, 0.03)
    );
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.comment:hover::after {
    opacity: 1;
}

/* 按钮点击波纹 */
.comment-like-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(231, 76, 60, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.comment-like-btn:active::before {
    width: 200px;
    height: 200px;
}
