/**
 * 泥鳅社区主题样式 - 二次元风格
 *
 * @package NiqiuCommunity
 * @since 1.0.0
 */

/* ===== 变量定义 ===== */
:root {
    --primary-color: #FF6B9D;
    --secondary-color: #6C5CE7;
    --accent-color: #00D2D3;
    --text-color: #2d3436;
    --text-light: #636e72;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e9ecef;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-small: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --content-min-desktop: 60vw;
    --content-max-desktop: 80vw;
    --content-margin: clamp(20px, 3vw, 40px);
    --card-image-scale: 0.25;
}

/* ===== 基础样式 ===== */
* {
    box-sizing: border-box;
}

body.niqiu-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* ===== 布局 ===== */
.niqiu-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.niqiu-main-layout {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 20px;
    padding: 20px 0;
}

@media (max-width: 1200px) {
    .niqiu-main-layout {
        grid-template-columns: 1fr 320px;
    }
    
    .sidebar-left {
        display: none;
    }
}

@media (max-width: 768px) {
    .niqiu-main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar-right {
        display: none;
    }
}

/* ===== 头部 ===== */
.site-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-branding .site-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.site-branding .site-title a {
    color: white;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.main-navigation a {
    color: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: var(--radius-small);
    transition: var(--transition);
}

.main-navigation a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-login,
.btn-register {
    padding: 8px 20px;
    border-radius: var(--radius-small);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.btn-login:hover,
.btn-register:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-menu {
    position: relative;
}

.user-avatar-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.user-avatar-btn img {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: block;
}

.user-avatar-btn:hover img,
.user-avatar-btn.active img {
    border-color: white;
    transform: scale(1.1);
}

.avatar-arrow {
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    transition: var(--transition);
    display: none;
}

@media (max-width: 768px) {
    .avatar-arrow {
        display: block;
    }
}

.user-avatar-btn.active .avatar-arrow {
    transform: rotate(180deg);
}

/* 首页封面 */
.home-hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-size: cover;
    background-position: center;
    padding: 60px 20px;
    color: #fff;
}

.home-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.2), rgba(0,0,0,0.35));
}

.home-hero-inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 1;
}

.home-hero-title {
    margin: 0 0 8px 0;
    font-size: 42px;
    font-weight: 800;
}

.home-hero-subtitle {
    margin: 0 0 20px 0;
    font-size: 16px;
    opacity: 0.95;
}

.home-hero-actions {
    display: flex;
    gap: 12px;
}

.home-hero-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius-small);
    background: #fff;
    color: var(--primary-color);
    font-weight: 700;
}

.home-hero-btn.secondary {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}

@media (max-width: 768px) {
    .home-hero { padding: 40px 16px; }
    .home-hero-title { font-size: 32px; }
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
    overflow: hidden;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.user-menu.active .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
}

