/* ===============================================
   九渊衍真阁 · 文章栏目  Premium Design
   典雅 · 高端 · 现代东方美学
   =============================================== */

:root {
    --article-green: #1a3f3b;
    --article-green-light: #234f49;
    --article-gold: #c9963e;
    --article-gold-light: #e2c074;
    --article-gold-dark: #9a6f24;

    --article-paper: #ffffff;
    --article-paper-warm: #f3ecda;
    --article-paper-deep: #ebe0c4;

    --article-ink: #263a36;
    --article-muted: #8a8372;
    --article-line: #e0d4b8;
    --article-line-light: #ece3cc;

    --article-card-bg: #ffffff;
    --article-card-hover: #fffdf7;

    --shadow-sm: 0 2px 8px rgba(26, 63, 59, 0.04);
    --shadow-md: 0 6px 20px rgba(26, 63, 59, 0.08);
    --shadow-lg: 0 12px 36px rgba(26, 63, 59, 0.12);
    --shadow-gold: 0 4px 20px rgba(201, 150, 62, 0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--article-ink);
    background: #f9f5eb;
    font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Source Han Sans SC", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* 宣纸纹理 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(201, 150, 62, 0.025) 0.5px, transparent 0.5px),
        radial-gradient(circle at 75% 75%, rgba(26, 63, 59, 0.02) 0.5px, transparent 0.5px),
        radial-gradient(circle at 50% 50%, rgba(26, 63, 59, 0.015) 1px, transparent 1px);
    background-size: 38px 38px, 52px 52px, 100px 100px;
    pointer-events: none;
    z-index: 0;
}

/* 背景光晕 */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(201, 150, 62, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(26, 63, 59, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==============================
   共享容器
   ============================== */
.article-site {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-bottom: 56px;
}

/* ==============================
   顶部导航 - 典雅浮动
   ============================== */
.article-top {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    height: 56px;
    background: rgba(250, 246, 237, 0.88);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-radius: 14px;
    margin: 14px 14px 0;
    border: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.article-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--article-green);
    text-decoration: none;
    font: 700 26px "STKaiti", "KaiTi", "Noto Serif SC", serif;
    letter-spacing: 8px;
    position: relative;
}

.article-brand::before {
    content: '九';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, var(--article-green) 0%, var(--article-green-light) 100%);
    color: var(--article-gold-light);
    border-radius: 12px;
    font: 700 22px "STKaiti", "KaiTi", "Noto Serif SC", serif;
    box-shadow:
        0 4px 14px rgba(26, 63, 59, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    flex-shrink: 0;
}

.article-brand::after {
    content: '';
    position: absolute;
    left: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--article-gold-light), var(--article-gold));
    z-index: -1;
    opacity: 0.7;
    filter: blur(6px);
}

/* ==============================
   Hero 区域 - 典雅分隔
   ============================== */
.article-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 56px 20px 0;
    position: relative;
}

.article-hero::after {
    content: '';
    display: none;
}

.article-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--article-muted);
    font-size: 12px;
    letter-spacing: 6px;
    font-weight: 400;
}

.article-hero-kicker::before,
.article-hero-kicker::after {
    content: '';
    width: 32px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--article-gold));
}

.article-hero-kicker::after {
    background: linear-gradient(to left, transparent, var(--article-gold));
}

.article-hero-title {
    margin: 4px 0 0;
    color: var(--article-green);
    font: 700 38px "STKaiti", "KaiTi", "Noto Serif SC", serif;
    letter-spacing: 8px;
    text-align: center;
    line-height: 1.35;
}

.article-hero-text {
    color: #000000;
    font-size: 14px;
    line-height: 1.9;
    text-align: center;
    max-width: 520px;
    letter-spacing: 1px;
    margin-top: 8px;
}

/* ==============================
   分类标签 - Hero 底部
   ============================== */
.category-tabs {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    margin: 24px auto 0;
    padding: 0 4px 16px;
    border-bottom: 1px solid var(--article-line);
    position: relative;
    justify-content: center;
    min-width: 200px;
}

.category-tabs::-webkit-scrollbar {
    height: 3px;
}

.category-tabs::-webkit-scrollbar-thumb {
    background: var(--article-line);
    border-radius: 2px;
}

