/* 页面背景 - 防止布局抖动 */
html {
    overflow-y: scroll; /* 始终显示垂直滚动条 */
}

body {
    min-height: 100vh;
    min-height: 100dvh; /* 动态视口高度，确保移动端也需要滚动条 */
}

:root {
    --xhs-primary: #ff2442;
    --xhs-primary-soft: #fff1f2;
    --xhs-primary-border: rgba(255, 36, 66, 0.2);
    --xhs-primary-shadow: rgba(255, 36, 66, 0.25);
}

/*
 * 圆角层级：交互按钮、标签与角标统一 20px 胶囊；卡片与评论输入 10px；
 * 面板、表单与弹窗 8px；头像与圆形图标按钮 50%。
 * 不再保留 4px 扁平按钮，避免同一页面出现两套按钮语言。
 */

/* 移动端 */
@media (max-width: 768px) {
    html {
        overflow-x: hidden;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
        /* 确保body高度超过视口，强制显示滚动条 */
        min-height: calc(100vh + 1px);
        min-height: calc(100dvh + 1px);
    }
}

/* 分类标签导航栏 - 与顶部导航栏样式一致 */
.category-nav-wrapper {
    margin-bottom: 16px;
    overflow: hidden;
    position: relative;
}

.category-nav {
    display: flex;
    align-items: center;
    gap: 32px; /* 与顶部导航栏 space-x-8 一致 */
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    font-size: 15px;
    color: #999;
    font-weight: 400;
    padding: 8px 0;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.category-item:hover {
    color: #333;
}

.category-item.active {
    color: #333;
    font-weight: 600;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
}

/* 移动端滑动提示箭头 */
.category-nav-arrow {
    display: none;
}

/* 移动端分类导航优化 */
@media (max-width: 768px) {
    .category-nav-wrapper {
        margin: 0 -16px 12px;
        padding: 0 16px;
    }
    
    .category-nav {
        gap: 24px; /* 移动端稍微紧凑一些 */
        padding-right: 24px; /* 给箭头留出空间 */
    }
    
    .category-item {
        font-size: 15px;
        padding: 6px 0;
    }
    
    .category-item.active {
        padding: 4px 12px;
    }
    
    /* 显示滑动提示箭头 - 可点击 */
    .category-nav-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 32px;
        color: #666;
        font-size: 12px;
        cursor: pointer;
        transition: color 0.2s;
    }
    
    .category-nav-arrow:hover {
        color: #333;
    }
    
    .category-nav-arrow:active {
        color: #ff2442;
    }
}

.xhs-notes-container {
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* 主内容区域撑满剩余空间 */
.xhs-notes-container > .max-w-7xl {
    flex: 1;
}

/* 瀑布流网格 - 小红书双列布局 */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 6px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .masonry-grid {
        gap: 16px;
        padding: 0 12px;
    }
}

@media (min-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1280px) {
    .masonry-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
    }
}