.dropdown-user-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.dropdown-user-level {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.user-dropdown-menu {
    padding: 10px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-color);
    transition: var(--transition);
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.dropdown-item-logout {
    color: #e74c3c;
}

.dropdown-item-logout:hover {
    background: #fee;
    color: #e74c3c;
}

.dropdown-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.dropdown-text {
    flex: 1;
}

/* ===== 主内容区 ===== */
.niqiu-main-content {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

/* 帖子列表网格布局 */
.niqiu-posts-list { display: block; }
.niqiu-posts-list.video-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap:16px; }
@media (max-width: 1200px){ .niqiu-posts-list.video-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px){ .niqiu-posts-list.video-grid{ grid-template-columns: repeat(2, 1fr); } }

/* ===== 内容筛选器 ===== */
.niqiu-content-filters {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.filter-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-tab a {
    display: inline-block;
    padding: 10px 20px;
    color: var(--text-light);
    border-radius: var(--radius-small) var(--radius-small) 0 0;
    position: relative;
    transition: var(--transition);
}

.filter-tab.active a,
.filter-tab a:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.filter-tab.active a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.notification-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #e74c3c;
    border-radius: 50%;
    margin-left: 5px;
}

/* ===== 帖子卡片 ===== */
.niqiu-post-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    padding: 10px;
    margin-bottom: 8px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.niqiu-post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    position: relative;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.author-name {
    font-weight: 600;
    color: var(--text-color);
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.user-level {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.user-vip {
    background: linear-gradient(135deg, #f8b500, #ff6b9d);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.post-title {
    font-size: 16px;
    font-weight: 600;
    margin: 8px 0;
}

.post-title a {
    color: var(--text-color);
}

.post-title a:hover {
    color: var(--primary-color);
}

/* 单篇头部作者与浏览数一排显示 */
/* removed post-views badge in single header */

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.5;
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-thumbnail {
    margin: 6px 0;
    border-radius: var(--radius-small);
    overflow: hidden;
    background: #f5f5f5;
    height: var(--card-thumb-h, 200px);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    position: relative;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: var(--transition);
}

.post-thumbnail.full-image { height: auto; }
.post-thumbnail.full-image img { height: auto; object-fit: contain; width: calc(var(--card-image-scale) * 100%); margin: 0; }
.post-thumbnail .media-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.6); opacity: 1; transition: opacity .3s ease; }
.post-thumbnail.loaded .media-loading { opacity: 0; pointer-events: none; }

.post-card-menu { position: relative; }
.post-card-menu-btn { background: transparent; border: none; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; color: var(--text-light); display: inline-flex; align-items: center; justify-content: center; transition: var(--transition); }
.post-card-menu-btn:hover { background: var(--bg-light); color: var(--primary-color); }
.post-card-menu-btn .dots { display: inline-block; width: 16px; height: 16px; line-height: 1; background: url('../images/placeholder.png') no-repeat center/contain; text-indent: -9999px; }
.post-card-menu-btn .dots.icon-a { background-image: url('../public/icons/dots-a.svg'); }
.post-card-menu-btn .dots.icon-b { background-image: url('../public/icons/dots-b.svg'); }
.post-card-menu-btn .dots.icon-c { background-image: url('../public/icons/dots-c.svg'); }
.post-card-menu-dropdown { position: absolute; right: 0; top: 120%; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-small); box-shadow: var(--shadow); min-width: 140px; display: none; z-index: 10; overflow: hidden; }
.post-card-menu-dropdown::before { content: ''; position: absolute; top: -6px; right: 10px; width: 10px; height: 10px; background: #fff; border-left: 1px solid var(--border-color); border-top: 1px solid var(--border-color); transform: rotate(45deg); }
.post-card-menu-dropdown .post-card-menu-item { display: block; width: 100%; padding: 10px 14px; background: none; border: none; text-align: left; cursor: pointer; color: var(--text-color); font-size: 13px; }
.post-card-menu-dropdown .post-card-menu-item:hover { background: var(--bg-light); }
.post-card-menu-dropdown .post-card-menu-item.danger { color: #e74c3c; }
.post-card-menu.open .post-card-menu-dropdown { display: block; }

/* 取消固定宽度，使用卡片宽度自适应 */

.lazy-img { opacity: 0; transition: opacity 0.5s ease; }
.lazy-img.is-loaded { opacity: 1; }

.post-thumbnail:hover img {
    transform: scale(1.05);
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-action-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    transition: var(--transition);
    font-size: 12px;
    text-decoration: none;
}

.post-action-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.post-action-btn.liked {
    color: var(--primary-color);
}

.post-action-btn .icon {
    font-size: 14px;
    flex-shrink: 0;
}

.post-action-btn .count {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-views-btn {
    cursor: default;
}

.post-views-btn:hover {
    background: transparent;
    color: var(--text-light);
}

/* ===== 侧边栏 ===== */
.widget-area {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* 用户卡片 */
.sidebar-user-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius);
    padding: 20px;
    color: white;
    margin-bottom: 20px;
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.user-card-header .user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.user-card-header .user-name {
    margin: 0;
}

.user-card-header .user-name a {
    color: white;
}

.user-level-progress {
    margin: 15px 0;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    background: white;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-small);
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
}

.stat-label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

.user-actions {
    margin-top: 15px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-small);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
    width: 100%;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* ===== 分页 ===== */
.niqiu-pagination {
    margin-top: 30px;
    text-align: center;
}

.niqiu-pagination .page-numbers {
    display: inline-flex;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.niqiu-pagination .page-numbers a,
.niqiu-pagination .page-numbers span {
    display: inline-block;
    padding: 8px 15px;
    border-radius: var(--radius-small);
    background: var(--bg-light);
    color: var(--text-color);
    transition: var(--transition);
}

.niqiu-pagination .page-numbers a:hover,
.niqiu-pagination .page-numbers .current {
    background: var(--primary-color);
    color: white;
}

/* ===== 底部 ===== */
.site-footer {
    background: var(--text-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 30px 0;
    margin-top: 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.site-info {
    font-size: 14px;
}

.site-info a {
    color: var(--primary-color);
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.niqiu-post-card {
    animation: fadeIn 0.3s ease-out;
}

/* 默认桌面端隐藏移动顶栏 */
.mobile-topbar { display: none; }
.mobile-search-overlay { display: none; }

/* 单篇主图与正文图片最大宽度 */
.niqiu-single-post .post-featured { max-width: clamp(var(--content-min-desktop), 900px, var(--content-max-desktop)); margin: var(--content-margin) auto; border-radius: var(--radius); overflow: hidden; background: #f5f5f5; transition: max-width .25s ease; }
.niqiu-single-post .post-featured img { width: 100%; height: auto; display: block; }
/* 内容区容器约束，防止撑破布局 */
.niqiu-single-post .entry-content { max-width: clamp(var(--content-min-desktop), 900px, var(--content-max-desktop)); margin: var(--content-margin) auto; padding: 0 12px; transition: max-width .25s ease; }
/* 响应式媒体：保持比例，不变形，宽度不超过容器 */
.niqiu-single-post .entry-content img,
.niqiu-single-post .entry-content picture,
.niqiu-single-post .entry-content video { width: 100%; max-width: 100%; height: auto; display: block; margin: 16px auto; border-radius: var(--radius-small); object-fit: contain; }
/* 淡入过渡 */
.niqiu-single-post .entry-content img.content-img { opacity: 0; transition: opacity .5s ease; }
.niqiu-single-post .entry-content img.content-img.is-loaded { opacity: 1; }
.niqiu-single-post .entry-content img.content-img.shrink-10 { width: 10%; max-width: 10%; height: auto; transition: width .25s ease, max-width .25s ease; }

/* 卡片标题与摘要截断 */
.niqiu-post-card .post-title { max-height: 2.6em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.niqiu-post-card .post-excerpt { max-height: 4.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    
    .main-navigation {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    
    .main-navigation ul {
        flex-wrap: wrap;
    }
    
    .niqiu-main-content {
        padding: 15px;
    }
    
    .post-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
    :root { --card-image-scale: 0.25; }
}
    .niqiu-single-post .post-featured { max-width: calc(100vw - 24px); margin: 12px auto; }
    .niqiu-single-post .entry-content { max-width: calc(100vw - 24px); margin: 12px auto; }
}

/* ===== 快捷发布框 ===== */
.jinsom-sns-publish,
.niqiu-quick-post {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    position: relative;
}

.quick-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.quick-post-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.quick-post-user-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 15px;
}

.quick-post-form {
    position: relative;
}

.quick-post-title {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    margin-bottom: 10px;
    transition: var(--transition);
    background: var(--bg-color);
    display: none;
}

.quick-post-title.show {
    display: block;
}

.quick-post-title:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 157, 0.1);
}

.quick-post-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    background: var(--bg-color);
    line-height: 1.6;
    color: var(--text-color);
}

.quick-post-textarea::placeholder {
    color: #999;
}

.quick-post-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 157, 0.1);
}

.quick-post-media-preview {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.quick-post-media-preview .media-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-small);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.quick-post-media-preview img,
.quick-post-media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.quick-post-media-preview .remove-media {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.quick-post-media-preview .remove-media:hover {
    background: rgba(231, 76, 60, 0.8);
}

.quick-post-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.quick-post-tools-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-post-tool-btn {
    background: none;
    border: none;
    border-radius: var(--radius-small);
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #999;
    transition: var(--transition);
    min-width: 32px;
    height: 32px;
    position: relative;
}

.quick-post-tool-btn:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.quick-post-tool-btn.active {
    color: var(--primary-color);
    background: var(--bg-light);
}

.quick-post-tool-btn .icon {
    font-size: 18px;
    line-height: 1;
}

.quick-post-submit {
    padding: 8px 18px;
    min-width: 80px;
    max-width: 160px;
    flex: 0 0 auto;
    background: #666;
    color: white;
    border: none;
    border-radius: var(--radius-small);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.quick-post-submit:hover {
    background: #555;
}

.quick-post-submit:active {
    background: #444;
}

.quick-post-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 表情选择器 */
.emoji-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 320px;
    max-height: 300px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.emoji-picker-header {
    display: flex;
    gap: 5px;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.emoji-category {
    padding: 5px 10px;
    cursor: pointer;
    border-radius: var(--radius-small);
    transition: var(--transition);
    font-size: 20px;
}

.emoji-category:hover,
.emoji-category.active {
    background: var(--primary-color);
    color: white;
}

.emoji-picker-content {
    padding: 10px;
    max-height: 240px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.emoji-item {
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-small);
    text-align: center;
    font-size: 24px;
    transition: var(--transition);
}

.emoji-item:hover {
    background: var(--bg-light);
    transform: scale(1.2);
}

/* @用户选择器 */
.mention-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 280px;
    max-height: 250px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.mention-picker-content {
    max-height: 250px;
    overflow-y: auto;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.mention-item:last-child {
    border-bottom: none;
}

.mention-item:hover {
    background: var(--bg-light);
}

.mention-item-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.mention-item-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

/* ===== 评论区域 ===== */
#comments {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.comments-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.comments-title::before {
    content: '💬';
    font-size: 28px;
}

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

.comment-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.comment-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.comment-item .comment-author-avatar {
    float: left;
    margin-right: 15px;
}

.comment-item .comment-author-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.comment-content {
    overflow: hidden;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-author-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 15px;
}

.comment-time {
    font-size: 12px;
    color: var(--text-light);
}

.comment-text {
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: var(--radius-small);
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.comment-like-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--radius-small);
    transition: var(--transition);
    font-size: 14px;
}

.comment-like-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.comment-like-btn.liked {
    color: var(--primary-color);
}

.comment-reply-link {
    color: var(--text-light);
    font-size: 14px;
    padding: 5px 10px;
    border-radius: var(--radius-small);
    transition: var(--transition);
}

.comment-reply-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

/* 评论表单 */
.comment-respond {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.05), rgba(108, 92, 231, 0.05));
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 10px;
    margin-bottom: 16px;
}

.comment-reply-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-reply-title::before {
    content: '✍️';
    font-size: 24px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-form-comment {
    margin: 0;
}

/* 移除label后保持整洁间距 */
/* 原 .comment-form-comment label 块已删除 */

.comment-form-comment textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    background: var(--bg-color);
}

.comment-form-comment textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.comment-form-author,
.comment-form-email,
.comment-form-url {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-small);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-color);
}

.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.form-submit {
    margin: 0;
}

.form-submit .submit {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: var(--radius-small);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.form-submit .submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 移除已废弃的 .logged-in-as 样式 */

/* 评论工具与表情 */
.comment-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; position: relative; }
.emoji-btn { background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 14px; padding: 6px 10px; cursor: pointer; color: var(--text-color); }
.emoji-btn:hover { background: var(--bg-color); color: var(--primary-color); }
.emoji-btn.loading { opacity: 0.7; position: relative; }
.emoji-btn.loading::after { content: ''; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border: 2px solid var(--primary-color); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.comment-text img.emoji { width: 24px; height: 24px; vertical-align: middle; }
.no-comments-banner { background: linear-gradient(135deg, rgba(255,107,157,0.15), rgba(108,92,231,0.15)); border: 1px dashed var(--primary-color); color: var(--secondary-color); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; text-align: center; font-weight: 600; }

/* 嵌套评论 */
.children {
    list-style: none;
    margin: 20px 0 0 0;
    padding-left: 60px;
}

.children .comment-item {
    background: var(--bg-light);
    border-color: var(--border-color);
}

@media (max-width: 768px) {
    .children {
        padding-left: 20px;
    }
    
    .quick-post-tools {
        flex-wrap: wrap;
    }
    
    .quick-post-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .quick-post-submit {
        width: 100%;
    }
    
    .comment-respond {
        padding: 20px;
    }
}

/* ===== 论坛页面 ===== */
.forum-page {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 0;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.forum-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(108, 92, 231, 0.1));
    border-bottom: 2px solid var(--border-color);
}

.forum-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.btn-new-post {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--radius-small);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-new-post:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: white;
}