.category-tab {
    flex: 0 0 auto;
    padding: 10px 2px;
    color: var(--article-muted);
    border: none;
    background: transparent;
    font-size: 17px;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.category-tab::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--article-gold-dark), var(--article-gold), var(--article-gold-light));
    transition: transform 0.25s ease;
}

.category-tab:hover {
    color: var(--article-green);
}

.category-tab.active {
    color: var(--article-green);
    font-weight: 700;
}

.category-tab.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* ==============================
   主体容器
   ============================== */
.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 28px 72px;
}

/* ==============================
   文章卡片网格
   ============================== */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.article-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #fdfbf5 100%);
    border: 1px solid var(--article-line-light);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
}

/* 金色装饰线 */
.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        to right,
        var(--article-gold-dark) 0%,
        var(--article-gold) 30%,
        var(--article-gold-light) 50%,
        var(--article-gold) 70%,
        var(--article-gold-dark) 100%
    );
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 右上角装饰 */
.article-card::after {
    content: '';
    position: absolute;
    top: 14px;
    right: 14px;
    width: 20px;
    height: 20px;
    background:
        linear-gradient(135deg, transparent 40%, rgba(201, 150, 62, 0.15) 40%) border-box;
    border: 1px solid rgba(201, 150, 62, 0.2);
    border-right: none;
    border-top: none;
    border-radius: 0 8px 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.article-card:hover {
    transform: translateY(-4px);
    background: var(--article-card-hover);
    box-shadow: var(--shadow-lg);
    border-color: rgba(201, 150, 62, 0.4);
}

.article-card:hover::before {
    transform: scaleX(1);
}

.article-card:hover::after {
    opacity: 1;
}

/* ==============================
   封面 - 完整显示
   ============================== */
.article-cover {
    position: relative;
    display: flex;
    width: 100%;
    overflow: hidden;
    background: #f5efe0;
    padding: 8px;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 4;
}

.article-cover img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

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

.article-cover-text {
    display: flex;
    flex-direction: column;
    width: 100%;
    aspect-ratio: 3 / 4;
    align-items: center;
    justify-content: center;
    color: rgba(247, 226, 171, 0.9);
    font: 700 18px "STKaiti", "KaiTi", serif;
    letter-spacing: 4px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    padding: 10px 6px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
    background: linear-gradient(145deg, var(--article-green) 0%, var(--article-green-light) 100%);
}

/* ==============================
   卡片内容
   ============================== */
.article-card-body {
    padding: 12px 10px 16px;
    text-align: center;
    width: 100%;
}

.article-card-meta {
    display: none;
}

.article-price {
    color: var(--article-gold);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
}

.article-price .price-symbol-img {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

.article-card-title {
    display: block;
    margin: 0;
    color: var(--article-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.3s;
}

.article-card:hover .article-card-title {
    color: var(--article-green);
}

.article-card-excerpt {
    display: none;
}

/* ==============================
   空状态
   ============================== */
.article-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    color: var(--article-muted);
    border: 1px dashed var(--article-line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(253,251,246,0.5) 100%);
    text-align: center;
    letter-spacing: 2px;
    position: relative;
}

.article-empty::before {
    content: '◇';
    display: block;
    font-size: 20px;
    color: var(--article-gold-light);
    margin-bottom: 12px;
    letter-spacing: 4px;
}

/* ==============================
   响应式 - 列表页
   ============================== */
@media (max-width: 1024px) {
    .article-container {
        padding: 28px 20px 56px;
    }

    .article-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .article-hero-title {
        font-size: 32px;
        letter-spacing: 6px;
    }
}

@media (max-width: 768px) {
    .article-top {
        padding: 0 16px;
        height: 56px;
    }

    .article-brand {
        font-size: 20px;
        letter-spacing: 5px;
        gap: 10px;
    }

    .article-brand::before {
        width: 34px;
        height: 34px;
        font-size: 17px;
        border-radius: 9px;
    }

    .article-brand::after {
        width: 34px;
        height: 34px;
    }

    .article-hero {
        padding: 40px 16px 0;
    }

    .article-hero-title {
        font-size: 28px;
        letter-spacing: 5px;
    }

    .article-container {
        padding: 24px 14px 48px;
    }

    .category-tabs {
        gap: 24px;
        margin-top: 20px;
    }

    .category-tab {
        font-size: 15px;
        padding: 8px 2px;
    }

    .article-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .article-card {
        border-radius: 12px;
    }

    .article-cover {
        padding: 6px;
    }

    .article-card-body {
        padding: 8px 6px 10px;
    }

    .article-card-title {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .article-brand {
        font-size: 18px;
        letter-spacing: 4px;
    }

    .article-brand::before {
        width: 30px;
        height: 30px;
        font-size: 15px;
        border-radius: 8px;
    }

    .article-brand::after {
        width: 30px;
        height: 30px;
    }

    .article-hero-title {
        font-size: 22px;
        letter-spacing: 4px;
    }

    .article-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .article-card {
        border-radius: 10px;
    }

    .article-cover {
        padding: 4px;
    }

    .article-card-body {
        padding: 6px 4px 8px;
    }

    .article-card-title {
        font-size: 12px;
    }
}

/* =======================================================
   以下为文章详情页样式 (article.php)
   保持不变
   ======================================================= */

.article-back {
    display: inline-flex;
    margin: 0 0 12px;
    color: var(--article-muted);
    font-size: 13px;
    text-decoration: none;
}

.article-back:hover { color: var(--article-green); }

.article-detail-wrap {
    width: min(840px, calc(100% - 24px));
    margin: 28px auto 0;
}

.article-detail {
    overflow: hidden;
    border: 1px solid rgba(201, 157, 62, 0.24);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(28, 55, 50, 0.06);
}

.article-detail-cover {
    overflow: hidden;
}

.article-detail-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    background: #1a2e3a;
}

.article-detail-head {
    padding: 34px 42px 26px;
    border-bottom: 1px solid var(--article-line);
}

.article-detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--article-muted);
    font-size: 12px;
    letter-spacing: 2px;
}

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

