@charset "UTF-8";
/* ==========================================================================
   缠中说禅 · 阅读页样式 (article.css)
   ========================================================================== */
@import url("chan-base.css");

/* ---------- 阅读进度条（reader.js 生成） ---------- */
.read-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    z-index: 80;
    background: transparent;
    pointer-events: none;
}

.read-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--cinnabar), var(--cinnabar-h));
    transition: width .1s linear;
}

/* ---------- 文章容器 ---------- */
.article-container {
    max-width: var(--read);
    margin: 0 auto;
    padding: 0 24px 40px;
    transition: max-width .3s var(--ease);
}

.article-container.wide { max-width: 980px; }

/* ---------- 面包屑 ---------- */
.breadcrumb {
    margin: 22px 0 10px;
    font-size: 12.5px;
    letter-spacing: .06em;
    color: var(--ink-4);
}

.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--cinnabar); }
.breadcrumb span { color: var(--ink-3); }

/* 原文出处小行 */
.article-container > h4 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: .06em;
}

.article-container > h4 a { color: var(--ink-4); }
.article-container > h4 a:hover { color: var(--cinnabar); }

/* ---------- 文章头 ---------- */
.article-header {
    position: relative;
    margin: 14px 0 30px;
    padding: 0 0 22px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.article-header::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    width: 90px;
    height: 3px;
    border-top: 1px solid var(--cinnabar);
}

.article-title {
    font-family: var(--serif);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .04em;
    color: var(--ink);
}

.article-meta {
    margin-top: 14px;
    font-size: 12.5px;
    letter-spacing: .12em;
    color: var(--ink-3);
}

.article-meta .pubtime { display: inline-block; }

.article-meta .pubtime::before {
    content: "◦ ";
    color: var(--cinnabar);
}

/* ---------- 正文 ---------- */
.article-content {
    font-family: var(--serif);
    font-size: var(--read-fs, 17.5px);
    line-height: 1.95;
    letter-spacing: .015em;
    color: var(--ink);
    text-align: justify;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 段落 */
.article-content p,
.article-content div { margin: 0 0 .85em; }

.article-content div:empty,
.article-content p:empty,
.article-content .blank { display: none !important; }

.article-content br + br { display: none; }

/* 抹平新浪内联字号，保留语义层级 */
.article-content font { font-size: inherit; line-height: inherit; }

.article-content .big-title {
    display: block;
    margin: 1.5em 0 .8em;
    padding-left: 12px;
    border-left: 3px solid var(--cinnabar);
    font-size: 1.16em;
    font-weight: 700;
    line-height: 1.6;
    color: var(--ink);
}

/* 正文标题 */
.article-content h1, .article-content h2,
.article-content h3, .article-content h4 {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--ink);
    margin: 1.5em 0 .8em;
    line-height: 1.55;
}

.article-content h1 { font-size: 1.35em; }
.article-content h2 { font-size: 1.25em; }
.article-content h3 { font-size: 1.12em; }

/* 链接 */
.article-content a {
    color: var(--ink);
    border-bottom: 1px dotted var(--line-3);
}

.article-content a:hover {
    color: var(--cinnabar);
    border-bottom-color: var(--cinnabar);
}

/* 强调 */
.article-content strong, .article-content b { font-weight: 700; color: var(--ink); }
.article-content em { font-style: normal; background: linear-gradient(transparent 62%, rgba(156, 58, 46, .14) 0); }

/* 引用 */
.article-content blockquote {
    margin: 1.2em 0;
    padding: .9em 1.1em;
    border-left: 3px solid var(--cinnabar);
    background: var(--paper-warm);
    color: var(--ink-2);
    font-size: .96em;
}

/* 列表 */
.article-content ul, .article-content ol {
    margin: .8em 0;
    padding-left: 1.6em;
    list-style: disc;
}
.article-content ol { list-style: decimal; }
.article-content li { margin: .25em 0; list-style: inherit; }

/* 图片 */
.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.3em auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
}

.article-content img.img-broken { display: none; }

/* 表格 */
.article-content table {
    width: 100%;
    margin: 1.2em 0;
    font-size: .94em;
    border: 1px solid var(--line);
}

.article-content td, .article-content th {
    padding: 8px 10px;
    border: 1px solid var(--line);
    line-height: 1.7;
}

