/* =====================================================
 * 今时织 · TodayMesh  —  Typecho Theme
 * 织锦水墨风 / 宣纸底 · 墨色字 · 朱砂为引 · 经纬成网
 * ===================================================== */

/* ---------- 主题变量 ---------- */
:root {
    --paper:        #f4eee2;   /* 宣纸底 */
    --paper-2:      #ece3d2;   /* 略深纸色 */
    --card:         #fbf7ee;   /* 卡片纸（比底略亮） */
    --ink:          #211c16;   /* 墨色（近黑暖调） */
    --ink-soft:     #4b4339;   /* 淡墨 */
    --muted:        #8a7f6e;   /* 褪墨 */
    --muted-dim:    #a99c87;   /* 更淡 */
    --thread:       #e4dac3;   /* 经纬线（细网格） */
    --thread-2:     #dbcdaf;   /* 菱形网线 */
    --line:         rgba(33,28,22,.12);   /* 细线 */
    --line-strong:  rgba(33,28,22,.22);
    --shadow:       rgba(70,52,32,.14);
    --shadow-soft:  rgba(70,52,32,.08);
    --accent:       #9e2b25;   /* 朱砂（默认） */
    --accent-2:     #b8472f;
    --accent-soft:  rgba(158,43,37,.10);
    --radius:       14px;
    --radius-sm:    9px;
    --maxw:         1140px;
    --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", "Source Han Serif CN", serif;
    --sans:  "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono:  ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* 雅致色调变体 */
body.tone-cinnabar { --accent: #9e2b25; --accent-2: #b8472f; --accent-soft: rgba(158,43,37,.10); }
body.tone-indigo   { --accent: #2f4858; --accent-2: #3d6b7e; --accent-soft: rgba(47,72,88,.10); }
body.tone-bamboo   { --accent: #4a6b4f; --accent-2: #6f8f63; --accent-soft: rgba(74,107,79,.10); }
body.tone-ochre    { --accent: #a8632b; --accent-2: #c07a3a; --accent-soft: rgba(168,99,43,.10); }

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    background:
        radial-gradient(120% 58% at 50% -12%, var(--accent-soft), transparent 56%),
        var(--paper);
}
h1, h2, h3, h4, h5 { font-family: var(--serif); line-height: 1.35; font-weight: 700; color: var(--ink); letter-spacing: .5px; }
a { color: var(--accent); text-decoration: none; transition: color .2s, opacity .2s; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent); color: #fff; }

/* ---------- 经纬背景：宣纸上的细网格 + 菱形网 ---------- */
body::before {
    content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background-image:
        linear-gradient(to right,  var(--thread) 1px, transparent 1px),
        linear-gradient(to bottom, var(--thread) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: .55;
}
body::after {
    content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background-image:
        repeating-linear-gradient(45deg,  var(--thread-2) 0 1px, transparent 1px 30px),
        repeating-linear-gradient(-45deg, var(--thread-2) 0 1px, transparent 1px 30px);
    opacity: .35;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; width: 100%; }

/* ---------- 顶栏 ---------- */
#header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(244,238,226,.82);
    backdrop-filter: saturate(120%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex; align-items: center; gap: 18px;
    min-height: 70px; flex-wrap: nowrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
    display: grid; place-items: center; width: 46px; height: 46px;
    border-radius: 12px; background: var(--card);
    border: 1px solid var(--line-strong);
    box-shadow: 0 2px 10px var(--shadow-soft);
}
.brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.45; }
.brand-name { font-family: var(--serif); font-weight: 800; font-size: 20px; letter-spacing: 2px; color: var(--ink); }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 1px; margin-top: 3px; }

/* 随机翻阅按钮（顶栏固定） */
.random-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border-radius: 999px;
    font-family: var(--serif); font-weight: 700; font-size: 14px; letter-spacing: 1px;
    color: var(--accent); border: 1px solid var(--accent);
    background: transparent; cursor: pointer; text-decoration: none;
    transition: background .2s, color .2s, box-shadow .2s, transform .15s;
}
.random-btn:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 14px var(--accent-soft); transform: translateY(-1px); }
.random-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.random-btn .rnd-ico { flex: none; transition: transform .4s ease; }
.random-btn:hover .rnd-ico { transform: rotate(180deg); }

/* ---------- 分类：顶栏按钮 + 向下展开面板 ---------- */
.cat-toggle {
    margin-left: auto; flex: none;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 999px; cursor: pointer;
    font-family: var(--serif); font-weight: 700; font-size: 14px; letter-spacing: 1px;
    color: var(--accent); border: 1px solid var(--accent); background: transparent;
    transition: background .22s, color .22s, box-shadow .22s, transform .15s;
}
.cat-toggle:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 14px var(--accent-soft); transform: translateY(-1px); }
.cat-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-toggle .cat-caret { flex: none; transition: transform .28s ease; }
#header.cat-open .cat-toggle { background: var(--accent); color: #fff; box-shadow: 0 4px 14px var(--accent-soft); }
#header.cat-open .cat-toggle .cat-caret { transform: rotate(180deg); }

