/* 交友圈详情页 - 完整优化版样式 */

/* === CSS变量定义 === */
:root {
    --primary-color: #8b5cf6;
    --secondary-color: #a855f7;
    --accent-color: #c084fc;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --text-color: #ffffff;
    --text-secondary: #e2e8f0;
    --background-color: #0f0f23;
    --surface-color: rgba(15, 15, 35, 0.95);
    --card-bg-color: rgba(30, 30, 60, 0.9);
    --glass-bg: rgba(15, 15, 35, 0.7);
    --neon-purple: #8b5cf6;
    --neon-pink: #ec4899;
    --neon-blue: #06b6d4;
    --neon-orange: #f97316;
    --neon-red: #ef4444;
    --gradient-sexy: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #06b6d4 100%);
    --gradient-hot: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #8b5cf6 100%);
    --gradient-passion: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition-fast: 0.15s;
    --transition-normal: 0.3s;
    --shadow-sm: 0 2px 4px rgba(139, 92, 246, 0.1);
    --shadow-md: 0 4px 8px rgba(139, 92, 246, 0.15);
    --shadow-lg: 0 8px 16px rgba(139, 92, 246, 0.2);
    --shadow-neon: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* === 基础重置和布局 === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 400;
    letter-spacing: -0.025em;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

/* === 动态背景 === */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1a1a3e 0%, #0f0f23 70%);
    pointer-events: none;
}

.background-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    will-change: transform;
    animation: elegantFloat 25s ease-in-out infinite;
    pointer-events: none;
}

.shape1 {
    width: 500px;
    height: 500px;
    background: conic-gradient(from 0deg, #8b5cf6, #ec4899, #06b6d4, #a855f7, #8b5cf6);
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.shape2 {
    width: 600px;
    height: 350px;
    background: linear-gradient(45deg, #a855f7, #ec4899, #06b6d4);
    bottom: -100px;
    right: -200px;
    border-radius: 60% 40% 60% 40%;
    animation-delay: 8s;
}

.shape3 {
    width: 400px;
    height: 500px;
    background: radial-gradient(ellipse, #ec4899, #8b5cf6, #6366f1);
    top: 30%;
    left: 70%;
    border-radius: 70% 30% 70% 30%;
    animation-delay: 15s;
}

@keyframes elegantFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 50%;
    }
    25% {
        transform: translate(40px, -30px) scale(1.05) rotate(90deg);
        border-radius: 60% 40% 70% 30%;
    }
    50% {
        transform: translate(-20px, 40px) scale(0.95) rotate(180deg);
        border-radius: 30% 70% 40% 60%;
    }
    75% {
        transform: translate(30px, 20px) scale(1.02) rotate(270deg);
        border-radius: 70% 30% 60% 40%;
    }
}

/* === 页面加载动画 === */
.fade-in {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0.3;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === LOGO悬浮层 === */
#floating-logo {
    position: absolute;
    top: 20px;
    left: 300px;
    z-index: 9999;
    transition: all 0.3s ease;
}

#floating-logo img {
    width: 250px;
    height: auto;
    transition: all 0.3s ease;
}

#floating-logo.shrinked {
    top: 120px;
}

#floating-logo.shrinked img {
    width: 100px;
}

/* === 帖子头部样式 === */
.post-header {
    background: var(--glass-bg);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(24px);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    z-index: 1;
}

.post-header:hover {
    border-color: var(--neon-purple);
    box-shadow: var(--shadow-neon);
}

.post-user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.user-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
    transition: all var(--transition-normal);
    object-fit: cover;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    background: var(--gradient-sexy);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-time {
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0.8;
}

.btn-return {
    background: var(--gradient-sexy);
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 16px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
}

.btn-return:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--gradient-hot);
}

.post-labels {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.label-title, .label-category {
    background: rgba(139, 92, 246, 0.15);
    color: var(--neon-purple);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 400;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.post-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-color);
    margin: 16px 0;
    padding: 16px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--neon-purple);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-content-link {
    color: var(--neon-blue) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    background: rgba(6, 182, 212, 0.1) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(6, 182, 212, 0.3) !important;
    transition: all var(--transition-normal) !important;
    display: inline-block !important;
    margin: 0 2px !important;
    word-break: break-all !important;
}

