/* 基础重置和变量 */
/* 确保头部样式一致 */
/* 加载提示样式 */

/* =========================== */
/* 赛博朋克2077风格样式系统 */
/* 参考官网: https://www.cyberpunk.net */
/* =========================== */

/* 导入未来感字体 */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Orbitron:wght@400;700;900&display=swap');

/* CSS变量定义 - 赛博朋克2077配色系统 */
:root {
    /* 主色调 - 黄色系 */
    --cp-yellow: #fcee0a;
    --cp-yellow-dark: #d4c007;
    --cp-yellow-glow: #fcee0a;
    
    /* 背景色 */
    --bg-primary: #050505;
    --bg-secondary: #0f0f0f;
    --bg-tertiary: #1a1a1a;
    
    /* 霓虹色彩 */
    --neon-cyan: #00f0ff;
    --neon-pink: #ff0080;
    --neon-red: #ff003c;
    --neon-blue: #0066ff;
    --neon-purple: #b000ff;
    
    /* 文本颜色 */
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --text-muted: #707070;
    --text-glow: #ffffff;
    
    /* 发光效果 */
    --glow-yellow: 0 0 10px var(--cp-yellow), 0 0 20px var(--cp-yellow), 0 0 40px var(--cp-yellow);
    --glow-cyan: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 30px var(--neon-cyan);
    --glow-pink: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-pink), 0 0 30px var(--neon-pink);
    --glow-red: 0 0 10px var(--neon-red), 0 0 20px var(--neon-red), 0 0 30px var(--neon-red);
    
    /* 边框样式 */
    --border-yellow: 2px solid var(--cp-yellow);
    --border-cyan: 1px solid var(--neon-cyan);
    --border-radius: 0;
    
    /* 字体 */
    --font-title: 'Rajdhani', 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}
/* 加载动画赛博朋克风格 */
.search-loading {
    text-align: center;
    padding: 2rem;
    color: var(--neon-cyan);
    font-size: 14px;
    display: none;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.search-loading.show {
    display: block;
}

/* 帖子卡片样式 */
.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.post-content {
    padding: 1rem;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.post-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ddd;
}

.interactions {
    display: flex;
    gap: 1rem;
}

.interaction {
    cursor: pointer;
    transition: color 0.3s;
}

.interaction:hover {
    color: #4A90E2;
}

.edit-btn {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

.edit-btn:hover {
    background: #357ABD;
}

.follow-btn {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

.follow-btn:hover {
    background: #357ABD;
}

.follow-btn.following {
    background: #ddd;
    color: #666;
}

.delete-btn {
    color: #ff4d4f;
    cursor: pointer;
    font-size: 1em;
}

header {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
    position: relative;
}

.user-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#userProfile {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* 加载更多提示样式 */
.search-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(252, 238, 10, 0.05) 25%, rgba(252, 238, 10, 0.05) 26%, transparent 27%, transparent 74%, rgba(252, 238, 10, 0.05) 75%, rgba(252, 238, 10, 0.05) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(252, 238, 10, 0.05) 25%, rgba(252, 238, 10, 0.05) 26%, transparent 27%, transparent 74%, rgba(252, 238, 10, 0.05) 75%, rgba(252, 238, 10, 0.05) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

/* 背景故障效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

/* 散射光效果 */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(252, 238, 10, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

a {
    text-decoration: none;
    color: var(--cp-yellow);
    text-shadow: 0 0 5px var(--cp-yellow);
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--text-glow);
    text-shadow: var(--glow-yellow);
}

ul, li {
    list-style: none;
}

/* 头部导航 */
header {
    background: var(--bg-primary);
    border-bottom: var(--border-yellow);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(252, 238, 10, 0.3);
    backdrop-filter: blur(10px);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}
.logo {
    font-size: 1.8rem;
    font-weight: bold;
    font-family: var(--font-title);
    color: var(--cp-yellow);
    text-shadow: var(--glow-yellow);
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
}

.logo::before {
    content: attr(data-text);
    position: absolute;
    left: 2px;
    top: 0;
    color: var(--neon-cyan);
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    animation: glitchTop 2s infinite;
}

.logo::after {
    content: attr(data-text);
    position: absolute;
    left: -2px;
    top: 0;
    color: var(--neon-pink);
    overflow: hidden;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    animation: glitchBottom 3s infinite;
}
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}
.nav-links li a {
    color: white;
    font-weight: 500;
    transition: opacity 0.3s;
}
.nav-links li a:hover {
    opacity: 0.8;
}
.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
    position: relative;
}
.search-bar input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: var(--border-neon);
    border-radius: 20px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.1);
}