/* 展开面板 */
.cat-panel {
    max-height: 0; opacity: 0; overflow: hidden;
    border-top: 1px solid transparent;
    background: rgba(244,238,226,.96);
    backdrop-filter: saturate(120%) blur(10px);
    transition: max-height .34s cubic-bezier(.2,.7,.3,1), opacity .24s ease, border-color .24s ease;
}
#header.cat-open .cat-panel {
    max-height: 76vh; opacity: 1; border-top-color: var(--line);
    overflow-y: auto; overscroll-behavior: contain;
}
.cat-panel-inner { padding: 20px 0 24px; }

.cat-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.cat-chip {
    display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
    padding: 13px 15px; border-radius: 13px;
    border: 1px solid var(--line); background: var(--card);
    box-shadow: 0 1px 3px var(--shadow-soft);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.cat-chip:hover {
    color: inherit; border-color: var(--accent);
    transform: translateY(-2px); box-shadow: 0 8px 20px var(--shadow-soft);
}
.cat-chip-name {
    font-family: var(--serif); font-weight: 700; font-size: 15px;
    color: var(--ink); letter-spacing: .5px; line-height: 1.4;
}
.cat-chip-meta { font-size: 11.5px; color: var(--muted); letter-spacing: .6px; }
.cat-chip.current { border-color: var(--accent); background: var(--accent-soft); }
.cat-chip.current .cat-chip-name { color: var(--accent); }
.cat-chip.is-empty { border-style: dashed; background: transparent; box-shadow: none; }
.cat-chip.is-empty .cat-chip-name { color: var(--ink-soft); font-weight: 600; }

/* ---------- 主体布局 ---------- */
#body { padding-top: 36px; }
body.is-home #body { padding-top: 0; }

/* ---------- 首页 Hero（占满首屏，元素随视口缩放） ---------- */
.hero {
    min-height: 88vh; min-height: 88svh;
    display: flex; align-items: flex-start; justify-content: center;
    text-align: center;
    padding: clamp(78px, 11vh, 130px) 22px 90px; position: relative;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 820px; }

/* 顶部经线装饰：从上方垂下的细线，填补空白并点题 */
.hero-threads {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: .55;
}
.hero-threads .thread {
    position: absolute; top: 0; width: 1px; height: clamp(90px, 18vh, 180px);
    background: linear-gradient(180deg, transparent, var(--line-strong) 60%, var(--accent-soft));
    animation: threadDrop 1.2s ease-out both;
}
.hero-threads .t1 { left: 8%;  height: 120px; animation-delay: .1s; }
.hero-threads .t2 { left: 22%; height: 160px; animation-delay: .25s; }
.hero-threads .t3 { left: 38%; height: 100px; animation-delay: .15s; }
.hero-threads .t4 { left: 62%; height: 150px; animation-delay: .3s; }
.hero-threads .t5 { left: 78%; height: 110px; animation-delay: .2s; }
.hero-threads .t6 { left: 92%; height: 140px; animation-delay: .35s; }
@keyframes threadDrop { from { transform: translateY(-40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 岁月碎片：轻飘的文字碎片，填补上半部空间 */
.hero-shards {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.hero-shards .shard {
    position: absolute; font-family: var(--serif); font-size: clamp(11px, 1.2vw, 14px);
    letter-spacing: 2px; color: var(--muted); opacity: .28;
    padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--card); transform: rotate(var(--r, -8deg));
    animation: fadeIn .9s ease both;
}
.hero-shards .shard:nth-child(1) { top: 12%; left: 10%; --r: -12deg; animation-delay: .5s; }
.hero-shards .shard:nth-child(2) { top: 22%; left: 6%; --r: 6deg; animation-delay: .65s; }
.hero-shards .shard:nth-child(3) { top: 10%; right: 12%; --r: 10deg; animation-delay: .55s; }
.hero-shards .shard:nth-child(4) { top: 20%; right: 8%; --r: -5deg; animation-delay: .7s; }
.hero-shards .shard:nth-child(5) { top: 30%; left: 16%; --r: 4deg; animation-delay: .6s; }
.hero-shards .shard:nth-child(6) { top: 28%; right: 16%; --r: -8deg; animation-delay: .75s; }
/* 印章：朱砂方印 + 织字，作为视觉焦点 */
.hero-seal {
    width: clamp(58px, 9vw, 88px); height: clamp(58px, 9vw, 88px); margin-bottom: clamp(12px, 2vw, 22px);
    border-radius: 15px; background: var(--accent); color: #fff;
    font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 5vw, 46px); letter-spacing: 0;
    display: grid; place-items: center; transform: rotate(-5deg);
    box-shadow: 0 10px 26px var(--accent-soft), inset 0 0 0 2px rgba(255,255,255,.4);
}
.hero-kicker {
    font-family: var(--mono); font-size: clamp(11px, 1.4vw, 13px); letter-spacing: 4px;
    color: var(--muted); margin: 0 0 clamp(12px, 2vw, 18px); text-transform: uppercase;
}
.hero-title {
    font-family: var(--serif); font-weight: 800;
    font-size: clamp(46px, 12vw, 108px); margin: 0;
    letter-spacing: clamp(8px, 1.6vw, 16px); text-indent: clamp(8px, 1.6vw, 16px); /* 抵消尾部字距，保持视觉居中 */
    color: var(--ink); line-height: 1.04;
}
/* 标题下的朱砂细线 + 结 */
.hero-rule {
    position: relative; width: clamp(120px, 18vw, 184px); height: 0;
    margin: clamp(20px, 3vw, 32px) auto 0; border-top: 2px solid var(--accent);
}
.hero-rule::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: clamp(10px, 1.4vw, 13px); height: clamp(10px, 1.4vw, 13px); background: var(--accent);
    border: 2px solid var(--paper); transform: translate(-50%, -50%) rotate(45deg);
}
.hero-slogan {
    font-family: var(--serif); color: var(--ink-soft);
    margin: clamp(20px, 3vw, 30px) auto 0; max-width: 640px;
    font-size: clamp(16px, 2.2vw, 21px); letter-spacing: 3px;
}
/* 搜索框（梭）—— 放大并随视口缩放 */
.hero-search {
    margin: clamp(30px, 4.5vw, 48px) auto 0; width: 100%;
    max-width: clamp(420px, 72vw, 660px); display: flex; align-items: center;
    background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px;
    padding: clamp(6px, 1vw, 10px) clamp(12px, 2vw, 20px);
    gap: clamp(8px, 1.2vw, 12px);
    box-shadow: 0 12px 34px var(--shadow-soft);
    transition: border-color .25s, box-shadow .25s;
}
/* focus 用内发光，避免左右越界压到图标/按钮 */
.hero-search:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-soft); }
.hero-search .search-ico { color: var(--muted); flex: none; width: clamp(20px, 2.4vw, 27px); height: clamp(20px, 2.4vw, 27px); }
.hero-search input {
    flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
    font-size: clamp(15px, 1.9vw, 19px); outline: none;
    padding: clamp(9px, 1.4vw, 15px) clamp(4px, 1vw, 8px); font-family: var(--sans);
}
.hero-search input::placeholder { color: var(--muted-dim); }
.search-btn {
    flex: none; border: 0; cursor: pointer;
    padding: clamp(11px, 1.6vw, 16px) clamp(20px, 2.8vw, 34px); border-radius: 999px;
    background: var(--accent); color: #fff; font-weight: 700; letter-spacing: 2px;
    font-family: var(--serif); font-size: clamp(14px, 1.8vw, 17px);
    transition: transform .15s, filter .15s;
}
.search-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* 向下浏览提示 */
.hero-scroll {
    position: absolute; left: 50%; bottom: clamp(20px, 4vh, 40px); transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--muted);
    animation: rise .7s ease both; animation-delay: .45s;
}
.hero-scroll .chev { font-size: 20px; line-height: 1; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(7px); opacity: 1; } }


