/**
 * WooCommerce 产品评论样式
 */



#reviews .woocommerce-Reviews-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 30px;
}

/* ==========================================================================
   评论列表
   ========================================================================== */


#comments {
    margin-bottom: 40px;
}

.commentlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.commentlist .comment {
    margin-bottom: 30px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #E8EBED;
}

/* ==========================================================================
   单条评论样式
   ========================================================================== */
.comment_container {
    display: flex;
    gap: 20px;
}

/* 头像 */
.comment_container img.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 评论内容 */
.comment-text {
    flex: 1;
}

/* 评论作者和元信息 */
.comment-text .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.comment-text .meta strong {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.comment-text .meta .woocommerce-review__published-date {
    font-size: 14px;
    color: #999;
}

.comment-text .meta .woocommerce-review__verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #10b981;
    font-weight: 500;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
}

.comment-text .meta .woocommerce-review__verified::before {
    content: "✓";
    font-weight: bold;
}

/* ==========================================================================
   评级样式 - 现代化设计（修复文字显示问题）
   ========================================================================== */
.star-rating {
    display: inline-block;
    font-family: star;
    font-size: 18px;
    line-height: 1;
    position: relative;
    margin-bottom: 0px;
    height: 1em;
    width: 5.6em;
    font-weight: 400;
}
.commentlist li{
   padding-bottom: 20px;
}
/* 隐藏原始文字内容 */
.star-rating span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;
    color: transparent;
}

/* 背景星星（空心） */
.star-rating::before {
    content: "\53\53\53\53\53";
    color: #E8EBED;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    letter-spacing: 0.1em;
    font-size: 1em;
}

/* 填充星星（实心） */
.star-rating span::before {
    content: "\53\53\53\53\53";
    color: #FFB800;
    top: 0;
    position: absolute;
    left: 0;
    letter-spacing: 0.1em;
    font-size: 1em;
}

/* 使用@font-face定义星星字体 */
@font-face {
    font-family: star;
    src: url("../images/stars.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
}

/* 评论区星星显示 */
.comment-text .star-rating {
    display: inline-block;
    margin-bottom: 12px;
    vertical-align: middle;
}

.comment-text .star-rating::after {
    display: none;
}
.comment-text .description {
    margin-top: 15px;
}

.comment-text .description p {
    margin: 0 0 15px;
    line-height: 1.8;
    color: #666;
    font-size: 15px;
}

.comment-text .description p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   评论表单
   ========================================================================== */
#review_form_wrapper {
    background: white;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #E8EBED;
    margin-top: 40px;
}

#reply-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 25px;
}

.comment-reply-title small {
    font-size: 14px;
    font-weight: 400;
    margin-left: 10px;
}

.comment-reply-title small a {
    color: #C8102E;
    text-decoration: none;
}

.comment-reply-title small a:hover {
    text-decoration: underline;
}

/* 评分选择器 */
.comment-form-rating {
    margin-bottom: 25px;
}

.comment-form-rating label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.comment-form-rating .stars {
    display: inline-flex;
    gap: 5px;
    line-height: 1;
}

.comment-form-rating .stars a {
    display: inline-block;
    width: 32px;
    height: 32px;
    font-family: star;
    text-decoration: none;
    color: #E8EBED;
    transition: all 0.2s ease;
    line-height: 32px;
    text-align: center;
    position: relative;
    /* 隐藏链接中的文字 */
    font-size: 0;
    margin-inline-start: 8px;
}

.comment-form-rating .stars a::before {
    content: "\53";
    font-size: 26px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: inherit;
}

.comment-form-rating .stars a:hover,
.comment-form-rating .stars a.active,
.comment-form-rating .stars a.hover {
    color: #FFB800;
    transform: scale(1.1);
}

/* 表单字段 */
.comment-form p {
    margin-bottom: 20px;
}

.comment-form label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E8EBED;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #00247D;
    box-shadow: 0 0 0 3px rgba(0, 36, 125, 0.1);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* 提交按钮 */
.comment-form .form-submit {
    margin: 0;
}

.comment-form .submit {
    background: #00247D;
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form .submit:hover {
    background: #C8102E;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200, 16, 46, 0.35);
}

/* 必填标记 */
.required {
    color: #C8102E;
}

/* ==========================================================================
   评论统计
   ========================================================================== */
.woocommerce-review-link {
    color: #00247D;
    text-decoration: none;
    font-weight: 500;
}

.woocommerce-review-link:hover {
    text-decoration: underline;
}

/* 无评论提示 */
.woocommerce-noreviews {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.1rem;
}

/* ==========================================================================
   评论排序
   ========================================================================== */
.woocommerce-Reviews-title + .woocommerce-Reviews {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   响应式适配
   ========================================================================== */
@media (max-width: 768px) {
    .comment_container {
        flex-direction: column;
        gap: 15px;
    }
    
    .comment_container img.avatar {
        width: 50px;
        height: 50px;
    }
    
    .comment-text .meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #review_form_wrapper {
        padding: 0px;
        border:none;
    }
    
    .commentlist .comment {
        padding: 20px;
    }
    
    /* 移动端星星评分 - 保持PC端样式 */
    .star-rating {
        font-size: 16px;
        width: 5.4em;
        height: 1em;
    }
    
    .star-rating::before,
    .star-rating span::before {
        letter-spacing: 0.1em;
    }
    
    /* 移动端评分选择器 - 稍微调小但保持清晰 */
    .comment-form-rating .stars a {
        width: 28px;
        height: 28px;
        line-height: 28px;
    }
    
    .comment-form-rating .stars a::before {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    /* 小屏幕星星适配 */
    .star-rating {
        font-size: 14px;
        width: 5.6em;
    }
    
    /* 评分选择器 */
    .comment-form-rating .stars a {
        width: 26px;
        height: 26px;
        line-height: 26px;
    }
    
    .comment-form-rating .stars a::before {
        font-size: 18px;
    }
    
    .comment-form .submit {
        width: 100%;
    }
    
    /* 确保星星颜色在移动端也正常 */
    .star-rating::before {
        color: #E8EBED;
    }
    
    .star-rating span::before {
        color: #FFB800;
    }
    
    .comment-form-rating .stars a {
        color: #E8EBED;
    }
    
    .comment-form-rating .stars a:hover,
    .comment-form-rating .stars a.active,
    .comment-form-rating .stars a.hover {
        color: #FFB800;
    }
}
