/* ==========================================================
   Rizhi —— 迷你日志风格
   基于 Cuteen 内核重做视觉层：白纸、细线、无阴影、小字号
   ========================================================== */

:root {
    --rz-bg: #f4f5f7;
    --rz-paper: #ffffff;
    --rz-text: #2c2c2c;
    --rz-sub: #8b9099;
    --rz-line: #ebedf0;
    --rz-accent: #4a7ab5;
    --rz-radius: 2px;
    --rz-container: 1000px;
    --rz-narrow: 780px;
}

/* ---------- 基础 ---------- */
body.rz-body {
    background: var(--rz-bg) !important;
    color: var(--rz-text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "MiSans", "Noto Sans SC", sans-serif;
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    padding-top: 0 !important;
    margin: 0;
}

body.rz-body a {
    color: var(--rz-text);
    text-decoration: none;
    transition: color .18s ease;
}

body.rz-body a:hover {
    color: var(--rz-accent);
}

.rz-dot {
    margin: 0 6px;
    color: #c7cbd1;
}

/* Cuteen 的装饰与侧栏在新版式里不需要 */
body.rz-body .sidebar,
body.rz-body .sidebar-author,
body.rz-body .pc-sidebar,
body.rz-body .hero,
body.rz-body #hero-box {
    display: none !important;
}

body.rz-body .blur-img {
    display: none !important;
}

/* ---------- 顶部大图 ---------- */
.rz-hero {
    position: relative;
    height: 340px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #cfd6de;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rz-hero-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .34) 0%, rgba(0, 0, 0, .52) 100%);
}

.rz-hero-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    max-width: 820px;
}

.rz-hero-title {
    margin: 0;
    color: #fff;
    font-size: 32px;
    font-weight: 500;
    letter-spacing: 3px;
    line-height: 1.5;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .28);
    font-family: "Source Han Serif SC", "Songti SC", Georgia, serif;
}

.rz-hero-sub {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    letter-spacing: 1px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .3);
}

.rz-hero-sub a {
    color: rgba(255, 255, 255, .92) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .35);
}

/* ---------- 导航 ---------- */
.rz-nav {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--rz-line);
}