.article-content hr {
    margin: 2em 0;
    border: 0;
    border-top: 1px solid var(--line);
}

/* ---------- 延伸阅读（reader.js 收纳原站相关链接） ---------- */
.related-card {
    margin: 34px 0 0;
    padding: 18px 20px;
    background: var(--paper-warm);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.related-card h5 {
    font-family: var(--serif);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--cinnabar);
    margin-bottom: 10px;
}

.related-card a {
    display: block;
    padding: 5px 0;
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.65;
}

.related-card a:hover { color: var(--cinnabar); }

/* ---------- 上下篇导航（reader.js 生成） ---------- */
.reader-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 34px 0 0;
}

.reader-nav .nv {
    display: block;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    transition: transform .26s var(--ease), box-shadow .26s var(--ease), border-color .26s var(--ease);
}

.reader-nav .nv:hover {
    transform: translateY(-2px);
    border-color: var(--line-3);
    box-shadow: var(--shadow-2);
}

.reader-nav .nv .lb {
    display: block;
    font-size: 11.5px;
    letter-spacing: .16em;
    color: var(--cinnabar);
    margin-bottom: 5px;
}

.reader-nav .nv .tx {
    display: block;
    font-family: var(--serif);
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--ink-2);
    max-height: 3.3em;
    overflow: hidden;
}

.reader-nav .nv:hover .tx { color: var(--ink); }

.reader-nav .nv.next { text-align: right; }

.reader-nav .nv.disabled { opacity: .45; pointer-events: none; }

/* 回目录 */
.reader-home {
    display: block;
    margin: 16px 0 0;
    text-align: center;
    font-family: var(--serif);
    font-size: 13px;
    letter-spacing: .12em;
    color: var(--ink-3);
}

.reader-home:hover { color: var(--cinnabar); }

/* ---------- 回复区 ---------- */
.reply-section {
    margin: 34px 0 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.reply-section > .reply-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--card-2);
    border-bottom: 1px solid var(--line);
}

.reply-section > .reply-header h2 {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--ink);
}

.reply-count {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--cinnabar);
}

.reply-toggle {
    margin-left: auto;
    padding: 6px 16px;
    font-family: var(--serif);
    font-size: 13px;
    letter-spacing: .08em;
    color: var(--ink-2);
    background: var(--card);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .25s var(--ease);
}

.reply-toggle:hover {
    color: var(--cinnabar);
    border-color: var(--cinnabar);
    background: var(--cinnabar-bg);
}

.reply-toggle .toggle-icon { display: inline-block; margin-left: 4px; transition: transform .3s var(--ease); }
.reply-toggle.active .toggle-icon { transform: rotate(180deg); }

.reply-content-area { display: none; padding: 16px 20px 20px; }
.reply-content-area.show { display: block; }

.reply-filter {
    margin-bottom: 14px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--ink-2);
    background: var(--paper-warm);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    user-select: none;
}

.reply-filter input { margin-left: 8px; accent-color: var(--cinnabar); vertical-align: -1px; }

.reply-list { display: flex; flex-direction: column; gap: 12px; }

.reply-item {
    padding: 14px 16px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-3);
    border-radius: var(--radius);
    font-family: var(--sans);
}

.reply-item.divReplyIsHostTrue {
    border-left-color: var(--cinnabar);
    background: #FFF9F4;
}

.reply-item .reply-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}

