/* 文章模块：列表 / 详情 / 正文排版 / 大图预览 / 返回顶部 */
:root {
    --article-brand: var(--color-brand, #1ebafc);
    --article-ink: var(--color-ink, #17181c);
    --article-muted: var(--color-muted, #6b6f76);
    --article-line: var(--color-line, #ececec);
    --article-paper: var(--color-paper, #f7f7f5);
}

.article-wrap {
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
}

.article-wrap-detail {
    max-width: 80rem;
}

@media (min-width: 640px) {
    .article-wrap {
        padding: 3.5rem 1.5rem 5rem;
    }
}

/* 列表页头 */
.article-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.article-list-heading {
    min-width: 0;
}

.article-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    max-width: 21rem;
    padding: 0.3rem 0.35rem 0.3rem 1rem;
    border-radius: 9999px;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--article-line);
    transition: box-shadow 0.2s ease;
}

.article-search:focus-within {
    box-shadow: inset 0 0 0 1px var(--article-brand), 0 10px 30px -18px rgb(23 24 28 / 0.3);
}

.article-search input {
    flex: 1;
    min-width: 0;
    height: 2.25rem;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 0.875rem;
    color: var(--article-ink);
    outline: none;
}

.article-search input::placeholder {
    color: var(--article-muted);
    opacity: 0.75;
}

.article-search button {
    flex: none;
    height: 2.25rem;
    padding: 0 0.95rem;
    border: 0;
    border-radius: 9999px;
    background: var(--article-ink);
    font-size: 0.8125rem;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.article-search button:hover {
    background: var(--article-brand);
}

@media (min-width: 768px) {
    .article-search {
        width: 21rem;
    }
}

.article-search-result {
    margin: -0.75rem 0 1.5rem;
    font-size: 0.8125rem;
    color: var(--article-muted);
}

.article-search-result a {
    margin-left: 0.5rem;
    color: var(--article-brand);
    text-decoration: none;
}

.article-search-result a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.article-list-eyebrow {
    margin: 0;
    font-family: var(--font-display, ui-serif, Georgia, serif);
    font-style: italic;
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--article-brand);
    text-transform: uppercase;
}

.article-list-title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--article-ink);
}

.article-list-sub {
    margin: 0.75rem 0 0;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--article-muted);
}

/* 列表卡片 */
.article-list {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-card {
    overflow: hidden;
    border-radius: 1.5rem;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--article-line);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px var(--article-line), 0 18px 40px -24px rgb(23 24 28 / 0.35);
}

.article-card-link {
    display: grid;
    gap: 1.25rem;
    padding: 1rem;
    color: inherit;
    text-decoration: none;
}

@media (min-width: 640px) {
    .article-card-link {
        grid-template-columns: 240px minmax(0, 1fr);
        padding: 1.25rem;
    }
}

.article-card-cover {
    aspect-ratio: 200 / 133;
    overflow: hidden;
    border-radius: 1rem;
    background: var(--article-paper);
}

.article-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-card-cover img {
    transform: scale(1.04);
}

.article-card-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 0.25rem 0;
}

.article-card-date {
    font-family: var(--font-display, ui-serif, Georgia, serif);
    font-style: italic;
    font-size: 0.9375rem;
    color: var(--article-brand);
}

.article-card-title {
    display: -webkit-box;
    margin: 0.3rem 0 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
    font-size: 1.0625rem;
    line-height: 1.45;
    font-weight: 600;
    color: var(--article-ink);
}

@media (min-width: 640px) {
    .article-card-title {
        font-size: 1.25rem;
    }
}

.article-card-desc {
    display: -webkit-box;
    margin: 0.5rem 0 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--article-muted);
}

.article-card-more {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: auto;
    padding-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--article-muted);
    transition: color 0.2s ease;
}

.article-card:hover .article-card-more {
    color: var(--article-brand);
}

.article-empty {
    padding: 3rem 0;
    text-align: center;
    color: var(--article-muted);
}

/* 详情布局 */
.article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

@media (min-width: 1024px) {
    .article-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
        align-items: start;
    }

    .article-aside {
        position: sticky;
        top: 1.5rem;
    }
}

.article-paper {
    border-radius: 1.5rem;
    background: #fff;
    padding: 2rem 1.25rem;
    box-shadow: inset 0 0 0 1px var(--article-line);
}