.rz-nav-inner {
    max-width: var(--rz-container);
    margin: 0 auto;
    height: 54px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.rz-menu {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.rz-menu::-webkit-scrollbar {
    display: none;
}

.rz-menu > li {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.rz-menu > li + li::before {
    content: "·";
    color: #d3d7dd;
    margin: 0 9px;
    font-size: 13px;
}

.rz-menu a {
    color: #4a4f57;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    white-space: nowrap;
}

.rz-menu a:hover,
.rz-menu a.on {
    color: var(--rz-text);
    border-bottom-color: var(--rz-text);
}

.rz-nav-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.rz-icon-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #7a8089;
    cursor: pointer;
    border-radius: 50%;
    transition: background .18s ease, color .18s ease;
}

.rz-icon-btn:hover {
    background: #f1f2f4;
    color: var(--rz-text);
}

.rz-icon-btn .icon {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.rz-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.rz-nav-toggle {
    color: var(--rz-text);
}

.rz-nav-toggle span {
    display: block;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
}

/* 搜索面板 */
.rz-search {
    max-height: 0;
    overflow: hidden;
    transition: max-height .26s ease;
    background: #fafbfc;
    border-top: 1px solid transparent;
}

.rz-search.open {
    max-height: 70px;
    border-top-color: var(--rz-line);
}

.rz-search-form {
    max-width: var(--rz-container);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.rz-search-input {
    flex: 1 1 auto;
    border: 0;
    background: #fff;
    border: 1px solid var(--rz-line);
    padding: 8px 12px;
    font-size: 13.5px;
    outline: none;
    color: var(--rz-text);
    border-radius: var(--rz-radius);
}

.rz-search-input:focus {
    border-color: #c9d2dd;
}

.rz-search-submit {
    border: 0;
    background: #fff;
    border: 1px solid var(--rz-line);
    padding: 8px 14px;
    cursor: pointer;
    color: #7a8089;
    border-radius: var(--rz-radius);
}

.rz-search-submit .icon {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

/* ---------- 主体容器 ---------- */
.rz-main {
    display: block !important;
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

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

.rz-container-narrow {
    max-width: calc(var(--rz-narrow) + 40px);
}

/* ---------- 卡片流 ---------- */
.rz-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.rz-card {
    background: var(--rz-paper);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.rz-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(31, 41, 55, .07);
    border-color: #e2e5e9;
}

.rz-card-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f0f2f4;
}

.rz-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .45s ease;
}

.rz-card:hover .rz-card-thumb img {
    transform: scale(1.035);
}

.rz-card-body {
    padding: 15px 16px 17px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.rz-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: .2px;
}

.rz-card-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rz-card-desc {
    margin: 9px 0 0;
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--rz-sub);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1 1 auto;
}

.rz-card-meta {
    margin-top: 13px;
    font-size: 12px;
    color: #a4a9b1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.rz-card-meta a {
    color: #a4a9b1;
}

.rz-card-meta a:hover {
    color: var(--rz-accent);
}

/* ---------- 文章页 ---------- */
.rz-post {
    background: var(--rz-paper);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius);
    padding: 38px 44px 40px;
}

.rz-typography {
    font-size: 15.5px;
    line-height: 1.95;
    color: #35383d;
    word-wrap: break-word;
}

.rz-typography p {
    margin: 1.15em 0;
}

.rz-typography h1,
.rz-typography h2,
.rz-typography h3,
.rz-typography h4,
.rz-typography h5,
.rz-typography h6 {
    font-weight: 600;
    line-height: 1.5;
    margin: 1.9em 0 .75em;
    color: #23262a;
    letter-spacing: .3px;
}

.rz-typography h2 { font-size: 20px; }
.rz-typography h3 { font-size: 17px; }
.rz-typography h4 { font-size: 15.5px; }

.rz-typography a {
    color: var(--rz-accent);
    border-bottom: 1px solid rgba(74, 122, 181, .3);
}

.rz-typography img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    display: block;
    margin: 1.5em auto;
}

.rz-typography blockquote {
    margin: 1.6em 0;
    padding: 2px 0 2px 18px;
    border-left: 2px solid #dfe3e8;
    color: #6b7079;
    background: transparent;
}

.rz-typography blockquote p {
    margin: .5em 0;
}

.rz-typography ul,
.rz-typography ol {
    padding-left: 1.5em;
    margin: 1.1em 0;
}

.rz-typography li {
    margin: .45em 0;
}

.rz-typography hr {
    border: 0;
    border-top: 1px solid var(--rz-line);
    margin: 2.2em 0;
}

.rz-typography code {
    background: #f5f6f8;
    padding: .16em .42em;
    border-radius: 3px;
    font-size: .9em;
    color: #b1483f;
    font-family: "Cascadia Mono", Consolas, Monaco, monospace;
}

.rz-typography pre {
    background: #f7f8fa;
    border: 1px solid var(--rz-line);
    border-radius: 3px;
    padding: 15px 17px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.75;
    margin: 1.6em 0;
}

.rz-typography pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.rz-typography table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    font-size: 13.5px;
}

.rz-typography th,
.rz-typography td {
    border: 1px solid var(--rz-line);
    padding: 8px 11px;
    text-align: left;
}

.rz-typography th {
    background: #fafbfc;
    font-weight: 600;
}