.btn-new-post .icon {
    font-size: 16px;
}

.forum-filters {
    padding: 20px 30px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.forum-categories {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.category-tab {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.category-tab:hover,
.category-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

.category-count {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 4px;
}

.forum-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-tab {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-color);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

.sort-tab:hover,
.sort-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.forum-sticky-posts {
    padding: 25px 30px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.05), rgba(108, 92, 231, 0.05));
    border-bottom: 2px solid var(--border-color);
}

.forum-sticky-posts .section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.forum-sticky-posts .section-title .icon {
    font-size: 20px;
}

.sticky-posts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.forum-sticky-posts .niqiu-post-card {
    background: var(--bg-color);
    border-left: 4px solid var(--primary-color);
}

.forum-posts-section {
    padding: 25px 30px;
}

.forum-posts-section .section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.niqiu-no-content {
    text-align: center;
    padding: 60px 20px;
}

.no-content-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.niqiu-no-content p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
    .forum-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
    }
    
    .forum-title {
        font-size: 24px;
    }
    
    .btn-new-post {
        width: 100%;
        justify-content: center;
    }
    
    .forum-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 15px 20px;
    }
    
    .forum-categories {
        width: 100%;
    }
    
    .forum-sort {
        width: 100%;
        justify-content: space-around;
    }
    
    .forum-sticky-posts,
    .forum-posts-section {
        padding: 20px;
    }
}

