/**
 * 资讯详情页 - 样式文件
 * 设计风格：新闻阅读风格，简洁清晰
 */

/* ========================================
   迷你 Header
   ======================================== */
.mini-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    max-width: 680px;
    margin: 0 auto;
}

.mini-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mini-back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.mini-back-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.mini-title {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-share-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mini-share-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.mini-share-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========================================
   主内容区
   ======================================== */
.main {
    max-width: 680px;
    margin: 0 auto;
    padding: 12px 0;
    padding-bottom: 100px;
}

/* ========================================
   资讯卡片
   ======================================== */
.news-card {
    background: var(--bg-card);
    margin: 0 12px 12px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

/* 资讯头部 */
.news-header {
    padding: 24px 20px 16px;
}

.news-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.news-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.news-badge.top {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.news-badge.recommend {
    background: linear-gradient(135deg, #ffa502 0%, #ff7f50 100%);
    color: white;
}

.news-category {
    color: var(--primary-blue);
    font-weight: 500;
}

.news-dot {
    color: var(--text-tertiary);
}

.news-time {
    color: var(--text-tertiary);
}

.news-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-tertiary);
}

.news-views svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ========================================
   发布者信息
   ======================================== */
.author-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar svg {
    width: 20px;
    height: 20px;
    fill: var(--primary-blue);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.author-meta {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.author-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.author-location svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ========================================
   资讯封面
   ======================================== */
.news-cover {
    padding: 0 20px 20px;
}

.news-cover img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
}

/* ========================================
   资讯正文
   ======================================== */
.news-content {
    padding: 0 20px 24px;
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-primary);
}

.news-content p {
    margin-bottom: 16px;
}

.news-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

.news-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.news-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 10px;
    color: var(--text-primary);
}

/* ========================================
   图片画廊
   ======================================== */
.news-gallery {
    padding: 0 20px 24px;
}

.gallery-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.gallery-title svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.gallery-count {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: normal;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* ========================================
   标签区域
   ======================================== */
.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 20px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-blue);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ========================================
   操作栏
   ======================================== */
.news-actions {
    display: flex;
    justify-content: space-around;
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-blue);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.action-btn:hover {
    background: rgba(59, 130, 246, 0.15);
}

.action-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ========================================
   返回顶部
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: rgba(59, 130, 246, 1);
    transform: translateY(-2px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ========================================
   图片预览弹窗
   ======================================== */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.lightbox-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 1001;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* ========================================
   底部导航
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 0;
}

.bottom-nav-inner {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 3px 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    text-decoration: none;
    color: inherit;
}

.nav-item-icon svg,
.nav-item svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: fill 0.2s;
}

.nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-item-label,
.nav-item span {
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-item.active .nav-item-icon svg,
.nav-item.active svg {
    fill: var(--primary);
}

.nav-item.active .nav-item-label,
.nav-item.active span {
    color: var(--primary);
    font-weight: 600;
}

.nav-item:hover .nav-item-icon svg,
.nav-item:hover svg {
    fill: var(--primary);
}

/* 发布按钮 - 红色背景 */
.nav-item.publish {
    margin-top: -13px;
}

.nav-item.publish .nav-item-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(255, 85, 46, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.nav-item.publish .nav-item-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
    animation: publishShine 3s ease-in-out infinite;
}

@keyframes publishShine {
    0%, 100% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
}

.nav-item.publish .nav-item-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.nav-item.publish .nav-item-label {
    color: var(--primary);
    font-weight: 600;
    margin-top: 3px;
    font-size: 0.55rem;
}

.nav-item.publish:hover .nav-item-icon {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 85, 46, 0.5);
}

.nav-item.publish:active .nav-item-icon {
    transform: scale(0.95);
}

/* ========================================
   Toast 提示
   ======================================== */
.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 2000;
    animation: fadeInOut 2s ease forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 480px) {
    .news-title {
        font-size: 1.25rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .news-actions {
        gap: 8px;
    }

    .action-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}