.rz-post-tags {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid var(--rz-line);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rz-post-tags a,
.rz-tag {
    font-size: 12px;
    color: #8b9099;
    border: 1px solid var(--rz-line);
    padding: 3px 9px;
    border-radius: 2px;
    background: #fbfcfd;
}

.rz-post-tags a:hover {
    color: var(--rz-accent);
    border-color: #d8e0ea;
}

.rz-copyright {
    margin-top: 26px;
    padding: 14px 16px;
    background: #fafbfc;
    border: 1px solid var(--rz-line);
    font-size: 12.5px;
    color: #8b9099;
    line-height: 1.9;
}

.rz-copyright p {
    margin: 2px 0;
}

.rz-copyright a {
    color: #7a8089;
}

.rz-post-actions {
    margin-top: 28px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.rz-like,
.rz-reward,
.rz-btn {
    border: 1px solid var(--rz-line);
    background: #fff;
    color: #5d636b;
    font-size: 13px;
    padding: 7px 20px;
    cursor: pointer;
    border-radius: 2px;
    transition: all .18s ease;
}

.rz-like:hover,
.rz-reward:hover,
.rz-btn:hover {
    border-color: #cfd6dd;
    color: var(--rz-text);
    background: #fafbfc;
}

/* 上一篇 / 下一篇 */
.rz-near {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.rz-near-item {
    background: var(--rz-paper);
    border: 1px solid var(--rz-line);
    padding: 14px 17px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: border-color .18s ease;
}

.rz-near-item:hover {
    border-color: #d8dee5;
}

.rz-near-next {
    text-align: right;
}

.rz-near-label {
    font-size: 11.5px;
    color: #a4a9b1;
    letter-spacing: .5px;
}

.rz-near-title {
    font-size: 13.5px;
    color: #4a4f57;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 密码保护表单 */
.rz-protect {
    text-align: center;
    padding: 20px 0;
}

.rz-protect-tip {
    font-size: 14px;
    color: #6b7079;
    margin-bottom: 18px;
}

.rz-input {
    border: 1px solid var(--rz-line);
    padding: 8px 12px;
    font-size: 13.5px;
    outline: none;
    border-radius: 2px;
    margin-right: 8px;
}

/* ---------- 评论区（沿用 Cuteen 组件，去掉卡片外壳） ---------- */
body.rz-body #comments.card {
    background: var(--rz-paper) !important;
    border: 1px solid var(--rz-line) !important;
    border-radius: var(--rz-radius) !important;
    box-shadow: none !important;
    margin-top: 22px !important;
    padding: 26px 32px 30px !important;
}

body.rz-body #comments > .mb-4 {
    font-size: 14px;
    font-weight: 500;
    color: #2c2c2c;
    border-bottom: 1px solid var(--rz-line);
    padding-bottom: 14px;
}

body.rz-body .comment-item-flat {
    padding: 16px 0;
    border-bottom: 1px solid #f4f5f7;
}

body.rz-body .comment-item-flat:last-child {
    border-bottom: 0;
}

body.rz-body .comment-item .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

body.rz-body .comment-item .name {
    font-size: 13px;
    font-weight: 600;
    color: #3d4147;
}

body.rz-body .comment-text {
    font-size: 14px;
    line-height: 1.85;
    color: #3d4147;
}

body.rz-body .comment-reply-link {
    font-size: 12px;
    color: #a4a9b1;
    cursor: pointer;
}

body.rz-body .comment-reply-link:hover {
    color: var(--rz-accent);
}

body.rz-body #comment-form .form-control {
    border: 1px solid var(--rz-line);
    border-radius: 2px;
    font-size: 13.5px;
    box-shadow: none;
}

body.rz-body #comment-form .form-control:focus {
    border-color: #c9d2dd;
    box-shadow: none;
}

body.rz-body #comments #comment-form .btn-primary,
body.rz-body #comments .comment-input-warp .btn-primary {
    background: #35383d !important;
    border-color: #35383d !important;
    border-radius: 2px !important;
    font-size: 13px !important;
    padding: 7px 20px !important;
    box-shadow: none !important;
    font-weight: 400 !important;
}

body.rz-body #comments #comment-form .btn-primary:hover,
body.rz-body #comments .comment-input-warp .btn-primary:hover {
    background: #23262a !important;
    border-color: #23262a !important;
}

body.rz-body #comments #comment-form .btn-link {
    color: #8b9099 !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

/* 评论输入框统一沿用主题自带的下划线样式，避免只给 textarea 加边框造成不一致 */
body.rz-body #comments #comment-form textarea.form-control {
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ---------- 分页 ---------- */
body.rz-body .All_Pagination {
    margin-top: 34px;
    display: flex;
    justify-content: center;
}

body.rz-body .All_Pagination ul.prev {
    display: flex;
    align-items: center;
    gap: 7px;
    list-style: none;
    margin: 0;
    padding: 0;
}

body.rz-body .All_Pagination ul.prev li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
    color: #6b7079;
    background: #fff;
    border: 1px solid var(--rz-line);
    border-radius: 2px;
}

body.rz-body .All_Pagination ul.prev li a:hover {
    border-color: #cfd6dd;
    color: var(--rz-text);
}

body.rz-body .All_Pagination ul.prev li.active1 a {
    background: #35383d;
    border-color: #35383d;
    color: #fff;
    cursor: default;
}

/* ---------- 页脚 ---------- */
.rz-footer {
    border-top: 1px solid var(--rz-line);
    background: #fff;
    padding: 26px 20px 30px;
}