/* ===== 用户主页 ===== */
.user-profile-page {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

/* 用户信息头部 */
.user-profile-top {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.profile-avatar-wrapper {
    position: relative;
}

.profile-avatar-wrapper img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    object-fit: cover;
    display: block;
}

.btn-change-avatar {
    padding: 8px 20px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-small);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-change-avatar:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.profile-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.2;
}

.profile-meta-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-level-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    color: white;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.user-vip-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #f8b500, #ff6b9d);
    color: white;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.profile-action-btn {
    margin-top: 10px;
}

.btn-follow {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--radius-small);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-follow:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-follow.followed {
    background: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* 用户统计数据 */
.user-stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 30px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
}

.user-stats-section .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: var(--radius);
    transition: var(--transition);
}

.user-stats-section .stat-item:hover {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(108, 92, 231, 0.1));
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.user-stats-section .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.user-stats-section .stat-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* 最近动态 */
.user-activities-section {
    margin-top: 30px;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.activities-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: var(--bg-light);
    margin: 0 -15px;
    padding: 15px;
    border-radius: var(--radius-small);
}

.activity-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 50%;
    font-size: 20px;
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.activity-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.activity-title:hover {
    color: var(--primary-color);
}

.activity-text {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.6;
}

.activity-link {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
}

.activity-link:hover {
    text-decoration: underline;
}

