/* 仅针对未加载完成的懒加载图片（加载图标） */
.home .lazy-load-img:not(.loaded) {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 加载图标固定尺寸，不拉伸 */
    width: 12px !important;
    height: 12px !important;
    object-fit: contain !important;
    /* 强制优先级，仅作用于加载中状�?*/
    max-width: 48px !important;
    max-height: 48px !important;
}

/* 加载完成后的正常图片（完全继承原有样式，无任何强制限制） */
.home .lazy-load-img.loaded {

}

/* 加载失败的图片（保留加载图标原始尺寸，不拉伸�?*/
.home .lazy-load-img.loaded-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 加载图标固定尺寸，不拉伸 */
    width: 12px !important;
    height: 12px !important;
    object-fit: contain !important;
    /* 强制优先级，仅作用于加载失败状�?*/
    max-width: 48px !important;
    max-height: 48px !important;
    /* 可选：添加错误提示样式 */
}

/* ========== 新增：点击浮窗样�?========== */

/* 遮罩层样�?*/
.grid-info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

/* 浮窗容器样式 */
.grid-info-container {
    position: absolute;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    display: none;
    width: 280px;
    padding: 12px;
    font-size: 13px;
}

/* 浮窗箭头样式 */
.grid-info-container::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 8px 8px;
    border-style: solid;
    border-color: transparent transparent #e0e0e0 transparent;
    transition: all 0.3s;
}

.grid-info-container::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 8px 8px;
    border-style: solid;
    border-color: transparent transparent white transparent;
    transition: all 0.3s;
}

/* 浮窗显示在图片上方时的箭头样式 */
.grid-info-container.arrow-down::before {
    top: auto;
    bottom: -8px;
    border-width: 8px 8px 0 8px;
    border-color: #e0e0e0 transparent transparent transparent;
}

.grid-info-container.arrow-down::after {
    top: auto;
    bottom: -7px;
    border-width: 8px 8px 0 8px;
    border-color: white transparent transparent transparent;
}

/* 浮窗标题样式 */
.grid-info-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.3;
}

