/* ==========================================================================
   ACG Gallery —— 二次元图片资源分享主题
   --------------------------------------------------------------------------
   设计约束：图片是主角，界面让位。
   - 全站没有一处 box-shadow，分隔只靠 1px 细线和留白；
   - 圆角分四级（卡片 14 / 横幅 16 / 输入 10 / 胶囊 999），层级靠圆角区分而不是阴影；
   - 樱花粉只用在「可点的主行动」和「当前分类」上，其余地方一律安静。

   关于粉色：--sakura 是主色，对白字只有 2.6:1，撑不起正文，
   所以凡是承载文字的地方都用 --sakura-deep（对白字 4.95:1）。
   --iris 同理，只做焦点环和装饰，链接文字用 --iris-deep。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量
   -------------------------------------------------------------------------- */

:root {
    /* 底色 */
    --paper: #FBFBFC;
    --card: #FFFFFF;
    --well: #F2F2F5;

    /* 文字 */
    --ink: #1A1A1F;
    --ink-2: #5A5A66;
    --muted: #6E6E7A;

    /* 细线 */
    --line: #ECECF0;
    --line-2: #DFDFE6;

    /* 主色 */
    --sakura: #F2789A;
    --sakura-deep: #BE4568;
    --sakura-press: #A93A59;
    --sakura-wash: #FDF1F5;

    /* 次色：只做焦点环和输入框的聚焦描边，不承载文字 */
    --iris: #7C8CF8;

    /* 圆角：用层级而不是同一个值铺满全站 */
    --r-card: 14px;
    --r-banner: 16px;
    --r-input: 10px;
    --r-pill: 999px;

    /* 尺寸。--page 是图片的舞台宽度（横幅、顶部大图），
       --narrow 是文字栏宽度 —— 一行中文超过 45 字左右读起来就累。 */
    --page: 1240px;
    --narrow: 720px;
    --gap: 18px;

    /* 字体：不引外部字体。
       国内访问 Google Fonts 经常超时，而这套系统栈在 Windows / macOS /
       Android 上都有合适的中文字面，优先级按各平台的实际观感排。 */
    --font-sans: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB",
        "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei UI",
        "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono",
        Consolas, "Liberation Mono", monospace;

    --ease: cubic-bezier(.2, .8, .2, 1);
}

/* --------------------------------------------------------------------------
   2. 基础
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    border-style: none;
}

a {
    color: var(--sakura-deep);
    text-decoration: none;
}

a:hover {
    color: var(--sakura-press);
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: -.015em;
}

:focus-visible {
    outline: 2px solid var(--iris);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection {
    background: var(--sakura-wash);
    color: var(--sakura-deep);
}

/* --------------------------------------------------------------------------
   3. 工具
   -------------------------------------------------------------------------- */

.shell {
    width: min(100% - 40px, var(--page));
    margin-inline: auto;
}

.shell-narrow {
    width: min(100% - 40px, var(--narrow));
    margin-inline: auto;
}


.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: 0;
    left: -9999px;
    z-index: 100;
    padding: 10px 18px;
    background: var(--sakura-deep);
    color: #fff;
    border-radius: 0 0 var(--r-input) 0;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 700;
}

.section-count {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   4. 按钮
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .2s, border-color .2s, color .2s, transform .15s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--sakura-deep);
    color: #fff;
}

.btn-primary:hover {
    background: var(--sakura-press);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border-color: var(--line-2);
    color: var(--ink);
}

.btn-ghost:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.text-link {
    color: var(--ink-2);
    font-size: 14px;
    white-space: nowrap;
}

.text-link:hover {
    color: var(--sakura-deep);
}

/* --------------------------------------------------------------------------
   5. 站点头部
   -------------------------------------------------------------------------- */

.site-head {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 251, 252, .86);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.site-head-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    color: var(--ink);
}

.brand:hover {
    color: var(--ink);
}