@media (min-width: 640px) {
    .article-paper {
        padding: 3rem;
    }
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
    padding: 0.375rem 0.875rem 0.375rem 0.625rem;
    border: 0;
    border-radius: 9999px;
    background: var(--article-paper);
    box-shadow: inset 0 0 0 1px var(--article-line);
    font-size: 0.75rem;
    line-height: 1rem;
    color: var(--article-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.article-back:hover {
    background: #fff;
    color: var(--article-ink);
    box-shadow: inset 0 0 0 1px rgb(23 24 28 / 0.15);
}

.article-back-icon {
    width: 0.875rem;
    height: 0.875rem;
    transition: transform 0.2s ease;
}

.article-back:hover .article-back-icon {
    transform: translateX(-2px);
}

.article-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
    font-size: 0.75rem;
    color: var(--article-muted);
}

.article-crumb a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-crumb a:hover {
    color: var(--article-brand);
}

.article-detail-title {
    margin: 1.25rem 0 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--article-ink);
}

.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.25rem;
    margin: 1rem 0 0;
    font-size: 0.8125rem;
    color: var(--article-muted);
}

.article-detail-date {
    font-family: var(--font-display, ui-serif, Georgia, serif);
    font-style: italic;
    font-size: 0.9375rem;
    color: var(--article-brand);
}

.article-detail-desc {
    margin: 1.5rem 0 0;
    padding-left: 1rem;
    border-left: 2px solid var(--article-brand);
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--article-muted);
}

/* 正文排版：兼容后台富文本里带内联样式的历史内容 */
.article-body {
    margin-top: 2rem;
    font-size: 16px;
    line-height: 1.9;
    color: var(--article-ink);
    overflow-wrap: anywhere;
}

.article-body * {
    background-color: transparent !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-indent: 0 !important;
    color: inherit !important;
}

.article-body p {
    margin: 1.25rem 0 !important;
    padding: 0 !important;
}

.article-body a,
.article-body a * {
    color: var(--article-brand) !important;
}

.article-body a {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 0.75rem;
    box-shadow: 0 8px 30px rgb(23 24 28 / 0.08);
    cursor: zoom-in;
}

.article-body h1,
.article-body h2 {
    margin: 2.5rem 0 1rem !important;
    font-size: 1.375rem !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

.article-body h3,
.article-body h4 {
    margin: 2rem 0 0.75rem !important;
    font-size: 1.125rem !important;
    line-height: 1.45 !important;
    font-weight: 600 !important;
}

.article-body strong,
.article-body b {
    font-weight: 600 !important;
}

.article-body ul,
.article-body ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body li > p {
    margin: 0.25rem 0 !important;
}

.article-body blockquote {
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 2px solid var(--article-brand);
    color: var(--article-muted);
}

.article-body hr {
    margin: 2.5rem 0;
    border: 0;
    border-top: 1px solid var(--article-line);
}

.article-body table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.article-body th,
.article-body td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--article-line);
}

.article-body pre {
    margin: 1.5rem 0;
    padding: 1rem;
    overflow: auto;
    border-radius: 0.75rem;
    background: var(--article-paper) !important;
}

.article-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 0.875em !important;
}

/* 大图预览 */
.article-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgb(23 24 28 / 0.85);
    backdrop-filter: blur(4px);
}

.article-lightbox[hidden] {
    display: none;
}

.article-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0.75rem;
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.45);
    cursor: zoom-out;
}

.article-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 9999px;
    background: rgb(255 255 255 / 0.12);
    font-size: 1.5rem;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.article-lightbox-close:hover {
    background: rgb(255 255 255 / 0.24);
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 10px 30px -10px rgb(23 24 28 / 0.35), inset 0 0 0 1px var(--article-line);
    font-size: 1rem;
    color: var(--article-ink);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.back-to-top:hover {
    color: var(--article-brand);
    transform: translateY(-2px);
}

.back-to-top[hidden] {
    display: none;
}

@media (min-width: 640px) {
    .back-to-top {
        right: 1.5rem;
        bottom: 1.5rem;
    }
}

/* 分页 */
.article-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.75rem;
}

.article-page-btn,
.article-page-num {
    display: inline-grid;
    place-items: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.8rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--article-line);
    font-size: 0.8125rem;
    color: var(--article-ink);
    text-decoration: none;
    transition: color 0.2s ease, box-shadow 0.2s ease;
}

.article-page-num {
    padding: 0 0.5rem;
}

.article-page-btn:hover,
.article-page-num:hover {
    color: var(--article-brand);
    box-shadow: inset 0 0 0 1px var(--article-brand);
}

.article-page-num.is-current {
    background: var(--article-ink);
    color: #fff;
    box-shadow: none;
}

.article-page-btn.is-disabled {
    color: var(--article-muted);
    opacity: 0.45;
    cursor: not-allowed;
}

/* 404 */
.article-notfound {
    text-align: center;
}

.article-notfound-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--article-brand);
    text-decoration: none;
}

.article-notfound-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}