/* 浮窗详情容器样式 */
.grid-info-details {
    margin-bottom: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

/* 浮窗行样式 */
.grid-info-row {
    display: flex;
    padding: 8px 10px;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.3;
}

/* 移除最后一行的分割线 */
.grid-info-row:last-child {
    border-bottom: none;
}

/* 交替行背景色（可选） */
.grid-info-row:nth-child(even) {
    background-color: #fafafa;
}

/* 浮窗标签样式 */
.grid-info-label {
    font-weight: 600;
    color: #555;
    min-width: 80px;
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1.3;
}

/* 浮窗值样式 */
.grid-info-value {
    color: #666;
    line-height: 1.3;
    flex: 1;
    word-break: break-all;
    font-size: 12px;
    padding-left: 6px;
}

/* 浮窗描述样式 */
.grid-info-description {
    /* 继承.grid-info-value样式 */
}

/* 浮窗链接样式 */
.grid-info-link {
    color: #1890ff;
    text-decoration: none;
}

.grid-info-link:hover {
    text-decoration: underline;
}

/* 浮窗日期样式 */
.grid-info-date {
    color: #999;
    font-size: 12px;
}

/* 功能图标容器样式 */
.grid-info-actions {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* 礼物按钮独占一行 */
.grid-info-action.gift-action {
    width: 100%;
    margin-top: 8px;
    background: #fff3cd;
    border: 1px solid #ffeeba;
}

/* 功能图标样式 */
.grid-info-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
    flex: 1;
    min-width: 56px;
    background: #f5f5f5;
    margin: 2px;
    padding: 5px;
    border-radius: 10px;
    user-select: none;
}

.grid-info-action:hover {
    color: #1890ff;
}

/* 功能图标禁用状�?*/
.grid-info-action.disabled {
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.grid-info-action.disabled:hover {
    color: #ccc;
    opacity: 0.6;
}

/* 图标样式 */
.action-icon {
    font-size: 18px;
    margin-bottom: 2px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 通用图标样式 */
.action-icon-img,
.like-icon {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
    /* 确保图标可以被缩放 */
    transform-origin: center;
}

/* 点赞按钮样式 */
.like-action {
    transition: all 0.3s ease;
}

/* 未点赞状态 */
.like-action:not(.liked) .action-icon {
    color: #999;
    transform: scale(1);
}

.like-action:not(.liked):hover .action-icon {
    color: #ff4d4f;
    transform: scale(1.2);
    animation: pulse 1s infinite;
}

/* 已点赞状态 */
.like-action.liked {
    cursor: not-allowed !important;
    color: #ff4d4f;
    opacity: 0.8;
    /* 移除pointer-events: none，以便鼠标指针样式生效 */
    /* pointer-events: none; */
    /* 确保没有其他规则覆盖 */
    pointer-events: auto !important;
}

.like-action.liked .action-icon {
    color: #ff4d4f;
    transform: scale(1.2);
    animation: heartBeat 0.6s ease;
    /* 确保图标也显示禁止鼠标指针 */
    cursor: not-allowed !important;
}

/* 脉冲动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* 心跳动画 */
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* 图标数字样式 */
.action-count {
    font-size: 10px;
    color: #999;
    font-weight: 500;
    margin-bottom: 2px;
    min-width: 30px;
    text-align: center;
}

/* 图标文本样式 */
.action-text {
    font-size: 11px;
}

/* 加载图标样式 */
.loading-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* 使带有data-order-id的元素可点击 */
.home span[data-order-id] {
    cursor: pointer;
}

/* ========== 新增：评论区域样式 ========== */

/* 统一浮窗容器样式 - 显示在浮窗右侧 */
.grid-info-float {
    position: absolute;
    top: 0;
    left: calc(100% + 10px); /* 显示在浮窗右侧，间距10px */
    width: 280px;
    /* height: 100%; */
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 12px;
    font-size: 13px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
    /* 为浮窗容器添加相对定位，便于内部内容布局 */
    display: flex;
    flex-direction: column;
}

/* 内部浮窗内容区域 - 默认显示，因为HTML是动态加载的 */
.grid-info-comments,
.grid-info-gift {
    display: flex;
    width: 100%;
    flex: 1;
    flex-direction: column;
}

/* 评论头部样式 */
.comments-header,
.gift-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.comments-header h3,
.gift-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.comments-count {
    font-size: 12px;
    color: #999;
}

/* 礼物内容样式 */
.gift-content {
    text-align: center;
}

.gift-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* 评论列表样式 - 只保留一个定义 */
.comments-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px; /* 设置最高高度为400px */
    padding-right: 4px;
    margin-bottom: 8px;
    /* 隐藏滚动条，只在内容溢出时显示 */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

/* 评论框容器样式 - 位于comments-list外部，不会被滚动条影响 */
.comment-form-container {
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
    background-color: white;
    /* 移除sticky定位，因为现在已经在外部 */
    position: relative;
    z-index: 10;
}

/* 鼠标悬停或内容溢出时显示滚动条 */
.comments-list:hover {
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* 评论列表滚动条样式 - 美化 */
.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background-color: transparent;
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.comments-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.comments-list::-webkit-scrollbar-thumb:active {
    background-color: rgba(0, 0, 0, 0.4);
}

/* 评论项样式 */
.comment-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
    border-bottom: 1px solid #f5f5f5;
}

/* 评论主体内容（头像+内容） */
.comment-main {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.comment-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}



/* 用户头像样式 */
.comment-avatar {
    margin-right: 8px;
    flex-shrink: 0;
}

/* 子评论列表容器 - 关键样式，解决缩进问题 */
.sub-comments {
    margin-top: 6px;
    margin-left: 36px; /* 固定左侧间距，用于容纳子评论头像 */
}

/* 子评论项样式 - 所有层级子评论通用 */
.comment-item.sub-comment {
}

/* 子评论头像 - 与主评论头像对齐 */
.comment-item.sub-comment .comment-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-right: 8px;
}

/* 子评论内容 - 与主评论内容对齐 */
.comment-item.sub-comment .comment-content {
    flex: 1;
    min-width: 0;
}

/* 核心修复：嵌套子评论容器不再增加缩进 */
.sub-comments .sub-comments {
    margin-left: 0; /* 嵌套子评论容器不再增加左侧间距 */
    margin-top: 6px;
}

.comment-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e0e0e0;
}

/* 评论内容样式 */
.comment-content {
    flex: 1;
    min-width: 0;
}

/* 评论头部（作者和日期）样式 */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

/* 评论作者样式 */
.comment-author {
    color: #1890ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.comment-author:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* 评论日期样式 */
.comment-date {
    color: #999;
    font-size: 11px;
    text-align: left;
    display: block;
    margin-bottom: 4px;
}

/* 评论页脚样式 */
.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

/* 评论操作样式 */
.comment-actions {
    display: flex;
    align-items: center;
    color: #999;
}

.comment-reply {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.comment-reply:hover {
    color: #1890ff;
    text-decoration: underline;
}

.comment-control {
    text-decoration: none;
    transition: color 0.3s;
}

.comment-control:hover {
    text-decoration: underline;
}

.comment-control-separator {
    color: #ddd;
}

/* 评论文本样式 */
.comment-text {
    color: #666;
    line-height: 1.4;
    font-size: 12px;
    word-break: break-word;
    text-align: left;
    margin-top: 2px;
}



/* 空评论状态样式 */
.comments-empty {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 16px 0;
    background-color: #fafafa;
    border-radius: 4px;
}

.comments-empty p {
    margin: 0;
}

/* 加载中状态样式 */
.comments-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    color: #999;
    font-size: 12px;
}

.comments-loading .loading-icon {
    margin-right: 6px;
}

/* 加载错误状态样式 */
.comments-error {
    text-align: center;
    color: #ff4d4f;
    font-size: 12px;
    padding: 16px 0;
    background-color: #fff2f0;
    border-radius: 4px;
}



/* ========== 新增：评论框样式 ========== */

/* 评论表单 */
.comment-form {
    display: flex;
    flex-direction: column;
}

/* 评论输入区域 - 单行布局 */
.comment-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* 确保textarea滚动条默认不显示，超过1行才显示 */
.comment-textarea {
    flex: 1;
    min-height: 33px;
    max-height: 96px;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    resize: none;
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.3s;
    overflow: hidden;
    /* 只有在内容超过一行时才显示滚动条 */
    overflow-y: hidden;
    /* 滚动条样式：默认完全隐藏，只在需要时显示 */
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
    transition: overflow-y 0.2s ease, scrollbar-width 0.2s ease, scrollbar-color 0.2s ease;
}

/* 当textarea获得焦点或内容超过一行时，显示滚动条 */
.comment-textarea:focus,
.comment-textarea:valid {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* 评论操作区 */
.comment-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 11px;
    color: #999;
}

/* 评论回复链接 */
.comment-reply {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
    min-width: 24px;
}

.comment-reply:hover {
    color: #1890ff;
}

/* 评论控制分隔符 */
.comment-control-separator {
    margin: 0 4px;
    color: #ddd;
}

/* 评论控制链接 */
.comment-control {
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
    color: red;
    min-width: 24px;
}

.comment-control:hover {
    opacity: 0.8;
}

/* 引用评论样式 */
.comment-quote-container {
    margin-bottom: 8px;
}

.comment-quote {
    background-color: #f5f5f5;
    padding: 8px 8px;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    color: #666;
}

.comment-quote-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 11px;
    color: #999;
}

.quote-label {
    margin-right: 4px;
}

.quote-author {
    color: #1890ff;
    text-decoration: none;
    margin-right: auto;
}

.quote-close-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.quote-close-btn:hover {
    background-color: #e0e0e0;
    color: #666;
}

.comment-quote-content {
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: left;
}

/* 评论文本域 - 微信聊天输入框样式 */
.comment-textarea {
    flex: 1;
    min-height: 33px;
    max-height: 96px; /* 3行 */
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    resize: none;
    font-size: 12px;
    line-height: 1.4;
    color: #666;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.3s;
    overflow-y: auto;
}

/* 评论文本域滚动条样式 - 美化 */
.comment-textarea::-webkit-scrollbar {
    width: 6px;
}

.comment-textarea::-webkit-scrollbar-track {
    background-color: transparent;
    border-radius: 3px;
}

.comment-textarea::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.comment-textarea::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.comment-textarea::-webkit-scrollbar-thumb:active {
    background-color: rgba(0, 0, 0, 0.4);
}

.comment-textarea:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* 禁用状态的评论文本域 */
.comment-textarea:disabled {
    background-color: #fafafa;
    color: #999;
    cursor: not-allowed;
}

/* 提交按钮 - 单行布局 */
.comment-submit-btn {
    height: 33px;
    padding: 0 16px;
    background-color: #1890ff;
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.comment-submit-btn:hover {
    background-color: #40a9ff;
}

.comment-submit-btn:active {
    background-color: #096dd9;
}

/* 禁用状态的提交按钮 */
.comment-submit-btn:disabled {
    background-color: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

/* 未登录提示样式已移至 gift.css 文件 */

/* 仿文本域样式 */
.fake-textarea {
    flex: 1;
    height: 33px;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 12px;
    line-height: 1.4;
    color: #999;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fafafa;
}

.fake-textarea a {
    color: #1890ff;
    text-decoration: none;
    transition: color 0.3s;
}

.fake-textarea a:hover {
    color: #40a9ff;
    text-decoration: underline;
}

/* 访客评论表单样式 */
.comment-form-guest .comment-input-area {
    align-items: flex-end;
}

.comment-form-guest .comment-textarea {
    background-color: #fafafa;
    color: #999;
}

/* ========== 新增：格主标识样式 ========== */

/* 格主标识 */
.comment-owner-badge {
    display: inline-block;
    padding: 1px 4px;
    background-color: #ff7a45;
    color: white;
    font-size: 10px;
    font-weight: 500;
    border-radius: 3px;
    vertical-align: middle;
    min-width: 20px;
}

/* 置顶标识 */
.comment-top-badge {
    display: inline-block;
    padding: 1px 4px;
    background-color: #f5222d;
    color: white;
    font-size: 10px;
    font-weight: 500;
    border-radius: 3px;
    vertical-align: middle;
    min-width: 20px;
}

/* 置顶评论项样式 */
.comment-item.is-top {
    background-color: #fff2f0;
    padding: 4px;
    border-radius: 6px;
}

/* 评论作者容器，确保用户名和格主标识垂直居中 */
.comment-author-container {
    display: flex;
    align-items: center;
    color: #424242;
}

/* ========== 访问量趋势颜色样式 ========== */
/* 增长趋势 - 红色 */
.visit-trend-increase {
    color: #f44336 !important;
}

/* 下降趋势 - 绿色 */
.visit-trend-decrease {
	color: #4CAF50 !important;
}

/* 持平趋势 - 灰色 */
.visit-trend-steady {
    color: #9e9e9e !important;
}

/* 7日内最高 - 橙色 */
.visit-trend-max {
    color: #ff9800 !important;
}
