﻿/* 新闻阅读页面样式 */
@import '../design-system.css';

/* ── 布局 ──────────────────────────────────────────────────────── */
.article-layout {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* ── 文章卡片 ──────────────────────────────────────────────────── */
.news-article {
    background: var(--md-sys-color-surface-container);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--card-shadow-soft);
    border: 1px solid var(--md-sys-color-surface-variant);
    margin-bottom: 24px;
}

/* ── 文章头部 ──────────────────────────────────────────────────── */
.article-header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--md-sys-color-surface-variant);
}

.article-title {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--md-sys-color-outline);
    font-size: 13px;
    align-items: center;
    margin-bottom: 12px;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.article-meta .material-symbols-outlined {
    font-size: 15px;
}

.author-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--md-sys-color-surface-variant);
    color: var(--deep-orange);
    font-weight: 700;
    font-size: 12px;
    border: 1px solid color-mix(in srgb, var(--deep-orange) 20%, transparent);
}

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

.article-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* ── 操作按钮（作者可见） ──────────────────────────────────────── */
.article-actions {
    display: none;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ── 文章正文 ──────────────────────────────────────────────────── */
.article-body {
    font-size: 15px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    cursor: zoom-in;
    transition: box-shadow 0.2s ease;
}

.article-body img:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ── 相关新闻 ──────────────────────────────────────────────────── */
.related-news {
    display: none;
    background: var(--md-sys-color-surface-container);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow-soft);
    border: 1px solid var(--md-sys-color-surface-variant);
    margin-bottom: 24px;
}

.related-news h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--deep-orange);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-list {
    display: grid;
    gap: 10px;
}

.related-item {
    display: block;
    padding: 14px 16px;
    background: var(--md-sys-color-surface);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--md-sys-color-surface-variant);
    transition: var(--transition);
}

.related-item:hover {
    transform: translateX(4px);
    border-color: var(--deep-orange);
    background: var(--deep-orange-soft);
}

.related-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
    line-height: 1.4;
}

.related-item-date {
    font-size: 12px;
    color: var(--md-sys-color-outline);
    display: flex;
    align-items: center;
    gap: 4px;
}

.related-item-date .material-symbols-outlined {
    font-size: 13px;
}

/* ── 确认删除模态 ──────────────────────────────────────────────── */
.confirm-modal .modal-content {
    max-width: 420px;
}

/* ── 响应式 ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .article-layout {
        padding: 0 16px 48px;
    }

    .news-article {
        padding: 24px 20px;
    }

    .article-meta {
        gap: 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .news-article {
        padding: 16px;
    }

    .article-actions {
        flex-wrap: wrap;
    }

    .article-actions button {
        flex: 1;
        justify-content: center;
    }
}

/* ── 页面进入动画 ────────────────────────────────────────────────── */
.breadcrumb {
    opacity: 0;
    animation: page-enter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s forwards;
}

.news-article {
    opacity: 0;
    animation: page-enter-scale 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s forwards;
}

.article-actions {
    opacity: 0;
    animation: page-enter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s forwards;
}

.related-news {
    opacity: 0;
    animation: page-enter 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards;
}

/* 相关新闻条目逐个进入 */
.related-item {
    opacity: 0;
    animation: page-enter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
