/* ==========================================================================
   Lightline —— 单栏简约浅色 Typecho 主题
   ========================================================================== */

/* ---------- 配色变量：浅色（默认） ---------- */
:root {
    color-scheme: light;
    --bg: #f7f7f4;
    --card: #ffffff;
    --text: #2b2b28;
    --text-light: #7a7a72;
    --line: #ececea;
    --accent: #5b7a6b;
    --accent-2: #93b3a4;
    --accent-soft: #eef3f0;
    --code-bg: #2b2b28;
    --code-text: #f3f3ee;
    --shadow: 0 6px 24px rgba(60, 60, 50, 0.06);
    --radius: 14px;
    --max-width: 720px;
}

/* ---------- 配色变量：深色 ---------- */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #15171a;
    --card: #1d2024;
    --text: #e6e4df;
    --text-light: #96968f;
    --line: #2c2f34;
    --accent: #8fb3a2;
    --accent-2: #b7cfc2;
    --accent-soft: #222a26;
    --code-bg: #101114;
    --code-text: #e6e4df;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.38);
}

/* ---------- 配色变量：「风轻云淡」冷调（后台整体色调选它时生效） ----------
   偏冷的青白底 + 青灰绿点缀，替代默认的暖米白 + 墨绿。
   选「暖米白」时不走这两块，颜色就是上面的默认值。 */
:root[data-mood="sky"] {
    --bg: #f4f8f7;
    --card: #ffffff;
    --text: #26302c;
    --text-light: #6f7d77;
    --line: #e7eeeb;
    --accent: #55806f;
    --accent-2: #a6c4b7;
    --accent-soft: #edf4f1;
    --shadow: 0 6px 24px rgba(40, 70, 60, 0.07);
}

[data-theme="dark"][data-mood="sky"] {
    --bg: #101518;
    --card: #1a2024;
    --text: #e5ece8;
    --text-light: #8f9c97;
    --line: #252d31;
    --accent: #8cb3a5;
    --accent-2: #b2cfc2;
    --accent-soft: #1c2523;
    --code-bg: #0c1012;
    --code-text: #e5ece8;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.42);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: 0.01em;
    transition: background-color .25s ease, color .25s ease;
}

/* 页面顶部一层很淡的天空，往下渐隐回背景色（只在「风轻云淡」下出现） */
:root[data-mood="sky"] body {
    background-image: linear-gradient(180deg,
        #e6efeb 0,
        rgba(244, 248, 247, 0.60) 150px,
        rgba(244, 248, 247, 0) 320px);
    background-repeat: no-repeat;
}

[data-theme="dark"][data-mood="sky"] body {
    background-image: linear-gradient(180deg,
        #17211f 0,
        rgba(16, 21, 24, 0.60) 150px,
        rgba(16, 21, 24, 0) 320px);
}

/* 顶部与正文之间一根两头淡出的细线，像一道很轻的地平线 */
:root[data-mood="sky"] .site-header {
    border-bottom: 0;
    padding: 32px 0 0;
}

:root[data-mood="sky"] .site-header::after {
    content: "";
    display: block;
    height: 1px;
    margin-top: 20px;
    background: linear-gradient(90deg,
        rgba(231, 238, 235, 0),
        var(--line) 16%,
        var(--line) 84%,
        rgba(231, 238, 235, 0));
}

/* 线下面留一口气，接首页引言 */
:root[data-mood="sky"] .site-intro {
    padding-top: 18px;
}

/* ---------- 标题衬线化（data-serif="1" 时生效） ---------- */
:root[data-serif="1"] .site-logo,
:root[data-serif="1"] .logo-text,
:root[data-serif="1"] .post-title,
:root[data-serif="1"] .archive-title,
:root[data-serif="1"] .search-head-title,
:root[data-serif="1"] .banner-title,
:root[data-serif="1"] .ar-title,
:root[data-serif="1"] .ar-year-num {
    font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC",
        "SimSun", "STSong", Georgia, "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s ease;
}