.rz-footer-inner {
    max-width: var(--rz-container);
    margin: 0 auto;
    text-align: center;
}

.rz-footer-line {
    margin: 5px 0;
    font-size: 12.5px;
    color: #9aa0a8;
}

.rz-footer-line a {
    color: #7a8089;
}

.rz-footer-beian a {
    margin: 0 6px;
}

.rz-footer-theme {
    color: #c2c7cd;
    font-size: 11.5px;
    letter-spacing: .5px;
}

/* 返回顶部 */
.rz-top {
    position: fixed;
    right: 22px;
    bottom: 26px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--rz-line);
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .24s ease;
    z-index: 70;
    box-shadow: 0 2px 10px rgba(31, 41, 55, .05);
}

.rz-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rz-top svg {
    width: 16px;
    height: 16px;
    fill: #7a8089;
}

.rz-top:hover svg {
    fill: var(--rz-text);
}

/* ---------- 404 ---------- */
.rz-404 {
    background: var(--rz-paper);
    border: 1px solid var(--rz-line);
    padding: 60px 30px;
    text-align: center;
}

.rz-404-code {
    font-size: 56px;
    font-weight: 200;
    color: #dfe3e8;
    margin: 0 0 6px;
    letter-spacing: 4px;
}

.rz-404-text {
    font-size: 15px;
    color: #4a4f57;
    margin: 0 0 6px;
}

.rz-404-sub {
    font-size: 13px;
    color: #a4a9b1;
    margin: 0 0 24px;
}

/* ---------- 兼容老模板（友人账 / 归档 / 微语 / 纪念册） ---------- */
body.rz-body .card {
    background: var(--rz-paper) !important;
    border: 1px solid var(--rz-line) !important;
    border-radius: var(--rz-radius) !important;
    box-shadow: none !important;
}

body.rz-body .col-lg-9 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-top: 0 !important;
}

body.rz-body .container,
body.rz-body .container-fluid {
    max-width: var(--rz-container) !important;
}

/* ---------- 夜间模式 ---------- */
html.rz-dark {
    --rz-bg: #16181c;
    --rz-paper: #1e2126;
    --rz-text: #d6d9de;
    --rz-sub: #8b9099;
    --rz-line: #2c3037;
    --rz-accent: #7ea6d8;
}

html.rz-dark body.rz-body {
    background: var(--rz-bg) !important;
    color: var(--rz-text);
}

html.rz-dark .rz-nav {
    background: rgba(30, 33, 38, .96);
}

html.rz-dark .rz-menu a {
    color: #b3b8c0;
}

html.rz-dark .rz-menu a.on,
html.rz-dark .rz-menu a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

html.rz-dark .rz-icon-btn:hover {
    background: #2a2e35;
}

html.rz-dark .rz-search {
    background: #1a1d21;
}

html.rz-dark .rz-search-input,
html.rz-dark .rz-search-submit,
html.rz-dark .rz-like,
html.rz-dark .rz-reward,
html.rz-dark .rz-btn,
html.rz-dark .rz-top {
    background: #23262b;
    border-color: #2c3037;
    color: #c2c7cd;
}

html.rz-dark .rz-copyright,
html.rz-dark .rz-typography code,
html.rz-dark .rz-typography pre,
html.rz-dark .rz-typography th,
html.rz-dark .rz-post-tags a {
    background: #23262b;
}

html.rz-dark .rz-typography a {
    color: var(--rz-accent);
}

html.rz-dark .rz-footer {
    background: #191c20;
}

html.rz-dark body.rz-body #comments.card {
    background: var(--rz-paper) !important;
}

/* 自定义页面（归档/微语/友人账/纪念册）自带浅色设计，暗色模式下保持白底，
   否则会出现「暗底 + 暗字」看不清的情况 */
html.rz-dark body.rz-body .rz-main > .row .card,
body.rz-body .rz-main > .row .card {
    background: #fff !important;
    color: #2b3242 !important;
}

html.rz-dark body.rz-body .All_Pagination ul.prev li a {
    background: #23262b;
    border-color: #2c3037;
    color: #b3b8c0;
}

html.rz-dark body.rz-body .All_Pagination ul.prev li.active1 a {
    background: #4a5058;
    border-color: #4a5058;
    color: #fff;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .rz-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .rz-hero {
        height: 260px;
    }

    .rz-hero-title {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .rz-post {
        padding: 26px 24px 30px;
    }

    body.rz-body #comments.card {
        padding: 20px 20px 24px !important;
    }
}