.activity-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

.no-activities {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-activities p {
    font-size: 16px;
    margin: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .user-profile-page {
        padding: 20px;
    }
    
    .user-profile-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }
    
    .profile-info-section {
        align-items: center;
        text-align: center;
    }
    
    .profile-name {
        font-size: 24px;
    }
    
    .user-stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px 0;
    }
    
    .user-stats-section .stat-item {
        padding: 15px;
    }
    
    .user-stats-section .stat-value {
        font-size: 24px;
    }
    
    .activity-item {
        padding: 12px 0;
    }
    
    .activity-item:hover {
        margin: 0 -10px;
        padding: 12px 10px;
    }
}

@media (max-width: 480px) {
    .user-stats-section {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .user-stats-section .stat-item {
        padding: 12px 8px;
    }
    
    .user-stats-section .stat-value {
        font-size: 20px;
    }
    
    .user-stats-section .stat-label {
        font-size: 12px;
    }
}
.post-meta { display: inline-flex; align-items: center; gap: 10px; color: var(--text-light); font-size: 13px; }
.post-meta .post-category { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-light); padding: 4px 8px; border-radius: 14px; color: var(--text-color); text-decoration: none; }
.post-meta .post-category:hover { background: var(--bg-color); color: var(--primary-color); }

@media (max-width: 768px) {
    .post-footer { flex-direction: row; }
    .post-actions { gap: 6px; }
    .post-action-btn { padding: 6px 10px; font-size: 12px; min-height: 36px; }
    .post-card-menu-btn { width: 28px; height: 28px; }
    .post-meta { gap: 8px; font-size: 12px; }
}
/* 单篇头部：作者信息左，浏览量右 */
.niqiu-single-post .entry-meta { display: flex; align-items: center; justify-content: space-between; }
.single-topbar + header.entry-header .entry-meta { margin-top: var(--gap-sm); }
.niqiu-single-post .entry-meta .post-views { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-light); padding: 4px 8px; border-radius: 14px; color: var(--text-light); font-size: 13px; }
.niqiu-single-post .entry-meta .author-info .follow-inline { margin-left: 2em; padding: 4px 10px; font-size: 12px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-light); color: var(--text-color); }
.niqiu-single-post .entry-meta .author-info .follow-inline:hover { background: var(--bg-color); color: var(--primary-color); }
.niqiu-single-post .entry-meta .author-info .follow-inline.followed { background: #eef6ff; color: var(--secondary-color); border-color: #cfe2ff; }
.niqiu-single-post .entry-meta .author-info { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.niqiu-single-post .entry-meta .author-info .follow-inline { margin-left: auto; }
.niqiu-single-post .entry-meta .author-info .author-meta { width: 100%; margin-top: 4px; }

/* 单帖在移动端隐藏顶部栏，桌面端显示 */
@media (max-width: 768px) {
    .single .site-header { display: none; }
}
/* 单帖顶部横栏（移动端显示） */
.single-topbar { display: none; }
@media (max-width: 768px) {
    .single-topbar { display: block; position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--border-color); }
    .single-topbar .topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
    .single-topbar .topbar-left .topbar-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 18px; background: linear-gradient(135deg, var(--bg-light), #fff); color: var(--text-color); text-decoration: none; border: 1px solid var(--border-color); box-shadow: var(--shadow); }
    .single-topbar .topbar-left .topbar-back .topbar-back-icon { width: 16px; height: 16px; display: inline-block; }
    .single-topbar .topbar-left .topbar-back:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); color: var(--primary-color); }
    .single-topbar .topbar-left .topbar-back:active { transform: translateY(0); }
    .single-topbar .topbar-left .topbar-back:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
    .single-topbar .topbar-title { font-size: 15px; color: var(--text-color); }
    .single-topbar .topbar-right { display: inline-flex; align-items: center; }
}
/* 全站：移动端隐藏桌面头部，显示移动顶栏 */
@media (max-width: 768px) {
    .site-header { display: none; }
    .mobile-topbar { display: block; position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--border-color); }
    /* 单篇帖子界面隐藏移动顶部栏 */
    .single .mobile-topbar, .single .single-topbar { display: none; }
    .mobile-topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; }
    .mobile-left .mobile-avatar img { width: 32px; height: 32px; border-radius: 50%; }
    .mobile-left .mobile-login { font-size: 14px; color: var(--primary-color); text-decoration: none; }
    .mobile-title { font-weight: 700; font-size: 16px; text-align: center; }
    .mobile-title a { color: var(--text-color); text-decoration: none; padding: 4px 8px; border-radius: 12px; }
    .mobile-title a:hover { background: var(--bg-light); }
    .mobile-right .mobile-search-btn { background: transparent; border: none; font-size: 18px; cursor: pointer; }
    .mobile-search-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; }
    .mobile-search-box { position: absolute; left: 50%; top: 20%; transform: translateX(-50%); width: 90%; background: #fff; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
    .mobile-search-box input { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: var(--radius-small); margin-bottom: 8px; }
    .mobile-search-box #mobile-search-submit { width: 100%; padding: 10px; background: var(--primary-color); color: #fff; border: none; border-radius: var(--radius-small); }
    .mobile-search-box .mobile-search-close { margin-top: 8px; width: 100%; padding: 10px; background: var(--bg-light); border: 1px solid var(--border-color); border-radius: var(--radius-small); }
    .mobile-search-results { margin-top: 8px; max-height: 300px; overflow: auto; }
}
/* 头像弹窗 */
.avatar-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100; display: flex; align-items: center; justify-content: center; }
.avatar-modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); width: 90%; max-width: 420px; padding: 12px; }
.avatar-modal h3 { margin: 0 0 8px; font-size: 16px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.avatar-choice { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-small); padding: 4px; cursor: pointer; }
.avatar-choice img { width: 100%; height: auto; display: block; border-radius: var(--radius-small); }
.avatar-actions { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.avatar-actions .btn-close { padding: 6px 10px; border: 1px solid var(--border-color); background: var(--bg-light); border-radius: var(--radius-small); cursor: pointer; }
/* 强制移动端帖子页显示内容顶部栏 */
@media (max-width: 768px) {
    .single .single-topbar { display: block !important; }
    .single .mobile-topbar { display: none !important; }
}
.image-lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 200; display: flex; align-items: center; justify-content: center; }
.image-lightbox { max-width: clamp(var(--content-min-desktop), 900px, var(--content-max-desktop)); max-height: 90vh; transform: scale(0.98); transition: transform .25s ease; }
.image-lightbox img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius); }
.image-lightbox-overlay.show .image-lightbox { transform: scale(1); }
.image-lightbox-close { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,0.9); border: none; border-radius: 20px; padding: 6px 10px; cursor: pointer; }
.post-thumbnail.scale-50 { height: calc((var(--card-thumb-h, 180px))/2); }
.post-thumbnail.scale-50 img { width: 50%; height: auto; transition: transform .25s ease; }
@media (max-width: 768px) {
    .post-thumbnail.scale-50 { height: calc((var(--card-thumb-h, 120px))/2); }
}
.niqiu-post-card .post-thumbnail img.shrink-10 { width: 10% !important; max-width: 10% !important; height: auto !important; transition: width .25s ease, max-width .25s ease; }
.post-video { margin: 6px 0; border-radius: var(--radius-small); overflow: hidden; background: #000; height: var(--card-thumb-h, 200px); position: relative; display: flex; align-items: flex-start; justify-content: flex-start; }
.post-video:hover::after{ content:''; position:absolute; inset:0; background:rgba(0,0,0,0.15); }
.post-video video { width: calc(var(--card-image-scale, 0.25) * 100%); height: 100%; object-fit: contain; display: block; background: #000; }
.post-video .play-overlay { position: absolute; left: 8px; top: 8px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); cursor: pointer; transition: var(--transition); }
.post-video .play-overlay:hover { transform: scale(1.05); }
.post-video .play-overlay::before { content: '\25B6'; color: var(--text-color); font-size: 18px; margin-left: 3px; }
.post-video.playing .play-overlay { display: none; }