a:hover {
    color: var(--text);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* ---------- 头部 ---------- */
.site-header {
    padding: 32px 0 24px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.site-logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
}

.site-logo:hover {
    color: var(--accent);
}

.site-logo.has-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Logo 悬停震动：鼠标移到图片上时轻微抖一下，作为点击反馈。
   只在 .can-shake 上生效（后台开关），深浅两张图共用，隐藏的那张不会动。 */
@keyframes logo-shake {
    0%, 100% {
        transform: translateX(0) rotate(0);
    }
    15% {
        transform: translateX(-3px) rotate(-3deg);
    }
    30% {
        transform: translateX(3px) rotate(3deg);
    }
    45% {
        transform: translateX(-2.4px) rotate(-2.4deg);
    }
    60% {
        transform: translateX(2.4px) rotate(2.4deg);
    }
    75% {
        transform: translateX(-1.5px) rotate(-1.5deg);
    }
    90% {
        transform: translateX(0.8px) rotate(0.8deg);
    }
}

/* 用 img 而不是 .logo-img：深色那张的类名是 .logo-img-dark（不带 .logo-img），
   这样深浅两张都能震，实际只会动当前显示的那张 */
.site-logo.can-shake img:hover {
    animation: logo-shake .45s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .site-logo.can-shake img:hover {
        animation: none;
    }
}

/* Logo 悬停彩色下划线：渐变下划线从左展开，图片和文字都生效（后台选「彩色下划线」） */
.site-logo.logo-underline {
    position: relative;
    display: inline-block;
    text-decoration: none;
}

.site-logo.logo-underline::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .3s ease;
}

.site-logo.logo-underline:hover::after {
    transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
    .site-logo.logo-underline::after {
        transition: none;
    }
}

.logo-img {
    display: block;
    width: auto;
    max-width: 60vw;
    height: auto;
    border-radius: 0;
    object-fit: contain;
}

/* 深色 Logo 默认不显示：既靠 hidden 兜底，也靠这条样式
   （注意此选择器不带 .logo-img，避免被 .logo-img 的 display:block 覆盖） */
.logo-img-dark {
    display: none;
    width: auto;
    max-width: 60vw;
    height: auto;
    border-radius: 0;
    object-fit: contain;
}

[data-theme="dark"] .logo-img-light.has-dark {
    display: none;
}

[data-theme="dark"] .logo-img-dark {
    display: block;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--text-light);
    font-size: 15px;
}

.site-nav a:hover {
    color: var(--accent);
}

/* ---------- 头部操作区（导航 + 主题切换） ---------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: color .2s ease, border-color .2s ease, background-color .25s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* ---------- 主体 ---------- */
.site-main {
    padding: 16px 0 40px;
}

/* 601–759px：容器还没到 720，这里的横向内边距又是 0，正文会顶到窗口两边；
   补一层和手机端一致的 20px 边距（>=760 时容器自带边距，<=600 由手机端规则处理） */
@media (min-width: 601px) and (max-width: 759px) {
    .site-main {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ---------- 文章列表 ---------- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.post-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 28px;
    transition: box-shadow .2s ease, transform .2s ease;
}

.post-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.post-title {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
}

.post-title a {
    color: var(--text);
}

.post-title a:hover {
    color: var(--accent);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 14px;
}

/* 标题下方的标签：和元信息同一行，点击进对应标签归档 */
.meta-tags {
    display: inline;
}

.meta-tags a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color .25s ease, border-color .25s ease;
}

.meta-tags a:hover {
    border-bottom-color: var(--accent);
}

.post-excerpt {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 16px;
}

.read-more {
    font-size: 14px;
    font-weight: 500;
}

/* ---------- 首页引言 ---------- */
.site-intro {
    padding: 2px 0 22px;
}

.intro-text {
    position: relative;
    margin: 0;
    padding-left: 22px;
    font-size: 14px;
    line-height: 1.75;
    letter-spacing: .02em;
    color: var(--text-light);
}

.intro-text::before {
    content: "“";
    position: absolute;
    left: 0;
    top: -1px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    line-height: 1;
    color: var(--accent-2);
}

.intro-author {
    display: inline-block;
    margin-top: 6px;
    padding-left: 22px;
    font-size: 13px;
    color: var(--text-light);
    opacity: .78;
}

/* ---------- 站内搜索面板 ---------- */
.search-panel {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 15vh 20px 20px;
}

.search-panel[hidden] {
    display: none;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 28, 26, .42);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: search-fade .22s ease;
}