.search-bar input:focus {
    border-color: var(--neon-pink);
    box-shadow: var(--glow-pink);
    background: var(--bg-tertiary);
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}
.user-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.user-actions button {
    background: var(--bg-secondary);
    border: var(--border-neon);
    color: var(--neon-cyan);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}
.user-actions button:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
    color: var(--text-glow);
}
#userProfile, #publishBtn {
    color: white;
    cursor: pointer;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
#userProfile:hover, #publishBtn:hover {
    background: rgba(255,255,255,0.2);
    opacity: 0.8;
}
#publishBtn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    display: none; /* 默认隐藏，只登录后显示 */
}
.user-avatar, .user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}
.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

/* 顶部类别按钮 */
.top-categories {
    background: var(--bg-secondary);
    padding: 0.5rem 2rem;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}
.top-categories::-webkit-scrollbar {
    display: none;
}
.category-btn {
    background: var(--bg-secondary);
    border: var(--border-neon);
    color: var(--neon-cyan);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 0.5rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.category-btn:hover::before {
    left: 100%;
}

.category-btn:hover {
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    box-shadow: var(--glow-cyan);
}

/* 主内容区域 - 4列网格布局 */
main {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 1.5rem 2rem;
}

/* 布局容器 - 固定4列 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1400px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

/* 帖子卡片样式优化 */
.post-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: var(--border-neon);
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), var(--neon-cyan));
    animation: borderScan 3s linear infinite;
}

.post-card:hover {
    box-shadow: var(--glow-cyan);
    transform: translateY(-5px);
    border-color: var(--neon-pink);
}

/* 图片容器 - 使用固定宽高比 */
.post-image {
    width: 100%;
    padding-top: 55%; /* 16:9比例约为56.25%，这里使用55%更接近363.62x199.99 */
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
}

.post-image img,
.post-image video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image img,
.post-card:hover .post-image video {
    transform: scale(1.05);
}
/* 自动生成的文字图片样式 */
.post-image.auto-generated {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-image.auto-generated .text-image-content {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    padding: 1rem;
    width: 90%;
    z-index: 2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.post-content {
    padding: 0.75rem;
}

.post-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--neon-cyan);
    font-family: var(--font-title);
    text-shadow: 0 0 10px var(--neon-cyan);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.post-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.user-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--neon-pink);
    box-shadow: var(--glow-pink);
}

.interactions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.interaction {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s ease;
    font-size: 0.85rem;
    white-space: nowrap;
}

.interaction:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    transform: scale(1.1);
}
.interaction.liked {
    color: #ff4d4f; /* 已赞高亮 */
}
.like-unliked {
    color: #999; /* 未赞灰色空心 */
    font-size: 1.1em;
}
.like-liked {
    color: #ff4d4f; /* 已赞红色实心 */
    font-size: 1.1em;
}
.delete-btn {
    color: var(--neon-orange);
    cursor: pointer;
    font-size: 1.1em;
    border: 1px solid var(--neon-orange);
    background: none;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.3);
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: var(--neon-orange);
    color: var(--bg-primary);
    box-shadow: var(--glow-orange);
}

.follow-btn {
    background: var(--neon-pink);
    color: var(--bg-primary);
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}
.follow-btn:hover {
    box-shadow: var(--glow-pink);
    transform: translateY(-2px);
}
.follow-btn.following {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}
.follow-btn.following:hover {
    background: var(--bg-secondary);
}
.edit-btn {
    background: var(--neon-green);
    color: var(--bg-primary);
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.5rem;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
    transition: all 0.3s ease;
}
.edit-btn:hover {
    box-shadow: var(--glow-green);
    transform: translateY(-2px);
}

