/* 新鲜事列表页面样式 - 专业问答列表风格 */

/* 页面容器 */
.trace-page {
    max-width: 1440px;
    background: #f8f9fa;
    padding-bottom: 60px;
    padding-top: 70px;
}

/* 排序筛选区域 */
.trace-filter-section {
    background: #fff;
    padding: 16px 0;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 70px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.trace-filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.trace-sort-group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.trace-sort-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
}

.trace-sort-icon {
    width: 18px;
    height: 18px;
    stroke: #6c757d;
    stroke-width: 2px;
}

.trace-sort-options {
    display: flex;
    gap: 8px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 6px;
}

.trace-sort-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.trace-sort-option:hover {
    background: #e9ecef;
    color: #495057;
}

.trace-sort-option.active {
    background: linear-gradient(135deg, #ff7a45 0%, #ff9a6c 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 122, 69, 0.3);
}

.trace-option-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2px;
}

/* 内容区域 */
.trace-content-section {
    padding: 24px 0;
}

.trace-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.trace-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* 列表项 - 卡片风格 */
.trace-item {
    display: flex;
    align-items: flex-start;
    padding: 20px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    cursor: pointer;
}

.trace-item:hover {
    background: #fafafa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 卡片链接样式 */
.trace-item {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 内容区域 */
.trace-content {
    flex: 1;
    min-width: 0;
}

/* 头部信息 */
.trace-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.trace-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trace-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.trace-username {
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

.trace-time {
    font-size: 12px;
    color: #adb5bd;
}

.trace-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #fff0eb;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #ff7a45;
    margin-left: auto;
}

/* 标题 */
.trace-question {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    line-height: 1.5;
    margin: 0 0 8px 0;
    transition: color 0.2s ease;
}

.trace-item:hover .trace-question {
    color: #ff7a45;
}

/* 回答摘要 */
.trace-answer {
    font-size: 14px;
    color: #6c757d;
    line-height: 1.6;
    margin: 0 0 12px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 5;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

/* 无图卡片显示更多内容 */
.trace-item:not(.trace-item-with-image) .trace-answer {
    line-clamp: 5;
    -webkit-line-clamp: 5;
}

/* 图片预览 */
.trace-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    max-width: 100%;
    overflow: hidden;
}

.trace-preview-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.trace-preview-img:hover {
    transform: scale(1.05);
    border-color: #ff7a45;
}

/* 底部统计 */
.trace-item-footer {
    display: flex;
    align-items: center;
    gap: 20px;
}

.trace-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #adb5bd;
    transition: color 0.2s ease;
}

.trace-stat:hover {
    color: #ff7a45;
}

.trace-stat-icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2px;
}