/* 笔记卡片 - 简洁风格 */
.note-card {
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

/* 纯文字笔记卡片样式 - 小红书风格 */
.note-card.text-only {
    background: #fff;
    border-radius: 10px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.note-card.text-only .p-3 {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px !important;
}

.note-card.text-only .note-content {
    color: #333;
    font-size: 15px;
    -webkit-line-clamp: 8;
    flex: 1;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* 图片容器 - 模糊背景填充 */
.note-card .relative.overflow-hidden,
.note-card .relative {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 10px;
    /* 防止图片加载时布局抖动 */
    min-height: 0;
    contain: layout;
}

/* 模糊背景层 */
.note-card .image-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    object-fit: cover;
    filter: blur(20px);
    transform: scale(1.1);
    opacity: 0.6;
}

/* 笔记图片 - 保持比例居中 */
.note-image {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 0;
    z-index: 1;
}

/* 卡片内容区 */
.note-card .p-3 {
    padding: 10px 0 12px !important;
}

.note-title {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
    color: #1f1f1f;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* 笔记内容文字 - 小红书风格标题 */
.note-content {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    word-break: break-word;
}

.detail-post-time {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: #999;
}

.detail-post-sep {
    color: #d1d5db;
}

.detail-post-views {
    color: inherit;
}

.note-content p {
    margin: 0;
}

.note-content img {
    display: none; /* 卡片中隐藏内容图片 */
}

/* 隐藏markdown格式标签 */
.note-content h1,
.note-content h2,
.note-content h3,
.note-content h4,
.note-content h5,
.note-content h6 {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.note-content ul,
.note-content ol,
.note-content blockquote,
.note-content pre,
.note-content code {
    display: none;
}

/* 纯文字卡片显示所有内容 */
.note-card.text-only .note-content ul,
.note-card.text-only .note-content ol,
.note-card.text-only .note-content blockquote,
.note-card.text-only .note-content pre,
.note-card.text-only .note-content code {
    display: block;
    font-size: 14px;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

.note-card.text-only .note-content li {
    list-style: none;
}

/* 作者信息 - 小红书底部样式 */
.note-card .flex.items-center.justify-between.mt-2 {
    margin-top: 8px !important;
}

.note-card .flex.items-center.justify-between.mt-2 img {
    width: 18px !important;
    height: 18px !important;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
    object-fit: cover;
}

.note-card .flex.items-center.justify-between.mt-2 .text-xs {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

/* 点赞按钮 - 小红书风格 */
.like-action {
    display: flex;
    align-items: center;
    gap: 3px;
}

/*
 * 原插件把颜色与字号挂在 <i class="far like-btn fa-heart"> 上：.like-btn 出灰色、
 * .like-btn.text-pink-600 出红色，字号 14px（移动端 12px）。移植后图标是内联 SVG，
 * font-size 对它无效，所以颜色与尺寸都直接落到 svg，由 currentColor 继承。
 * 缺了颜色规则，实心心形会继承正文色（黑）。
 */
.like-action svg {
    width: 14px;
    height: 14px;
    color: #9b9b9b;
    transition: color 0.2s ease;
}

.like-action.liked svg {
    color: #ff2442;
}

.like-count {
    font-size: 12px;
    color: #9b9b9b;
}

/* 关注按钮 - 小红书风格 */
.follow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.follow-btn.not-followed {
    background: #ff2442;
    color: #fff;
}

.follow-btn.followed {
    background: #f5f5f5;
    color: #666;
}

.follow-btn i,
.follow-btn svg {
    width: 12px;
    height: 12px;
    margin-right: 4px;
    font-size: 10px;
}

.follow-btn:hover {
    opacity: 0.9;
}

/* ========================================
   头部导航 - 小红书风格
   ======================================== */
.site-header {
    background: #fff;
    position: fixed;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.site-brand {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.site-brand img {
    height: 32px;
    max-width: 120px;
    object-fit: contain;
}

/* 小红书风格文字Logo：纯文字品牌标识，不做色块与胶囊 */
.xhs-text-logo {
    display: inline-block;
    background: transparent;
    color: #ff2442;
    padding: 0;
    border-radius: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.nav-link {
    font-size: 15px;
    color: #999;
    font-weight: 400;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #333;
}

.nav-link.active {
    color: #ff2442;
    font-weight: 600;
    background: transparent;
    padding: 8px 0;
}

.nav-link.active::after {
    display: none;
}


.mobile-header-search-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-header-search-btn:hover,
.mobile-header-search-btn:active {
    background: transparent;
    color: #333;
}

@media (max-width: 768px) {
    .mobile-header-search-btn {
        display: inline-flex;
    }
}
.nav-button {
    background: #ff2442;
    color: #fff;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-button:hover {
    background: #e61e3a;
    color: #fff;
}

/* ========================================
   模态框样式 - 小红书风格
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 1000;
    overflow-y: auto;
}

body.modal-open {
    overflow: hidden;
}

.modal-content {
    background: #fff;
    max-height: 90vh;
    overflow-y: auto;
}

/* 小红书风格模态框容器 */
.modal .max-w-6xl {
    max-width: 1000px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
}

/* 关闭按钮 */
.modal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    z-index: 100;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.modal .modal-close:hover {
    background: rgba(0,0,0,0.7);
}

/* 左右分栏布局 */
.modal .grid.grid-cols-1.md\:grid-cols-2 {
    gap: 0 !important;
}

/* 左侧图片区域 */
.modal .carousel {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.modal .carousel-container {
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100%;
    height: 100%;
    position: relative;
}

/* 模态框图片容器 */
.modal .modal-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f5f5;
}

/* 模态框模糊背景 */
.modal .modal-image-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    object-fit: cover;
    filter: blur(30px);
    transform: scale(1.2);
    opacity: 0.6;
}

/* 模态框主图片 */
.modal .modal-image {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    z-index: 1;
}

/* 轮播控制按钮 */
.modal .carousel-prev,
.modal .carousel-next {
    background: rgba(255,255,255,0.9) !important;
    color: #333 !important;
    width: 36px;
    height: 36px;
    padding: 8px !important;
    z-index: 10;
    transition: opacity 0.2s, background 0.2s;
}

.modal .carousel-prev:hover,
.modal .carousel-next:hover {
    background: #fff !important;
}

/* 轮播指示器 */
.modal .carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    background: rgba(0,0,0,0.3);
    padding: 6px 10px;
    border-radius: 20px;
    z-index: 5;
}

.modal .carousel-indicators button,
.modal .carousel-indicators span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    padding: 0;
    margin: 0 3px;
    transition: all 0.2s;
}

.modal .carousel-indicators button.active,
.modal .carousel-indicators span.active {
    background: #fff;
    width: 16px;
    border-radius: 3px;
}

/* 右侧内容区域 - 使用Flexbox布局 */
.modal-right-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 80vh;
    background: #fff;
    position: relative;
    padding: 0;
    margin: 0;
}

/* 内容区域 - 可滚动 */
.modal-scroll-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 20px;  /* 添加上下内边距 */
    margin: 0;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* 修复Firefox下的flexbox滚动问题 */
    position: relative;
}

/* 底部操作栏 - 统一样式 */
.modal-bottom-bar {
    display: flex;
    align-items: center;
    padding: 16px 20px 20px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    margin: 0;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    flex-shrink: 0;
}

.modal-bottom-bar * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1 !important;
}

/* 确保模态框内容不会超出容器 */
.modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 纯文字模式 - 无图片视频时 */
.modal .max-w-6xl.text-only-modal {
    max-width: 450px;
}

.modal-content .grid.text-only-mode {
    display: block !important;
}

.modal-content .grid.text-only-mode .carousel {
    display: none !important;
}

.modal-content .grid.text-only-mode .modal-right-panel {
    max-width: 100%;
}

/* 作者信息头部 */
.modal-author-header {
    padding: 16px 20px;
    flex-shrink: 0;
}

.modal-author-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-author-info .author-left {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.modal-author-info .author-left:hover {
    opacity: 0.8;
}

.modal-author-info .author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.modal-author-info .author-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.modal-author-info .follow-btn {
    padding: 6px 16px;
    font-size: 14px;
    border-radius: 20px;
    background: #ff2442;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.modal-author-info .follow-btn i,
.modal-author-info .follow-btn svg {
    width: 12px;
    height: 12px;
    font-size: 12px;
}

.modal-author-info .follow-btn.followed {
    background: #f5f5f5;
    color: #666;
}

/* 笔记内容 */
.modal .modal-note-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    max-height: none !important;
}

.modal-note-title,
.detail-note-title {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
    color: #1f1f1f;
    word-break: break-word;
}

.detail-note-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.detail-meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 20px;
    background: #fff5f5;
    color: #ff2442;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.detail-meta-tag:hover {
    background: #ffe9ed;
}

.modal .modal-note-content p {
    margin-bottom: 12px;
}

.modal .modal-note-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

/* 发布时间 */
.modal-post-time {
    font-size: 13px;
    color: #999;
    margin-top: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* 评论区 */
.modal .comments-section {
    border-top: none !important;
    padding: 0 !important;
    margin: 16px 0 0 0 !important;
    max-height: none !important;
}

.modal .comments-header {
    margin-bottom: 16px;
}

.modal .comments-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.modal .comments-list {
    max-height: none !important;
    padding: 0 !important;
}

.modal .comments-empty {
    padding: 32px 0;
    text-align: center;
}

.modal .comments-empty .empty-comment-icon {
    width: 48px;
    height: 48px;
    color: #ddd;
    margin: 0 auto 12px;
    display: block;
}

.modal .comments-empty p {
    font-size: 14px;
    color: #999;
}

/* 评论项 - 小红书风格 */
.modal .comment-item {
    display: flex;
    padding: 16px 0 !important;
    margin: 0 !important;
    background: transparent !important;
    position: relative;
}

.modal .comment-item .comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

.modal .comment-item .comment-body {
    flex: 1;
    min-width: 0;
}

.modal .comment-item .comment-author {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    text-decoration: none;
    display: block;
}

.modal .comment-item .comment-author:hover {
    color: #ff2442;
}

/* 评论头像链接 */
.modal .comment-item .comment-avatar-link {
    flex-shrink: 0;
}

.modal .comment-item .comment-avatar-link:hover .comment-avatar {
    opacity: 0.85;
}

.modal .comment-item .comment-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 8px;
    word-break: break-word;
}

.modal .comment-item .comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.modal .comment-item .comment-time {
    color: #999;
}

.modal .comment-item .comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal .comment-item .comment-reply-btn,
.modal .comment-item .comment-like {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.modal .comment-item .comment-like:hover,
.modal .comment-item .comment-reply-btn:hover {
    color: #333;
}

.modal .comment-item .comment-like.liked {
    color: #ff2442;
}

.modal .comment-item .comment-like.liked i,
.modal .comment-item .comment-like.liked svg {
    color: #ff2442;
}

/* 回复列表样式 */
.modal .comment-replies {
    margin-top: 12px;
    margin-left: 0;
    padding-left: 12px;
    border-left: 2px solid #f0f0f0;
}

.modal .comment-reply {
    padding: 12px 0 !important;
    border-bottom: none !important;
    background: transparent !important;
    margin-bottom: 0;
}

.modal .comment-reply:last-child {
    padding-bottom: 0 !important;
}

.modal .comment-reply .comment-avatar {
    width: 28px;
    height: 28px;
}

.modal .comment-reply .comment-author {
    font-size: 13px;
}

.modal .comment-reply .comment-text {
    font-size: 13px;
}

/* 回复前缀样式 */
.reply-to {
    color: #999;
}

.reply-nickname {
    color: #ff2442;
    font-weight: 500;
    text-decoration: none;
}

a.reply-nickname:hover {
    text-decoration: underline;
}

/* 删除按钮样式 */
.modal .comment-item .comment-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s, opacity 0.2s;
    opacity: 0;
    margin-left: 8px;
}

.modal .comment-item:hover .comment-delete-btn {
    opacity: 1;
}

.modal .comment-item .comment-delete-btn:hover {
    color: #ff2442;
}


.modal-input-wrapper {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    margin-right: 16px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    background: #f5f5f5;
    border-radius: 10px;
    padding-right: 4px;
    min-width: 0;
    height: 36px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    line-height: 1;
}

.modal-comment-input {
    flex: 1;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 14px;
    color: #333;
    outline: none;
    display: flex;
    align-items: center;
    text-decoration: none;
    min-width: 0;
    line-height: 1;
}

.modal-comment-input::placeholder {
    color: #999;
}

.xhs-reply-cancel-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #e5e5e5;
    color: #777;
    font-size: 18px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    margin-right: 4px;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.xhs-reply-cancel-btn:hover {
    background: #d9d9d9;
    color: #333;
}

.modal-login-hint {
    color: #999 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    height: 36px !important;
}

.modal-send-btn {
    padding: 6px 16px;
    background: #ff2442;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.modal-send-btn:hover {
    background: #e61e3a;
}

.modal-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 20px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    height: 36px;
    line-height: 1;
}

.modal-action-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    height: 36px;
    line-height: 1;
}

.modal-action-item i,
.modal-action-item svg {
    /* 原版是 FontAwesome 的 <i>，靠 font-size 定尺寸；内联 SVG 不认 font-size，
       必须显式给宽高，否则图标停在 Icon::svg() 的默认 20px 上不跟随断点。 */
    width: 20px;
    height: 20px;
    font-size: 20px;
    margin-right: 4px;
    line-height: 1;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.modal-action-item span {
    line-height: 1;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    font-size: 13px;
    color: #666;
}

/* 移动端底部操作栏优化 */
@media (max-width: 640px) {
    .modal-bottom-bar {
        padding: 12px 12px 16px;
        height: auto;
        min-height: 50px;
    }
    
    .modal-input-wrapper {
        margin-right: 8px;
        flex: 1;
        min-width: 0;
    }
    
    .modal-comment-input {
        padding: 0 12px;
        font-size: 13px;
    }
    
    .modal-send-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .modal-actions {
        gap: 18px;
        margin-left: auto;
    }
    
    .modal-action-item i,
    .modal-action-item svg {
        width: 18px;
        height: 18px;
        font-size: 18px;
        margin-right: 2px;
    }
    
    .modal-action-item span {
        font-size: 12px;
    }
}

.modal-action-item:hover {
    color: #ff2442;
}

/* 原插件这里用 FontAwesome 的 \f004 把描边心形换成实心。
   图标已改为内联 SVG，实心/描边由 JS 换 outerHTML（paintLike / paintCommentLike）负责。 */
.modal-action-item.liked i,
.modal-action-item.liked svg {
    color: #ff2442;
}

/* 登录/注册弹窗：小红书右栏表单 + 固定纵向结构 */
.xhs-login-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(0, 0, 0, 0.45);
    overflow-y: auto;
}

.xhs-login-modal.is-open {
    display: flex;
}

.xhs-login-mask {
    position: absolute;
    inset: 0;
}

.xhs-login-card {
    position: relative;
    z-index: 1;
    display: flex;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100dvh - 48px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: xhsLoginPop 0.25s ease-out;
}

.xhs-login-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(51, 51, 51, 0.55);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.xhs-login-close:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #333;
}