/* 模块3：评论区域样式 */
.comments-section {
    display: block !important; /* 始终显示评论区 */
    margin-top: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}
.comments-section.show {
    display: block;
}
/* 评论回复样式 */
.comment-replies {
    margin-left: 2rem;
    margin-top: 0.5rem;
    border-left: 2px solid #e5e7eb;
    padding-left: 1rem;
}

.comment-reply-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.comment-reply-item:last-child {
    border-bottom: none;
}

.reply-to {
    color: #667eea;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.reply-form-container {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
}

.reply-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.reply-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
}

.reply-form button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.reply-form button:first-of-type {
    background: #4A90E2;
    color: white;
}

.reply-form button:last-of-type {
    background: #6b7280;
    color: white;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.reply-btn, .delete-btn {
    background: none;
    border: none;
    color: #4A90E2;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

.delete-btn {
    color: #ef4444;
}

.reply-btn:hover, .delete-btn:hover {
    text-decoration: underline;
}


.comment-item {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.comment-author {
    font-weight: 500;
    color: #333;
    margin-right: 0.5rem;
}
.comment-text {
    color: #666;
}

/* 详情页样式 */
.post-detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    background: #f5f5f5;
}
.detail-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}
.back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}
.back-btn:hover {
    background: #f0f0f0;
}
.detail-title-bar {
    flex: 1;
    text-align: center;
    padding: 0 2rem;
}
.detail-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.detail-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.detail-meta span {
    white-space: nowrap;
}
.post-detail-media {
    width: 100%;
    height: auto;
    max-height: 100vh;
    object-fit: cover;
    display: block;
    border-radius: 0; /* 全宽无圆角 */
}
.post-detail-video {
    width: 100%;
    height: 100vh;
    object-fit: cover;
}
.post-detail-content {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.post-detail-description {
    font-size: 1rem;
    color: #333;
    line-height: 1.8;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.tag {
    background: #f0f0f0;
    color: #666;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
}
.interaction-bar {
    position: relative; /* 桶面端默认跟随内容 */
    bottom: auto;
    left: auto;
    right: auto;
    background: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #eee;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 1rem auto 0;
}
.interaction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: #999;
    transition: color 0.3s, transform 0.2s;
    flex: 1;
}
.interaction-item:hover {
    color: #ff4d4f;
    transform: scale(1.05);
}
.interaction-item.liked {
    color: #ff4d4f;
}
.interaction-item.favorited {
    color: #ffd700;
}
.interaction-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}
.interaction-count {
    font-size: 0.85rem;
    font-weight: 500;
}
.author-section {
    background: white;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    flex-shrink: 0;
}
.author-details h4 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.25rem;
}
.author-details p {
    font-size: 0.9rem;
    color: #666;
}
.delete-post-btn {
    background: none;
    border: none;
    color: #ff4d4f;
    cursor: pointer;
    font-size: 1rem;
    margin-left: auto;
}
.comments-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #333;
}
.comment-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}
.comment-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.comment-form button {
    padding: 0.75rem 1.5rem;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.comment-list {
    max-height: 60vh;
    overflow-y: auto;
}
.comment-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.comment-author {
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.comment-meta {
    font-size: 0.85rem;
    color: #999;
}
.comment-actions {
    display: flex;
    gap: 1rem;
}
.comment-like {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    color: #999;
    font-size: 0.85rem;
}
.comment-like.liked {
    color: #ff4d4f;
}
.comment-reply {
    color: #4A90E2;
    font-size: 0.85rem;
    cursor: pointer;
}
.comment-text {
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}
.reply-form {
    display: none;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 6px;
}
.reply-form input {
    width: calc(100% - 80px);
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.reply-form button {
    width: 70px;
    padding: 0.5rem;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.delete-btn {
    color: #ff4d4f;
    font-size: 0.85rem;
    cursor: pointer;
    display: none; /* 只作者可见 */
}
.delete-btn.visible {
    display: inline;
}

/* 设置页额外样式 */
.settings-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem;
}
.settings-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}
.settings-section h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}
.user-info-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
}
.user-details {
    font-size: 1.1rem;
    color: #666;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.form-group label {
    font-weight: 500;
    color: #333;
}
.form-group input, .form-group textarea, .form-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.form-group textarea {
    resize: vertical;
    height: 80px;
}
.avatar-upload {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: border-color 0.3s;
}
.avatar-upload:hover {
    border-color: #4A90E2;
}
.avatar-upload.dragover {
    border-color: #4A90E2;
    background: #f9f9f9;
}
.avatar-upload img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 50%;
    margin-top: 1rem;
}
.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 1rem;
}
.save-btn {
    padding: 0.75rem 1.5rem;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
}
.save-btn:hover {
    background: #357ABD;
}
.liked-posts, .my-posts {
    list-style: none;
}
.liked-posts li, .my-posts li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}
.liked-posts li a, .my-posts li a {
    color: #4A90E2;
    text-decoration: none;
}
.liked-posts li a:hover, .my-posts li a:hover {
    text-decoration: underline;
}
.notification-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.notification-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
}
.logout-btn {
    background: #ff4d4f;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
}
.back-btn {
    background: #4A90E2;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 1rem;
    display: block;
    width: fit-content;
}