.post-content-link:hover {
    color: #0891b2 !important;
    background: rgba(6, 182, 212, 0.2) !important;
    border-color: rgba(6, 182, 212, 0.5) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2) !important;
}

.post-stats {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--neon-purple);
    font-weight: 500;
    font-size: 14px;
}

.post-stats i {
    color: var(--neon-pink);
}



/* === 评论区样式 === */
.comments-section {
    background: var(--glass-bg);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(24px);
    position: relative;
    z-index: 10;
}

.comments-section h2 {
    background: var(--gradient-sexy);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 700;
}

.login-prompt {
    text-align: center;
    padding: 20px;
    background: rgba(139, 92, 246, 0.08);
    border-radius: var(--border-radius);
    border: 2px dashed rgba(139, 92, 246, 0.3);
}

.login-prompt a {
    color: var(--neon-purple);
    text-decoration: none;
    font-weight: 600;
}

.login-prompt a:hover {
    color: var(--neon-pink);
    text-decoration: underline;
}

/* === 评论输入框 === */
.comment-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(139, 92, 246, 0.2);
    position: relative;
    z-index: 20;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
    object-fit: cover;
    flex-shrink: 0;
}

.comment-input-wrapper {
    flex: 1;
    position: relative;
    z-index: 10;
}

.comment-input {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-normal);
    resize: none;
    font-family: inherit;
}

.comment-input:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.comment-input[contenteditable]:empty::before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.comment-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
    position: relative;
    z-index: 30;
}

.comment-tool-buttons {
    display: flex;
    gap: 6px;
    position: relative;
    z-index: 30;
}

.tool-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--gradient-sexy);
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    position: relative;
    z-index: 30;
    pointer-events: auto;
}

.tool-btn:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: var(--shadow-md);
    background: var(--gradient-hot);
}

.tool-btn:active {
    transform: translateY(0) scale(0.95);
}

.tool-btn i {
    font-size: 13px;
    color: white;
    pointer-events: none;
}

.submit-comment-btn {
    background: var(--gradient-sexy);
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 16px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    position: relative;
    z-index: 20;
}

.submit-comment-btn:hover:not(.disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: var(--gradient-hot);
}

.submit-comment-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* === 表情选择器 === */
.emoji-picker {
    position: fixed !important;
    z-index: 999999 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    width: 280px !important;
    max-height: 320px !important;
    padding: 12px !important;
    background: rgba(15, 15, 35, 0.98) !important;
    border: 1px solid rgba(139, 92, 246, 0.4) !important;
    border-radius: var(--border-radius) !important;
    backdrop-filter: blur(24px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: emojiPickerShow 0.2s ease-out !important;
}

@keyframes emojiPickerShow {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.emoji-tabs {
    display: flex !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3) !important;
    margin-bottom: 10px !important;
    padding: 0 !important;
    gap: 2px !important;
}

.emoji-tab {
    flex: 1 !important;
    padding: 8px 10px !important;
    cursor: pointer !important;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    background: rgba(139, 92, 246, 0.1) !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    transition: all var(--transition-fast) !important;
    user-select: none !important;
    pointer-events: auto !important;
}

.emoji-tab:hover {
    background: rgba(139, 92, 246, 0.2) !important;
    color: var(--neon-purple) !important;
}

.emoji-tab:first-child {
    color: var(--neon-purple) !important;
    border-color: var(--neon-purple) !important;
    background: rgba(139, 92, 246, 0.25) !important;
}

.emoji-content {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 6px !important;
    max-height: 260px !important;
    overflow-y: auto !important;
}

.emoji-item {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    background: rgba(139, 92, 246, 0.08) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    border-radius: 6px !important;
    transition: all var(--transition-fast) !important;
    pointer-events: auto !important;
}

.emoji-item:hover {
    background: rgba(139, 92, 246, 0.25) !important;
    border-color: var(--neon-purple) !important;
    transform: scale(1.05) !important;
    box-shadow: var(--shadow-sm) !important;
}

.emoji-item:active {
    transform: scale(0.95) !important;
    background: rgba(139, 92, 246, 0.35) !important;
}

.emoji-item img {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain !important;
    pointer-events: none !important;
    user-select: none !important;
}

.emoji-content::-webkit-scrollbar {
    width: 4px !important;
}

.emoji-content::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1) !important;
    border-radius: 2px !important;
}

.emoji-content::-webkit-scrollbar-thumb {
    background: var(--gradient-sexy) !important;
    border-radius: 2px !important;
}