.xhs-login-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 36px 48px;
    overflow: hidden;
    box-sizing: border-box;
}

.xhs-login-title {
    flex: 0 0 auto;
    margin: 0 0 24px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.xhs-login-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 304px;
    min-height: 0;
    padding: 2px 0;
    overflow-y: auto;
}

.xhs-login-alert {
    width: 100%;
    max-width: 304px;
    margin-bottom: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    background: #fff4f6;
    color: #be123c;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
    box-sizing: border-box;
}

.xhs-login-form {
    display: none;
    flex: 0 0 auto;
    width: 100%;
    max-width: 304px;
}

.xhs-login-form.active {
    display: block;
}

.xhs-login-field {
    margin-bottom: 12px;
}

.xhs-login-field input {
    width: 100%;
    height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.03);
    color: #333;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: background 0.2s, border-color 0.2s;
}

.xhs-login-field input:focus {
    background: #fff;
    border-color: rgba(255, 36, 66, 0.4);
}

.xhs-login-field input::placeholder {
    color: rgba(51, 51, 51, 0.4);
}

.xhs-login-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.xhs-login-row input {
    flex: 1;
    min-width: 0;
}

.xhs-login-send-code {
    flex: 0 0 auto;
    height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 36, 66, 0.08);
    color: #ff2442;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.xhs-login-send-code:disabled {
    opacity: 0.5;
    cursor: default;
}

.xhs-login-helper {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 12px;
}

.xhs-login-helper a {
    color: rgba(51, 51, 51, 0.6);
    font-size: 12px;
    text-decoration: none;
}

.xhs-login-helper a:hover {
    color: #ff2442;
}

.xhs-login-submit {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: #ff2442;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.xhs-login-submit:hover {
    background: #e61e3a;
}

.xhs-login-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.xhs-login-foot {
    display: none;
    flex: 0 0 auto;
    padding-top: 16px;
    color: rgba(51, 51, 51, 0.6);
    font-size: 14px;
    text-align: center;
}

.xhs-login-foot.active {
    display: block;
}

.xhs-login-foot a {
    color: #ff2442;
    font-weight: 500;
    text-decoration: none;
}

.xhs-login-foot a:hover {
    text-decoration: underline;
}