/* 加载更多 */
.trace-load-more {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.trace-load-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trace-load-btn:hover {
    background: #f8f9fa;
    border-color: #ff7a45;
    color: #ff7a45;
}

/* 响应式适配 */
@media (max-width: 1024px) {
    /* 平板端调整 */
    .trace-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .trace-item {
        padding: 16px 20px;
    }
    
    .trace-answer {
        line-clamp: 3;
        -webkit-line-clamp: 3;
    }
    
    .trace-item:not(.trace-item-with-image) .trace-answer {
        line-clamp: 4;
        -webkit-line-clamp: 4;
    }
}

@media (max-width: 768px) {
    /* 手机端调整 */
    .trace-filter-container {
        padding: 0 16px;
    }
    
    .trace-sort-group {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .trace-sort-options {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        width: 100%;
        min-width: 100%;
    }
    
    .trace-sort-options::-webkit-scrollbar {
        display: none;
    }
    
    .trace-sort-option {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .trace-container {
        padding: 0 16px;
    }
    
    .trace-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .trace-item {
        padding: 16px;
    }
    
    .trace-question {
        font-size: 15px;
    }
    
    .trace-answer {
        font-size: 13px;
        line-clamp: 2;
        -webkit-line-clamp: 2;
    }
    
    .trace-item:not(.trace-item-with-image) .trace-answer {
        line-clamp: 3;
        -webkit-line-clamp: 3;
    }
    
    .trace-preview-img {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .trace-item {
        padding: 14px;
    }
    
    .trace-question {
        font-size: 14px;
    }
    
    .trace-answer {
        line-clamp: 2;
        -webkit-line-clamp: 2;
    }
    
    .trace-item-footer {
        gap: 16px;
    }
    
    .trace-stat {
        font-size: 12px;
    }
    
    .trace-preview-img {
        width: 50px;
        height: 50px;
    }
}

/* 图片预览样式 */
.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-preview-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-preview-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.image-preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-preview-wrapper {
    position: relative;
    width: 100%;
    height: calc(100% - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-preview-img.loaded {
    opacity: 1;
    transform: scale(1);
}

.image-preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.preview-spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.preview-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: #ff7a45;
    border-radius: 50%;
    animation: preview-spin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.preview-spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.preview-spinner-ring:nth-child(2) {
    width: 75%;
    height: 75%;
    top: 12.5%;
    left: 12.5%;
    animation-delay: 0.15s;
    border-top-color: #ff9c6e;
    animation-duration: 1s;
}

.preview-spinner-ring:nth-child(3) {
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
    animation-delay: 0.3s;
    border-top-color: #ffbb96;
    animation-duration: 0.8s;
}

@keyframes preview-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.image-preview-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 20px;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.image-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.image-preview-close:hover {
    background: rgba(255, 122, 69, 0.8);
    transform: rotate(90deg);
}

.image-preview-close svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.image-preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.image-preview-nav:hover {
    background: rgba(255, 122, 69, 0.8);
}

.image-preview-nav.prev {
    left: 20px;
}

.image-preview-nav.next {
    right: 20px;
}

.image-preview-nav svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.image-preview-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    max-width: 80%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.image-preview-thumbnails::-webkit-scrollbar {
    display: none;
}

.preview-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.preview-thumbnail:hover {
    opacity: 0.9;
}

.preview-thumbnail.active {
    opacity: 1;
    border-color: #ff7a45;
    transform: scale(1.1);
}

/* 响应式 */
@media (max-width: 768px) {
    .image-preview-wrapper {
        height: calc(100% - 120px);
        padding: 10px;
    }
    
    .image-preview-nav {
        width: 40px;
        height: 60px;
    }
    
    .image-preview-nav.prev {
        left: 10px;
    }
    
    .image-preview-nav.next {
        right: 10px;
    }
    
    .image-preview-nav svg {
        width: 24px;
        height: 24px;
    }
    
    .image-preview-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .image-preview-counter {
        top: 10px;
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .image-preview-thumbnails {
        bottom: 10px;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .preview-thumbnail {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .image-preview-nav {
        display: none;
    }
    
    .preview-thumbnail {
        width: 45px;
        height: 45px;
    }
}

/* 加载提示 */
.load-tip {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    white-space: nowrap;
}

.load-tip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.load-tip::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #52c41a;
    border-radius: 50%;
    margin-right: 8px;
    font-size: 0.75rem;
}

/* 加载更多指示器 */
.load-more-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    background: linear-gradient(180deg, #fafbfc 0%, #f0f2f5 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-top: 1px solid #e8e8e8;
}

.load-more-container:hover:not(.loading):not(.no-more) {
    background: linear-gradient(180deg, #f5f7fa 0%, #e8ecf0 100%);
}

.load-more-container.loading {
    padding: 60px 20px;
    cursor: default;
}

.load-more-container.no-more {
    padding: 20px;
    cursor: default;
    background: transparent;
    border-top: none;
}

.load-more-spinner {
    display: none;
    position: relative;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.load-more-container.loading .load-more-spinner {
    display: block;
}

.load-more-container.loading .load-more-text {
    color: #ff7a45;
    font-weight: 600;
    font-size: 1rem;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: #ff7a45;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    width: 75%;
    height: 75%;
    top: 12.5%;
    left: 12.5%;
    animation-delay: 0.15s;
    border-top-color: #ff9c6e;
    animation-duration: 1s;
}

.spinner-ring:nth-child(3) {
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
    animation-delay: 0.3s;
    border-top-color: #ffbb96;
    animation-duration: 0.8s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.load-more-text {
    font-size: 0.95rem;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.load-more-text::before {
    content: '↓';
    font-size: 1.2rem;
    animation: bounce 1.5s ease-in-out infinite;
    color: #ff7a45;
}

.load-more-container.loading .load-more-text::before {
    content: '';
    animation: none;
}

.load-more-container.no-more .load-more-text {
    color: #999;
    font-weight: 400;
    font-size: 0.85rem;
}

.load-more-container.no-more .load-more-text::before {
    content: '';
    display: none;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* 新加载的卡片动画 */
.trace-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .load-more-container {
        padding: 40px 16px;
    }
    
    .load-more-container.loading {
        padding: 50px 16px;
    }
    
    .load-more-container.no-more {
        padding: 15px 16px;
    }
    
    .load-more-spinner {
        width: 40px;
        height: 40px;
    }
    
    .load-more-text {
        font-size: 0.9rem;
    }
    
    .load-tip {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .load-more-container {
        padding: 35px 12px;
    }
    
    .load-more-container.loading {
        padding: 45px 12px;
    }
    
    .load-more-container.no-more {
        padding: 15px 12px;
    }
    
    .load-more-text {
        font-size: 0.85rem;
        gap: 8px;
    }
}