@media (max-width: 640px) {
    .rz-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .rz-hero {
        height: 200px;
    }

    .rz-hero-title {
        font-size: 20px;
        letter-spacing: 1.5px;
    }

    .rz-hero-sub {
        font-size: 12px;
        margin-top: 10px;
    }

    .rz-nav-inner {
        height: 50px;
        padding: 0 14px;
    }

    .rz-nav-toggle {
        display: flex;
    }

    .rz-menu {
        position: absolute;
        top: 50px;
        left: 0;
        right: 0;
        background: var(--rz-paper);
        border-bottom: 1px solid var(--rz-line);
        box-shadow: 0 12px 24px rgba(31, 41, 55, .08);
        flex-direction: column;
        align-items: flex-start;
        padding: 6px 14px;
        display: none;
        max-height: 70vh;
        overflow: auto;
    }

    .rz-menu.open {
        display: flex;
    }

    .rz-menu > li {
        width: 100%;
        padding: 8px 0;
        border-bottom: 1px solid #f6f7f8;
    }

    .rz-menu > li + li::before {
        content: none;
    }

    .rz-menu > li:last-child {
        border-bottom: 0;
    }

    .rz-container {
        padding: 18px 14px 34px;
    }

    .rz-post {
        padding: 20px 16px 24px;
    }

    .rz-typography {
        font-size: 15px;
    }

    .rz-near {
        grid-template-columns: 1fr;
    }

    .rz-near-next {
        text-align: left;
    }

    body.rz-body #comments.card {
        padding: 16px 14px 20px !important;
    }
}

/* ---------- 分类下拉 ---------- */
.rz-has-sub {
    position: relative;
}

.rz-caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid #b3b8c0;
    margin-left: 5px;
    vertical-align: middle;
    transition: transform .18s ease;
}

.rz-has-sub.open .rz-caret {
    transform: rotate(180deg);
}

.rz-sub {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 168px;
    max-height: 62vh;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--rz-line);
    box-shadow: 0 10px 26px rgba(31, 41, 55, .09);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.rz-has-sub.open .rz-sub,
.rz-has-sub:hover .rz-sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rz-sub > li {
    display: block;
}

.rz-sub > li::before {
    content: none !important;
}

.rz-sub a {
    display: block;
    padding: 7px 15px;
    font-size: 13px;
    color: #4a4f57;
    white-space: nowrap;
    border-bottom: 0 !important;
}

.rz-sub a:hover,
.rz-sub a.on {
    background: #f6f7f9;
    color: var(--rz-text);
}

html.rz-dark .rz-sub {
    background: #1e2126;
    border-color: #2c3037;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
}

html.rz-dark .rz-sub a:hover,
html.rz-dark .rz-sub a.on {
    background: #262a30;
}

/* 移动端下拉改为内联展开 */
@media (max-width: 640px) {
    body.rz-body .rz-menu {
        /* 面板自身滚动，避免展开分类后内容溢出到面板外 */
        overflow-x: hidden;
        overflow-y: auto;
        max-height: calc(100vh - 50px);
        white-space: normal;
        -webkit-overflow-scrolling: touch;
    }

    .rz-has-sub {
        width: 100%;
    }

    .rz-sub {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        border: 0;
        border-top: 1px solid var(--rz-line);
        max-height: none;
        padding: 2px 0 4px 10px;
        display: none;
        min-width: 0;
    }

    .rz-has-sub.open .rz-sub,
    .rz-has-sub.open:hover .rz-sub {
        display: block;
    }

    .rz-has-sub:hover .rz-sub {
        display: none;
    }

    .rz-sub a {
        padding: 6px 8px;
        font-size: 13px;
        color: #6b7079;
    }
}

/* 自定义页面（友人账 / 归档 / 微语 / 纪念册）落到统一容器内 */
body.rz-body .rz-main > .row,
body.rz-body .rz-main > .container,
body.rz-body .rz-main > .layout-wrap {
    width: 100% !important;
    max-width: var(--rz-container) !important;
    margin: 30px auto 46px !important;
    padding: 0 12px !important;
}

body.rz-body .rz-main > .row > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
}