@keyframes xhsLoginPop {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

body.xhs-auth-open {
    overflow: hidden;
}

@media (max-width: 860px) {
    .xhs-login-modal {
        padding: 12px;
    }

    .xhs-login-card {
        width: min(100%, 400px);
        height: min(520px, calc(100dvh - 24px));
        max-height: calc(100dvh - 24px);
    }

    .xhs-login-right {
        padding: 32px 24px;
    }
}

/* ========================================
   评论区样式
   ======================================== */
.comments-section {
    padding-top: 16px;
    margin-top: 16px;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
}

.comment-item {
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* ========================================
   用户主页样式 - 小红书风格
   ======================================== */
.xhs-profile-header {
    background: #fff;
    padding: 24px 16px;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.xhs-profile-main {
    display: inline-flex;
    align-items: flex-start;
    text-align: left;
    box-sizing: border-box;
}

.xhs-profile-avatar {
    flex-shrink: 0;
    margin-right: 16px;
}

.xhs-profile-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.xhs-profile-content {
    flex: 1;
    min-width: 0;
}

.xhs-profile-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.xhs-profile-id {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.xhs-profile-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}

.xhs-profile-desc-empty {
    color: #ccc;
}

/* 统计数据 - 横向排列 */
.xhs-profile-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 统计项 - 数字和文字横向排列 */
.xhs-stat-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.xhs-stat-num {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1;
}

.xhs-stat-label {
    font-size: 12px;
    color: #999;
}

/* 关注按钮 */
.xhs-profile-action {
    flex-shrink: 0;
    margin-left: 16px;
    align-self: center;
}

.xhs-follow-btn {
    min-width: 64px;
    height: 32px;
    padding: 0 16px;
    background: #ff2442;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.xhs-follow-btn:hover {
    background: #e61e3a;
}

.xhs-follow-btn.followed {
    background: #f5f5f5;
    color: #666;
}

.xhs-follow-btn.followed:hover {
    background: #eee;
}

/* 移动端样式 */
@media (max-width: 768px) {
    .xhs-profile-header {
        padding: 16px 6px !important;
        text-align: center !important;
        margin-left: -16px;
        margin-right: -16px;
        width: calc(100% + 32px);
    }
    
    .xhs-profile-header .xhs-profile-main {
        display: inline-flex !important;
        width: auto !important;
        max-width: 100%;
        padding: 0 16px;
        text-align: left;
    }
    
    .xhs-profile-avatar img {
        width: 60px;
        height: 60px;
    }
    
    .xhs-profile-avatar {
        margin-right: 12px;
    }
    
    .xhs-profile-name {
        font-size: 16px;
    }
    
    .xhs-profile-stats {
        gap: 16px;
    }
    
    .xhs-stat-num {
        font-size: 15px;
    }
    
    .xhs-profile-action {
        margin-left: 12px;
    }
    
    .xhs-follow-btn {
        min-width: 56px;
        height: 28px;
        font-size: 12px;
        padding: 0 10px;
    }
    
    .xhs-edit-btn {
        min-width: 56px;
        height: 28px;
        font-size: 12px;
        padding: 0 10px;
    }
}

/* 编辑按钮样式 */
.xhs-edit-btn {
    min-width: 64px;
    height: 32px;
    padding: 0 14px;
    background: #f5f5f5;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.xhs-edit-btn:hover {
    background: #eee;
}

.xhs-edit-btn i,
.xhs-edit-btn svg {
    width: 11px;
    height: 11px;
    font-size: 11px;
}

/* 编辑资料弹窗 */
.edit-profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.edit-profile-modal.active {
    display: block;
}

.edit-profile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.edit-profile-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.edit-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.edit-profile-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.edit-profile-close {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.edit-profile-close:hover {
    color: #333;
}

.edit-profile-body {
    padding: 20px;
}

.edit-field {
    margin-bottom: 16px;
}

.edit-field:last-child {
    margin-bottom: 0;
}

.edit-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.edit-field input[type="text"] {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
}

.edit-field input[type="text"]:focus {
    outline: none;
    border-color: #ff2442;
}

.edit-field input[type="text"]::placeholder {
    color: #999;
}

.edit-field textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    resize: none;
    box-sizing: border-box;
}

.edit-field textarea:focus {
    outline: none;
    border-color: #ff2442;
}

.edit-field textarea::placeholder {
    color: #999;
}

.edit-field-hint {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.edit-profile-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
}

.edit-cancel-btn {
    padding: 8px 20px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.edit-cancel-btn:hover {
    background: #eee;
}

.edit-save-btn {
    padding: 8px 20px;
    background: #ff2442;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.edit-save-btn:hover {
    background: #e61e3a;
}

.edit-save-btn:disabled {
    background: #ffb3be;
    cursor: not-allowed;
}

/* 标签页 - 小红书风格 */
.tab-container {
    background: #fff;
    border-radius: 0;
    overflow: visible;
    margin-bottom: 0;
    width: 100%;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: none;
    background: #fff;
    position: relative;
    padding: 12px 0;
    gap: 8px;
}

.tab-button {
    flex: none;
    padding: 5px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    outline: none;
    white-space: nowrap;
    border-radius: 20px;
}

.tab-button:hover {
    color: #333;
    background: #f5f5f5;
}

.tab-button.active {
    color: #333;
    font-weight: 600;
    background: #f5f5f5;
}

/* 移动端tab栏 - 小红书风格 */
@media (max-width: 640px) {
    .tab-container {
        border-radius: 0;
        margin: 0 -16px;
        width: calc(100% + 32px);
        position: sticky;
        top: 56px;
        z-index: 50;
        overflow: visible;
    }
    
    .tab-content {
        overflow: visible;
    }
    
    .tab-buttons {
        padding: 10px 0;
        gap: 6px;
    }
    
    .tab-button {
        padding: 6px 16px;
        font-size: 13px;
    }
}

.tab-content {
    padding: 16px 0;
    display: none;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.tab-content.active {
    display: block;
}

/* 移动端tab-content内的masonry-grid不需要负边距 */
@media (max-width: 640px) {
    .tab-content .masonry-grid {
        margin: 0;
        width: 100%;
        padding: 0 6px;
    }
}

/* 关注/粉丝列表 */
.follow-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding: 0 6px;
}

.follow-item {
    background: #fff;
    border-radius: 10px;
    padding: 16px 8px;
    text-align: center;
}

.follow-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 8px;
    object-fit: cover;
}

.follow-avatar-link {
    display: inline-block;
}

.follow-info {
    min-width: 0;
}

.follow-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-desc {
    margin: 4px 0 0;
    color: #999;
    font-size: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.follow-notes {
    margin: 4px 0 0;
    color: #bbb;
    font-size: 12px;
}

.follow-item .follow-btn {
    margin-top: 8px;
}

/* 空状态统一：与搜索/关注空态共用同一套居中布局与圆形图标 */
.empty-state,
.search-empty,
.following-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 80px 20px;
    box-sizing: border-box;
    text-align: center;
}

.empty-state-icon,
.search-empty-icon,
.following-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #ccc;
}

.empty-state-icon svg,
.search-empty-icon svg,
.following-empty-icon svg {
    width: 28px;
    height: 28px;
    color: #ccc;
}

.empty-state-title {
    margin: 0 0 8px;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.empty-state-desc {
    margin: 0;
    color: #999;
    font-size: 14px;
}

.empty-state-text {
    font-size: 14px;
    color: #999;
}

.empty-state .following-empty-btn,
.empty-state .xhs-primary-btn {
    margin-top: 24px;
}

/* ========================================
   响应式调整
   ======================================== */
@media (max-width: 640px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 0 6px;
        margin: 0 -16px;
        width: calc(100% + 32px);
        box-sizing: border-box;
    }
    
    .note-card .p-3 {
        padding: 8px 0 10px !important;
    }
    
    .note-content {
        font-size: 13px;
        -webkit-line-clamp: 2;
        margin-bottom: 6px;
    }
    
    .note-card .flex.items-center.justify-between.mt-2 img {
        width: 16px !important;
        height: 16px !important;
    }
    
    .note-card .flex.items-center.justify-between.mt-2 .text-xs {
        font-size: 11px;
    }
    
    /* 原版移动端把 .like-btn 的 font-size 收到 12px，内联 SVG 要用宽高表达。 */
    .like-action svg {
        width: 12px;
        height: 12px;
    }
    
    .like-count {
        font-size: 11px;
    }
}

/* ========================================
   滚动条美化
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* ========================================
   其他通用样式
   ======================================== */
.xhs-load-more {
    text-align: center;
    padding: 24px 0;
}

/* ========================================
   无限滚动加载样式
   ======================================== */
.infinite-scroll-trigger {
    height: 1px;
    width: 100%;
}

.loading-spinner {
    padding: 20px 0;
}

.loading-spinner svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.load-more-container {
    min-height: 60px;
}

.no-more-text {
    color: #999;
    font-size: 14px;
}

/* ========================================
   移动端底部导航 - 小红书风格
   ======================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    /* 给页面底部留出导航栏空间 */
    body {
        padding-bottom: 10px;
    }
}

.mobile-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 50px;
    max-width: 400px;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
}

.mobile-nav-text {
    font-size: 15px;
    font-weight: 400;
    color: #999;
    transition: color 0.2s ease;
}

.mobile-nav-text-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.mobile-nav-item.active .mobile-nav-text {
    color: #333;
    font-weight: 600;
}

.mobile-nav-item:hover .mobile-nav-text {
    color: #333;
}

/* 发布按钮 - 小红书红色加号 */
.mobile-nav-publish {
    flex: 1 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-publish-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ff2442;
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    border-radius: 20px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.mobile-nav-publish:hover .mobile-nav-publish-btn {
    background: #e61e3a;
    transform: scale(1.05);
}

/* ========================================
   关注页面 - 小红书风格
   ======================================== */

/* 关注页空状态 */
.following-empty-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.following-empty-desc {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.following-empty-btn,
.xhs-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 32px;
    background: #ff2442;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.following-empty-btn:hover,
.xhs-primary-btn:hover {
    background: #e61e3a;
    color: #fff;
}

/* ========================================
   视频相关样式
   ======================================== */
.video-cover-placeholder {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: #000;
    overflow: hidden;
    border-radius: 10px;
}

.video-cover-placeholder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 卡片角标：视频 / 图片数量 / 私密 */
.note-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    line-height: 1;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.note-badge-video {
    width: 24px;
    padding: 0;
    border-radius: 50%;
}

.note-badge-video svg {
    width: 10px;
    height: 10px;
}

.note-badge-count {
    gap: 3px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
}

.note-badge-count svg {
    width: 12px;
    height: 12px;
}

.note-badge-private {
    top: 8px;
    right: auto;
    left: 8px;
    width: 24px;
    padding: 0;
    border-radius: 50%;
}

.note-badge-private svg {
    width: 12px;
    height: 12px;
}

/* 模态框视频样式 - 小红书风格 */
.modal-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0;
}

.xhs-xgplayer-mount,
.xhs-xgplayer-fallback {
    width: 100%;
    height: 100%;
    background: #000;
}

.xhs-xgplayer-mount.xgplayer,
.xhs-xgplayer-mount .xgplayer {
    width: 100% !important;
    height: 100% !important;
    background: #000;
}

.xhs-xgplayer-mount video,
.xhs-xgplayer-fallback {
    object-fit: contain;
}

.xhs-video-error {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 24px;
}

.xhs-video-error-card {
    max-width: 280px;
    text-align: center;
    color: rgba(255,255,255,0.86);
}

.xhs-video-error-icon {
    font-size: 28px;
    color: #ffb020;
    margin-bottom: 12px;
}

.xhs-video-error-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.xhs-video-error-desc {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255,255,255,0.62);
}