.search-box {
    position: relative;
    width: min(640px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px 18px;
    box-shadow: 0 18px 50px rgba(20, 30, 25, .16);
    animation: search-pop .24s ease;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.search-form-icon {
    flex: 0 0 auto;
    color: var(--text-light);
}

.search-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 17px;
    color: var(--text);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.search-submit {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: none;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: opacity .2s ease;
}

.search-submit:hover {
    opacity: .88;
    color: #fff;
}

.search-tip {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: var(--text-light);
}

body.search-open {
    overflow: hidden;
}

@keyframes search-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes search-pop {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 搜索结果页 ---------- */
.search-head {
    margin: 4px 0 24px;
}

.search-head-label {
    margin: 0 0 6px;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-light);
}

.search-head-title {
    margin: 0 0 16px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    word-break: break-word;
}

.search-head-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.search-head-form .search-input {
    font-size: 15px;
}

.empty-state {
    padding: 46px 20px 30px;
    text-align: center;
    color: var(--text-light);
}

.empty-icon {
    color: var(--accent-2);
    opacity: .8;
}

.empty-title {
    margin: 16px 0 8px;
    font-size: 17px;
    color: var(--text);
}

.empty-tip {
    margin: 0;
    font-size: 14px;
}

/* ---------- 首屏 Banner 图组 ---------- */
.banner-grid {
    display: grid;
    grid-template-columns: 1.06fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    height: var(--banner-height, 300px);
    margin-bottom: 26px;
}

.banner-grid.count-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.banner-grid.count-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.banner-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: var(--accent-soft);
    margin: 0;
    text-decoration: none;
}

.banner-large {
    grid-row: span 2;
}

.banner-grid.count-1 .banner-large,
.banner-grid.count-2 .banner-large {
    grid-row: auto;
}

.banner-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    margin: 0;
    transition: transform .55s cubic-bezier(.22, .61, .36, 1);
}

.banner-item:hover img {
    transform: scale(1.045);
}

/* 深色模式下把 Banner 压暗一点，避免亮图在暗底上过曝刺眼 */
[data-theme="dark"] .banner-item img {
    filter: brightness(0.92);
}

.banner-mask {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, .58) 0%, rgba(0, 0, 0, .12) 45%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

[data-theme="dark"] .banner-mask {
    background: linear-gradient(to top, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .2) 45%, rgba(0, 0, 0, 0) 70%);
}

.banner-title {
    position: absolute;
    left: 50%;
    bottom: 15px;
    transform: translateX(-50%);
    max-width: 86%;
    text-align: center;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .02em;
    text-shadow: 0 1px 10px rgba(0, 0, 0, .4);
    pointer-events: none;
}

/* ---------- 文章封面 ---------- */
.post-card.has-cover {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.post-card-body {
    flex: 1 1 auto;
    min-width: 0;
}

.post-cover {
    flex: 0 0 168px;
    width: 168px;
    height: 116px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--accent-soft);
}

.post-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    margin: 0;
}

.post-cover-single {
    margin: 0 0 22px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--accent-soft);
}

.post-cover-single img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
    margin: 0;
}

/* ---------- 归档标题 ---------- */
.archive-title {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0 22px;
    color: var(--text);
}

/* ---------- 单篇文章 ---------- */
.post-single {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 34px 32px;
    margin-bottom: 28px;
}

.post-single .post-title {
    font-size: 28px;
    margin-bottom: 14px;
}

.post-content {
    font-size: 16px;
    color: var(--text);
}

.post-content p {
    margin-bottom: 18px;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 28px 0 14px;
    line-height: 1.5;
}

.post-content h2 {
    font-size: 22px;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
}

.post-content h3 {
    font-size: 18px;
}

.post-content ul,
.post-content ol {
    margin: 0 0 18px 22px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content blockquote {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    padding: 14px 18px;
    border-radius: 0 10px 10px 0;
    color: var(--text-light);
    margin-bottom: 18px;
}

.post-content code {
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 14px;
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
}

.post-content pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 16px;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 18px;
}

.post-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.post-content img {
    margin: 8px 0 18px;
}

.post-tags {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-tags a {
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 20px;
}

.post-tags a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 14px;
}

.post-nav .next {
    margin-left: auto;
}

/* ---------- 评论 ---------- */
.comments {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 28px;
}

.comments-title {
    font-size: 18px;
    margin-bottom: 20px;
}