@media (max-width: 640px) {
    body.rz-body .rz-main > .row,
    body.rz-body .rz-main > .container,
    body.rz-body .rz-main > .layout-wrap {
        margin: 18px auto 34px !important;
        padding: 0 6px !important;
    }
}

@media (max-width: 640px) {
    /* 分类项改为纵向：标题在上，列表在下 */
    body.rz-body .rz-menu > .rz-has-sub {
        display: block !important;
    }

    body.rz-body .rz-menu > .rz-has-sub > a {
        display: block;
        padding-bottom: 6px;
    }
}

/* 分类标签在展开/聚焦时保持与其它菜单项一致 */
body.rz-body .rz-menu a.rz-sub-toggle,
body.rz-body .rz-menu a.rz-sub-toggle:hover,
body.rz-body .rz-menu a.rz-sub-toggle:focus,
body.rz-body .rz-menu a.rz-sub-toggle:active {
    color: #4a4f57 !important;
    border-bottom-color: transparent !important;
    outline: none;
}

body.rz-body .rz-has-sub.open > a.rz-sub-toggle {
    color: var(--rz-text) !important;
}

html.rz-dark body.rz-body .rz-menu a.rz-sub-toggle {
    color: #b3b8c0 !important;
}

/* ---------- 隐藏旧主题的悬浮工具（皮肤切换器会破坏新皮肤） ---------- */
body.rz-body #tool,
body.rz-body #skin-panel,
body.rz-body #skin-btn {
    display: none !important;
}

/* ---------- 空状态 ---------- */
.rz-empty {
    background: var(--rz-paper);
    border: 1px solid var(--rz-line);
    border-radius: var(--rz-radius);
    padding: 72px 24px;
    text-align: center;
}

.rz-empty-title {
    margin: 0 0 8px;
    font-size: 15px;
    color: #4a4f57;
}

.rz-empty-sub {
    margin: 0;
    font-size: 13px;
    color: #a4a9b1;
}

.rz-empty-sub a {
    color: var(--rz-accent);
    border-bottom: 1px solid rgba(74, 122, 181, .3);
}

/* ---------- 上下篇：到头时的禁用态 ---------- */
.rz-near-empty {
    cursor: default;
    background: #fafbfc;
}

.rz-near-empty .rz-near-title {
    color: #b9bec5;
}

/* ---------- 锚点定位避开吸顶导航 ---------- */
body.rz-body [id^="comment-"],
body.rz-body .rz-typography h1,
body.rz-body .rz-typography h2,
body.rz-body .rz-typography h3,
body.rz-body .rz-typography h4 {
    scroll-margin-top: 72px;
}

/* ---------- 表单错误提示 ---------- */
.rz-form-error {
    margin: 0 0 14px;
    padding: 9px 13px;
    font-size: 13px;
    color: #b1483f;
    background: #fdf3f2;
    border: 1px solid #f6dcda;
    border-radius: 2px;
}

html.rz-dark .rz-form-error {
    background: #2b1f1f;
    border-color: #4a2f2d;
    color: #e28d84;
}

html.rz-dark .rz-near-empty {
    background: #1a1d21;
}

/* ---------- 自定义页面的侧栏彻底移出布局 ----------
   只做 display:none 还不够：旧的 .col-lg-3 仍占 244px 宽度，
   会把 .col-lg-9 顶到下一行，造成顶部近千像素空白。
   单栏版式下直接让它脱离 flex 流。 */
body.rz-body .rz-main > .row > .col-lg-3,
body.rz-body .rz-main > .row > .col-md-3,
body.rz-body .rz-main > .row > .col-sm-3,
body.rz-body .rz-main > .row > aside,
body.rz-body .rz-main > .row > .sidebar {
    display: none !important;
    flex: 0 0 0 !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.rz-body .rz-main > .row {
    flex-wrap: nowrap !important;
}

/* ---------- 头图文字在浅色/杂乱图片上也要清晰 ---------- */
.rz-hero-title {
    text-shadow: 0 2px 18px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .45);
}

.rz-hero-sub {
    text-shadow: 0 1px 12px rgba(0, 0, 0, .6), 0 1px 2px rgba(0, 0, 0, .4);
}

/* ---------- 内容过短时页脚不留白 ---------- */
body.rz-body .rz-main {
    min-height: calc(100vh - 480px);
}

@media (max-width: 640px) {
    body.rz-body .rz-main {
        min-height: calc(100vh - 320px);
    }
}

