/* ============================================================
   文章详情页样式（模板 article.php）
   继承 style.css 的设计令牌
   ============================================================ */

/* ===== 面包屑 ===== */
.article-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-3);
    margin: 26px 0 16px;
    flex-wrap: wrap;
}
.article-crumb a {
    color: var(--text-2);
}
.article-crumb a:hover {
    color: var(--brand);
}
.article-crumb i {
    font-size: 11px;
    color: #C9BFB6;
}

/* ===== 两栏布局 ===== */
.two-col {
    display: flex;
    gap: 26px;
    align-items: flex-start;
}
.main-content {
    flex: 1;
    min-width: 0;
}
.sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 92px;
}

/* ===== 正文卡片 ===== */
.article-detail {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 34px 38px 30px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.article-detail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand), var(--gold), var(--brand));
}
.article-detail h1 {
    font-size: 29px;
    font-weight: 900;
    color: var(--text);
    font-family: var(--serif);
    line-height: 1.5;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.article-detail .meta {
    color: var(--text-3);
    font-size: 13.5px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 26px;
}
.article-detail .meta span {
    display: inline-flex;
    align-items: center;
    background: #FAF6F1;
    border-radius: 999px;
    padding: 3px 13px;
}
.article-detail .meta i {
    margin-right: 5px;
    color: #C9BFB6;
}

/* ===== 正文排版 ===== */
.article-detail .content {
    font-size: 16.5px;
    line-height: 2.05;
    color: #3A3430;
    word-wrap: break-word;
    word-break: break-word;
}
.article-detail .content p {
    margin-bottom: 16px;
}
.article-detail .content h2,
.article-detail .content h3,
.article-detail .content h4 {
    color: var(--text);
    font-family: var(--serif);
    font-weight: 800;
    line-height: 1.5;
    margin: 30px 0 14px;
    padding-left: 14px;
    border-left: 4px solid var(--brand);
    position: relative;
}
.article-detail .content h2 { font-size: 22px; }
.article-detail .content h3 { font-size: 19px; }
.article-detail .content h4 { font-size: 17px; }
.article-detail .content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 18px auto;
    display: block;
    box-shadow: var(--shadow);
}
.article-detail .content a {
    color: var(--brand);
    border-bottom: 1px dashed var(--gold-line);
}
.article-detail .content a:hover {
    border-bottom-style: solid;
}
.article-detail .content blockquote {
    border-left: 4px solid var(--gold);
    padding: 14px 22px;
    margin: 20px 0;
    background: #FBF6F1;
    border-radius: 0 12px 12px 0;
    color: var(--text-2);
    font-size: 15.5px;
}
.article-detail .content ul,
.article-detail .content ol {
    padding-left: 26px;
    margin-bottom: 16px;
}
.article-detail .content li {
    margin-bottom: 8px;
}
.article-detail .content strong {
    color: var(--text);
}
.article-detail .content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 15px;
}
.article-detail .content th,
.article-detail .content td {
    border: 1px solid var(--line);
    padding: 10px 14px;
    text-align: left;
}
.article-detail .content th {
    background: #FAF6F1;
    color: var(--text);
    font-weight: 700;
}
.article-detail .content pre {
    background: #2A2320;
    color: #E8DED4;
    padding: 16px 18px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.7;
    margin: 18px 0;
}
.article-detail .content code {
    background: #FAF6F1;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.92em;
    color: var(--brand);
}
.article-detail .content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ===== 上一篇 / 下一篇 ===== */
.article-navigation {
    display: flex;
    gap: 16px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}
.article-navigation a {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    background: #FAF6F1;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    transition: all 0.25s;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-decoration: none;
}
.article-navigation a:hover {
    background: var(--brand-soft);
    border-color: var(--gold-line);
    color: var(--brand);
}
.article-navigation .nav-label {
    display: block;
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 5px;
}
.article-navigation .next {
    text-align: right;
}

/* ===== 相关文章 ===== */
.related-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 26px 26px;
    box-shadow: var(--shadow);
}
.related-section h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    position: relative;
    font-family: var(--serif);
    letter-spacing: 1px;
}
.related-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 44px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--gold));
}
.related-section h3 i { color: var(--brand); margin-right: 8px; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.related-item {
    text-decoration: none;
    display: block;
    background: #FAF6F1;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.28s, box-shadow 0.28s, border-color 0.28s;
}
.related-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--gold-line);
}
.related-item .related-img {
    height: 120px;
    overflow: hidden;
    background: #F2EAE2;
}
.related-item .related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}
.related-item:hover .related-img img {
    transform: scale(1.05);
}
.related-item .related-title {
    display: block;
    padding: 13px 15px;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    font-weight: 500;
}
.related-item:hover .related-title { color: var(--brand); }

/* ===== 侧边栏 ===== */
.sidebar-card {
    background: #fff;
    padding: 20px 20px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.sidebar-card h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    position: relative;
    font-family: var(--serif);
    letter-spacing: 1px;
}
.sidebar-card h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 44px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--gold));
}
.sidebar-card h3 i { color: var(--brand); margin-right: 8px; font-size: 15px; }

.sidebar-list { list-style: none; }
.sidebar-list li {
    padding: 11px 0;
    border-bottom: 1px dashed var(--line-soft);
}
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-2);
    font-size: 14px;
    transition: color 0.2s;
}
.sidebar-list a:hover { color: var(--brand); }
.sidebar-list .list-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}
.sidebar-list .list-views,
.sidebar-list .list-date {
    color: var(--text-3);
    font-size: 12px;
    white-space: nowrap;
    background: #FAF6F1;
    padding: 1px 9px;
    border-radius: 999px;
    flex-shrink: 0;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 70px 20px;
    color: var(--text-3);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.empty-state i {
    font-size: 48px;
    color: #E2D6CA;
    display: block;
    margin-bottom: 16px;
}
.empty-state h2 {
    font-size: 20px;
    color: var(--text);
    margin-bottom: 18px;
    font-family: var(--serif);
}
.btn-primary {
    display: inline-block;
    padding: 11px 30px;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.25s;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(169, 49, 33, 0.22);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    transform: translateY(-2px);
}

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .sidebar {
        position: static;
        width: 100%;
    }
    .two-col {
        flex-direction: column;
    }
}
@media (max-width: 768px) {
    .article-crumb { margin: 18px 0 14px; }
    .article-detail { padding: 22px 18px 24px; border-radius: var(--radius); }
    .article-detail h1 { font-size: 21px; }
    .article-detail .content { font-size: 15.5px; line-height: 1.95; }
    .article-detail .content h2 { font-size: 19px; }
    .article-detail .content h3 { font-size: 17px; }
    .article-navigation { flex-direction: column; }
    .article-navigation .next { text-align: left; }
    .related-section { padding: 20px 18px 22px; }
    .related-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .related-item .related-img { height: 100px; }
}
@media (max-width: 480px) {
    .article-detail { padding: 18px 14px 20px; }
    .article-detail h1 { font-size: 19px; }
    .article-detail .meta { font-size: 12.5px; gap: 8px; }
    .related-grid { grid-template-columns: 1fr; }
}