.respond {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.cancel-comment-reply a {
    font-size: 13px;
    color: var(--text-light);
}

.comment-closed {
    font-size: 14px;
    color: var(--text-light);
    padding: 10px 0 0;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.comment-list li {
    list-style: none;
}

.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.comment-item:last-child {
    border-bottom: none;
}

/* 评论头像：左侧圆形，正文在右侧 */
.comment-body {
    display: flex;
    gap: 14px;
}

.comment-avatar {
    flex: 0 0 auto;
}

.comment-avatar:empty {
    display: none;
}

.comment-avatar .avatar {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0;
    background: var(--accent-soft);
}

.comment-main {
    flex: 1 1 auto;
    min-width: 0;
}

.comment-waiting,
.comment-awaiting-moderation {
    font-size: 12px;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 1px 8px;
    border-radius: 20px;
    font-style: normal;
}

.comment-head {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    font-size: 15px;
}

.comment-by-author .comment-author {
    color: var(--accent);
}

.comment-date {
    font-size: 13px;
    color: var(--text-light);
}

.comment-content {
    font-size: 15px;
    margin-bottom: 8px;
}

.comment-reply a {
    font-size: 13px;
}

.comment-children {
    margin: 10px 0 0;
    padding-left: 16px;
    border-left: 2px solid var(--line);
}

.comment-children .comment-list {
    margin: 0;
}

.comment-children .comment-item {
    border-bottom: none;
    padding-bottom: 6px;
}

.comment-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color .2s ease;
}

.comment-form .form-row input {
    flex: 1 1 160px;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--accent);
}

.comment-form textarea {
    resize: vertical;
    margin-bottom: 14px;
}

.btn-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px 26px;
    font-size: 15px;
    cursor: pointer;
    transition: opacity .2s ease;
}

.btn-submit:hover {
    opacity: .88;
}

/* 提交中状态：转圈 + 等待光标，禁用重复点击 */
.btn-submit.is-busy {
    opacity: .75;
    cursor: wait;
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 7px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: btn-spin .7s linear infinite;
}

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

/* 评论提交状态行：等待 / 成功 / 失败 */
.comment-status {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.7;
    min-height: 1.4em;
}

.comment-status.is-pending {
    color: var(--text-light);
}

.comment-status.is-success {
    color: var(--accent);
}

.comment-status.is-error {
    color: #c0492f;
}

[data-theme="dark"] .comment-status.is-error {
    color: #e08a76;
}

@media (prefers-reduced-motion: reduce) {
    .btn-spinner {
        animation: none;
    }
}

.login-tip {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 14px;
}

/* ---------- 分页 ---------- */
.page-navigator {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 34px 0 10px;
    padding: 0;
    list-style: none;
}

/* 盒子画在 li 上（没有 li 的版本画在裸 a / span 上），
   里面的 a / span 只当文字用：不带边框、不带底色，
   hover、当前页、点击都只会换 li 的颜色，圆角始终保留。 */
.page-navigator li,
.page-navigator > a,
.page-navigator > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
    padding: 0 12px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 10px !important;
    background: var(--card);
    color: var(--text-light);
    font-size: 14px;
    line-height: 1;
    font-weight: 400;
    list-style: none;
    text-decoration: none;
    overflow: hidden;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}

/* 内层文字：只负责显示，不参与画框 */
.page-navigator li > a,
.page-navigator li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: inherit;
    background: none;
    color: inherit;
    font: inherit;
    line-height: 1;
    text-decoration: none;
}

/* 悬停：换个底色和描边，形状不变 */
.page-navigator li:hover,
.page-navigator > a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.page-navigator li.current,
.page-navigator li:has(> .current),
.page-navigator > a.current,
.page-navigator > span.current {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
    font-weight: 500;
}

.page-navigator li.current:hover {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent);
}

/* 键盘聚焦时给个柔和光圈，不用方角的默认 outline */
.page-navigator a:focus,
.page-navigator > a:focus,
.page-navigator li > a:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-soft);
    border-radius: 10px;
}

[data-theme="dark"] .page-navigator li.current,
[data-theme="dark"] .page-navigator li:has(> .current),
[data-theme="dark"] .page-navigator > a.current,
[data-theme="dark"] .page-navigator > span.current {
    color: #101518;
}

@media (max-width: 600px) {
    .page-navigator {
        gap: 6px;
        margin: 26px 0 6px;
    }

    .page-navigator li,
    .page-navigator > a,
    .page-navigator > span {
        min-width: 36px;
        height: 34px;
        padding: 0 10px;
        font-size: 13.5px;
    }
}

/* ---------- 404 / 空状态 ---------- */
.empty,
.error-page {
    text-align: center;
    color: var(--text-light);
    padding: 50px 0;
}

