/* ============================================================
   css/article.css — 文章页
   配色 / 字体 / 排版全部沿用主页（index.html）那一套
   分五块：1 变量  2 基础  3 页头  4 正文  5 页脚 + 手机端
   ============================================================ */


/* ========== 1. 变量（改颜色只改这里） ========== */
:root {
    /* 底色 */
    --jink:   #07060b;
    --jink-2: #0b080f;

    /* 文字：强 / 中 / 弱 */
    --jsoft: #f0eaf5;
    --jtext: rgba(245, 238, 255, .82);
    --jbody: rgba(235, 223, 255, .62);
    --jdim:  rgba(235, 223, 255, .42);

    /* 线 */
    --jline: rgba(235, 225, 255, .10);

    /* 强调色：玫瑰 / 蓝 / 紫 */
    --jrose:  #e5a9c1;
    --jblue:  #7a8fc0;
    --jmauve: #a08fc0;

    /* 字体：三个家伙分工明确 */
    --serif: "Bodoni Moda", Didot, "Bodoni MT", "Times New Roman", serif;
    --mono:  ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
             "PingFang SC", "Microsoft YaHei", Arial, sans-serif;

    /* 版心 */
    --measure: 660px;
}


/* ========== 2. 基础 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    position: relative;
    min-height: 100vh;
    background: var(--jink);
    color: var(--jbody);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 背景光晕：和主页同一个做法，两层很淡的光 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 46% at 78% -8%,
            rgba(229, 169, 193, .10) 0%, transparent 62%),
        radial-gradient(ellipse 54% 38% at 8% 4%,
            rgba(122, 143, 255, .07) 0%, transparent 66%);
}

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

img {
    display: block;
    max-width: 100%;
}


/* ========== 3. 版心与页头 ========== */
.container {
    position: relative;
    z-index: 1;
    max-width: var(--measure);
    margin: 0 auto;
    padding: clamp(56px, 10vh, 104px) clamp(20px, 4vw, 32px) clamp(72px, 12vh, 120px);
}

/* ---- 返回链接：等宽小字 + 一条短线 ---- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: clamp(40px, 7vh, 64px);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--jdim);
    transition: color .25s ease;
}

.back-link::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
    transition: width .3s cubic-bezier(.16, 1, .3, 1);
}

.back-link:hover {
    color: var(--jrose);
}

.back-link:hover::before {
    width: 28px;
}

/* ---- 大标题：衬线，和主页的 CYBER CASTLE 同一家族 ---- */
.article-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(30px, 4.4vw, 52px);
    line-height: 1.14;
    letter-spacing: -.02em;
    color: var(--jsoft);
}

/* ---- 日期 / 分类：等宽小字，压在一条细线上 ---- */
.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: clamp(18px, 3vh, 26px);
    padding-bottom: clamp(18px, 3vh, 26px);
    border-bottom: 1px solid var(--jline);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--jdim);
}

.article-meta time {
    letter-spacing: .12em;
}

.article-category {
    color: var(--jrose);
    opacity: .85;
}

/* 空的就干脆不占位置 */
.article-category:empty,
.article-meta time:empty {
    display: none;
}


/* ========== 4. 正文 ========== */
.article-content {
    padding-top: clamp(30px, 5vh, 46px);
}

.article-content p {
    margin-bottom: 1.5em;
    color: var(--jbody);
}

/* 去掉首字下沉——主页没有这种装饰 */
.article-content p:first-of-type::first-letter {
    float: none;
    padding: 0;
    font: inherit;
    color: inherit;
}

.article-content h2,
.article-content h3 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -.01em;
    color: var(--jtext);
}

.article-content h2 {
    font-size: clamp(22px, 2.6vw, 30px);
    line-height: 1.3;
    margin: 2.2em 0 .8em;
}

.article-content h3 {
    font-size: clamp(17px, 1.9vw, 21px);
    line-height: 1.4;
    margin: 1.9em 0 .6em;
}

.article-content strong {
    font-weight: 600;
    color: var(--jtext);
}

.article-content em {
    font-family: var(--serif);
    font-style: italic;
}

.article-content a:not([download]) {
    color: var(--jrose);
    border-bottom: 1px solid rgba(229, 169, 193, .28);
    transition: border-color .25s ease;
}