/* ---------- 代码块 ----------
   主题加载的是 prism 的深色高亮（token 颜色为浅色），
   而我的正文用的是浅色底，两者叠加会导致代码几乎看不见。
   这里统一改成深色代码块，明暗模式下都成立。 */
.rz-typography pre {
    background: #1f2430 !important;
    border: 1px solid #1f2430 !important;
    color: #e8e8e3 !important;
    border-radius: 4px;
    padding: 16px 18px;
}

.rz-typography pre code {
    background: transparent !important;
    color: inherit !important;
    font-size: 13px;
    line-height: 1.75;
}

.rz-typography pre code[class*="language-"],
.rz-typography pre[class*="language-"] {
    color: #e8e8e3 !important;
    text-shadow: none !important;
}

/* 代码块顶部的 mac 风格装饰条与深色底统一 */
.rz-typography .code-header,
.rz-typography pre::before {
    border-radius: 4px 4px 0 0;
}

html.rz-dark .rz-typography pre {
    background: #171b22 !important;
    border-color: #171b22 !important;
}

/* 代码块外层容器（prism toolbar）与代码底色统一，避免"黑条 + 深灰块"两层色 */
.rz-typography .code-toolbar {
    background: #1f2430 !important;
    border-radius: 4px;
    overflow: hidden;
    margin: 1.6em 0;
}

.rz-typography .code-toolbar pre {
    margin: 0 !important;
    border-radius: 0 !important;
}

html.rz-dark .rz-typography .code-toolbar {
    background: #171b22 !important;
}

/* ==========================================================
   夜间模式：统一文本色
   早期规则里不少文字颜色是写死的深灰，深色底上会看不见，
   这里成组覆盖，避免遗漏。
   ========================================================== */
html.rz-dark body.rz-body .rz-typography,
html.rz-dark body.rz-body .rz-typography p,
html.rz-dark body.rz-body .rz-typography li,
html.rz-dark body.rz-body .rz-typography td {
    color: #c7ccd4 !important;
}

html.rz-dark body.rz-body .rz-typography h1,
html.rz-dark body.rz-body .rz-typography h2,
html.rz-dark body.rz-body .rz-typography h3,
html.rz-dark body.rz-body .rz-typography h4,
html.rz-dark body.rz-body .rz-typography h5,
html.rz-dark body.rz-body .rz-typography h6,
html.rz-dark body.rz-body .rz-typography strong,
html.rz-dark body.rz-body .rz-typography b {
    color: #e8eaee !important;
}

html.rz-dark body.rz-body .rz-typography blockquote,
html.rz-dark body.rz-body .rz-typography blockquote p {
    color: #9aa1ab !important;
    border-left-color: #3a4048 !important;
}

html.rz-dark body.rz-body .rz-typography hr {
    border-top-color: #2c3037 !important;
}

html.rz-dark body.rz-body .rz-typography table th {
    background: #23262b !important;
    color: #d6d9de !important;
}

html.rz-dark body.rz-body .rz-typography th,
html.rz-dark body.rz-body .rz-typography td {
    border-color: #2c3037 !important;
}

/* 内联代码在深色底上要提亮 */
html.rz-dark body.rz-body .rz-typography code {
    background: #2a2e35 !important;
    color: #e5a79f !important;
}

/* 文章页周边文字 */
html.rz-dark body.rz-body .rz-near-item {
    background: #1e2126;
    border-color: #2c3037;
}

html.rz-dark body.rz-body .rz-near-title {
    color: #c2c7cd;
}

html.rz-dark body.rz-body .rz-near-empty {
    background: #1a1d21;
}

html.rz-dark body.rz-body .rz-near-empty .rz-near-title {
    color: #6b727c;
}

html.rz-dark body.rz-body .rz-copyright {
    background: #23262b;
    border-color: #2c3037;
    color: #9aa1ab;
}

html.rz-dark body.rz-body .rz-copyright a {
    color: #aeb4bd;
}

html.rz-dark body.rz-body .rz-post-tags a,
html.rz-dark body.rz-body .rz-tag {
    background: #23262b;
    border-color: #2c3037;
    color: #9aa1ab;
}

html.rz-dark body.rz-body .rz-empty {
    background: #1e2126;
    border-color: #2c3037;
}