/* === 评论列表 === */
.comments-list {
    margin-top: 16px;
}

.comment-item {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 12px;
    transition: all var(--transition-normal);
    position: relative;
    z-index: 5;
}

.comment-item:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.comment-header {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-user-info {
    flex: 1;
    min-width: 0;
}

.comment-user-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.comment-username {
    color: #10b981;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    flex-shrink: 0;
}

.comment-username:hover {
    color: #059669;
}

.comment-location {
    color: rgba(139, 92, 246, 0.7);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.comment-location i {
    font-size: 10px;
}

.comment-time {
    color: var(--text-secondary);
    font-size: 11px;
    opacity: 0.6;
    margin-left: auto;
}

.comment-content {
    color: var(--text-color);
    line-height: 1.5;
    margin: 8px 0;
    font-size: 14px;
    padding-left: 46px;
}

.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-left: 46px;
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: 4px 8px;
    border-radius: var(--border-radius);
    font-size: 12px;
    background: transparent;
    border: none;
}

.comment-action:hover {
    color: var(--neon-purple);
    background: rgba(139, 92, 246, 0.1);
}

.comment-action.liked {
    color: var(--neon-purple);
    background: rgba(139, 92, 246, 0.15);
}

/* === 回复相关 === */
.comment-replies-container {
    margin-left: 16px;
    border-left: 2px solid rgba(139, 92, 246, 0.2);
    padding-left: 12px;
    margin-top: 10px;
}

.reply-item {
    background: rgba(139, 92, 246, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: var(--border-radius);
    padding: 10px;
    margin-bottom: 8px;
    position: relative;
    z-index: 5;
}

.toggle-replies {
    color: var(--neon-purple);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 8px;
    border-radius: var(--border-radius);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    margin: 8px 0;
}

.toggle-replies:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--neon-pink);
}

.reply-container {
    margin-top: 10px;
    position: relative;
    z-index: 15;
}

.reply-input-container {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: rgba(139, 92, 246, 0.03);
    border-radius: var(--border-radius);
    border: 1px solid rgba(139, 92, 246, 0.15);
    position: relative;
    z-index: 15;
}

.reply-input {
    width: 100%;
    min-height: 40px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.reply-input:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.reply-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    position: relative;
    z-index: 25;
}

.reply-tool-buttons {
    display: flex;
    gap: 4px;
    position: relative;
    z-index: 25;
}

.reply-tool-buttons .tool-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
    z-index: 25;
}

.reply-action-buttons {
    display: flex;
    gap: 6px;
}

.cancel-reply-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 4px 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 12px;
}

.cancel-reply-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

.submit-reply-btn {
    background: var(--gradient-sexy);
    border: none;
    border-radius: var(--border-radius);
    padding: 4px 10px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 12px;
}

.submit-reply-btn:hover:not(.disabled) {
    background: var(--gradient-hot);
    transform: translateY(-1px);
}

.submit-reply-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reply-to-name {
    color: #06b6d4 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    background: rgba(6, 182, 212, 0.1) !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(6, 182, 212, 0.3) !important;
    transition: all 0.3s ease !important;
}

.reply-to-name:hover {
    color: #0891b2 !important;
    background: rgba(6, 182, 212, 0.2) !important;
    border-color: rgba(6, 182, 212, 0.5) !important;
    transform: scale(1.02) !important;
}

/* === 语音和图片相关 === */
.comment-voice-player {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--border-radius);
    padding: 10px;
    margin: 8px 0;
    margin-left: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.voice-play-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-sexy);
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    font-size: 12px;
}

.voice-play-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    background: var(--gradient-hot);
}