.xhs-video-error-link {
    display: inline-flex;
    margin-top: 14px;
    color: #fff;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.modal-xgplayer {
    min-height: 100%;
}

.xhs-xgplayer-mount.xgplayer .xgplayer-start,
.xhs-xgplayer-mount .xgplayer-start {
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 8px 26px rgba(0,0,0,0.25);
    overflow: hidden;
}

.xhs-xgplayer-mount.xgplayer.xgplayer-playing .xgplayer-start,
.xhs-xgplayer-mount .xgplayer.xgplayer-playing .xgplayer-start,
.xhs-xgplayer-mount.xhs-player-playing .xgplayer-start {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.xhs-xgplayer-mount.xgplayer .xgplayer-start xg-start-inner,
.xhs-xgplayer-mount .xgplayer-start xg-start-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
}

.xhs-xgplayer-mount.xgplayer .xgplayer-start svg,
.xhs-xgplayer-mount .xgplayer-start svg {
    width: 30px !important;
    height: 30px !important;
}

.xhs-xgplayer-mount.xgplayer .xgplayer-start svg path,
.xhs-xgplayer-mount .xgplayer-start svg path {
    fill: #111 !important;
}

.modal-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    outline: none;
    background: #000;
}

/* 视频控制条样式优化 */
.modal-video::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}

.modal-video::-webkit-media-controls-play-button {
    filter: brightness(1.2);
}

.modal-video::-webkit-media-controls-timeline {
    filter: brightness(1.2);
}

/* 视频轮播项样式 */
.carousel-item[data-type="video"] {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3/4;
}

.carousel-item[data-type="video"] .modal-video-wrapper {
    width: 100%;
    height: 100%;
}

.carousel-item video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000;
}

/* 视频加载状态 */
.modal-video-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #ff2442;
    border-radius: 50%;
    animation: video-loading-spin 1s linear infinite;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.modal-video-wrapper.loading::before {
    opacity: 1;
}

@keyframes video-loading-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 视频播放按钮覆盖层 - 小红书风格 */
.modal-video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.modal-video-play-overlay:hover {
    background: rgba(0,0,0,0.4);
}

.modal-video-play-overlay .play-btn {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

.modal-video-play-overlay:hover .play-btn {
    transform: scale(1.1);
}

.modal-video-play-overlay .play-btn i {
    color: #333;
    font-size: 24px;
    margin-left: 4px;
}

.modal-video-play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   搜索功能样式
   ======================================== */

/* 搜索弹窗 */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.search-modal.active {
    display: block;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.search-modal-content {
    position: relative;
    background: #fff;
    padding: 16px;
    animation: searchSlideDown 0.2s ease;
}

@keyframes searchSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-modal-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-modal-input-wrapper {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 0 16px;
}

.search-modal-input-wrapper i,
.search-modal-input-wrapper svg {
    width: 16px;
    height: 16px;
    color: #999;
    font-size: 16px;
}

.search-modal-input {
    flex: 1;
    height: 44px;
    padding: 0 12px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #333;
    outline: none;
}

.search-modal-input::placeholder {
    color: #999;
}

.search-modal-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #999;
    font-size: 16px;
}

.search-modal-close:hover {
    color: #333;
}

/* 消息通知 */
.xhs-notification-link {
    position: relative;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: #999;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.xhs-notification-link:hover {
    background: transparent;
    color: #333;
}

.xhs-notification-link.active {
    background: #f0f0f0;
    color: #333;
}

.xhs-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 20px;
    background: #ff2442;
    color: #fff;
    font-size: 10px;
    line-height: 1;
    text-align: center;
    font-weight: 700;
    box-sizing: border-box;
}

.xhs-notification-badge.mobile {
    top: -8px;
    right: -18px;
    left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    transform: none;
    box-shadow: none;
}

.xhs-notification-badge.mobile.dot {
    top: -7px;
    right: -12px;
    min-width: 10px;
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
}


.mobile-bottom-nav .xhs-notification-link {
    position: relative;
    width: auto;
    height: auto;
    min-width: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    flex-direction: column;
}

.mobile-bottom-nav .xhs-notification-link:hover {
    background: transparent;
}

.xhs-message-page {
    min-height: calc(100vh - 80px);
    padding-top: 44px;
}

.xhs-message-content {
    width: min(100%, 640px);
    max-width: 640px;
    margin: 0 auto;
}

.xhs-message-tabs {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 56px;
    margin-bottom: 0;
    border-bottom: 1px solid #eeeeee;
}

.xhs-message-main {
    min-height: 360px;
    background: #fff;
    border: 0;
    border-radius: 0;
    overflow: hidden;
}

.xhs-message-page .xhs-notification-list {
    padding: 0;
}

.xhs-message-page .xhs-notification-tab {
    position: relative;
    flex: 0 0 auto;
    height: 36px;
    min-width: 96px;
    padding: 0 16px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: #777;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.xhs-message-page .xhs-notification-tab i {
    display: none;
}

.xhs-message-page .xhs-notification-tab.active {
    color: #111;
    background: #f5f5f5;
}

.xhs-message-page .xhs-notification-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    min-height: 132px;
    padding: 26px 0;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #eeeeee;
    transition: background 0.2s ease;
}

.xhs-message-page .xhs-notification-item:hover {
    background: transparent;
}

.xhs-message-page .xhs-notification-item.unread {
    background: transparent;
}

.xhs-message-page .xhs-notification-item.unread .xhs-notification-main::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-radius: 50%;
    background: #ff2442;
    vertical-align: middle;
}

.xhs-notification-user {
    color: inherit;
    text-decoration: none;
}