.error-code {
    font-size: 52px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.error-page p {
    margin-bottom: 18px;
}

/* ---------- 页脚 ---------- */
.site-footer {
    padding: 28px 0 40px;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

/* ---------- 阅读进度条 ---------- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease;
}

.reading-progress-bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 8px rgba(91, 122, 107, 0.35);
}

/* ---------- 回到顶部 ---------- */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease,
        color .2s ease, border-color .2s ease, background-color .25s ease;
    z-index: 99;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- 友情链接页 ---------- */
/* 整块兜底：超长无空格内容（长网址、连续英文）允许断行，不撑破容器 */
.friend-links {
    overflow-wrap: break-word;
    overflow-wrap: anywhere;
}

.friend-links__group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 26px 0 12px;
}

.friend-links__group:first-of-type {
    margin-top: 4px;
}

.friend-links__group-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

.friend-links__group-name::before {
    content: "";
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: var(--accent);
}

.friend-links__group-count {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11.5px;
    line-height: 1.7;
}

.friend-links__intro {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-light);
}

.friend-links__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.friend-links__card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px 15px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    text-decoration: none;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.friend-links__card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 10px 24px rgba(30, 45, 38, .10);
}

.friend-links__avatar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
}

.friend-links__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    border-radius: 50%;
}

.friend-links__body {
    flex: 1 1 auto;
    min-width: 0;
}

.friend-links__name {
    display: block;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-links__card:hover .friend-links__name {
    color: var(--accent);
}

.friend-links__meta {
    display: block;
    margin-top: 3px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-links__arrow {
    flex: 0 0 auto;
    color: var(--text-light);
    opacity: .55;
    transition: transform .22s ease, opacity .22s ease, color .22s ease;
}

.friend-links__card:hover .friend-links__arrow {
    transform: translateX(3px);
    opacity: 1;
    color: var(--accent);
}

.friend-links__apply {
    margin: 26px 0 4px;
    padding: 18px 18px 16px;
    border: 1px dashed var(--line);
    border-radius: 12px;
}

.friend-links__apply-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.friend-links__apply-title::before {
    content: "";
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--accent);
}

.friend-links__apply-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-light);
}

.friend-links__apply-mail {
    display: inline-block;
    max-width: 100%;
    margin-top: 12px;
    padding: 7px 14px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.friend-links__apply-mail:hover {
    background: var(--accent);
    color: #fff;
}

.friend-links__empty {
    padding: 22px 18px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--text-light);
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .site-header {
        padding: 22px 0 16px;
    }

    /* 风轻云淡：手机上顶部留白收紧，地平线跟着上移 */
    :root[data-mood="sky"] .site-header {
        padding: 22px 0 0;
    }

    :root[data-mood="sky"] .site-header::after {
        margin-top: 16px;
    }

    /* 移动端：Logo、导航、主题切换整体居中 */
    .header-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .site-nav {
        justify-content: center;
    }

    /* 移动端统一左右留白：正文、图表、分页与头部对齐 */
    .site-main {
        padding: 16px 20px 40px;
    }

    .post-card,
    .post-single,
    .comments {
        padding: 22px 20px;
    }

    .post-single .post-title {
        font-size: 23px;
    }

    .post-nav {
        flex-direction: column;
    }

    .post-nav .next {
        margin-left: 0;
    }

    .back-to-top {
        right: 14px;
        bottom: 16px;
        width: 38px;
        height: 38px;
    }

    .comment-body {
        gap: 10px;
    }

    .comment-avatar .avatar {
        width: 34px;
        height: 34px;
    }

    .post-card.has-cover {
        flex-direction: column;
        gap: 14px;
    }

    .post-cover {
        flex: none;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .post-cover img {
        height: 100%;
    }

    .post-cover-single img {
        max-height: 240px;
    }

    .banner-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        height: auto;
        gap: 8px;
        margin-bottom: 18px;
        padding-left: 0;
        padding-right: 0;
    }

    .banner-item {
        aspect-ratio: 4 / 3;
    }

    .banner-large {
        grid-column: span 2;
        grid-row: auto;
        aspect-ratio: 16 / 9;
    }

    .banner-grid.count-1 .banner-item,
    .banner-grid.count-2 .banner-item {
        grid-column: span 2;
        aspect-ratio: 16 / 9;
    }

    .banner-title {
        font-size: 13px;
        bottom: 10px;
    }

    .site-intro {
        padding: 0 0 16px;
    }

    .intro-text {
        font-size: 13px;
    }

    .search-panel {
        padding: 12vh 16px 16px;
    }

    .search-box {
        padding: 16px 16px 14px;
    }

    .search-input {
        font-size: 16px;
    }

    .search-submit {
        padding: 7px 13px;
    }

    .search-head-title {
        font-size: 21px;
    }

    /* 单列必须写 minmax(0, 1fr)：1fr 的最小尺寸是 auto，
       卡片内不换行的长简介会把整列撑到超出屏幕（横向溢出）。 */
    .friend-links__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .friend-links__intro {
        margin-bottom: 16px;
    }
}