/* ---------- 通用卡片 ---------- */
.post-card, .list-item, .grid-item, .toc, .comment, .respond, .error-page {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px var(--shadow-soft);
}
.post-card { padding: 30px 34px; margin-bottom: 26px; position: relative; overflow: hidden; }
/* 经线：左侧一缕竖线 */
.post-card::before {
    content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 0 3px 3px 0;
}
.daily-card { padding-top: 26px; }

.post-flag {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px;
    color: var(--accent); text-transform: uppercase; margin-bottom: 12px;
}
/* 结（knot） */
.post-flag .dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}

.post-title { margin: 4px 0 12px; font-size: 27px; letter-spacing: 1px; }
.post-title a { color: var(--ink); }
.post-title a:hover { color: var(--accent); }
.post-meta {
    list-style: none; display: flex; flex-wrap: wrap; gap: 16px;
    padding: 0; margin: 0 0 16px; font-size: 13px; color: var(--muted);
    font-family: var(--mono);
}
.post-meta a { color: var(--ink-soft); }
.post-meta a:hover { color: var(--accent); }

.post-content { color: var(--ink-soft); font-size: 16px; }
.post-content p { margin: 0 0 1.1em; }
.post-content img { border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 8px 0; }
.post-content a { border-bottom: 1px solid var(--accent-soft); color: var(--accent); }
.post-content pre, .post-content code {
    font-family: var(--mono); background: var(--paper-2);
    border: 1px solid var(--line); border-radius: 8px;
}
.post-content code { padding: 2px 6px; font-size: .9em; color: var(--accent); }
.post-content pre { padding: 16px; overflow: auto; }
.post-content pre code { background: none; border: 0; padding: 0; color: var(--ink-soft); }
.post-content blockquote {
    margin: 1.2em 0; padding: 10px 18px; border-left: 3px solid var(--accent);
    background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--ink-soft);
}
.post-content h2, .post-content h3, .post-content h4 {
    margin: 1.6em 0 .6em; scroll-margin-top: 92px; font-family: var(--serif);
}
.post-content h2 { font-size: 22px; padding-left: 12px; border-left: 3px solid var(--accent); }
.post-content h3 { font-size: 19px; color: var(--ink); }
.post-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.post-content th, .post-content td { border: 1px solid var(--line); padding: 8px 12px; }