.voice-duration {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.voice-progress {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.voice-progress-bar {
    height: 100%;
    background: var(--gradient-sexy);
    width: 0%;
    transition: width 0.1s ease;
}

.voice-btn.recording {
    background: var(--gradient-passion) !important;
    animation: recordingPulse 1s infinite;
}

@keyframes recordingPulse {
    0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(236, 72, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
}

.comment-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
    padding-left: 46px;
}

.comment-image-wrapper {
    cursor: pointer;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.comment-image-wrapper:hover {
    transform: scale(1.02);
    border-color: var(--neon-purple);
    box-shadow: var(--shadow-sm);
}

.comment-image {
    width: 90px;
    height: 90px;
    object-fit: cover;
    display: block;
}

.image-preview-container,
.voice-preview-container {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding: 8px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.image-preview-wrapper {
    position: relative;
}

.image-preview {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.remove-image {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--gradient-passion);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 10px;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.remove-image:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.inline-emoji {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin: 0 1px;
}

/* === 加载和状态 === */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--neon-purple);
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.load-more-comments {
    text-align: center;
    margin: 16px 0;
}

.load-more-comments button {
    background: var(--gradient-sexy);
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 20px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    font-size: 14px;
}

.load-more-comments button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: var(--gradient-hot);
}

.loading-comments, .no-comments {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px 16px;
    font-style: italic;
    opacity: 0.7;
}

.no-replies {
    text-align: center;
    color: var(--text-secondary);
    padding: 12px;
    font-style: italic;
    font-size: 12px;
    opacity: 0.6;
}

.error-message {
    text-align: center;
    color: var(--neon-pink);
    padding: 16px;
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: var(--border-radius);
    margin: 12px 0;
}

.comment-item.highlight-comment {
    border-color: var(--neon-purple);
    box-shadow: var(--shadow-neon);
    animation: highlightFade 2s ease-out;
}

@keyframes highlightFade {
    0% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.6); }
    100% { box-shadow: var(--shadow-neon); }
}

/* === 通用按钮 === */
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 14px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--gradient-sexy);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--gradient-hot);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* === 图片模态框 === */
.modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal.show,
.modal[style*="flex"] {
    display: flex !important;
}

.modal-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    text-align: center;
    margin: auto;
    padding: 0;
    width: auto;
    top: auto;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    object-fit: contain;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--neon-purple);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-normal);
    z-index: 100001;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    line-height: 1;
}

.close:hover {
    color: var(--neon-pink);
    background: rgba(0, 0, 0, 0.7);
}

/* === Toast消息 === */
.toast-message {
    background: var(--glass-bg) !important;
    border: 1px solid rgba(139, 92, 246, 0.4) !important;
    color: var(--text-color) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: var(--shadow-md) !important;
    border-radius: var(--border-radius) !important;
}

.toast-success {
    border-left: 4px solid var(--success-color) !important;
}

.toast-error {
    border-left: 4px solid var(--neon-red) !important;
}

.toast-info {
    border-left: 4px solid var(--neon-purple) !important;
}

/* === 滚动条样式 === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-sexy);
    border-radius: 3px;
    transition: all var(--transition-normal);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-hot);
}

/* === 移动端响应式优化 === */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .post-header {
        padding: 16px;
    }

    .post-user-info {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .user-avatar {
        width: 45px;
        height: 45px;
    }

    .user-name {
        font-size: 16px;
    }

    .btn-return {
        padding: 8px 12px;
        font-size: 13px;
        height: 36px;
        white-space: nowrap;
    }

    .comments-section {
        padding: 16px;
    }

    .comment-input-container {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .comment-tools {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .comment-tool-buttons {
        justify-content: center;
    }

    .submit-comment-btn {
        width: 100%;
    }

    .comment-replies-container {
        margin-left: 10px;
        padding-left: 10px;
    }

    .comment-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 200px;
    }

    .emoji-picker {
        width: calc(100vw - 30px) !important;
        max-width: 280px !important;
        left: 15px !important;
        right: 15px !important;
        transform: none !important;
        bottom: 20px !important;
        top: auto !important;
    }

    .emoji-content {
        max-height: 220px !important;
    }

    .emoji-item {
        width: 30px !important;
        height: 30px !important;
    }

    .emoji-item img {
        width: 18px !important;
        height: 18px !important;
    }

    #floating-logo {
        left: 80px;
        top: 20px;
    }

    #floating-logo img {
        width: 200px;
    }

    #floating-logo.shrinked {
        top: 90px;
    }

    #floating-logo.shrinked img {
        width: 80px;
    }
}


/* === 触摸设备和无障碍优化 === */
@media (hover: none) and (pointer: coarse) {
    .tool-btn,
    .comment-action {
        min-height: 40px;
        min-width: 40px;
    }

    .emoji-item {
        width: 40px !important;
        height: 40px !important;
    }

    .post-image:hover,
    .comment-image-wrapper:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: more) {
    .post-header,
    .comments-section,
    .comment-item {
        border-width: 2px;
        border-color: var(--neon-purple);
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0a0a0f;
        --surface-color: rgba(10, 10, 15, 0.95);
        --glass-bg: rgba(10, 10, 15, 0.8);
    }
}