/* ---------- 归档页（时间树 + 标签） ---------- */
.ar-head {
    margin: 4px 0 30px;
}

.ar-title {
    font-size: 34px;
    line-height: 1.25;
    margin: 0 0 12px;
    color: var(--text);
}

.ar-stat {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-light);
    letter-spacing: 0.02em;
}

.ar-stat b {
    color: var(--accent);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 角标：年、月、标签后面的篇数 */
.ar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* 年份速跳 */
.ar-years {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 36px;
}

.ar-year-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 6px 5px 13px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 13px;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background-color .25s ease, color .25s ease;
}

.ar-year-chip .ar-badge {
    background: var(--card);
    color: var(--accent);
}

.ar-year-chip:hover {
    background: var(--accent);
    color: #fff;
}

.ar-year-chip:hover .ar-badge {
    background: rgba(255, 255, 255, .9);
}

/* 年份段 */
.ar-year {
    margin-bottom: 40px;
    scroll-margin-top: 24px;
}

.ar-year-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.ar-year-num {
    font-size: 26px;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.ar-year-rule {
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* 月份 + 文章，左列标签、右列树状列表 */
.ar-months {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.ar-month {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 16px;
}

.ar-month-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding-top: 6px;
    font-size: 12.5px;
    color: var(--text-light);
    letter-spacing: 0.06em;
}

.ar-list {
    position: relative;
    margin: 0;
    padding: 0 0 0 18px;
    list-style: none;
    border-left: 1px solid var(--line);
}

.ar-item {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
}

.ar-item::before {
    content: "";
    position: absolute;
    left: -20.5px;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    border-radius: 50%;
    background: var(--accent-2);
    transition: background-color .2s ease, transform .2s ease;
}

.ar-item:hover::before {
    background: var(--accent);
    transform: scale(1.35);
}

.ar-date {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-light);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.ar-link {
    color: var(--text);
    font-size: 14.5px;
    text-decoration: none;
    transition: color .2s ease;
}

.ar-link:hover {
    color: var(--accent);
}

/* 标签区 */
.ar-tags {
    margin-top: 44px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.ar-sub {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-light);
}

.ar-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.ar-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 6px 5px 13px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
    transition: background-color .25s ease, color .25s ease;
}

.ar-tag .ar-badge {
    background: var(--card);
    color: var(--accent);
}

.ar-tag:hover {
    background: var(--accent);
    color: #fff;
}

.ar-tag:hover .ar-badge {
    background: rgba(255, 255, 255, .9);
}

/* 深色模式下悬停底色是浅青绿，文字改用底色深色，避免白字发灰 */
[data-theme="dark"] .ar-year-chip:hover,
[data-theme="dark"] .ar-tag:hover {
    color: #0f1417;
}

[data-theme="dark"] .ar-year-chip:hover .ar-badge,
[data-theme="dark"] .ar-tag:hover .ar-badge {
    background: rgba(16, 21, 24, .16);
    color: #0f1417;
}

@media (max-width: 600px) {
    .ar-title {
        font-size: 26px;
    }

    .ar-stat {
        font-size: 13px;
    }

    .ar-years {
        margin-bottom: 28px;
    }

    .ar-year {
        margin-bottom: 32px;
    }

    .ar-year-num {
        font-size: 22px;
    }

    .ar-month {
        grid-template-columns: 46px 1fr;
        gap: 12px;
    }

    .ar-month-head {
        font-size: 12px;
    }

    .ar-item {
        gap: 9px;
        padding: 7px 0;
    }

    .ar-link {
        font-size: 14px;
    }
}

/* 归档页：页面正文里手写的说明文字 */
.ar-note {
    margin: 16px 0 0;
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-light);
}

.ar-note p {
    margin: 0 0 8px;
}

.ar-note p:last-child {
    margin-bottom: 0;
}