.read-more {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
    font-family: var(--serif); font-weight: 700; letter-spacing: 1px; color: var(--accent);
}
.read-more:hover { gap: 11px; color: var(--accent-2); }

/* 首篇摘要（不展示全文） */
.post-excerpt { color: var(--ink-soft); font-size: 16px; margin: 0 0 4px; line-height: 1.9; }
/* 首篇「今日织」强化为焦点卡片 */
.daily-card.featured { padding: 34px 38px; }
.daily-card.featured .post-title { font-size: 31px; }
.daily-card.featured::before { top: 22px; bottom: 22px; width: 4px; }

/* 区块分隔：细线 + 结 */
.divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 40px 0 30px; }
.divider::before, .divider::after { content: ""; height: 1px; width: 90px; background: var(--line-strong); }
.divider .knot { width: 9px; height: 9px; transform: rotate(45deg); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- 首页近期织片 ---------- */
.latest-grid { margin-top: 30px; }
.section-title {
    display: flex; align-items: center; gap: 14px;
    font-family: var(--serif); font-size: 18px; letter-spacing: 3px; color: var(--ink);
    margin: 10px 0 20px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-title span { position: relative; padding-left: 18px; }
.section-title span::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; align-items: stretch; }
.grid-item {
    display: flex; flex-direction: column; gap: 10px; padding: 22px;
    color: var(--ink); transition: transform .2s, border-color .2s, box-shadow .2s;
    min-height: 150px;
}
.grid-item:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 12px 28px var(--shadow); }
.grid-date { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 1px; }
.grid-title { flex: 1; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.45; }
.grid-meta { margin-top: auto; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

/* ---------- 首页经纬分类 ---------- */
.home-categories { margin: 46px 0 6px; }
.home-cat-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
}
.home-cat-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 14px; border-radius: 12px;
    background: var(--card); border: 1px solid var(--line);
    color: var(--ink-soft); box-shadow: 0 2px 8px var(--shadow-soft);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.home-cat-item:hover {
    color: var(--ink); border-color: var(--accent);
    transform: translateY(-2px); box-shadow: 0 8px 20px var(--shadow-soft);
}
.home-cat-name {
    font-family: var(--serif); font-weight: 700; font-size: 15px;
    letter-spacing: .5px; color: var(--ink);
}
.home-cat-count {
    flex: none; min-width: 22px; text-align: center;
    font-family: var(--mono); font-size: 11.5px; color: var(--muted);
    background: var(--paper-2); padding: 2px 7px; border-radius: 999px;
    border: 1px solid var(--line);
}
.home-cat-item:hover .home-cat-count { color: var(--accent); border-color: var(--accent-soft); }