/* 通用链接样式（用于按钮-like元素） */
.user-action-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    transition: background 0.3s;
}
.user-action-link:hover {
    background: rgba(255,255,255,0.3);
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #4A90E2;
    background: white;
    color: #4A90E2;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-btn:hover {
    background: #4A90E2;
    color: white;
}

.pagination-btn:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    background: white;
    color: #ccc;
}

.page-info {
    color: #666;
    font-size: 0.9rem;
}


/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    backdrop-filter: blur(5px);
}
.modal-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    border: var(--border-neon);
    box-shadow: var(--glow-cyan);
}
.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--neon-pink);
    text-shadow: var(--glow-pink);
    transition: all 0.3s ease;
}
.close:hover {
    color: var(--text-glow);
    transform: rotate(90deg);
}
.publish-modal form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.publish-modal input[type="text"],
.publish-modal textarea,
.publish-modal select {
    padding: 0.75rem;
    border: var(--border-neon);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.publish-modal input[type="text"]:focus,
.publish-modal textarea:focus,
.publish-modal select:focus {
    border-color: var(--neon-pink);
    box-shadow: var(--glow-pink);
    outline: none;
}
.publish-modal textarea {
    resize: vertical;
    min-height: 100px;
}
.publish-modal input[type="file"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.publish-modal button[type="submit"] {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--glow-cyan);
    transition: all 0.3s ease;
}
.publish-modal button[type="submit"]:hover {
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan);
    transform: translateY(-2px);
}
.publish-modal .media-preview {
    margin: 1rem 0;
    text-align: center;
}
.publish-modal .media-preview img,
.publish-modal .media-preview video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

/* 修改主容器样式 */
main#mainPosts {
    min-height: 400px; /* 增加最小高度 */
    width: 100%;
    display: flex; /* 使用flex布局 */
    flex-wrap: wrap; /* 允许换行 */
    align-content: flex-start; /* 从顶部开始排列 */
    align-items: flex-start;
    padding: 1rem 0; /* 添加一些内边距 */
    box-sizing: border-box;
    max-width: none; /* 确保没有最大宽度限制 */
    margin: 0;
}

/* 修改帖子网格容器 */
.posts-grid {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-content: flex-start;
    /* 移除grid布局，改用flex */
}

/* 帖子卡片样式优化 */
.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    /* 固定宽度，使用flex-basis */
    flex: 0 0 calc(33.333% - 1rem); /* 大约1/3宽度 */
    max-width: calc(33.333% - 1rem);
    min-width: 280px; /* 最小宽度 */
    box-sizing: border-box;
}