.reply-item .author {
    font-family: var(--serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: .04em;
}

.reply-item.divReplyIsHostTrue .author { color: var(--cinnabar); }

.reply-item.divReplyIsHostTrue .author::after {
    content: "缠师";
    margin-left: 7px;
    padding: 1px 7px;
    font-family: var(--sans);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: .06em;
    color: #FFF9F3;
    background: var(--cinnabar);
    border-radius: 999px;
    vertical-align: 2px;
}

.reply-item .reply-time {
    font-size: 11.5px;
    letter-spacing: .04em;
    color: var(--ink-4);
    font-variant-numeric: tabular-nums;
}

.reply-item .reply-content {
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.85;
    color: var(--ink-2);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.reply-item .reply-content img { max-width: 100%; margin: 8px 0; border-radius: var(--radius); }

/* 兼容：部分回复项只有 divReplyIsHostTrue/False（含早期抓取的裸结构页面） */
.reply-list > div,
.divReplyIsHostFalse,
.divReplyIsHostTrue {
    padding: 14px 16px;
    background: var(--card-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-3);
    border-radius: var(--radius);
    font-family: var(--sans);
    margin-bottom: 12px;
}

.reply-list > div { margin-bottom: 0; }

.divReplyIsHostTrue,
.reply-list > div.divReplyIsHostTrue {
    border-left-color: var(--cinnabar);
    background: #FFF9F4;
}

.divReplyIsHostFalse fieldset > div:first-child,
.divReplyIsHostTrue fieldset > div:first-child,
.reply-list > div .reply-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}

.divReplyIsHostFalse .author,
.divReplyIsHostTrue .author,
.reply-list > div .author {
    font-family: var(--serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: .04em;
}

.divReplyIsHostTrue .author,
.reply-list > div.divReplyIsHostTrue .author { color: var(--cinnabar); }

.divReplyIsHostTrue .author::after,
.reply-list > div.divReplyIsHostTrue .author::after {
    content: "缠师";
    margin-left: 7px;
    padding: 1px 7px;
    font-family: var(--sans);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: .06em;
    color: #FFF9F3;
    background: var(--cinnabar);
    border-radius: 999px;
    vertical-align: 2px;
}

.divReplyIsHostFalse .reply-time,
.divReplyIsHostTrue .reply-time,
.divReplyIsHostFalse .pubtime,
.divReplyIsHostTrue .pubtime,
.reply-list > div .reply-time {
    font-size: 11.5px;
    letter-spacing: .04em;
    color: var(--ink-4);
    font-variant-numeric: tabular-nums;
}

.divReplyIsHostFalse .reply-content,
.divReplyIsHostTrue .reply-content,
.divReplyIsHostFalse fieldset > div:last-child,
.divReplyIsHostTrue fieldset > div:last-child,
.reply-list > div .reply-content {
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.85;
    color: var(--ink-2);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 裸结构页面补出来的回复容器 */
.reply-plain {
    margin: 34px 0 0;
    padding: 18px 20px 20px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
}

.reply-plain > .reply-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.reply-plain > .reply-header h2 {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--ink);
}

/* 裸结构页面的标题兜底（JS 会补成 .article-header，这里防 JS 失效） */
body > h1 {
    font-family: var(--serif);
    font-size: 1.7rem;
    line-height: 1.5;
    letter-spacing: .04em;
    margin: 12px 0 8px;
}

/* ---------- 阅读工具（reader.js 生成） ---------- */
.reader-tools {
    position: fixed;
    right: 18px;
    bottom: 26px;
    z-index: 70;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reader-tools button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-family: var(--serif);
    font-size: 14px;
    color: var(--ink-2);
    background: rgba(255, 253, 248, .95);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line-2);
    border-radius: 50%;
    box-shadow: var(--shadow-1);
    cursor: pointer;
    transition: all .25s var(--ease);
}

.reader-tools button:hover {
    color: #FFF9F3;
    background: var(--cinnabar);
    border-color: var(--cinnabar);
    transform: translateY(-2px);
}

.reader-tools .to-top { opacity: 0; pointer-events: none; }
.reader-tools .to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- 旧结构兜底（articalContent） ---------- */
.articalContent {
    font-family: var(--serif);
    font-size: 17.5px;
    line-height: 1.95;
    text-align: justify;
}

.articalContent p,
.articalContent > div { margin: 0 0 .85em; }

.articalContent div:empty,
.articalContent .blank { display: none !important; }

.articalContent img { display: block; max-width: 100%; margin: 1.2em auto; border-radius: var(--radius); }

.articalContent a { color: var(--ink); border-bottom: 1px dotted var(--line-3); }
.articalContent a:hover { color: var(--cinnabar); border-bottom-color: var(--cinnabar); }

.next-prev-nav { margin-top: 30px; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
    .article-container { padding: 0 18px 30px; }
    .article-title { font-size: 1.45rem; }
    .article-content { font-size: 16.8px; line-height: 1.9; }
    .reader-nav { grid-template-columns: 1fr; }
    .reader-nav .nv.next { text-align: left; }
    .reader-tools { right: 12px; bottom: 16px; }
    .reader-tools button { width: 36px; height: 36px; font-size: 13px; }
    .reply-section > .reply-header { padding: 14px 16px; flex-wrap: wrap; }
    .reply-content-area { padding: 14px 16px 16px; }
}