/* 2×2 的小方块，就是首页瀑布流的缩影；左上角那颗换了主色 */
.brand-mark {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.brand-mark i {
    display: block;
    background: var(--ink);
    border-radius: 2px;
}

.brand-mark i:first-child {
    background: var(--sakura);
}

/* 站名就在旁边，Logo 按内容高度走，不设固定宽高比 —— 方形图标和横版字标都能用 */
.brand-logo {
    display: block;
    width: auto;
    max-width: 160px;
    max-height: 30px;
    object-fit: contain;
}

.brand-name {
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
    display: none;
}

.site-nav a {
    padding: 6px 11px;
    border-radius: var(--r-pill);
    color: var(--ink-2);
    font-size: 14px;
    white-space: nowrap;
    transition: background-color .2s, color .2s;
}

.site-nav a:hover {
    background: var(--line);
    color: var(--ink);
}

.site-nav a.is-on {
    background: var(--sakura-wash);
    color: var(--sakura-deep);
    font-weight: 600;
}

.site-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.search-form {
    display: flex;
    align-items: center;
    padding: 0 4px 0 13px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    transition: border-color .2s;
}

.search-form:focus-within {
    border-color: var(--iris);
}

.search-form input {
    width: 140px;
    padding: 7px 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
}

.search-form input:focus {
    outline: 0;
}

.search-form input::placeholder {
    color: var(--muted);
}

.search-submit {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: var(--r-pill);
    background: none;
    color: var(--muted);
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.search-submit:hover {
    background: var(--sakura-wash);
    color: var(--sakura-deep);
}

.nav-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.nav-toggle {
    display: none;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-input);
    color: var(--ink-2);
    cursor: pointer;
}

.nav-toggle:hover {
    background: var(--line);
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   6. 首页横幅
   -------------------------------------------------------------------------- */

.banner {
    position: relative;
    display: flex;
    align-items: flex-end;
    width: min(100% - 40px, var(--page));
    min-height: clamp(220px, 30vw, 340px);
    margin: 22px auto 0;
    border-radius: var(--r-banner);
    background: var(--sakura-wash);
    overflow: hidden;
}

.banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: banner-in .9s var(--ease) both;
}

/* 图片上那层压暗。不是装饰——白色文字压在任意图片上都得靠它兜住对比度 */
.banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(12, 12, 16, .78) 0%,
            rgba(12, 12, 16, .55) 38%,
            rgba(12, 12, 16, .12) 100%);
    pointer-events: none;
}

.banner-plain::after {
    display: none;
}

.banner-body {
    position: relative;
    z-index: 1;
    max-width: 620px;
    padding: 34px 36px 34px;
    color: var(--ink);
}

.banner:not(.banner-plain) .banner-body {
    color: #fff;
}

.banner-title {
    margin: 0 0 10px;
    font-size: clamp(23px, 3.2vw, 36px);
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -.02em;
}

.banner-sub {
    max-width: 42ch;
    margin: 0 0 22px;
    font-size: 14.5px;
    line-height: 1.7;
    opacity: .9;
}

.banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.banner:not(.banner-plain) .btn-ghost {
    border-color: rgba(255, 255, 255, .48);
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.banner:not(.banner-plain) .btn-ghost:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.banner-plain .btn-ghost {
    background: var(--card);
}

@keyframes banner-in {
    from {
        opacity: 0;
        transform: scale(1.04);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   7. 分类筛选条
   -------------------------------------------------------------------------- */

.rail {
    display: flex;
    gap: 8px;
    padding: 24px 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.rail::-webkit-scrollbar {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 7px 15px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--ink-2);
    font-size: 14px;
    transition: border-color .2s, color .2s, background-color .2s;
}

.chip:hover {
    border-color: var(--line-2);
    color: var(--ink);
}

.chip.is-on {
    background: var(--sakura-wash);
    border-color: transparent;
    color: var(--sakura-deep);
    font-weight: 600;
}

.chip-count {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.chip.is-on .chip-count {
    color: var(--sakura-deep);
    opacity: .65;
}

/* --------------------------------------------------------------------------
   8. 瀑布流
   -------------------------------------------------------------------------- */

.grid {
    column-gap: var(--gap);
    margin: 0;
}

.grid--2 { column-count: 2; }
.grid--3 { column-count: 3; }
.grid--4 { column-count: 4; }
.grid--5 { column-count: 5; }

.card {
    break-inside: avoid;
    margin: 0 0 var(--gap);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    overflow: hidden;
    transition: transform .45s var(--ease), border-color .25s;
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--line-2);
}

.card-link {
    display: block;
    color: inherit;
}

.card-link:focus-visible {
    outline-offset: -2px;
}

.card-link:hover {
    color: inherit;
}

.card-figure {
    position: relative;
    min-height: 110px;
    margin: 0;
    background: var(--well);
    overflow: hidden;
}

.card-figure img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform .6s var(--ease), filter .45s ease;
}

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

.card-blank {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    color: var(--muted);
    font-size: 13px;
}

/* R18 在列表里一直糊着，不提供悬停揭晓 —— 触屏上悬停本来就不可靠，
   想看内容点进文章，那里有明确的「显示图片」按钮 */
.card.is-nsfw .card-figure img {
    filter: blur(18px);
    transform: scale(1.1);
}

.card-flag {
    position: absolute;
    top: 9px;
    right: 9px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(12, 12, 16, .62);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.card-body {
    padding: 12px 14px 14px;
}

.card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.45;
    transition: color .2s;
}

.card:hover .card-title {
    color: var(--sakura-deep);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 8px;
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

.card-meta a {
    color: inherit;
}

.card-cat {
    overflow: hidden;
    max-width: 46%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 日期用等宽数字，一列卡片扫下来不会因为字宽不同而参差 */
.card-date {
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   9. 归档页标题
   -------------------------------------------------------------------------- */

.page-head {
    padding: 34px 0 0;
}

.page-title {
    margin: 0 0 4px;
    font-size: clamp(20px, 2.4vw, 27px);
    letter-spacing: -.02em;
}

.page-count {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   10. 分页
   -------------------------------------------------------------------------- */

.pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 14px 0 60px;
    padding: 0;
    list-style: none;
}

.pager a,
.pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-input);
    color: var(--ink-2);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    transition: border-color .2s, color .2s;
}

.pager a:hover {
    border-color: var(--line-2);
    color: var(--ink);
}

.pager .current a {
    background: var(--sakura-wash);
    border-color: transparent;
    color: var(--sakura-deep);
    font-weight: 700;
}

.pager-sm {
    margin: 22px 0 0;
}

/* --------------------------------------------------------------------------
   11. 空状态
   -------------------------------------------------------------------------- */

.empty {
    max-width: 430px;
    margin: 0 auto;
    padding: 76px 24px 92px;
    text-align: center;
}

.empty-code {
    margin: 0 0 6px;
    color: var(--line-2);
    font-size: 54px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
}

.empty-title {
    margin: 0 0 8px;
    font-size: 19px;
}

.empty-text {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.8;
}

.search-form-lg {
    max-width: 340px;
    margin: 0 auto 14px;
}

.search-form-lg input {
    flex: 1 1 auto;
    width: auto;
    padding: 9px 0;
}

/* --------------------------------------------------------------------------
   12. 文章详情
   -------------------------------------------------------------------------- */

.entry {
    padding-top: 34px;
}

.entry-head {
    margin-bottom: 26px;
}

.crumb {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
}

.crumb a {
    color: var(--sakura-deep);
}

.crumb a:hover {
    text-decoration: underline;
}

.entry-title {
    margin: 0 0 12px;
    font-size: clamp(21px, 2.6vw, 30px);
    letter-spacing: -.02em;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
}

.entry-meta a {
    color: inherit;
}

.entry-meta a:hover {
    color: var(--sakura-deep);
}

.entry-sep {
    color: var(--line-2);
}

/* 顶部大图。宽度按 --page 走，比下面的文字栏宽得多 —— 图是主角，舞台要给够 */
.entry-hero {
    position: relative;
    width: min(100% - 40px, var(--page));
    margin: 0 auto 26px;
    border-radius: var(--r-card);
    background: var(--well);
    overflow: hidden;
}

.entry-hero img {
    display: block;
    width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   13. 正文排版
   -------------------------------------------------------------------------- */

.entry-body {
    width: min(100% - 40px, var(--narrow));
    margin-inline: auto;
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--ink-2);
    word-break: break-word;
}

.entry-body p {
    margin: 0 0 1.1em;
}

.entry-body h2 {
    margin: 1.9em 0 .7em;
    color: var(--ink);
    font-size: 19px;
}

.entry-body h3 {
    margin: 1.6em 0 .6em;
    color: var(--ink);
    font-size: 16.5px;
}

.entry-body h4 {
    margin: 1.4em 0 .5em;
    color: var(--ink);
    font-size: 15.5px;
}

.entry-body a {
    border-bottom: 1px solid rgba(190, 69, 104, .32);
}

.entry-body a:hover {
    border-bottom-color: currentColor;
}

.entry-body img {
    display: block;
    height: auto;
    margin: 1.5em 0;
    border-radius: var(--r-input);
    background: var(--well);
}

.entry-body ul,
.entry-body ol {
    margin: 0 0 1.1em;
    padding-left: 1.35em;
}

.entry-body li {
    margin-bottom: .35em;
}

.entry-body blockquote {
    margin: 1.5em 0;
    padding: 2px 0 2px 16px;
    border-left: 2px solid var(--sakura);
    color: var(--muted);
}

.entry-body code {
    padding: .15em .4em;
    border-radius: 4px;
    background: var(--line);
    font-family: var(--font-mono);
    font-size: .88em;
}

.entry-body pre {
    margin: 1.5em 0;
    padding: 16px 18px;
    border-radius: var(--r-input);
    background: #16181F;
    color: #E8E8EC;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    overflow-x: auto;
}

.entry-body pre code {
    padding: 0;
    background: none;
    color: inherit;
}

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

.entry-body table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
    font-size: 14px;
}

.entry-body th,
.entry-body td {
    padding: 8px 12px;
    border: 1px solid var(--line);
    text-align: left;
}

.entry-body th {
    background: var(--paper);
    font-weight: 600;
}

/* R18：正文和顶部大图里的图片，都按 X（推特）的做法处理 ——
   糊着，中间盖一个「点击查看」，点一下显示这一张。

   JS 会给每张图套一层 .blur 并挂上按钮；.is-nsfw 那两条是没有 JS 时的兜底，
   那时整篇（整图）保持模糊、不给揭晓入口。JS 跑完会把 .is-nsfw 摘掉。 */
.entry-body.is-nsfw img,
.entry-hero.is-nsfw img {
    filter: blur(28px);
    transform: scale(1.08);
}

.blur {
    position: relative;
    display: block;
    overflow: hidden;
}

.blur img {
    filter: blur(28px);
    transform: scale(1.08);
    transition: filter .4s ease, transform .4s ease;
}

.blur.is-revealed img {
    filter: none;
    transform: none;
}

.blur-reveal {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    width: 100%;
    padding: 0;
    border: 0;
    background: rgba(12, 12, 16, .06);
    cursor: pointer;
}

.blur-reveal-label {
    padding: 9px 18px;
    border-radius: var(--r-pill);
    background: rgba(12, 12, 16, .72);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.blur-reveal:hover .blur-reveal-label {
    background: rgba(12, 12, 16, .88);
}

.entry-foot {
    margin-top: 34px;
}

.entry-foot a {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 4px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    color: var(--muted);
    font-size: 13px;
    transition: border-color .2s, color .2s;
}

.entry-foot a:hover {
    border-color: var(--sakura);
    color: var(--sakura-deep);
}

.entry-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 40px auto 0;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.entry-nav div {
    min-width: 0;
}

.entry-nav a {
    display: block;
    overflow: hidden;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    color: var(--ink-2);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: border-color .2s, color .2s;
}

.entry-nav a:hover {
    border-color: var(--sakura);
    color: var(--sakura-deep);
}

.entry-nav span {
    display: block;
    padding: 12px 16px;
    color: var(--muted);
    font-size: 14px;
}

.entry-nav-next {
    text-align: right;
}

/* --------------------------------------------------------------------------
   14. 评论
   -------------------------------------------------------------------------- */

.comments {
    margin-top: 58px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
}

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

.comment {
    display: flex;
    flex-wrap: wrap;
    gap: 0 13px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.comment-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--sakura-wash);
    color: var(--sakura-deep);
    font-size: 15px;
    font-weight: 700;
}

.comment-owner > .comment-avatar {
    background: var(--sakura-deep);
    color: #fff;
}

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

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 5px;
    font-size: 13px;
}

.comment-name {
    color: var(--ink);
    font-style: normal;
    font-weight: 600;
}

.comment-badge {
    padding: 1px 7px;
    border-radius: var(--r-pill);
    background: var(--sakura-wash);
    color: var(--sakura-deep);
    font-size: 11px;
    font-weight: 600;
}

.comment-time {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.comment-time:hover {
    color: var(--sakura-deep);
}

.comment-content {
    color: var(--ink-2);
    font-size: 14.5px;
    line-height: 1.8;
    word-break: break-word;
}

.comment-content p {
    margin: 0 0 .7em;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-actions {
    margin: 8px 0 0;
    font-size: 13px;
}

.comment-actions a {
    color: var(--muted);
}

.comment-actions a:hover {
    color: var(--sakura-deep);
}

.comment-awaiting {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.comment-children {
    flex: 0 0 100%;
    margin-top: 16px;
    padding-left: 18px;
    border-left: 2px solid var(--line);
}

.comments-empty {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 14.5px;
}

.respond {
    margin-top: 36px;
}

.respond-cancel {
    font-size: 13px;
    font-weight: 400;
}

.form-note {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13.5px;
}

.form-note a {
    color: var(--sakura-deep);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.form-row .form-field {
    margin-bottom: 0;
}

.form-field {
    margin: 0 0 16px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-input);
    background: var(--card);
    color: var(--ink);
    font-family: inherit;
    font-size: 14.5px;
    transition: border-color .2s, box-shadow .2s;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: 0;
    border-color: var(--iris);
    box-shadow: 0 0 0 3px rgba(124, 140, 248, .18);
}

.form-field textarea {
    min-height: 116px;
    line-height: 1.75;
    resize: vertical;
}

.form-actions {
    margin: 0;
}

/* --------------------------------------------------------------------------
   15. 页脚
   -------------------------------------------------------------------------- */

.site-foot {
    margin-top: 76px;
    padding: 36px 0 46px;
    background: var(--card);
    border-top: 1px solid var(--line);
}

.foot-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.foot-about {
    max-width: 320px;
}

.foot-name {
    margin: 9px 0 4px;
    font-size: 15px;
    font-weight: 700;
}

.foot-desc {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.7;
}

.foot-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    font-size: 14px;
}

.foot-nav a {
    color: var(--ink-2);
}

.foot-nav a:hover {
    color: var(--sakura-deep);
}

.foot-meta {
    color: var(--muted);
    font-size: 13px;
    text-align: right;
}

.foot-meta p {
    margin: 0 0 4px;
}

.foot-sep {
    margin: 0 5px;
    color: var(--line-2);
}

.to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 40;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--card);
    color: var(--ink-2);
    transition: border-color .2s, color .2s;
}

.to-top:hover {
    border-color: var(--sakura);
    color: var(--sakura-deep);
}

.to-top[hidden] {
    display: none;
}

/* --------------------------------------------------------------------------
   16. 自适应
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
    .grid--5 { column-count: 4; }
}

@media (max-width: 1000px) {
    .grid--4 { column-count: 3; }
    .grid--5 { column-count: 3; }
}

@media (max-width: 860px) {
    .site-head-inner {
        flex-wrap: wrap;
        gap: 12px;
        padding-top: 9px;
        padding-bottom: 9px;
    }

    .nav-toggle {
        display: grid;
    }

    /* 有 JS 与否都能展开：checkbox 是浏览器原生行为 */
    .nav-toggle-input:not(:checked)~.site-nav {
        display: none;
    }

    .site-nav {
        order: 10;
        flex: 1 0 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow: visible;
        padding-bottom: 6px;
    }

    .site-nav a {
        padding: 10px 12px;
        border-radius: var(--r-input);
    }

    .site-actions {
        margin-left: auto;
    }

    .nav-toggle-input:focus-visible~.site-actions .nav-toggle {
        outline: 2px solid var(--iris);
        outline-offset: 2px;
    }

    .banner-body {
        padding: 26px 22px;
    }

    .entry-nav {
        grid-template-columns: 1fr;
    }

    .entry-nav-next {
        text-align: left;
    }

    .foot-meta {
        text-align: left;
    }
}

@media (max-width: 760px) {
    .grid--3 { column-count: 2; }
    .grid--4 { column-count: 2; }
    .grid--5 { column-count: 2; }

    .search-form input {
        width: 104px;
    }
}

@media (max-width: 420px) {
    :root {
        --gap: 12px;
    }

    .search-form input {
        width: 76px;
    }

    .brand-name {
        max-width: 30vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* --------------------------------------------------------------------------
   17. 降低动效 / 打印
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .banner-img {
        animation: none;
    }
}

@media print {

    .site-head,
    .rail,
    .pager,
    .entry-nav,
    .comments,
    .site-foot,
    .to-top,
    .blur-reveal {
        display: none;
    }

    /* 打印时不该糊着 */
    .entry-body.is-nsfw img,
    .blur img {
        filter: none;
        transform: none;
    }

    body {
        background: #fff;
    }
}