/* === 兼容性修复 === */
@supports not (backdrop-filter: blur(10px)) {
    .post-header,
    .comments-section,
    .comment-input-container,
    .emoji-picker {
        background: rgba(15, 15, 35, 0.95) !important;
    }
}

@supports not (aspect-ratio: 4 / 3) {
    .post-image {
        height: 200px;
    }

    @media (min-width: 1024px) {
        .post-image { height: 240px; }
        .post-images.count-1 .post-image { height: 300px; }
    }

    @media (min-width: 769px) and (max-width: 1023px) {
        .post-image { height: 200px; }
        .post-images.count-1 .post-image { height: 250px; }
    }

    @media (min-width: 481px) and (max-width: 768px) {
        .post-image { height: 180px; }
        .post-images.count-1 .post-image { height: 220px; }
    }

    @media (max-width: 480px) {
        .post-image { height: 150px; }
        .post-images.count-1 .post-image { height: 200px; }
        .post-images.count-7 .post-image,
        .post-images.count-8 .post-image,
        .post-images.count-9 .post-image { height: 100px; }
    }
}

/* 键盘导航优化 */
.tool-btn:focus,
.comment-action:focus,
.toggle-replies:focus,
.emoji-item:focus,
.submit-comment-btn:focus,
.submit-reply-btn:focus {
    outline: 2px solid var(--neon-purple);
    outline-offset: 2px;
}

/* 确保所有交互元素可用 */
.tool-btn,
.comment-action,
.toggle-replies,
.emoji-item,
.emoji-tab {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 表情选择器层级最终修复 */
html .emoji-picker,
body .emoji-picker,
* .emoji-picker {
    position: fixed !important;
    z-index: 999999 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.post-images,
.post-header,
.container {
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

.post-image {
    transform: none !important;
    backface-visibility: visible !important;
    z-index: auto !important;
    will-change: auto !important;
}

.post-image:hover {
    transform: none !important;
    z-index: auto !important;
}

.emoji-picker,
.emoji-picker *,
.emoji-tab,
.emoji-item,
.emoji-content {
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    pointer-events: auto !important;
}

/* === 用户头像和姓名点击样式 === */

/* 用户头像链接 */
.user-avatar-link {
    text-decoration: none;
    display: block;
    border-radius: 50%;
    transition: all var(--transition-normal);
    position: relative;
}

.user-avatar-link:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.6);
}

.user-avatar-link:active {
    transform: scale(0.98);
}

/* 用户名链接 */
.user-name-link {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-normal);
    display: inline-block;
    border-radius: 6px;
    padding: 2px 4px;
    margin: -2px -4px;
}

.user-name-link:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.user-name-link:active {
    transform: translateY(0);
    background: rgba(139, 92, 246, 0.25);
}

.user-name-link .user-name {
    background: var(--gradient-sexy);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 18px;
    font-weight: 700;
    transition: all var(--transition-normal);
}

.user-name-link:hover .user-name {
    background: var(--gradient-hot);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 评论区用户链接（已有的样式保持不变） */
.comment-username {
    color: #10b981;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    flex-shrink: 0;
    transition: all var(--transition-normal);
    border-radius: 4px;
    padding: 1px 3px;
    margin: -1px -3px;
}

.comment-username:hover {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-1px);
}

.comment-username:active {
    transform: translateY(0);
    background: rgba(16, 185, 129, 0.2);
}

/* 回复中的@用户名链接 */
.reply-to-name {
    color: #06b6d4 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    background: rgba(6, 182, 212, 0.1) !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    border: 1px solid rgba(6, 182, 212, 0.3) !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
}

.reply-to-name:hover {
    color: #0891b2 !important;
    background: rgba(6, 182, 212, 0.2) !important;
    border-color: rgba(6, 182, 212, 0.5) !important;
    transform: scale(1.02) translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2) !important;
}