/* ---------- 归档 / 列表页 ---------- */
.archive-head { margin: 26px 0 22px; }
.archive-title {
    font-family: var(--serif); font-size: 26px; margin: 0; letter-spacing: 2px;
    display: inline-flex; align-items: center; gap: 10px;
}
.archive-title::before {
    content: ""; width: 22px; height: 3px; border-radius: 3px;
    background: var(--accent);
}
.archive-count { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 8px; }

.post-list { display: flex; flex-direction: column; gap: 16px; }
.list-item { padding: 22px 26px; transition: transform .2s, border-color .2s, box-shadow .2s; }
.list-item:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 10px 26px var(--shadow); }
.list-title { font-family: var(--serif); font-size: 21px; margin: 0 0 10px; letter-spacing: 1px; }
.list-title a { color: var(--ink); }
.list-title a:hover { color: var(--accent); }
.list-excerpt { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* ---------- 文章页布局（含目录） ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 34px; align-items: start; }
/* 目录关闭时：内容自适应整宽 */
.layout-single { grid-template-columns: minmax(0, 1fr); }
.main-col { min-width: 0; }
.toc-col { position: sticky; top: 94px; }
.toc { padding: 18px 18px 20px; max-height: calc(100vh - 120px); overflow: auto; }
.toc h4 {
    font-family: var(--serif); margin: 0 0 12px; font-size: 15px; letter-spacing: 3px;
    color: var(--accent); display: flex; align-items: center; gap: 8px;
}
.toc h4::before { content: "❖"; font-size: 13px; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-item { margin: 2px 0; }
.toc-item a {
    display: block; padding: 5px 10px; border-radius: 8px; font-size: 13.5px;
    color: var(--muted); border-left: 2px solid transparent; line-height: 1.5;
    transition: all .18s;
}
.toc-item a:hover { color: var(--ink); background: var(--paper-2); }
.toc-item a.active {
    color: var(--accent); border-left-color: var(--accent);
    background: var(--accent-soft);
}
.toc-top { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.toc-top a { color: var(--muted-dim); font-size: 12px; }

/* ---------- 标签 ---------- */
.post-tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.post-tags .tag-label { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.tag {
    display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px;
    color: var(--ink-soft); border: 1px solid var(--line-strong); background: var(--paper-2);
    transition: all .2s;
}
.tag:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- 上一篇 / 下一篇 ---------- */
.post-near {
    list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    padding: 0; margin: 26px 0 0;
}
.post-near li {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 14px 16px; transition: border-color .2s, transform .2s;
    box-shadow: 0 2px 8px var(--shadow-soft);
}
.post-near li:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-near .near-label { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: 1px; }
.post-near a { font-family: var(--serif); font-weight: 600; color: var(--ink); }
.post-near a:hover { color: var(--accent); }
.post-near li:last-child { text-align: right; }

/* ---------- 分页 ---------- */
.page-navigator {
    list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
    gap: 8px; padding: 30px 0 8px; margin: 0;
}
.page-navigator li a, .page-navigator li span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--line); color: var(--ink-soft);
    font-family: var(--mono); font-size: 14px; background: var(--card);
    transition: all .2s;
}
.page-navigator li a:hover { color: #fff; border-color: var(--accent); background: var(--accent); }
.page-navigator li.current span {
    color: #fff; font-weight: 700; border-color: var(--accent);
    background: var(--accent);
}

/* ---------- 评论 ---------- */
#comments { margin-top: 34px; }
#comments h3 { font-family: var(--serif); font-size: 19px; letter-spacing: 2px; margin: 0 0 16px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 14px; }
.comment {
    padding: 16px 18px; background: var(--card); border: 1px solid var(--line);
    box-shadow: 0 2px 8px var(--shadow-soft);
}
.comment .avatar { border-radius: 50%; float: left; margin-right: 12px; }
.comment-author { font-weight: 700; color: var(--ink); font-family: var(--serif); }
.comment-author .browser, .comment-meta { color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.comment-body, .comment-content { margin-top: 8px; color: var(--ink-soft); }
.comment-reply { font-size: 12.5px; color: var(--accent); }

.respond { padding: 20px 22px; margin-top: 8px; }
.respond h3 { font-family: var(--serif); margin-top: 0; letter-spacing: 2px; }
.respond label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.respond .required { color: var(--accent); }
.respond input[type=text], .respond input[type=email], .respond input[type=url], .respond textarea {
    width: 100%; background: var(--paper); border: 1px solid var(--line-strong);
    border-radius: 10px; color: var(--ink); padding: 10px 14px; font-size: 14.5px;
    font-family: var(--sans); outline: none; transition: border-color .2s, box-shadow .2s;
}
.respond input:focus, .respond textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.respond textarea { resize: vertical; min-height: 120px; }
.respond .submit {
    margin-top: 6px; border: 0; cursor: pointer; padding: 11px 26px; border-radius: 999px;
    background: var(--accent); color: #fff; font-weight: 700; letter-spacing: 2px;
    font-family: var(--serif); transition: transform .15s, filter .15s;
}
.respond .submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cancel-comment-reply { margin-bottom: 10px; font-size: 13px; }

/* ---------- 404 ---------- */
.error-page { padding: 50px 30px; text-align: center; margin: 40px 0; }
.error-page .post-title { color: var(--accent); font-family: var(--serif); letter-spacing: 2px; }

/* ---------- 页脚 ---------- */
#footer {
    margin-top: 60px; padding: 34px 0 46px; border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent, var(--paper-2));
}
.footer-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: 14px; }
.footer-brand { font-family: var(--serif); color: var(--ink); font-weight: 700; letter-spacing: 2px; }
.footer-sep { color: var(--muted-dim); }
.footer-icp, .footer-extra { text-align: center; color: var(--muted-dim); font-size: 13px; margin-top: 8px; font-family: var(--mono); }
.footer-powered { text-align: center; color: var(--muted-dim); font-size: 12.5px; margin-top: 10px; }
.footer-powered a { color: var(--muted); }