html.rz-dark body.rz-body .rz-empty-title,
html.rz-dark body.rz-body .rz-404-text {
    color: #d6d9de;
}

html.rz-dark body.rz-body .rz-protect-tip {
    color: #9aa1ab;
}

/* 评论区文字 */
html.rz-dark body.rz-body #comments > .mb-4 {
    color: #e8eaee;
    border-bottom-color: #2c3037;
}

html.rz-dark body.rz-body .comment-item .name {
    color: #d6d9de;
}

html.rz-dark body.rz-body .comment-text,
html.rz-dark body.rz-body .comment-text.comment-text {
    color: #c7ccd4 !important;
    background-color: #23262b !important;
    border-color: #33383f !important;
}

html.rz-dark body.rz-body .comment-item-flat {
    border-bottom-color: #262a30;
}

/* 上面的内联 code 底色不能作用到代码块内部，否则每行都会出现灰底块 */
html.rz-dark body.rz-body .rz-typography pre code {
    background: transparent !important;
    color: #e8e8e3 !important;
}

/* ==========================================================
   无障碍与打印
   ========================================================== */

/* 键盘用户可直接跳到正文 */
.rz-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: #fff;
    color: #111;
    padding: 10px 16px;
    font-size: 13px;
    border: 1px solid var(--rz-line);
    border-radius: 0 0 2px 0;
}

.rz-skip:focus {
    left: 8px;
    top: 8px;
}

/* 明确的键盘焦点环 */
body.rz-body a:focus-visible,
body.rz-body button:focus-visible,
body.rz-body input:focus-visible,
body.rz-body textarea:focus-visible,
body.rz-body select:focus-visible,
body.rz-body [tabindex]:focus-visible {
    outline: 2px solid var(--rz-accent);
    outline-offset: 2px;
}

/* 超长标题在头图里自动均衡换行，避免把图片压扁 */
.rz-hero-title {
    overflow-wrap: anywhere;
    text-wrap: balance;
}

html.rz-dark .rz-skip {
    background: #1e2126;
    color: #e8eaee;
    border-color: #2c3037;
}

@media print {
    .rz-nav,
    .rz-hero,
    .rz-footer,
    .rz-top,
    .rz-search,
    .rz-near,
    .rz-post-actions,
    #comments form,
    #tool {
        display: none !important;
    }

    body.rz-body {
        background: #fff !important;
        color: #000 !important;
    }

    .rz-container {
        max-width: none !important;
        padding: 0 !important;
    }

    .rz-post {
        border: 0 !important;
        padding: 0 !important;
    }

    .rz-typography a {
        color: #000 !important;
        text-decoration: underline;
    }

    .rz-typography pre {
        background: #f5f5f5 !important;
        border: 1px solid #ddd !important;
        color: #000 !important;
    }
}

/* ---------- 窄屏头图信息行 ---------- */
@media (max-width: 640px) {
    .rz-hero {
        height: 220px;
    }

    /* 日期/阅读/评论/分类这一行：字号收小，避免中文被拆成"生活日 / 志" */
    .rz-hero-sub.rz-hero-meta {
        font-size: 11.5px;
        line-height: 1.9;
        letter-spacing: 0;
        word-break: keep-all;
        overflow-wrap: break-word;
        padding: 0 10px;
    }

    .rz-hero-meta .rz-dot {
        margin: 0 5px;
    }
}

/* ==========================================================
   卡片整体即链接
   之前每张卡片里有 2 个链接（图片 + 标题），中间一大片是死区；
   后来用伪元素铺满整卡，但 inset:0 在旧内核（360/QQ 浏览器等）
   不生效，覆盖层尺寸为 0，等于没修。
   现在直接把卡片本身做成 <a>，任何浏览器都成立。
   ========================================================== */
body.rz-body a.rz-card,
body.rz-body a.rz-card:visited,
body.rz-body a.rz-card:hover,
body.rz-body a.rz-card:active {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.rz-card-title {
    /* 标题限两行，避免长标题把卡片高度拉乱 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rz-card-thumb,
.rz-card-body,
.rz-card-meta {
    display: flex;
}

.rz-card-thumb {
    display: block;
}

.rz-card-body {
    flex-direction: column;
    flex: 1 1 auto;
}

.rz-card-meta {
    align-items: center;
    flex-wrap: wrap;
}

.rz-card-cat {
    color: inherit;
}