.reply-to-name:active {
    transform: scale(1) translateY(0) !important;
    background: rgba(6, 182, 212, 0.3) !important;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .user-avatar-link:hover {
        transform: scale(1.03); /* 移动端减小缩放效果 */
    }

    .user-name-link:hover {
        transform: none; /* 移动端取消浮动效果 */
        background: rgba(139, 92, 246, 0.1);
    }

    /* 增加移动端触摸区域 */
    .user-avatar-link,
    .user-name-link,
    .comment-username,
    .reply-to-name {
        min-height: 44px; /* 符合触摸友好的最小尺寸 */
        display: flex;
        align-items: center;
    }

    .user-name-link {
        padding: 8px 4px;
        margin: -8px -4px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .user-avatar-link:hover,
    .user-name-link:hover,
    .comment-username:hover,
    .reply-to-name:hover {
        transform: none; /* 触摸设备不显示hover动画 */
    }

    /* 触摸反馈 */
    .user-avatar-link:active,
    .user-name-link:active,
    .comment-username:active,
    .reply-to-name:active {
        opacity: 0.7;
        transition: opacity 0.1s ease;
    }
}

/* 无障碍优化 */
.user-avatar-link:focus,
.user-name-link:focus,
.comment-username:focus,
.reply-to-name:focus {
    outline: 2px solid var(--neon-purple);
    outline-offset: 2px;
    border-radius: 6px;
}

/* 键盘导航优化 */
.user-avatar-link:focus-visible,
.user-name-link:focus-visible,
.comment-username:focus-visible,
.reply-to-name:focus-visible {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* 防止选中文本 */
.user-avatar-link,
.user-name-link {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 加载状态 */
.user-avatar-link.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.5;
        transform: scale(1);
    }
}

/* === 微信朋友圈风格图片九宫格布局 - 完全修正版 === */

/* 图片容器基础样式 */
.post-images {
    display: grid;
    gap: 4px;
    margin: 16px 0;
    border-radius: 8px;
    overflow: visible;
    position: relative;
    z-index: auto;
    max-width: 100%;
}

/* 图片基础样式 - 统一正方形，适配所有长宽比 */
.post-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    position: relative;
    z-index: auto;
    background: rgba(139, 92, 246, 0.1);
    display: block;
    border: 1px solid rgba(139, 92, 246, 0.15);
    opacity: 0;
    /* 移除有问题的image-rendering属性 */
    /* 使用更安全的图片优化方式 */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* 单独为不同浏览器设置图片渲染优化 */
/* WebKit浏览器（Chrome, Safari） */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .post-image {
        -webkit-image-rendering: -webkit-optimize-contrast;
    }
}

/* Firefox浏览器 */
@-moz-document url-prefix() {
    .post-image {
        image-rendering: crisp-edges;
    }
}

/* Edge浏览器 */
@supports (-ms-ime-align: auto) {
    .post-image {
        image-rendering: auto;
    }
}

/* 现代浏览器的通用设置 */
@supports (image-rendering: crisp-edges) {
    .post-image {
        image-rendering: crisp-edges;
    }
}

.post-image:hover {
    transform: scale(1.02);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.4);
    z-index: 10;
}

.post-image:active {
    transform: scale(0.98);
}

/* 图片加载完成后显示 */
.post-image[src] {
    animation: imageSlideIn 0.4s ease-out forwards;
}

@keyframes imageSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === 桌面端布局 (≥768px) === */
@media (min-width: 768px) {
    /* 1张图片 - 大图显示，保持4:3比例 */
    .post-images.count-1 {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 16px 0;
    }

    .post-images.count-1 .post-image {
        aspect-ratio: 4 / 3;
        max-height: 400px;
        border-radius: 12px;
    }

    /* 2张图片 - 1行2列 */
    .post-images.count-2 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 420px;
    }

    /* 3张图片 - 1行3列 */
    .post-images.count-3 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 630px;
    }

    /* 4张图片 - 2行2列 */
    .post-images.count-4 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 420px;
    }

    /* 5张图片 - 第1行2张，第2行3张 */
    .post-images.count-5 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto;
        max-width: 630px;
    }
    .post-images.count-5 .post-image:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    .post-images.count-5 .post-image:nth-child(2) {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }
    .post-images.count-5 .post-image:nth-child(3) {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }
    .post-images.count-5 .post-image:nth-child(4) {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }
    .post-images.count-5 .post-image:nth-child(5) {
        grid-column: 3 / 4;
        grid-row: 2 / 3;
    }

    /* 6张图片 - 2行3列 */
    .post-images.count-6 {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        max-width: 630px;
    }

    /* 7张图片 - 第1行3张，第2行3张，第3行1张居中 */
    .post-images.count-7 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto auto;
        max-width: 630px;
    }
    .post-images.count-7 .post-image:nth-child(7) {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
    }

    /* 8张图片 - 第1行3张，第2行3张，第3行2张居中 */
    .post-images.count-8 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto auto;
        max-width: 630px;
    }
    .post-images.count-8 .post-image:nth-child(7) {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }
    .post-images.count-8 .post-image:nth-child(8) {
        grid-column: 2 / 3;
        grid-row: 3 / 4;
    }

    /* 9张图片 - 3行3列 标准九宫格 */
    .post-images.count-9 {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        max-width: 630px;
    }
}

