/* Shared article layout and prose styles for dynamic and generated post pages. */
.page {
    width: min(1200px, 94vw);
    margin: 28px auto 34px;
}

.container {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeInUp 0.45s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

.article-header {
    padding: 36px 38px 26px;
    text-align: center;
    border-bottom: 1px solid rgba(197, 179, 88, 0.24);
    background: linear-gradient(155deg, rgba(197, 179, 88, 0.12), rgba(255, 255, 255, 0.96));
}

.article-category-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.article-title {
    margin: 0 0 12px;
    padding-bottom: 0;
    color: var(--gold);
    font-family: var(--font-serif);
    font-size: clamp(28px, 4.5vw, 42px);
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    letter-spacing: 0;
}

.article-description {
    margin-bottom: 20px;
    color: var(--ink-soft);
    font-size: clamp(14px, 1.8vw, 17px);
    line-height: 1.7;
    text-align: center;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 12px 22px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: #86929f;
    font-size: 13px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.article-body {
    padding: clamp(20px, 4vw, 44px) clamp(18px, 5vw, 56px) clamp(28px, 5vw, 48px);
}

.article-content {
    max-width: 780px;
    margin: 0 auto;
    color: #000;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 17px;
    line-height: 1.82;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 1.5em;
    margin-bottom: 1em;
    color: var(--gold);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 700;
}

.article-content h1 {
    display: none;
}

.article-content h2 {
    border-bottom: 1px solid rgba(197, 179, 88, 0.45);
    padding-bottom: 5px;
    font-size: clamp(22px, 2.8vw, 30px);
}

.article-content h3 {
    font-size: clamp(19px, 2.4vw, 24px);
}

.article-content p {
    margin-bottom: 1.28em;
    text-align: justify;
}

.article-content a {
    border-bottom: 1px dashed var(--gold);
    color: var(--gold);
    text-decoration: none;
    transition: all 0.25s ease;
}

.article-content a:hover {
    border-bottom-style: solid;
    color: #b3a24d;
}

.article-content strong {
    padding: 0 2px;
    color: var(--gold);
    font-weight: 700;
}

.article-content blockquote {
    margin: 20px 0;
    border-left: 4px solid var(--gold);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 10px 20px;
    background: rgba(197, 179, 88, 0.08);
    color: #555;
    font-style: italic;
}

.article-content ul,
.article-content ol {
    margin: 18px 0 18px 28px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content li::marker {
    color: var(--gold);
    font-weight: 700;
}

.article-content code {
    border: 1px solid #e2e8ee;
    border-radius: 4px;
    padding: 2px 5px;
    background: #f1f4f6;
    color: #4a6376;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.article-content pre {
    position: relative;
    margin: 25px 0;
    border: 1px solid var(--gold);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-x: auto;
    background: #e2e9ef;
    box-shadow: 0 4px 12px rgba(0, 78, 140, 0.1);
    color: #2c3e50;
    line-height: 1.6;
}

.article-content pre::before {
    content: "CODE";
    display: block;
    margin-bottom: 12px;
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    opacity: 0.5;
}

.article-content pre code {
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font-family: var(--font-mono);
    font-size: 14px;
}

.article-content table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.article-content thead th {
    background: var(--primary);
    color: #fff;
    padding: 10px;
    text-align: left;
}

.article-content td,
.article-content th {
    border: 1px solid #dfe2e5;
    padding: 8px 12px;
}

.article-content tr:nth-child(2n) {
    background: #f6f8fa;
}

.article-content hr {
    height: 1px;
    margin: 24px 0;
    border: none;
    padding: 0;
    background: #eee;
}

.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    border-radius: var(--radius-md);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.14);
    padding-top: 24px;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 30px;
    border-top: 1px solid rgba(var(--primary-rgb), 0.14);
    padding-top: 24px;
}

.article-footer .nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(var(--primary-rgb), 0.26);
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--gold);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.nav-link:hover {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--deep));
    color: #fff;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(var(--primary-rgb), 0.26);
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--gold);
    text-decoration: none;
    transition: all 0.25s ease;
}

.share-btn:hover {
    transform: scale(1.08);
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--deep));
    color: #fff;
}

.loading {
    padding: 40px;
    color: var(--ink-soft);
    text-align: center;
}

.spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    border: 3px solid rgba(var(--primary-rgb), 0.18);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    margin: 20px 0;
    border: 1px solid #f0c5c5;
    border-radius: var(--radius-md);
    padding: 24px;
    background: #fdeaea;
    color: #c53434;
    text-align: center;
}

[data-theme='dark'] .container {
    border: 1px solid var(--line) !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow) !important;
    backdrop-filter: blur(16px) !important;
}

[data-theme='dark'] .article-header {
    border-bottom: 1px solid rgba(197, 179, 88, 0.32) !important;
    background: rgba(197, 179, 88, 0.08) !important;
}

[data-theme='dark'] .article-title,
[data-theme='dark'] .article-content h1,
[data-theme='dark'] .article-content h2,
[data-theme='dark'] .article-content h3,
[data-theme='dark'] .article-content h4 {
    color: #fff !important;
}

[data-theme='dark'] .article-content,
[data-theme='dark'] .article-content p,
[data-theme='dark'] .article-content li {
    color: #dbe9f8 !important;
}

[data-theme='dark'] .article-content h2 {
    border-bottom: 2px solid var(--gold) !important;
}

[data-theme='dark'] .article-content blockquote {
    border-left: 4px solid var(--gold) !important;
    background: rgba(0, 78, 140, 0.1) !important;
    color: var(--ink-soft) !important;
}

[data-theme='dark'] .article-content strong {
    color: var(--gold) !important;
    text-shadow: 0 0 10px rgba(197, 179, 88, 0.3) !important;
}

[data-theme='dark'] .article-content code {
    border-color: var(--line) !important;
    background: rgba(0, 78, 140, 0.2) !important;
    color: #60a5fa !important;
}

[data-theme='dark'] .article-content pre {
    border-color: var(--line) !important;
    background: #05080a !important;
    box-shadow: none !important;
}

@media (max-width: 760px) {
    .article-header {
        padding: 28px 20px 22px;
    }

    .article-meta {
        justify-content: flex-start;
    }

    .article-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .article-footer .nav-links {
        width: 100%;
    }

    .nav-link {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .article-footer .nav-links {
        flex-direction: column;
    }

    .nav-link {
        width: 100%;
    }
}