/* 响应式布局调整 */
@media (max-width: 1024px) {
    .post-card {
        flex: 0 0 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }
}

@media (max-width: 768px) {
    .post-card {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
}

/* 为容器添加调试边框（临时使用） */
main#mainPosts {
    border: 2px solid transparent; /* 透明边框，用于调试 */
}



/* 回到顶部按钮 */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-secondary);
    color: var(--neon-cyan);
    border: var(--border-neon);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--glow-cyan);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex !important;  /* 确保总是 flex 布局 */
    align-items: center;
    justify-content: center;
}
.back-to-top-btn.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}
.back-to-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px var(--neon-cyan), 0 0 60px var(--neon-cyan);
    background: var(--bg-tertiary);
}
.back-to-top-btn:active {
    transform: translateY(-3px);
}

/* 搜索加载 */
.search-loading {
    display: none;
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* 移除可能限制显示的媒体查询 */
@media (max-width: 1200px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .post-card {
        margin-bottom: 1rem;
    }
}

/* 页脚 */
footer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    border-top: var(--border-neon);
    box-shadow: 0 -2px 10px rgba(0, 255, 255, 0.2);
}

/* =========================== */
/* 赛博朋克动画定义 */
/* =========================== */

@keyframes neonFlicker {
    0%, 100% {
        text-shadow: var(--glow-cyan);
    }
    50% {
        text-shadow: 0 0 5px var(--neon-cyan), 0 0 10px var(--neon-cyan);
    }
}

@keyframes borderScan {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

/* 滚动条赛博朋克风格 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 4px;
    box-shadow: var(--glow-cyan);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink);
    box-shadow: var(--glow-pink);
}

/* =========================== */
/* 移动端适配 - 汉堡菜单和侧边抽屉 */
/* =========================== */

/* 汉堡菜单按钮 */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background: var(--neon-cyan);
    border-radius: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px var(--neon-cyan);
}

.hamburger-btn:hover span {
    background: var(--cp-yellow);
    box-shadow: var(--glow-yellow);
}

/* 侧边抽屉 */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: var(--border-yellow);
    box-shadow: -4px 0 20px rgba(252, 238, 10, 0.3);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-drawer.active {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: var(--border-neon);
    background: var(--bg-secondary);
}

.drawer-header .logo {
    font-size: 1.2rem;
    color: var(--cp-yellow);
    text-shadow: var(--glow-yellow);
    font-family: var(--font-title);
}

.drawer-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--neon-cyan);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.drawer-close:hover {
    color: var(--neon-pink);
    text-shadow: var(--glow-pink);
    transform: rotate(90deg);
}

.drawer-content {
    padding: 1rem;
}

.drawer-search {
    margin-bottom: 1.5rem;
}

.drawer-search input {
    width: 100%;
    padding: 0.75rem;
    border: var(--border-neon);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.1);
}

.drawer-search input:focus {
    outline: none;
    border-color: var(--neon-pink);
    box-shadow: var(--glow-pink);
}

.drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.drawer-actions button,
.drawer-actions a {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: var(--border-neon);
    color: var(--neon-cyan);
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
}

.drawer-actions button:hover,
.drawer-actions a:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--glow-cyan);
    transform: translateX(-5px);
}

/* 遮罩层 */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =========================== */
/* 响应式断点 - 1024px (平板) */
/* =========================== */

@media (max-width: 1024px) {
    /* 导航栏调整 */
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .search-bar {
        max-width: 300px;
        margin: 0 1.5rem;
    }
    
    /* 帖子网格 */
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 个人主页网格 */
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 模态框 */
    .modal-content {
        max-width: 85%;
    }
    
    .publish-modal {
        max-width: 600px;
    }
}

/* =========================== */
/* 响应式断点 - 768px (大手机/小平板) */
/* =========================== */