.article-content a:not([download]):hover {
    border-bottom-color: var(--jrose);
}

/* ---- 列表：不带圆点，每行一条细线（和主页文章列表同一个思路） ---- */
.article-content ul,
.article-content ol {
    margin: 0 0 clamp(36px, 6vh, 52px);
    padding: 0;
    list-style: none;
}

.article-content ul > li {
    position: relative;
    padding: 14px 0 14px 26px;
    border-bottom: 1px solid var(--jline);
    line-height: 1.45;
}

.article-content ul > li:first-child {
    border-top: 1px solid var(--jline);
}

/* 行首那一小段玫瑰色短线 */
.article-content ul > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 12px;
    height: 1px;
    background: var(--jrose);
    opacity: .45;
    transform: translateY(-50%);
    transition: width .3s cubic-bezier(.16, 1, .3, 1), opacity .25s ease;
}

.article-content ul > li:hover::before {
    width: 18px;
    opacity: 1;
}

/* 有序列表：用编号代替圆点 */
.article-content ol {
    counter-reset: item;
}

.article-content ol > li {
    position: relative;
    counter-increment: item;
    padding: 12px 0 12px 34px;
    border-bottom: 1px solid var(--jline);
}

.article-content ol > li::before {
    content: counter(item, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 12px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .1em;
    color: var(--jdim);
}

/* ---- 下载链接：整行可点，右边挂一个 NBT ↓ ---- */
.article-content a[download] {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    color: var(--jtext);
    font-size: 14px;
    transition: color .25s ease;
}

.article-content a[download]::after {
    content: "NBT ↓";
    flex: none;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .14em;
    color: var(--jdim);
    transition: color .25s ease, transform .3s cubic-bezier(.16, 1, .3, 1);
}

.article-content a[download]:hover {
    color: #f5d3e1;
}

.article-content a[download]:hover::after {
    color: var(--jrose);
    transform: translateX(3px);
}

/* ---- 引用块 ---- */
.article-content blockquote {
    margin: 1.8em 0;
    padding: 2px 0 2px 20px;
    border-left: 1px solid var(--jrose);
    font-family: var(--serif);
    font-style: italic;
    color: var(--jdim);
}

/* ---- 图片 ---- */
.article-content img {
    margin: 2em 0;
    border: 1px solid var(--jline);
}

/* ---- 分隔线 ---- */
.article-content hr {
    height: 1px;
    margin: 2.6em 0;
    border: 0;
    background: var(--jline);
}


/* ---- 行内代码与代码块 ---- */
.article-content code {
    padding: .15em .38em;
    border: 1px solid var(--jline);
    border-radius: 4px;
    background: rgba(255, 255, 255, .045);
    font-family: var(--mono);
    font-size: .88em;
    color: #f5d3e1;
}

.article-content pre {
    margin: 1.8em 0;
    padding: 16px 18px;
    overflow-x: auto;
    border: 1px solid var(--jline);
    background: rgba(255, 255, 255, .035);
}

.article-content pre code {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--jtext);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre;
}

/* ---- 配图与图注 ---- */
.article-content figure {
    margin: 2.2em 0;
}

.article-content figure img {
    margin: 0;
}

.article-content figcaption {
    margin-top: 10px;
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: .08em;
    color: var(--jdim);
}

/* ========== 5. 页脚 + 手机端 ========== */
.article-footer {
    margin-top: clamp(56px, 9vh, 92px);
    padding-top: clamp(20px, 3vh, 28px);
    border-top: 1px solid var(--jline);
}

.article-footer a {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--jdim);
    transition: color .25s ease;
}

.article-footer a:hover {
    color: var(--jrose);
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
        line-height: 1.9;
    }

    .container {
        padding: 44px 18px 72px;
    }

    .article-title {
        font-size: clamp(28px, 8.5vw, 36px);
    }

    /* 小标签也要跟着抬，不然和正文落差太大 */
    .back-link,
    .article-meta,
    .article-footer a {
        font-size: 11px;
    }

    .article-content ul > li {
        padding: 15px 0 15px 20px;
    }

    .article-content a[download] {
        font-size: 15px;
    }

    .article-content a[download]::after {
        font-size: 9px;
        letter-spacing: .1em;
    }
}

/* 有人在系统里关了动画，就不做过渡 */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