.article-detail-date::before,
.article-detail-views::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--article-gold-light);
}

.article-detail-views::before {
    background: var(--article-green-light);
}

.article-detail-title {
    margin: 12px 0 0;
    color: #233d38;
    font: 700 26px/1.45 "STKaiti", "KaiTi", serif;
    text-align: center;
    letter-spacing: 4px;
}

.article-detail-excerpt {
    color: #71807b;
    line-height: 1.8;
    white-space: pre-line;
    margin-top: 14px;
}

.article-content {
    padding: 34px 42px 46px;
    color: #3c4d48;
    font-size: 16px;
    line-height: 1.95;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 1.5em 0 0.7em;
    color: #274741;
    font-family: "STKaiti", "KaiTi", serif;
}

.article-content h2 {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--article-line);
    font-size: 24px;
}

.article-content p {
    margin: 0 0 1.15em;
}

.article-content blockquote {
    margin: 1.2em 0;
    padding: 14px 18px;
    color: #6f633e;
    border-left: 4px solid var(--article-gold);
    background: #fbf6e9;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.article-content a {
    color: #9b7020;
    text-decoration: underline;
}

/* 付费锁定卡片 */
.article-lock {
    margin: 28px 32px 42px;
    padding: 28px 24px 24px;
    border: 1px solid rgba(201, 157, 62, 0.28);
    border-radius: 18px;
    background: linear-gradient(180deg, #fdf9ed 0%, #faf3df 100%);
    text-align: center;
    box-shadow: 0 4px 20px rgba(30, 50, 40, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.article-lock-mark {
    display: flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: #f0d489;
    border-radius: 50%;
    background: linear-gradient(135deg, #2f6560, #234d49);
    font: 700 20px "STKaiti", "KaiTi", serif;
    box-shadow: 0 4px 12px rgba(35, 77, 73, 0.3);
}

.article-lock-title {
    color: #28433e;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 2px;
}

.article-lock-text {
    margin: 8px 0 18px;
    color: #8a7a5a;
    line-height: 1.6;
    font-size: 13px;
}

/* 胶囊按钮：用 flex 让原价（小）和现价（大）分块，不挤 */
.article-buy {
    min-height: 52px;
    padding: 10px 22px;
    color: #fff6d6;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #3a7a73 0%, #2a5c56 100%);
    box-shadow: 0 5px 18px rgba(42, 92, 86, 0.32);
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    line-height: 1.3;
    flex-wrap: wrap;
    max-width: 100%;
}

.article-buy:active {
    transform: scale(0.97);
}

.article-buy:disabled {
    cursor: wait;
    opacity: 0.7;
}

.article-btn-original-price {
    text-decoration: line-through;
    opacity: 0.6;
    font-size: 12px;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.article-btn-now {
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.article-buy .price-symbol-img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    vertical-align: middle;
}

.article-btn-original-price .price-symbol-img {
    width: 11px;
    height: 11px;
}

.article-message {
    margin-top: 12px;
    color: #a8756a;
    font-size: 13px;
}

/* 付费文章支付渠道选择区 */
.article-pay {
    display: none;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.article-pay-btn {
    flex: 0 0 calc(50% - 6px);
    min-width: 0;
    min-height: 46px;
    padding: 12px 8px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    color: #1a3a3a;
    background: #fff;
    border: 1px solid #d8d0bd;
    box-sizing: border-box;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.2;
    white-space: nowrap;
    letter-spacing: 0.8px;
}

.article-pay-btn:hover {
    border-color: #c9a84c;
    background: #faf6ec;
}

.article-pay-btn:active {
    transform: scale(0.97);
}

.article-pay-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.article-pay-ico {
    font-size: 20px;
    line-height: 1;
}

/* 二维码展示区 */
.article-qr {
    display: none;
    margin-top: 18px;
    text-align: center;
}

.article-qr-title {
    color: #28433e;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.article-qr-canvas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 216px;
    height: 216px;
    padding: 8px;
    background: #fff;
    border: 1px solid rgba(201, 157, 62, 0.35);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.article-qr-canvas img,
.article-qr-canvas canvas {
    display: block;
    width: 200px;
    height: 200px;
}

.article-qr-hint {
    margin-top: 12px;
    color: var(--article-muted);
    font-size: 13px;
}

.article-qr-back {
    margin-top: 14px;
    min-height: 38px;
    padding: 8px 22px;
    color: #2c5b55;
    background: transparent;
    border: 1px solid rgba(44, 91, 85, 0.4);
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
}

.article-qr-back:active {
    transform: scale(0.97);
}

/* ===== 付费文章支付弹窗（与产品页支付弹窗风格统一）===== */
.article-pay-mask {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(20, 32, 30, 0.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.article-pay-mask.show {
    display: flex;
    animation: articlePayMaskIn 0.22s ease;
}
@keyframes articlePayMaskIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.article-pay-dialog {
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fdfbf4;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    animation: articlePayPop 0.26s cubic-bezier(0.2, 0.8, 0.3, 1.1);
}
@keyframes articlePayPop {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.article-pay-head {
    padding: 24px 22px 20px;
    background: linear-gradient(135deg, #123b36, #205b50);
    border-radius: 20px 20px 0 0;
    text-align: center;
}
.article-pay-kicker {
    color: rgba(244, 223, 140, 0.72);
    font-size: 12px;
    letter-spacing: 4px;
}
.article-pay-title {
    margin-top: 10px;
    color: #f4df8c;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    font-family: "KaiTi", "STKaiti", serif;
    line-height: 1.4;
    word-break: break-all;
}

.article-pay-body {
    padding: 22px;
    text-align: center;
}
.article-pay-pricelabel {
    color: #8a8275;
    font-size: 13px;
    letter-spacing: 2px;
}
.article-pay-price {
    margin-top: 8px;
    color: #1f4f48;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.article-pay-price .price-symbol-img {
    width: 24px;
    height: 24px;
}
.article-pay-body .article-message {
    text-align: center;
    margin-top: 14px;
    min-height: 18px;
}
.article-pay-body .article-pay {
    margin-top: 16px;
}
.article-pay-body .article-qr {
    margin-top: 14px;
}

.article-pay-cancel {
    width: 100%;
    margin-top: 18px;
    min-height: 46px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(44, 91, 85, 0.35);
    background: transparent;
    color: #2c5b55;
    font-size: 15px;
    letter-spacing: 2px;
    cursor: pointer;
}
.article-pay-cancel:active {
    transform: scale(0.98);
}