/* === 平板端布局 (481px - 767px) === */
@media (min-width: 481px) and (max-width: 767px) {
    /* 1张图片 */
    .post-images.count-1 {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 16px 0;
    }

    .post-images.count-1 .post-image {
        aspect-ratio: 4 / 3;
        max-height: 320px;
        border-radius: 10px;
    }

    /* 2张图片 */
    .post-images.count-2 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 380px;
    }

    /* 3张图片 */
    .post-images.count-3 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 570px;
    }

    /* 4张图片 */
    .post-images.count-4 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 380px;
    }

    /* 5张图片 - 第1行2张，第2行3张 */
    .post-images.count-5 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto;
        max-width: 570px;
    }
    .post-images.count-5 .post-image:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    .post-images.count-5 .post-image:nth-child(2) {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }
    .post-images.count-5 .post-image:nth-child(3) {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }
    .post-images.count-5 .post-image:nth-child(4) {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }
    .post-images.count-5 .post-image:nth-child(5) {
        grid-column: 3 / 4;
        grid-row: 2 / 3;
    }

    /* 6-9张图片都使用3列布局 */
    .post-images.count-6,
    .post-images.count-7,
    .post-images.count-8,
    .post-images.count-9 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 570px;
    }
}

/* === 手机端布局 (≤480px) === */
@media (max-width: 480px) {
    .post-images {
        gap: 3px;
        margin: 12px 0;
    }

    /* 1张图片 */
    .post-images.count-1 {
        grid-template-columns: 1fr;
        max-width: 280px;
        margin: 12px 0;
    }

    .post-images.count-1 .post-image {
        aspect-ratio: 4 / 3;
        max-height: 260px;
        border-radius: 8px;
    }

    /* 2张图片 */
    .post-images.count-2 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 340px;
    }

    /* 3张图片 */
    .post-images.count-3 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 510px;
    }

    /* 4张图片 */
    .post-images.count-4 {
        grid-template-columns: repeat(2, 1fr);
        max-width: 340px;
    }

    /* 5张图片 - 第1行2张，第2行3张 */
    .post-images.count-5 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto;
        max-width: 510px;
    }
    .post-images.count-5 .post-image:nth-child(1) {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    .post-images.count-5 .post-image:nth-child(2) {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }
    .post-images.count-5 .post-image:nth-child(3) {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }
    .post-images.count-5 .post-image:nth-child(4) {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }
    .post-images.count-5 .post-image:nth-child(5) {
        grid-column: 3 / 4;
        grid-row: 2 / 3;
    }

    /* 6-9张图片都使用3列布局 */
    .post-images.count-6,
    .post-images.count-7,
    .post-images.count-8,
    .post-images.count-9 {
        grid-template-columns: repeat(3, 1fr);
        max-width: 510px;
    }
}

/* === 超小屏幕优化 (≤360px) === */
@media (max-width: 360px) {
    .post-images {
        gap: 2px;
        margin: 10px 0;
    }

    .post-images.count-1 {
        max-width: 240px;
    }

    .post-images.count-1 .post-image {
        max-height: 220px;
        border-radius: 6px;
    }

    .post-images.count-2,
    .post-images.count-4 {
        max-width: 300px;
    }

    .post-images.count-3,
    .post-images.count-5,
    .post-images.count-6,
    .post-images.count-7,
    .post-images.count-8,
    .post-images.count-9 {
        max-width: 450px;
    }
}

/* === 图片加载失败处理 === */
.post-image:not([src]),
.post-image[src=""] {
    display: none;
}