/* 底部站点索引导航 */
.footer-links {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 10px; margin-bottom: 16px; font-family: var(--serif); letter-spacing: 1px;
}
.footer-link { color: var(--ink-soft); font-size: 14.5px; padding: 4px 2px; transition: color .2s; }
.footer-link:hover { color: var(--accent); }

/* 全站归档 */
.archive-years { margin-top: 18px; }
.archive-year { margin-bottom: 28px; }
.archive-year-title {
    font-family: var(--serif); font-size: 20px; margin: 0 0 12px;
    display: flex; align-items: baseline; gap: 10px; color: var(--ink);
    border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.archive-year-count { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-row {
    display: flex; align-items: baseline; gap: 14px; padding: 7px 0;
    border-bottom: 1px dashed var(--line);
}
.archive-row:last-child { border-bottom: 0; }
.archive-date { font-family: var(--mono); font-size: 13px; color: var(--accent); flex: none; }
.archive-link { color: var(--ink-soft); font-family: var(--serif); font-size: 15.5px; }
.archive-link:hover { color: var(--accent); }

/* 标签云 */
.tag-cloud { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud-item {
    display: inline-flex; align-items: baseline; gap: 5px;
    padding: 8px 16px; border-radius: 999px;
    background: var(--paper-2); border: 1px solid var(--line-strong);
    color: var(--ink-soft); transition: all .2s; font-family: var(--serif);
}
.tag-cloud-item:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }
.tag-cloud-count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tag-cloud-item:hover .tag-cloud-count { color: rgba(255,255,255,.85); }

/* 检索页表单 */
.search-page-form { display: flex; gap: 10px; margin-top: 16px; max-width: 520px; }
.search-page-form input {
    flex: 1; min-width: 0; border: 1px solid var(--line-strong); background: var(--paper);
    border-radius: 999px; padding: 12px 18px; font-size: 15px; color: var(--ink);
    outline: none; font-family: var(--sans);
}
.search-page-form input:focus { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-soft); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .toc-col { position: static; order: -1; }
    .toc { max-height: none; }
    .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .header-inner { gap: 10px; flex-wrap: wrap; }
    .random-btn { padding: 6px 12px; font-size: 13px; }
    .cat-toggle { margin-left: auto; padding: 7px 14px; font-size: 13px; }
    .cat-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
    .cat-chip { padding: 11px 12px; }
    .cat-chip-name { font-size: 14px; }
    .home-cat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
    .home-cat-item { padding: 10px 12px; }
    .home-cat-name { font-size: 14px; }
    .hero { padding: 100px 18px 72px; }
    .hero-shards .shard { display: none; } /* 移动端隐藏碎片，避免遮挡 */
    .hero-threads { opacity: .35; }
    .grid { grid-template-columns: 1fr; }
    .post-near { grid-template-columns: 1fr; }
    .post-near li:last-child { text-align: left; }
    .post-card { padding: 22px 20px; }
}

/* ---------- 入场动效（克制） ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero-inner > *, .home-main > * { animation: rise .7s cubic-bezier(.2,.7,.3,1) both; }
.hero-seal   { animation-delay: .02s; }
.hero-kicker { animation-delay: .08s; }
.hero-title  { animation-delay: .14s; }
.hero-rule   { animation-delay: .20s; }
.hero-slogan { animation-delay: .26s; }
.hero-search { animation-delay: .32s; }
.daily-card  { animation-delay: .10s; }
.latest-grid { animation-delay: .18s; }
.home-categories { animation-delay: .26s; }

/* ---------- 焦点可见性（可访问性） ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

/* ---------- 回到顶部 ---------- */
#to-top {
    position: fixed; right: 22px; bottom: 22px; z-index: 60;
    width: 44px; height: 44px; border: 1px solid var(--line-strong);
    border-radius: 50%; background: var(--card); color: var(--accent);
    font-family: var(--serif); font-size: 18px; cursor: pointer;
    display: grid; place-items: center; opacity: 0; pointer-events: none;
    box-shadow: 0 6px 18px var(--shadow); transition: opacity .3s, transform .2s, border-color .2s;
}
#to-top.show { opacity: 1; pointer-events: auto; }
#to-top:hover { transform: translateY(-3px); border-color: var(--accent); }

/* 尊重减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .grid-item:hover, .list-item:hover, .post-near li:hover, .cat-chip:hover, .home-cat-item:hover, .respond .submit:hover, .read-more:hover, .search-btn:hover { transform: none; }
    .hero-inner > *, .home-main > *, .hero-threads .thread, .hero-shards .shard { animation: none !important; }
    .hero-scroll .chev { animation: none; }
}