@media (max-width: 768px) {
    /* 基础字号增大 */
    body {
        font-size: 15px;
    }
    
    /* 显示汉堡菜单，隐藏原搜索框和部分按钮 */
    .hamburger-btn {
        display: flex;
    }
    
    .search-bar {
        display: none;
    }
    
    .user-actions > button:not(#adminPanelBtn):not(#publishBtn),
    .user-actions > a:not(#settingsBtn) {
        display: none;
    }
    
    /* 导航栏 */
    .nav-container {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    
    /* 隐藏Logo的故障效果伪元素 */
    .logo::before,
    .logo::after {
        display: none;
    }
    
    /* 类别按钮 */
    .top-categories {
        padding: 0.5rem 1rem;
    }
    
    .category-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* 帖子网格 */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* 帖子卡片 */
    .post-card {
        margin-bottom: 1rem;
    }
    
    .post-title {
        font-size: 1rem;
    }
    
    .post-description {
        font-size: 0.9rem;
    }
    
    /* 个人主页 */
    .container {
        padding: 0 1rem;
        margin: 1rem auto;
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0.75rem;
    }
    
    /* 帖子详情页 */
    .post-detail-container {
        margin: 0;
        border-radius: 0;
    }
    
    .detail-header {
        padding: 1rem;
    }
    
    .detail-title {
        font-size: 1.2rem;
    }
    
    .post-detail-content {
        padding: 1rem;
        padding-bottom: 100px; /* 留出交互栏空间 */
    }
    
    /* 交互栏固定在底部 */
    .interaction-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: 100%;
        padding: 1rem 1.5rem;
        border-radius: 0;
        z-index: 100;
    }
    
    .interaction-icon {
        font-size: 1.8rem;
    }
    
    /* 评论区 */
    .comments-section {
        padding: 1rem;
        margin-bottom: 0;
    }
    
    .comment-form {
        flex-direction: column;
        padding: 0.75rem;
    }
    
    .comment-form input {
        width: 100%;
    }
    
    .comment-form button {
        width: 100%;
        padding: 0.75rem;
    }
    
    .comment-replies {
        margin-left: 1.5rem;
        padding-left: 0.75rem;
    }
    
    /* 模态框全屏 */
    .modal {
        align-items: flex-start;
        padding: 0;
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
    }
    
    .publish-modal {
        width: 100%;
        max-width: 100%;
        height: 100vh;
    }
    
    /* 登录/注册模态框 */
    .modal-content form {
        width: 100%;
    }
    
    /* 回到顶部按钮 */
    .back-to-top-btn {
        bottom: 5.5rem; /* 避开固定的交互栏 */
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    /* 设置页面 */
    .settings-container {
        padding: 1rem;
    }
    
    .settings-section {
        padding: 1rem;
    }
}

/* =========================== */
/* 响应式断点 - 480px (手机) */
/* =========================== */

@media (max-width: 480px) {
    /* Logo缩小 */
    .logo {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    /* 导航栏 */
    .nav-container {
        padding: 0 0.75rem;
    }
    
    /* 类别按钮 */
    .top-categories {
        padding: 0.5rem 0.75rem;
    }
    
    .category-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
    }
    
    /* 帖子网格单列 */
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* 个人主页网格单列 */
    .grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* 容器内边距 */
    .container {
        padding: 0 0.75rem;
    }
    
    /* 评论回复缩进 */
    .comment-replies {
        margin-left: 1rem;
        padding-left: 0.5rem;
    }
    
    /* 详情页标题 */
    .detail-title {
        font-size: 1.1rem;
    }
    
    .detail-meta {
        font-size: 0.8rem;
        gap: 1rem;
    }
    
    /* 交互栏 */
    .interaction-bar {
        padding: 0.75rem 1rem;
    }
    
    .interaction-item {
        font-size: 0.85rem;
    }
    
    /* 侧边抽屉宽度 */
    .mobile-drawer {
        width: 260px;
        right: -280px;
    }
    
    /* 按钮内边距 */
    .user-actions button {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* 设置页面 */
    .settings-section {
        padding: 0.75rem;
    }
    
    /* 模态框内边距 */
    .modal-content {
        padding: 1rem;
    }
}