/* === 触摸设备优化 === */
@media (hover: none) and (pointer: coarse) {
    .post-image:hover {
        transform: none;
        box-shadow: none;
        border-color: rgba(139, 92, 246, 0.15);
    }

    .post-image:active {
        transform: scale(0.95);
        opacity: 0.8;
        transition: all 0.1s ease;
    }

    .post-image {
        min-height: 44px;
    }
}

/* === 无障碍优化 === */
.post-image:focus {
    outline: 2px solid rgba(139, 92, 246, 0.8);
    outline-offset: 2px;
    border-radius: 8px;
}

.post-image:focus-visible {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* === 减少动画模式 === */
@media (prefers-reduced-motion: reduce) {
    .post-image,
    .post-image:hover {
        transition: none;
        animation: none;
        transform: none;
    }

    .post-image[src] {
        animation: none;
        opacity: 1;
    }
}

/* === 高对比度模式 === */
@media (prefers-contrast: more) {
    .post-image {
        border: 2px solid rgba(139, 92, 246, 0.6);
    }

    .post-image:hover {
        border-color: rgba(139, 92, 246, 1);
        box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.5);
    }
}

/* === 兼容性支持 === */
/* 对于不支持aspect-ratio的浏览器 */
@supports not (aspect-ratio: 1 / 1) {
    .post-image {
        height: 0;
        padding-bottom: 100%;
        position: relative;
        overflow: hidden;
    }

    .post-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .post-images.count-1 .post-image {
        padding-bottom: 75%;
    }

    /* 兼容性模式下的高度设置 */
    @media (min-width: 768px) {
        .post-image {
            height: 200px;
            padding-bottom: 0;
        }
        .post-images.count-1 .post-image {
            height: 240px;
        }
    }

    @media (min-width: 481px) and (max-width: 767px) {
        .post-image {
            height: 180px;
            padding-bottom: 0;
        }
        .post-images.count-1 .post-image {
            height: 220px;
        }
    }

    @media (max-width: 480px) {
        .post-image {
            height: 160px;
            padding-bottom: 0;
        }
        .post-images.count-1 .post-image {
            height: 200px;
        }
    }

    @media (max-width: 360px) {
        .post-image {
            height: 140px;
            padding-bottom: 0;
        }
        .post-images.count-1 .post-image {
            height: 180px;
        }
    }
}

/* === 性能优化 === */
.post-image {
    /* 启用硬件加速 */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* === 响应式图片容器居中 === */
.post-images {
    margin-left: auto;
    margin-right: auto;
}

/* 确保图片在容器中正确显示 */
.post-images img.post-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === 图片加载状态优化 === */
.post-image {
    background-color: rgba(139, 92, 246, 0.08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='rgba(139, 92, 246, 0.2)'%3E%3Cpath d='M20 2.5a17.5 17.5 0 1 0 0 35 17.5 17.5 0 0 0 0-35zm0 2a15.5 15.5 0 1 1 0 31 15.5 15.5 0 0 1 0-31z'/%3E%3Cpath d='M16 14a6 6 0 1 0 8 5.66V14h-8zm6 2v3.66a4 4 0 1 1-6-3.66H22z'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
}

.post-image[src] {
    background-image: none;
}

/* === 评论区图片适配 === */
.comment-images.post-images {
    margin-left: 46px;
    margin-top: 8px;
    transform: scale(0.8);
    transform-origin: left top;
}

.comment-images.post-images .post-image {
    max-width: 80px;
    max-height: 80px;
}

/* 移动端评论图片调整 */
@media (max-width: 768px) {
    .comment-images.post-images {
        margin-left: 0;
        transform: scale(0.9);
    }
}

/* === 延迟加载占位符 === */
.post-image[data-src]:not([src]) {
    background: linear-gradient(90deg,
    rgba(139, 92, 246, 0.1) 25%,
    rgba(139, 92, 246, 0.2) 50%,
    rgba(139, 92, 246, 0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* === 打印样式 === */
@media print {
    .post-images {
        break-inside: avoid;
        page-break-inside: avoid;
        gap: 2px;
    }

    .post-image {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }

    .post-image:hover {
        transform: none;
        box-shadow: none;
    }
}

/* === 深色模式适配 === */
@media (prefers-color-scheme: dark) {
    .post-image {
        background: rgba(139, 92, 246, 0.15);
        border-color: rgba(139, 92, 246, 0.25);
    }

    .post-image:hover {
        border-color: rgba(139, 92, 246, 0.5);
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    }
}