.xhs-notification-avatar-link {
    flex: 0 0 auto;
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.xhs-notification-name:hover {
    color: #111;
}

.xhs-notification-note-trigger,
.xhs-notification-content,
.xhs-notification-thumb-btn {
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.xhs-notification-note-trigger:hover,
.xhs-notification-content:hover {
    color: #333;
}

.xhs-notification-thumb-btn {
    position: relative;
    flex: 0 0 auto;
    margin-left: 18px;
    border-radius: 8px;
    overflow: hidden;
}
.xhs-notification-video-thumb {
    background: #111;
}

.xhs-notification-video-mark {
    position: absolute;
    right: 5px;
    bottom: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 8px;
}

.xhs-notification-video-mark i {
    margin-left: 1px;
}

.xhs-notification-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.xhs-notification-body {
    min-width: 0;
    flex: 1;
}

.xhs-notification-main {
    color: #888;
    font-size: 14px;
    line-height: 1.5;
}

.xhs-notification-name {
    color: #222;
    font-weight: 800;
    margin-right: 8px;
}

.xhs-notification-content {
    margin-top: 8px;
    color: #444;
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.xhs-notification-time {
    display: inline-block;
    margin-left: 8px;
    color: #888;
    font-size: 14px;
}

.xhs-notification-thumb {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.xhs-notification-empty,
.xhs-notification-loading {
    padding: 96px 18px;
    text-align: center;
    color: #999;
    font-size: 16px;
}

@media (max-width: 768px) {
    .xhs-message-page {
        max-width: none;
        min-height: 0;
        padding-top: 0;
    }

    .xhs-message-content {
        width: auto;
        max-width: none;
        margin: 0;
    }

    .xhs-message-tabs {
        display: flex;
        gap: 6px;
        min-height: 46px;
        margin: 0 -16px 12px;
        padding: 8px 16px 9px;
        overflow-x: auto;
        border-bottom: 1px solid #f1f1f1;
        scrollbar-width: none;
    }

    .xhs-message-tabs::-webkit-scrollbar {
        display: none;
    }

    .xhs-message-page .xhs-notification-tab {
        height: 32px;
        min-width: auto;
        padding: 0 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    .xhs-message-main {
        min-height: 60vh;
        border-radius: 0;
    }

    .xhs-message-page .xhs-notification-item {
        gap: 12px;
        padding: 14px 4px;
        min-height: 0;
    }

    .xhs-notification-avatar {
        width: 46px;
        height: 46px;
    }

    .xhs-notification-main {
        font-size: 14px;
    }

    .xhs-notification-content {
        margin-top: 3px;
        color: #aaa;
        font-size: 14px;
        -webkit-line-clamp: 1;
    }

    .xhs-notification-time {
        margin-left: 0;
        margin-top: 4px;
        display: block;
        color: #9aa3ad;
        font-size: 12px;
    }

    .xhs-notification-thumb-btn {
        margin-left: 8px;
    }

    .xhs-notification-thumb {
        width: 52px;
        height: 52px;
    }
}
/* 搜索结果页样式 */
.search-results-header {
    margin-bottom: 20px;
}

.search-results-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.search-results-count {
    font-size: 14px;
    color: #999;
}

/* 搜索空状态 */
.search-empty-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.search-empty-desc {
    font-size: 14px;
    color: #999;
}

/* 标签结果页样式 */
.tag-results-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 0;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #fff5f5;
    color: #ff2442;
    font-size: 18px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 8px;
}

.tag-badge i,
.tag-badge svg {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.tag-results-count {
    font-size: 14px;
    color: #999;
}

/* 笔记标签：note_tags 独立渲染，不再混在正文里 */
.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.note-tags .note-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    background: #fff5f5;
    color: var(--xhs-primary, #ff2442) !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.2s ease;
}

.note-tags .note-tag:hover {
    background: #ffe9ed;
    text-decoration: none;
}

.detail-note-tags {
    margin-top: 14px;
}


/* ========================================
   页面底部版权信息 - 小红书风格
   ======================================== */
.site-footer {
    background: #fff;
    padding: 12px 16px;
    text-align: center;
    margin-top: auto;
}

@media (max-width: 768px) {
    .site-footer {
        padding-bottom: 60px;
    }
}

.footer-content {
    font-size: 12px;
    color: #b8b8b8;
    line-height: 1.6;
}

.footer-content .copyright-text,
.footer-content .icp-number {
    margin: 0;
}

.footer-content .icp-number a {
    color: #b8b8b8;
    text-decoration: none;
}


/* ========================================
   移动端/PC端模态框区分
   ======================================== */

/* 移动端隐藏模态框（使用单页代替） */
@media (max-width: 768px) {
    #noteDetailModal {
        display: none !important;
    }
}

/* PC端模态框样式保持不变 */
@media (min-width: 769px) {
    #noteDetailModal.modal {
        display: none;
    }
    
    #noteDetailModal.modal[style*="display: block"] {
        display: block !important;
    }
}


/* ========================================
   详情页评论样式（移动端单页）
   ======================================== */
.detail-comments .comment-item {
    display: flex;
    padding: 16px 0;
    background: transparent;
    margin: 0;
}

.detail-comments .comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

.detail-comments .comment-body {
    flex: 1;
    min-width: 0;
}

.detail-comments .comment-author {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    text-decoration: none;
    display: block;
}

.detail-comments .comment-author:hover {
    color: #ff2442;
}

/* 详情页评论头像链接 */
.detail-comments .comment-avatar-link {
    flex-shrink: 0;
}

.detail-comments .comment-avatar-link:hover .comment-avatar {
    opacity: 0.85;
}

.detail-comments .comment-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 8px;
    word-break: break-word;
}

.detail-comments .comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.detail-comments .comment-time {
    color: #999;
}

.detail-comments .comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.detail-comments .comment-reply-btn,
.detail-comments .comment-delete-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

/* 评论点赞：原插件只有模态框里有，详情页评论用同一份模板，这里补上对应样式。 */
.detail-comments .comment-like {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.detail-comments .comment-like:hover {
    color: #333;
}

.detail-comments .comment-like.liked {
    color: #ff2442;
}

.detail-comments .comment-reply-btn:hover,
.detail-comments .comment-delete-btn:hover {
    color: #333;
}

.detail-comments .comment-delete-btn:hover {
    color: #ff2442;
}

.detail-comments .comments-empty {
    padding: 32px 0;
    text-align: center;
}

.detail-comments .empty-comment-icon {
    width: 48px;
    height: 48px;
    color: #ddd;
    margin: 0 auto 12px;
    display: block;
}

.detail-comments .comments-empty p {
    font-size: 14px;
    color: #999;
}

.detail-comments .comments-loading {
    padding: 20px 0;
    text-align: center;
}

/* “加载更多评论”：原插件只有选择器没有元素，这里补上；详情页与模态框共用。 */
.comments-load-more {
    padding: 12px 0;
    text-align: center;
}

.comments-load-more button {
    padding: 6px 18px;
    border: none;
    border-radius: 20px;
    background: #f5f5f5;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.comments-load-more button:hover {
    background: #ff2442;
    color: #fff;
}

/* 详情页评论回复样式 */
.detail-comments .comment-replies {
    margin-top: 12px;
    margin-left: 0;
    padding-left: 12px;
    border-left: 2px solid #f0f0f0;
}

.detail-comments .comment-reply {
    padding: 12px 0 !important;
}

.detail-comments .comment-reply:last-child {
    padding-bottom: 0 !important;
}

.detail-comments .comment-reply .comment-avatar {
    width: 28px;
    height: 28px;
}

.detail-comments .comment-reply .comment-author {
    font-size: 13px;
}

.detail-comments .comment-reply .comment-text {
    font-size: 13px;
}

/* 回复前缀样式 */
.detail-comments .reply-to {
    color: #999;
}

.detail-comments .reply-nickname {
    color: #ff2442;
    font-weight: 500;
    text-decoration: none;
}

.detail-comments a.reply-nickname:hover {
    text-decoration: underline;
}

/* CSS Version: 20260121180516 - Fixed modal bottom bar spacing */

@media (min-width: 768px) {
    .modal .max-w-6xl {
        width: min(980px, calc(100vw - 48px));
        height: min(720px, calc(100dvh - 48px));
        max-height: calc(100dvh - 48px);
        border-radius: 8px;
    }
    .modal .modal-content {
        height: 100%;
        max-height: none;
        overflow: hidden;
    }
    .modal .grid.grid-cols-1.md\:grid-cols-2 {
        display: grid;
        grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
        height: 100%;
        min-height: 0;
    }
    .modal .carousel,
    .modal .carousel-container,
    .modal .carousel-item.active {
        height: 100%;
        min-height: 0;
    }
    .modal .modal-image-wrapper,
    .modal .modal-video-wrapper,
    .modal .carousel-item[data-type="video"] {
        width: 100%;
        height: 100%;
        min-height: 0;
        aspect-ratio: auto;
    }
    .modal .carousel-item[data-type="image"] {
        height: 100%;
    }
    .modal .modal-right-panel {
        max-height: none;
        min-height: 0;
    }
    .modal .modal-scroll-content {
        padding: 18px 24px 24px;
        scrollbar-gutter: stable;
    }
}
/* ---- 详情页 / 灯箱 / 模态框样式（原插件 xhs_notes_detail.php 内联 style 迁移） ---- */
        /* 详情页专用样式。
           原插件这几条 html/body 级规则写在详情页自己的内联 <style> 里，不会出现在
           列表页。移植时改为由 layout.php 按 $isDetail 分支下发，
           不要搬回这里，否则列表页会被详情页的白色背景与 70px 底部留白污染。 */
        
        .detail-page {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            overflow-x: hidden;
        }
        
        /* 顶部导航栏 */
        .detail-header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 50px;
            background: #fff;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 12px;
            z-index: 100;
        }
        
        .detail-back-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            color: #333;
            font-size: 18px;
        }
        
        .detail-header-title {
            flex: 1;
            text-align: center;
            font-size: 16px;
            font-weight: 500;
            color: #333;
        }
        
        .detail-header-placeholder {
            width: 36px;
        }
        
        /* 媒体区域 */
        .detail-media {
            margin-top: 50px;
            background: #000;
            position: relative;
        }
        
        .detail-media-wrapper {
            position: relative;
            width: 100%;
            aspect-ratio: 3/4;
            max-height: 70vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        
        .detail-media-bg {
            position: absolute;
            top: -10%;
            left: -10%;
            width: 120%;
            height: 120%;
            object-fit: cover;
            filter: blur(30px);
            transform: scale(1.2);
            opacity: 0.6;
        }
        
        .detail-media-item {
            position: relative;
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            z-index: 1;
            cursor: zoom-in;
        }
        
        .detail-video,
        .detail-xgplayer,
        .detail-xgplayer.xgplayer,
        .detail-xgplayer .xgplayer,
        .detail-xgplayer .xhs-xgplayer-fallback {
            width: 100%;
            height: 100%;
            background: #000;
        }

        .detail-xgplayer video,
        .detail-xgplayer .xhs-xgplayer-fallback {
            object-fit: contain;
        }
        
        /* 轮播slide默认隐藏 */
        .carousel-slide {
            display: none;
        }
        
        .carousel-slide.active {
            display: flex;
        }
        
        /* 轮播指示器 */
        .detail-indicators {
            position: absolute;
            bottom: 16px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 6px;
            background: rgba(0,0,0,0.3);
            padding: 6px 10px;
            border-radius: 20px;
            z-index: 5;
        }
        
        .detail-indicator {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(255,255,255,0.5);
            transition: all 0.2s;
        }
        
        .detail-indicator.active {
            background: #fff;
            width: 16px;
            border-radius: 3px;
        }
        
        /* 轮播控制按钮 */
        .detail-carousel-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 36px;
            height: 36px;
            background: rgba(255,255,255,0.9);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #333;
            z-index: 10;
            border: none;
            cursor: pointer;
        }
        
        .detail-carousel-prev { left: 12px; }
        .detail-carousel-next { right: 12px; }
        
        /* 内容区域 */
        .detail-content-area {
            flex: 1;
            padding: 16px;
            background: #fff;
        }
        
        /* 纯文字笔记 - 无媒体时内容区域从顶部开始 */
        .detail-page.text-only .detail-content-area {
            margin-top: 50px;
            min-height: calc(100vh - 50px - 70px);
        }
        
        /* 纯文字笔记内容样式 */
        .detail-page.text-only .detail-note-content {
            font-size: 16px;
            line-height: 1.9;
            padding: 8px 0;
        }
        
        /* 作者信息 */
        .detail-author {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding-bottom: 16px;
            border-bottom: 1px solid #f0f0f0;
            margin-bottom: 16px;
        }
        
        .detail-author-left {
            display: flex;
            align-items: center;
        }
        
        .detail-author-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 12px;
            object-fit: cover;
        }
        
        .detail-author-name {
            font-size: 15px;
            font-weight: 600;
            color: #333;
        }
        
        /* 笔记内容 */
        .detail-note-content {
            font-size: 15px;
            line-height: 1.8;
            color: #333;
            margin-bottom: 16px;
        }
        
        .detail-note-content p {
            margin-bottom: 12px;
        }
        
        .detail-note-content img {
            max-width: 100%;
            border-radius: 8px;
            margin: 8px 0;
        }

        .detail-note-content video,
        .detail-note-content audio,
        .modal .modal-note-content video,
        .modal .modal-note-content audio {
            display: block;
            width: 100%;
            max-width: 100%;
            margin: 12px 0;
            border-radius: 10px;
            background: #000;
        }

        .detail-note-content video,
        .modal .modal-note-content video {
            max-height: 70vh;
        }

        .detail-note-content audio,
        .modal .modal-note-content audio {
            height: auto;
            min-height: 54px;
            background: transparent;
        }
        
        /* 发布时间 */
        .detail-post-time {
            font-size: 13px;
            color: #999;
            padding-bottom: 16px;
            border-bottom: 1px solid #f0f0f0;
        }
        
        /* 评论区 */
        .detail-comments {
            margin-top: 16px;
            padding-top: 0;
        }
        
        .detail-comments-header {
            font-size: 15px;
            font-weight: 500;
            color: #333;
            margin-bottom: 16px;
        }
        
        /* 底部操作栏 */
        .detail-bottom-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            display: flex;
            align-items: center;
            padding: 10px 12px;
            background: #fff;
            border-top: 1px solid #f0f0f0;
            z-index: 100;
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
        }
        
        .detail-input-wrapper {
            flex: 1;
            min-width: 0;
            display: flex;
            align-items: center;
            background: #f5f5f5;
            border-radius: 10px;
            padding-right: 4px;
            margin-right: 10px;
        }
        
        .detail-comment-input {
            flex: 1;
            min-width: 0;
            height: 36px;
            padding: 0 14px;
            border: none;
            border-radius: 10px;
            background: transparent;
            font-size: 14px;
            color: #333;
            outline: none;
        }

        .detail-login-hint {
            display: flex;
            align-items: center;
            color: #999;
            cursor: pointer;
        }

        .detail-reply-cancel-btn {
            width: 24px;
            height: 24px;
            border: none;
            border-radius: 50%;
            background: #e5e5e5;
            color: #777;
            font-size: 18px;
            line-height: 22px;
            text-align: center;
            cursor: pointer;
            flex-shrink: 0;
            padding: 0;
            margin-right: 4px;
            position: relative;
            z-index: 2;
            pointer-events: auto;
        }

        .detail-reply-cancel-btn:hover {
            background: #d9d9d9;
            color: #333;
        }
        
        .detail-send-btn {
            padding: 6px 12px;
            background: #ff2442;
            color: #fff;
            border: none;
            border-radius: 20px;
            font-size: 13px;
            cursor: pointer;
            white-space: nowrap;
            flex-shrink: 0;
        }
        
        .detail-actions {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-shrink: 0;
        }
        
        .detail-action-item {
            display: flex;
            align-items: center;
            cursor: pointer;
            color: #333;
        }
        
        .detail-action-item i,
        .detail-action-item svg {
            width: 20px;
            height: 20px;
            font-size: 20px;
            margin-right: 3px;
        }
        
        .detail-action-item span {
            font-size: 13px;
            color: #666;
        }
        
        .detail-action-item.liked i,
        .detail-action-item.liked svg {
            color: #ff2442;
        }
        
        /* 私密笔记标记 */
        .detail-private-badge {
            background-color: #fff5f5;
            border-left: 3px solid #ff2442;
            padding: 8px 12px;
            margin-bottom: 12px;
            border-radius: 8px;
            display: flex;
            align-items: center;
        }
        
        .detail-private-badge svg {
            width: 16px;
            height: 16px;
            margin-right: 8px;
            color: #ff2442;
        }
        
        .detail-private-badge span {
            font-size: 14px;
            color: #666;
        }
        
        /* 详情页灯箱样式 - 小红书风格 */
        .detail-lightbox {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #000;
            z-index: 2000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s ease;
            user-select: none;
            -webkit-user-select: none;
        }
        
        .detail-lightbox.active {
            opacity: 1;
            pointer-events: auto;
        }
        
        .detail-lightbox-container {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        
        .detail-lightbox-header {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 16px;
            padding-top: env(safe-area-inset-top);
            background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
            z-index: 10;
        }
        
        .detail-lightbox-close {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            cursor: pointer;
            border-radius: 50%;
        }
        
        .detail-lightbox-close svg {
            width: 24px;
            height: 24px;
        }
        
        .detail-lightbox-counter {
            color: #fff;
            font-size: 15px;
            font-weight: 500;
        }
        
        .detail-lightbox-image-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            touch-action: pan-x pan-y pinch-zoom;
        }
        
        .detail-lightbox-image {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            transition: transform 0.2s ease;
        }
        
        .detail-lightbox-indicators {
            position: absolute;
            bottom: calc(30px + env(safe-area-inset-bottom));
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            z-index: 10;
            padding: 8px 12px;
            background: rgba(0,0,0,0.3);
            border-radius: 20px;
        }
        
        .detail-lightbox-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(255,255,255,0.4);
            transition: all 0.2s ease;
        }
        
        .detail-lightbox-dot.active {
            background: #fff;
            width: 18px;
            border-radius: 3px;
        }
        
        .detail-lightbox-hint {
            position: absolute;
            bottom: calc(80px + env(safe-area-inset-bottom));
            left: 50%;
            transform: translateX(-50%);
            color: rgba(255,255,255,0.7);
            font-size: 12px;
            padding: 6px 12px;
            background: rgba(0,0,0,0.4);
            border-radius: 20px;
            opacity: 0;
            transition: opacity 0.3s;
            pointer-events: none;
        }
        
        .detail-lightbox-hint.show {
            opacity: 1;
        }


        
        /* 灯箱样式 - 小红书风格 */
        .lightbox-mode {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #000;
            z-index: 2000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s ease;
            user-select: none;
            -webkit-user-select: none;
        }
        
        .lightbox-mode.active {
            opacity: 1;
            pointer-events: auto;
        }
        
        .lightbox-container {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        
        .lightbox-image-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            touch-action: pan-x pan-y pinch-zoom;
        }
        
        .lightbox-image {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border-radius: 0;
            transition: transform 0.2s ease;
            cursor: grab;
        }
        
        .lightbox-image:active {
            cursor: grabbing;
        }
        
        .lightbox-image.zoomed {
            cursor: move;
        }
        
        /* 顶部操作栏 */
        .lightbox-header {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 16px;
            background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
            z-index: 10;
        }
        
        .lightbox-close {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            cursor: pointer;
            border-radius: 50%;
            transition: background 0.2s;
        }
        
        .lightbox-close:hover {
            background: rgba(255,255,255,0.1);
        }
        
        .lightbox-close svg {
            width: 24px;
            height: 24px;
        }
        
        .lightbox-counter {
            color: #fff;
            font-size: 15px;
            font-weight: 500;
            letter-spacing: 1px;
        }
        
        .lightbox-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        /* 底部指示器 - 小红书风格圆点 */
        .lightbox-indicators {
            position: absolute;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            z-index: 10;
            padding: 8px 12px;
            background: rgba(0,0,0,0.3);
            border-radius: 20px;
        }
        
        .lightbox-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(255,255,255,0.4);
            transition: all 0.2s ease;
            cursor: pointer;
        }
        
        .lightbox-dot.active {
            background: #fff;
            width: 18px;
            border-radius: 3px;
        }
        
        /* 左右导航按钮 - PC端显示 */
        .lightbox-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 48px;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255,255,255,0.9);
            border-radius: 50%;
            cursor: pointer;
            z-index: 10;
            transition: all 0.2s ease;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
        
        .lightbox-nav:hover {
            background: #fff;
            transform: translateY(-50%) scale(1.05);
        }
        
        .lightbox-nav svg {
            width: 20px;
            height: 20px;
            color: #333;
        }
        
        .lightbox-prev {
            left: 20px;
        }
        
        .lightbox-next {
            right: 20px;
        }
        
        /* 移动端隐藏左右按钮，使用滑动 */
        @media (max-width: 768px) {
            .lightbox-nav {
                display: none;
            }
            
            .lightbox-header {
                padding: 0 12px;
                padding-top: env(safe-area-inset-top);
            }
            
            .lightbox-indicators {
                bottom: calc(20px + env(safe-area-inset-bottom));
            }
        }
        
        /* 缩放提示 */
        .lightbox-zoom-hint {
            position: absolute;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            color: rgba(255,255,255,0.7);
            font-size: 12px;
            padding: 6px 12px;
            background: rgba(0,0,0,0.4);
            border-radius: 20px;
            opacity: 0;
            transition: opacity 0.3s;
            pointer-events: none;
        }
        
        .lightbox-zoom-hint.show {
            opacity: 1;
        }
        
        /* 轮播样式 */
        .carousel-item {
            display: none;
            border-radius: 10px;
            overflow: hidden;
        }
        
        .carousel-item.active {
            display: block;
        }
        
        /* 私密笔记标记 */
        .private-note-badge {
            background-color: #fff5f5;
            border-left: 3px solid #ff2442;
            padding: 8px 12px;
            margin-bottom: 12px;
            border-radius: 8px;
        }
        
        /* 模态框动画 */
        .modal-animation {
            animation: modalFadeIn 0.2s ease-out;
        }
        
        @keyframes modalFadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 页面内轻提示（替代原插件的原生 alert，避免阻塞交互） */
        .xhs-tip {
            position: fixed;
            top: 24px;
            left: 50%;
            transform: translate(-50%, -12px);
            max-width: min(80vw, 360px);
            padding: 10px 20px;
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.82);
            color: #fff;
            font-size: 14px;
            line-height: 1.5;
            text-align: center;
            word-break: break-word;
            z-index: 3000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s ease;
        }

        .xhs-tip.is-show {
            opacity: 1;
            transform: translate(-50%, 0);
        }

        .xhs-tip.is-error {
            background: var(--xhs-primary);
        }

        .xhs-notification-tab-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 16px;
            height: 16px;
            margin-left: 6px;
            padding: 0 4px;
            border-radius: 20px;
            background: #ff2442;
            color: #fff;
            font-size: 10px;
            font-weight: 700;
            line-height: 1;
            vertical-align: middle;
        }

        .xhs-notification-text {
            color: #888;
        }

        .xhs-notification-more {
            padding: 20px 0;
            text-align: center;
        }

        .xhs-notification-more button {
            padding: 8px 24px;
            border: 1px solid #eee;
            border-radius: 20px;
            background: #fff;
            color: #666;
            font-size: 14px;
            cursor: pointer;
            transition: background 0.2s, color 0.2s;
        }

        .xhs-notification-more button:hover {
            background: #ff2442;
            border-color: #ff2442;
            color: #fff;
        }

        .xhs-notification-read-all {
            margin-left: auto;
            padding: 0 4px;
            border: 0;
            background: none;
            color: #999;
            font-size: 13px;
            cursor: pointer;
            white-space: nowrap;
        }

        .xhs-notification-read-all:hover {
            color: #ff2442;
        }

        /*
         * 回复容器始终存在（JS 要往里追加），没有回复时不应占位：
         * 空容器会画出一条多余的左侧竖线与上边距。
         */
        .comment-replies:empty {
            display: none;
        }
