/* 广场页面样式 */

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 项目卡片样式 */
.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 文本截断样式 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 加载动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* 模态框样式 */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* 移动端模态框优化 */
@media (max-width: 768px) {
    /* 模态框容器 */
    .fixed.inset-0.bg-black.bg-opacity-50 {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    /* 模态框主体 */
    .bg-white.rounded-lg.max-w-4xl {
        max-width: 100% !important;
        width: 100% !important;
        max-height: calc(100vh - 4rem) !important;
        margin: 0 !important;
        border-radius: 0.75rem;
    }
    
    /* 模态框内容区域 */
    .modal-content {
        max-height: calc(100vh - 8rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 模态框头部 */
    .modal-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-radius: 0.75rem 0.75rem 0 0;
    }
    
    /* 模态框主体内容 */
    .modal-body {
        padding: 1rem;
    }
    
    /* 项目详情预览在移动端的高度调整 */
    .project-detail-preview {
        height: 12rem;
    }
    
    /* 操作按钮在移动端堆叠显示 */
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .action-button {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px; /* 确保触摸友好 */
    }
}

/* 响应式网格 */
@media (max-width: 640px) {
    .grid-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* 按钮悬停效果 */
.btn-hover {
    transition: all 0.2s ease;
}

.btn-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 输入框焦点样式 */
.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 价格标签样式 */
.price-tag {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.7);
}

/* 统计信息样式 */
.stats-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 空状态样式 */
.empty-state {
    opacity: 0.6;
}

/* 项目预览iframe样式 */
.project-preview iframe {
    border: none;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 用户菜单下拉动画 */
.user-menu {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 项目卡片内容区域 */
.project-content {
    padding: 1rem;
}

.project-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.project-author {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.project-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.project-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #9ca3af;
}

.project-stats-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 筛选和搜索区域 */
.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .filter-section {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .filter-controls {
        gap: 1rem;
    }
}

/* 模态框内容样式 */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* @提及样式 */
.mention {
    color: #3b82f6;
    background-color: #dbeafe;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mention:hover {
    background-color: #bfdbfe;
    color: #1d4ed8;
}

/* 回复提示框样式 */
.reply-indicator {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 3px solid #3b82f6;
}

/* 评论输入框样式 */
.comment-textarea {
    transition: all 0.3s ease;
    resize: none;
}

.comment-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: scale(1.01);
}

/* 回复按钮样式 */
.reply-button {
    transition: all 0.2s ease;
}

.reply-button:hover {
    background-color: #eff6ff;
    color: #3b82f6;
    transform: translateY(-1px);
}

/* 评论层级样式 */
.comment-reply {
    border-left: 2px solid #e5e7eb;
    margin-left: 1rem;
    padding-left: 1rem;
    position: relative;
}

.comment-reply::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #3b82f6, #e5e7eb);
}

/* 用户头像悬停效果 */
.user-avatar {
    transition: all 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 评论时间样式 */
.comment-time {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.comment-time:hover {
    opacity: 1;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.5rem;
}

/* 项目详情预览区域 */
.project-detail-preview {
    height: 16rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.project-detail-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .project-detail-info {
        grid-template-columns: 1fr 1fr;
    }
}

.info-section h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.info-section p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

/* 操作按钮区域 */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.action-button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 移动端评论输入框适配 */
.comment-textarea {
    transition: all 0.3s ease;
}

.comment-textarea:focus {
    transform: translateY(0);
}

/* 移动端键盘适配 */
@media (max-width: 768px) {
    /* 评论区域整体优化 */
    .comments-section {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .comments-section h4 {
        font-size: 1.125rem;
        margin-bottom: 1rem;
        font-weight: 600;
    }
    
    /* 评论输入框优化 */
    .comment-textarea {
        font-size: 16px; /* 防止iOS缩放 */
        min-height: 80px;
        padding: 1rem;
        border-radius: 0.75rem;
        border: 2px solid #e5e7eb;
        transition: all 0.3s ease;
        width: 100%;
        resize: none;
        line-height: 1.5;
    }
    
    .comment-textarea:focus {
        transform: none;
        position: relative;
        z-index: 100;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        outline: none;
    }
    
    /* 评论输入区域布局 */
    .comment-input-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
        background: #f9fafb;
        border-radius: 0.75rem;
    }
    
    /* 回复提示优化 */
    .reply-indicator {
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
        border-radius: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* 评论按钮优化 */
    .comment-submit-btn {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 0.75rem;
        margin-top: 0.75rem;
        transition: all 0.2s ease;
    }
    
    /* 评论列表优化 */
    .comment-list {
        margin-top: 1.5rem;
    }
    
    .comment-item {
        padding: 1rem;
        margin-bottom: 1rem;
        background: #ffffff;
        border-radius: 0.75rem;
        border: 1px solid #f3f4f6;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    /* 评论头部（用户信息）优化 */
    .comment-header {
        display: flex;
        align-items: center;
        margin-bottom: 0.75rem;
        gap: 0.75rem;
    }
    
    .comment-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        flex-shrink: 0;
        border: 2px solid #e5e7eb;
    }
    
    .comment-user-info {
        flex: 1;
        min-width: 0;
    }
    
    .comment-username {
        font-weight: 600;
        font-size: 0.875rem;
        color: #1f2937;
        margin-bottom: 0.25rem;
    }
    
    .comment-time {
        font-size: 0.75rem;
        color: #9ca3af;
    }
    
    /* 评论内容优化 */
    .comment-content {
        font-size: 0.875rem;
        line-height: 1.6;
        color: #374151;
        margin-bottom: 0.75rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* 评论操作按钮优化 */
    .comment-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .comment-action-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        min-height: 36px;
        border-radius: 0.5rem;
        border: 1px solid #e5e7eb;
        background: #ffffff;
        color: #6b7280;
        display: flex;
        align-items: center;
        gap: 0.25rem;
        transition: all 0.2s ease;
        cursor: pointer;
    }
    
    .comment-action-btn:hover {
        background: #f3f4f6;
        color: #374151;
        border-color: #d1d5db;
    }
    
    .comment-action-btn:active {
        transform: scale(0.98);
    }
    
    /* 回复列表优化 */
    .comment-replies {
        margin-top: 0.75rem;
        margin-left: 1rem;
        padding-left: 1rem;
        border-left: 2px solid #e5e7eb;
        position: relative;
    }
    
    .comment-replies::before {
        content: '';
        position: absolute;
        left: -2px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: linear-gradient(to bottom, #3b82f6 0%, #e5e7eb 100%);
    }
    
    .reply-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        background: #f9fafb;
        border-radius: 0.5rem;
        border: 1px solid #f3f4f6;
    }
    
    .reply-item:last-child {
        margin-bottom: 0;
    }
    
    /* 展开/收起按钮优化 */
    .toggle-replies-btn {
        font-size: 0.75rem;
        color: #3b82f6;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    .toggle-replies-btn:hover {
        color: #1d4ed8;
    }
    
    /* 空状态和加载状态优化 */
    .comments-empty {
        text-align: center;
        padding: 2rem 1rem;
        color: #9ca3af;
        font-size: 0.875rem;
    }
    
    .comments-loading {
        text-align: center;
        padding: 2rem 1rem;
        color: #9ca3af;
        font-size: 0.875rem;
    }
    
    /* 项目卡片在移动端的优化 */
    .project-card {
        margin-bottom: 1.5rem;
        border-radius: 0.75rem;
        overflow: hidden;
    }
    
    /* 项目卡片内容区域 */
    .project-content {
        padding: 1.25rem;
    }
    
    /* 统计信息在移动端的布局 */
    .project-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .project-stats-left {
        gap: 1rem;
    }
    
    /* 筛选控件在移动端的优化 */
    .filter-controls {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .filter-controls select,
    .filter-controls input {
        width: 100%;
        min-height: 44px;
        font-size: 16px; /* 防止iOS缩放 */
        padding: 0.75rem;
        border-radius: 0.5rem;
    }
    
    /* 导航栏在移动端的优化 */
    .gradient-bg .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 用户菜单在移动端的优化 */
    .user-menu {
        right: 0;
        left: auto;
        min-width: 200px;
        margin-top: 0.5rem;
        border-radius: 0.75rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }
    
    /* 分享模态框在移动端的优化 */
    .bg-white.rounded-lg.max-w-md {
        max-width: calc(100% - 2rem) !important;
        margin: 1rem;
        border-radius: 0.75rem;
    }
    
    /* 二维码区域优化 */
    #qrcode {
        max-width: 200px;
        margin: 0 auto;
    }
    
    /* 作者信息模态框优化 */
    .flex.items-center.mb-6 {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .flex.items-center.mb-6 > div:first-child {
        order: 1;
    }
    
    .flex.items-center.mb-6 > div:nth-child(2) {
        order: 2;
        text-align: center;
    }
    
    .flex.items-center.mb-6 > div:last-child {
        order: 3;
        width: 100%;
    }
    
    .flex.space-x-2 {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .flex.space-x-2 button {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
}

/* 响应式调整 */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .project-card {
        margin-bottom: 1rem;
    }
    
    .filter-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-controls select,
    .filter-controls input {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-button {
        justify-content: center;
    }
}

/* 加载状态样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.loading-spinner {
    font-size: 2rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.loading-text {
    color: #6b7280;
    font-size: 0.875rem;
}

/* 空状态样式 */
.empty-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.empty-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-text {
    color: #6b7280;
    font-size: 0.875rem;
}